/* ============================================================
   IntegraSUAS — Material Design Blue Theme
   ============================================================ */

:root {
    /* Blues */
    --primary-50:  #E3F2FD;
    --primary-100: #BBDEFB;
    --primary-200: #90CAF9;
    --primary-300: #64B5F6;
    --primary-400: #42A5F5;
    --primary-500: #2196F3;
    --primary-600: #1E88E5;
    --primary-700: #1565C0;
    --primary-800: #0D47A1;
    --primary-900: #0A237B;

    --primary:        var(--primary-700);
    --primary-dark:   var(--primary-800);
    --primary-light:  var(--primary-500);
    --primary-bg:     var(--primary-50);

    /* Accent */
    --accent:         #FF6F00;
    --accent-light:   #FFA040;

    /* Neutrals */
    --surface:        #FFFFFF;
    --surface-alt:    #F8FAFC;
    --background:     #EEF2F7;
    --on-surface:     #1A237E;
    --on-surface-2:   #455A64;
    --on-surface-3:   #90A4AE;
    --divider:        #E3E8EF;

    /* Status */
    --success:        #2E7D32;
    --success-bg:     #E8F5E9;
    --warning:        #E65100;
    --warning-bg:     #FFF3E0;
    --error:          #C62828;
    --error-bg:       #FFEBEE;
    --info:           #0277BD;
    --info-bg:        #E1F5FE;

    /* Shadows */
    --shadow-1: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);
    --shadow-2: 0 3px 6px rgba(0,0,0,.15), 0 2px 4px rgba(0,0,0,.12);
    --shadow-3: 0 10px 20px rgba(0,0,0,.15), 0 3px 6px rgba(0,0,0,.10);
    --shadow-4: 0 15px 35px rgba(0,0,0,.1), 0 5px 15px rgba(0,0,0,.07);

    /* Layout */
    --sidebar-w: 260px;
    --topbar-h:  64px;
    --radius:    8px;
    --radius-lg: 12px;

    /* Typography */
    --font: 'Roboto', sans-serif;
    --font-condensed: 'Roboto Condensed', sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: var(--font);
    background: var(--background);
    color: var(--on-surface);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
ul { list-style: none; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--primary-800);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0;
    z-index: 200;
    overflow: hidden;   /* o scroll fica apenas no .sidebar-nav */
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-3);
}

/* Estado fechado — desktop: desliza para fora */
.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Quando fechado, o wrapper ocupa 100% */
.main-wrapper.sidebar-collapsed {
    margin-left: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}
.sidebar-brand-icon {
    background: var(--accent);
    border-radius: 8px;
    padding: 6px;
    font-size: 22px;
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-size: 20px;
    font-family: var(--font-condensed);
    letter-spacing: .5px;
    color: #fff;
}
.sidebar-brand-text strong { color: var(--primary-200); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}
.sidebar-user-avatar .material-icons-round {
    font-size: 38px;
    color: var(--primary-200);
}
.sidebar-user-name {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-role {
    display: block;
    color: var(--primary-200);
    font-size: 11px;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;       /* apenas o nav rola */
    overflow-x: hidden;
    min-height: 0;          /* necessário para flex+overflow funcionar */
    /* Scrollbar fina e discreta */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }
.sidebar-nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--primary-300);
    padding: 14px 20px 4px;
}
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,.75);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    border-radius: 0 24px 24px 0;
    margin-right: 12px;
    cursor: pointer;
    text-decoration: none;
}
.sidebar-nav-item:hover { background: rgba(255,255,255,.10); color: #fff; text-decoration: none; }
.sidebar-nav-item.active { background: var(--primary-500); color: #fff; box-shadow: var(--shadow-1); }
.sidebar-nav-item .material-icons-round { font-size: 20px; }

.sidebar-footer {
    padding: 12px 0 8px;
    border-top: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;         /* nunca encolhe — fica sempre visível na base */
    background: var(--primary-800);
}
.sidebar-logout { color: rgba(255,255,255,.6); }
.sidebar-logout:hover { color: #ff8a80; background: rgba(255,0,0,.08); }
.sidebar-version {
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,.3);
    padding: 6px;
}
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 190;
    transition: opacity 0.28s;
}
.sidebar-overlay.visible { display: block; }

/* ============================================================
   MAIN WRAPPER & TOPBAR
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.28s cubic-bezier(.4,0,.2,1);
}
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--on-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background .15s;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
}
.topbar-menu-btn:hover { background: var(--primary-bg); }
.topbar-menu-btn .material-icons-round { font-size: 24px; pointer-events: none; }
.topbar-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--on-surface);
    flex: 1;
}
.topbar-municipio {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--on-surface-3);
}
.topbar-municipio .material-icons-round { font-size: 14px; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    padding: 24px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--divider);
    flex-wrap: wrap;
    gap: 10px;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--on-surface);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title .material-icons-round { color: var(--primary); font-size: 20px; }
.card-body { padding: 20px 24px; }
.card-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   STAT CARDS (DASHBOARD)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
/* ── Stat Cards ──────────────────────────────────────────────
   Uso: <div class="stats-grid"> <div class="stat-card"> ...
   ──────────────────────────────────────────────────────── */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    transition: box-shadow .18s, transform .18s;
    border: 1px solid transparent;
}
.stat-card:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
    border-color: var(--border);
}

/* Ícone quadrado com fundo colorido */
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon .material-icons-round { font-size: 22px; }

/* Paleta de cores do ícone */
.stat-icon.blue   { background: #E3F2FD; color: #1565C0; }
.stat-icon.green  { background: #E8F5E9; color: #2E7D32; }
.stat-icon.orange { background: #FFF3E0; color: #E65100; }
.stat-icon.red    { background: #FFEBEE; color: #C62828; }
.stat-icon.teal   { background: #E0F2F1; color: #00695C; }
.stat-icon.purple { background: #EDE7F6; color: #4527A0; }

/* Conteúdo textual */
.stat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--on-surface);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.3px;
}
.stat-value-md  { font-size: 20px; }
.stat-value-sm  { font-size: 16px; letter-spacing: 0; }

.stat-label {
    font-size: 12px;
    color: var(--on-surface-2);
    margin-top: 2px;
    font-weight: 500;
    line-height: 1.4;
    /* Até 2 linhas, com reticências se ultrapassar */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.stat-change {
    font-size: 11px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--error); }

/* ============================================================
   GRID LAYOUT
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: box-shadow .15s, background .15s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
}
.btn:hover { box-shadow: var(--shadow-2); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn .material-icons-round { font-size: 18px; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-bg); color: var(--primary); }
.btn-secondary:hover { background: var(--primary-100); }
.btn-danger    { background: var(--error-bg); color: var(--error); }
.btn-danger:hover { background: #FFCDD2; }
.btn-success   { background: var(--success-bg); color: var(--success); }
.btn-success:hover { background: #C8E6C9; }
.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-icon { padding: 8px; border-radius: 50%; min-width: 36px; min-height: 36px; justify-content: center; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */
.form-section {
    margin-bottom: 28px;
}
.form-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-100);
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-group.full { grid-column: 1 / -1; }
.form-group.span-2 { grid-column: span 2; }
label {
    font-size: 12px;
    font-weight: 600;
    color: var(--on-surface-2);
    text-transform: uppercase;
    letter-spacing: .4px;
}
label .req { color: var(--error); }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--divider);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    color: var(--on-surface);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,.15);
}
.form-control:disabled {
    background: var(--background);
    color: var(--on-surface-3);
    cursor: not-allowed;
}
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231565C0'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--on-surface-3); margin-top: 2px; }
.form-error { font-size: 11px; color: var(--error); margin-top: 2px; }

.checkbox-group, .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}
.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--on-surface);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1.5px solid var(--divider);
    transition: border-color .15s, background .15s;
    white-space: nowrap;
}
.checkbox-item:has(input:checked),
.radio-item:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}
.checkbox-item input, .radio-item input {
    accent-color: var(--primary);
    width: 15px; height: 15px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th {
    background: var(--background);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--on-surface-2);
    border-bottom: 2px solid var(--divider);
    white-space: nowrap;
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
    color: var(--on-surface);
    vertical-align: middle;
}
.table tbody tr:hover { background: var(--primary-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES / STATUS CHIPS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error   { background: var(--error-bg);   color: var(--error); }
.badge-info    { background: var(--info-bg);     color: var(--info); }
.badge-neutral { background: var(--background);  color: var(--on-surface-2); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    margin: 0 24px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    animation: slideDown .3s ease;
}
.alert .material-icons-round { font-size: 20px; flex-shrink: 0; }
.alert-close { margin-left: auto; background: none; border: none; cursor: pointer; padding: 2px; display: flex; }
.alert-success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); }
.alert-error   { background: var(--error-bg);   color: var(--error);   border-left: 4px solid var(--error); }
.alert-info    { background: var(--info-bg);     color: var(--info);    border-left: 4px solid var(--info); }
.alert-warning { background: var(--warning-bg);  color: var(--warning); border-left: 4px solid var(--warning); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s;
    padding: 0 6px;
}
.pagination a { color: var(--primary); text-decoration: none; }
.pagination a:hover { background: var(--primary-bg); text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; }
.pagination .disabled { color: var(--on-surface-3); cursor: default; }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}
.search-input-wrap .material-icons-round {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--on-surface-3);
    font-size: 18px;
}
.search-input-wrap input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1.5px solid var(--divider);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color .15s;
}
.search-input-wrap input:focus { border-color: var(--primary); }

/* ============================================================
   MODULE HEADER
   ============================================================ */
.module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.module-header-left h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--on-surface);
    display: flex;
    align-items: center;
    gap: 10px;
}
.module-header-left h1 .material-icons-round {
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    padding: 6px;
    font-size: 22px;
}
.module-header-left p {
    font-size: 13px;
    color: var(--on-surface-2);
    margin-top: 4px;
}
.module-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container {
    position: relative;
    width: 100%;
    height: 260px;
}
.chart-container-sm { height: 180px; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--divider);
    margin-bottom: 20px;
    gap: 2px;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 10px 18px;
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--on-surface-2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--primary); background: var(--primary-bg); border-radius: 6px 6px 0 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   CARTÃO BENEFICIÁRIO
   ============================================================ */
.beneficiary-card {
    width: 85.6mm;
    height: 53.98mm;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-2);
    font-family: var(--font);
}
.beneficiary-card::before {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
}
.beneficiary-card::after {
    content: '';
    position: absolute;
    left: -10px; bottom: -20px;
    width: 70px; height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
}
.card-brand {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: .85;
}
.card-logo {
    font-size: 10px;
    font-weight: 700;
    opacity: .9;
}
.card-number {
    font-size: 9px;
    letter-spacing: 1.5px;
    opacity: .8;
    font-family: monospace;
}
.card-name { font-size: 11px; font-weight: 700; }
.card-meta { font-size: 9px; opacity: .75; }
.card-ingresso { font-size: 8px; opacity: .7; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 60%, var(--primary-500) 100%);
    min-height: 100vh;
}
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 16px;
}
.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-4);
    padding: 40px 36px 32px;
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .logo-icon {
    width: 70px; height: 70px;
    background: var(--primary);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: var(--shadow-2);
}
.login-logo .logo-icon .material-icons-round { font-size: 40px; color: #fff; }
.login-logo h1 { font-size: 24px; font-weight: 700; color: var(--on-surface); }
.login-logo p { font-size: 13px; color: var(--on-surface-2); margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--on-surface-3);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .2s;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-4);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .25s ease;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--divider);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--on-surface-3);
}
.empty-state .material-icons-round {
    font-size: 56px;
    margin-bottom: 14px;
    opacity: .4;
}
.empty-state h3 { font-size: 16px; color: var(--on-surface-2); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- DESKTOP (> 900px): sidebar sempre visível por padrão,
       o botão sanduíche a colapsa deslizando para fora --- */
@media (min-width: 901px) {
    .sidebar-overlay { display: none !important; }
}

/* --- MOBILE / TABLET (≤ 900px): sidebar oculta por padrão,
       o botão sanduíche a abre deslizando para dentro --- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 400; /* acima do modal-backdrop (1000 quando aberto, mas sidebar abre sobre tudo) */
    }
    /* No mobile, "open" mostra a sidebar */
    .sidebar.open {
        transform: translateX(0);
        z-index: 400;
    }
    .sidebar-overlay {
        z-index: 399; /* logo abaixo da sidebar, acima do conteúdo */
    }
    .sidebar-overlay.visible { display: block; }
    .main-wrapper { margin-left: 0 !important; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .col-span-2, .col-span-3 { grid-column: span 1; }
    .main-content { padding: 16px; }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .module-header { flex-direction: column; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--on-surface-2); }
.text-small { font-size: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }

/* Print */
@media print {
    .sidebar, .topbar, .btn, .alert, .pagination, .search-bar, .no-print { display: none !important; }
    .main-wrapper { margin: 0; }
    .main-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ============================================================
   RELATÓRIOS — Estilos de tela e impressão
   ============================================================ */
.report-filters {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.report-filters-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.report-header-print {
    display: none;
}
.report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.report-summary-item {
    background: var(--primary-bg);
    border-radius: var(--radius);
    padding: 10px 18px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    border-left: 3px solid var(--primary);
}
.report-summary-item strong {
    font-size: 20px;
    display: block;
    line-height: 1.1;
    color: var(--primary-dark);
}

@media print {
    .sidebar, .topbar, .module-header,
    .report-filters, .search-bar,
    .pagination, .no-print,
    .btn, .alert, .card-footer { display: none !important; }

    .main-wrapper { margin: 0 !important; }
    .main-content { padding: 0 !important; }

    body { background: white; font-size: 11pt; color: #000; }

    .report-header-print {
        display: block !important;
        text-align: center;
        border-bottom: 2px solid #1565C0;
        padding-bottom: 12px;
        margin-bottom: 16px;
    }
    .report-header-print h1 {
        font-size: 16pt;
        color: #1565C0;
        margin-bottom: 4px;
    }
    .report-header-print p {
        font-size: 10pt;
        color: #555;
    }
    .report-header-print .report-meta {
        font-size: 9pt;
        color: #777;
        margin-top: 6px;
    }

    .report-summary {
        margin-bottom: 12px;
    }
    .report-summary-item {
        border: 1px solid #ccc;
        background: #f5f5f5;
        color: #000;
        padding: 6px 12px;
        font-size: 9pt;
    }
    .report-summary-item strong {
        font-size: 14pt;
        color: #1565C0;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    .card-header {
        background: #f0f4f8 !important;
        padding: 8px 12px !important;
    }
    .card-title { font-size: 11pt; }

    .table { font-size: 9pt; }
    .table th {
        background: #e8f0fe !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 6px 8px !important;
    }
    .table td { padding: 5px 8px !important; }
    .table tbody tr:nth-child(even) td {
        background: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .badge {
        border: 1px solid #999;
        background: transparent !important;
        color: #000 !important;
        padding: 1px 5px;
        font-size: 8pt;
    }

    @page {
        margin: 15mm 12mm;
        size: A4 portrait;
    }
    @page :first { margin-top: 10mm; }

    tr { page-break-inside: avoid; }
}

/* ============================================================
   BANNER DE COOKIES
   ============================================================ */
#cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #1A237E;
    color: #fff;
    z-index: 9999;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
    animation: slideUpCookie .35s ease;
}
@keyframes slideUpCookie {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}
#cookie-banner p {
    flex: 1;
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0;
    color: rgba(255,255,255,.9);
}
#cookie-banner p a {
    color: #90CAF9;
    text-decoration: underline;
}
#cookie-banner .btn-cookie-ok {
    background: #1E88E5;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Roboto', sans-serif;
    transition: background .15s;
    flex-shrink: 0;
}
#cookie-banner .btn-cookie-ok:hover { background: #1565C0; }
#cookie-banner .btn-cookie-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
#cookie-banner .btn-cookie-close:hover { color: #fff; }
