/* ═══════════════════════════════════════════════════════════════
   THEME SYSTEM — Cristal | Retrô | Linho | Liquid
   Applied via data-theme="cristal"|"retro"|"linho"|"aurora" on <html>
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset Bootstrap overrides ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ══════════════════════════════════════════════════════════════
   Cristal — LIQUID GLASS (default)
   ══════════════════════════════════════════════════════════════ */
:root,
[data-theme="cristal"] {
    /* Palette */
    --color-blue:    #007AFF;
    --color-green:   #34C759;
    --color-red:     #FF3B30;
    --color-orange:  #FF9500;
    --color-purple:  #AF52DE;
    --color-gray:    #8E8E93;

    /* Surfaces */
    --bg-primary:    #F2F2F7;
    --bg-elevated:   rgba(255,255,255,0.82);
    --bg-glass:      rgba(255,255,255,0.65);
    --bg-glass-dark: rgba(30,30,40,0.55);

    /* Sidebar */
    --sidebar-bg:    rgba(255,255,255,0.72);
    --sidebar-blur:  blur(24px) saturate(1.8);
    --sidebar-border:1px solid rgba(0,0,0,0.08);
    --sidebar-link:  #3c3c43;
    --sidebar-active-bg: rgba(0,122,255,0.12);
    --sidebar-active-color: #007AFF;
    --sidebar-hr:    rgba(0,0,0,0.10);

    /* Navbar */
    --nav-bg:        rgba(255,255,255,0.80);
    --nav-blur:      blur(24px) saturate(1.8);
    --nav-border:    0 0.5px 0 rgba(0,0,0,0.12);
    --nav-text:      #1c1c1e;
    --nav-brand:     #1c1c1e;

    /* Content */
    --content-bg:    #F2F2F7;
    --card-bg:       #ffffff;
    --card-radius:   14px;
    --card-shadow:   0 2px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    --card-border:   1px solid rgba(0,0,0,0.06);

    /* Text */
    --text-primary:  #1c1c1e;
    --text-secondary:#8E8E93;
    --text-tertiary: #c7c7cc;

    /* Inputs */
    --input-bg:      rgba(118,118,128,0.12);
    --input-border:  transparent;
    --input-radius:  10px;
    --input-focus:   #007AFF;

    /* Buttons */
    --btn-primary-bg: #007AFF;
    --btn-primary-text: #fff;
    --btn-radius:    12px;

    /* Tables */
    --table-stripe:  rgba(0,0,0,0.02);
    --table-border:  rgba(0,0,0,0.06);
    --table-header-bg: rgba(0,0,0,0.04);

    /* Font */
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
            'Helvetica Neue', Arial, sans-serif;
}

/* ══════════════════════════════════════════════════════════════
   Retrô — SKEUOMORPHIC (estilo glossy 2008-2010)
   ══════════════════════════════════════════════════════════════ */
[data-theme="retro"] {
    /* Palette */
    --color-blue:    #0077FF;
    --color-green:   #62b94d;
    --color-red:     #d62e2e;
    --color-orange:  #e07800;
    --color-gray:    #888;

    /* Surfaces */
    --bg-primary:    #c8c8d0;
    --bg-elevated:   #ffffff;
    --bg-glass:      #e8e8ec;
    --bg-glass-dark: #1a1a2e;

    /* Sidebar */
    --sidebar-bg:    linear-gradient(to bottom, #4a5a7a 0%, #2c3a5c 100%);
    --sidebar-blur:  none;
    --sidebar-border:1px solid #1a2540;
    --sidebar-link:  #d4ddf0;
    --sidebar-active-bg: linear-gradient(to bottom, #2266cc 0%, #1144aa 100%);
    --sidebar-active-color: #ffffff;
    --sidebar-hr:    rgba(255,255,255,0.15);

    /* Navbar */
    --nav-bg:        linear-gradient(to bottom, #6b7da5 0%, #3a4f7a 48%, #2a3a65 52%, #1e2d55 100%);
    --nav-blur:      none;
    --nav-border:    0 1px 0 #0d1d40;
    --nav-text:      #ffffff;
    --nav-brand:     #ffffff;

    /* Content */
    --content-bg:    #c8c8d0;
    --card-bg:       #ffffff;
    --card-radius:   8px;
    --card-shadow:   0 2px 6px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.5);
    --card-border:   1px solid #b0b0b8;

    /* Text */
    --text-primary:  #1a1a1a;
    --text-secondary:#555;
    --text-tertiary: #999;

    /* Inputs */
    --input-bg:      #ffffff;
    --input-border:  #b0b0b8;
    --input-radius:  6px;
    --input-focus:   #0077ff;

    /* Buttons */
    --btn-primary-bg: linear-gradient(to bottom, #4a90e2 0%, #0060e0 48%, #004ec0 52%, #003aaa 100%);
    --btn-primary-text: #ffffff;
    --btn-radius:    8px;

    /* Tables */
    --table-stripe:  #f0f4f8;
    --table-border:  #c8c8cc;
    --table-header-bg: linear-gradient(to bottom, #e8eaf0 0%, #d8dae8 100%);

    /* Font */
    --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ══════════════════════════════════════════════════════════════
   Linho — estilo 2011 /  (skeuomorphic, linen, glossy)
   web 2011 + estilo 2011 interface era — Myriad Pro / Helvetica Neue
   ══════════════════════════════════════════════════════════════ */
[data-theme="linho"] {
    /* Palette — estilo web 2011 */
    --color-blue:    #3996CF;
    --color-green:   #5CA632;
    --color-red:     #C0392B;
    --color-orange:  #D98C00;
    --color-gray:    #8E8E8E;

    /* Surfaces */
    --bg-primary:    #EFEFF4;
    --bg-elevated:   #FFFFFF;
    --bg-glass:      #E5E5EA;
    --bg-glass-dark: #1C1C1E;

    /* Sidebar — estilo 2011 dark "settings" style */
    --sidebar-bg:    linear-gradient(to bottom, #3a3a3a 0%, #1c1c1c 100%);
    --sidebar-blur:  none;
    --sidebar-border:1px solid #111111;
    --sidebar-link:  #cccccc;
    --sidebar-active-bg: linear-gradient(to bottom, #3f80c0 0%, #285e96 50%, #1e508a 51%, #1a4880 100%);
    --sidebar-active-color: #ffffff;
    --sidebar-hr:    rgba(255,255,255,0.10);

    /* Navbar — header escuro estilo 2011 */
    --nav-bg:        linear-gradient(to bottom, #555555 0%, #2a2a2a 48%, #1f1f1f 52%, #111111 100%);
    --nav-blur:      none;
    --nav-border:    0 1px 0 #000000, 0 2px 0 rgba(255,255,255,0.06);
    --nav-text:      #e8e8e8;
    --nav-brand:     #f0f0f0;

    /* Content */
    --content-bg:    #EFEFF4;
    --card-bg:       #FFFFFF;
    --card-radius:   6px;
    --card-shadow:   0 1px 3px rgba(0,0,0,0.13), 0 1px 0 rgba(255,255,255,0.9) inset;
    --card-border:   1px solid #C8C7CC;

    /* Text */
    --text-primary:  #1a1a1a;
    --text-secondary:#6D6D72;
    --text-tertiary: #AEAEB2;

    /* Inputs — estilo 2011 text field */
    --input-bg:      #ffffff;
    --input-border:  #C8C7CC;
    --input-radius:  6px;
    --input-focus:   #3996CF;

    /* Buttons — estilo 2011 blue glossy */
    --btn-primary-bg: linear-gradient(to bottom, #5AACDF 0%, #2F85C0 48%, #2578B5 52%, #1A6AAA 100%);
    --btn-primary-text: #ffffff;
    --btn-radius:    10px;

    /* Tables — estilo 2011 grouped table view */
    --table-stripe:  #F7F7F7;
    --table-border:  #C8C7CC;
    --table-header-bg: linear-gradient(to bottom, #F2F2F7 0%, #E5E5EA 100%);

    /* Font — Myriad Pro → Helvetica Neue fallback */
    --font: 'Myriad Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Linho — Linen texture body (estilo 2011 notification center) */
[data-theme="linho"] body {
    background-color: #EFEFF4;
    background-image:
        repeating-linear-gradient(
            -45deg,
            rgba(0,0,0,0.018) 0px, rgba(0,0,0,0.018) 1px,
            transparent 1px, transparent 6px
        ),
        repeating-linear-gradient(
            45deg,
            rgba(0,0,0,0.018) 0px, rgba(0,0,0,0.018) 1px,
            transparent 1px, transparent 6px
        );
}

/* ── Linho — Navbar brand silver shine */
[data-theme="linho"] .app-navbar .brand {
    font-weight: 300;
    font-size: 1.05rem;
    letter-spacing: .5px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

/* ── Linho — Sidebar: estilo 2011 "Settings" grouped list */
[data-theme="linho"] .app-sidebar {
    background: var(--sidebar-bg);
    border-right: var(--sidebar-border);
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.05), 2px 0 6px rgba(0,0,0,0.3);
}

[data-theme="linho"] .sidebar-nav a {
    border-radius: 0;
    border-bottom: 1px solid rgba(0,0,0,0.35);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: .6rem .85rem;
    font-size: .86rem;
    font-weight: 400;
    letter-spacing: .1px;
}
[data-theme="linho"] .sidebar-nav a::after {
    content: '›';
    margin-left: auto;
    color: rgba(255,255,255,0.3);
    font-size: 1.1rem;
    line-height: 1;
}
[data-theme="linho"] .sidebar-nav a:hover,
[data-theme="linho"] .sidebar-nav a.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0,0,80,0.3);
}
[data-theme="linho"] .sidebar-nav a.active::after { color: rgba(255,255,255,0.6); }

/* ── Linho — Navbar buttons */
[data-theme="linho"] .btn-menu,
[data-theme="linho"] .btn-nav-action {
    background: linear-gradient(to bottom, rgba(255,255,255,.18) 0%, rgba(255,255,255,.06) 100%);
    border: 1px solid rgba(0,0,0,0.4);
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.4);
    color: #e8e8e8;
    text-shadow: 0 -1px 0 rgba(0,0,0,.5);
    padding: .2rem .65rem;
    font-size: .82rem;
    font-weight: 500;
}
[data-theme="linho"] .btn-theme {
    color: rgba(255,255,255,.75);
    background: linear-gradient(to bottom, rgba(255,255,255,.18) 0%, rgba(255,255,255,.06) 100%);
    border: 1px solid rgba(0,0,0,0.4);
    border-radius: 5px;
    padding: .2rem .6rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.4);
    font-size: .75rem;
}

/* ── Linho — Cards with estilo 2011 grouped section style */
[data-theme="linho"] .card,
[data-theme="linho"] .app-card {
    background: #FFFFFF !important;
    border: 1px solid #C8C7CC !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.9) !important;
}

/* ── Linho — Tables: estilo 2011 plain table view */
[data-theme="linho"] .table-responsive {
    border: 1px solid #C8C7CC;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.8);
}
[data-theme="linho"] .table thead th {
    background: linear-gradient(to bottom, #F2F2F7 0%, #E2E2E8 100%);
    color: #6D6D72;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}
[data-theme="linho"] .table tbody tr:nth-child(even) td { background: #F7F7F7; }

/* ── Linho — Buttons */
[data-theme="linho"] .btn-primary {
    background: var(--btn-primary-bg) !important;
    border: 1px solid #1A5E9A !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 3px rgba(0,0,0,.3) !important;
    text-shadow: 0 -1px 0 rgba(0,0,80,.4) !important;
}
[data-theme="linho"] .btn-dark {
    background: linear-gradient(to bottom, #555 0%, #333 48%, #222 52%, #111 100%) !important;
    border: 1px solid #000 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 3px rgba(0,0,0,.4) !important;
}
[data-theme="linho"] .btn-outline-secondary {
    background: linear-gradient(to bottom, #fafafa 0%, #e8e8e8 100%) !important;
    border: 1px solid #C8C7CC !important;
    color: #444 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,1), 0 1px 2px rgba(0,0,0,.1) !important;
}

/* ── Linho — Inputs */
[data-theme="linho"] .form-control,
[data-theme="linho"] .form-select {
    border: 1px solid #C8C7CC !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.08) !important;
    border-radius: 6px !important;
}
[data-theme="linho"] .form-control:focus,
[data-theme="linho"] .form-select:focus {
    border-color: #3996CF !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.06), 0 0 0 3px rgba(57,150,207,.2) !important;
}

/* ── Linho — Offcanvas mobile menu */
[data-theme="linho"] .app-offcanvas {
    background: linear-gradient(to bottom, #3a3a3a 0%, #1c1c1c 100%) !important;
}
[data-theme="linho"] .app-offcanvas .sidebar-nav a {
    border-radius: 0;
    border-bottom: 1px solid rgba(0,0,0,0.35);
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Linho — Login page */
[data-theme="linho"] .login-page {
    background:
        repeating-linear-gradient(-45deg, rgba(0,0,0,.02) 0px, rgba(0,0,0,.02) 1px, transparent 1px, transparent 6px),
        repeating-linear-gradient( 45deg, rgba(0,0,0,.02) 0px, rgba(0,0,0,.02) 1px, transparent 1px, transparent 6px),
        #EFEFF4;
}
[data-theme="linho"] .login-card {
    background: linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%);
    border: 1px solid #C8C7CC;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,1);
}
[data-theme="linho"] .login-logo h2 {
    font-weight: 300;
    letter-spacing: -.5px;
    color: #1a1a1a;
}

/* ══════════════════════════════════════════════════════════════
   LIQUID — GLASSMORPHISM PASTEL (vidro leitoso, cápsulas, lilás)
   Ref: painel de vidro fosco sobre névoa rosa/lavanda/azul,
   bordas brancas grossas, pills, botão roxo glossy, texto navy
   ══════════════════════════════════════════════════════════════ */
[data-theme="aurora"] {
    /* Palette — pastel desaturado */
    --color-blue:    #6E8BD8;
    --color-green:   #6FCF97;
    --color-red:     #EF7A93;
    --color-orange:  #F2B279;
    --color-purple:  #A98BF0;
    --color-gray:    #8E97B8;

    /* Surfaces */
    --bg-primary:    #f3eef8;
    --bg-elevated:   rgba(255,255,255,0.65);
    --bg-glass:      rgba(255,255,255,0.50);
    --bg-glass-dark: rgba(70,72,110,0.50);

    /* Sidebar */
    --sidebar-bg:    rgba(255,255,255,0.40);
    --sidebar-blur:  blur(30px) saturate(1.4);
    --sidebar-border:1.5px solid rgba(255,255,255,0.85);
    --sidebar-link:  #47598a;
    --sidebar-active-bg: rgba(255,255,255,0.88);
    --sidebar-active-color: #8a63e8;
    --sidebar-hr:    rgba(255,255,255,0.70);

    /* Navbar */
    --nav-bg:        rgba(255,255,255,0.45);
    --nav-blur:      blur(28px) saturate(1.4);
    --nav-border:    0 8px 32px rgba(178,160,220,0.25), inset 0 -1px 0 rgba(255,255,255,0.70);
    --nav-text:      #3a5484;
    --nav-brand:     #3a5484;

    /* Content */
    --content-bg:    transparent;
    --card-bg:       rgba(255,255,255,0.52);
    --card-radius:   26px;
    --card-shadow:   0 20px 45px rgba(168,150,215,0.28), inset 0 2px 0 rgba(255,255,255,0.95), inset 0 -1px 0 rgba(255,255,255,0.40);
    --card-border:   1.5px solid rgba(255,255,255,0.85);

    /* Text — navy suave */
    --text-primary:  #3a5484;
    --text-secondary:#7d8ab0;
    --text-tertiary: #aab4d0;

    /* Inputs — cápsulas embutidas */
    --input-bg:      rgba(255,255,255,0.55);
    --input-border:  rgba(255,255,255,0.90);
    --input-radius:  999px;
    --input-focus:   #a98bf0;

    /* Buttons — pill roxo glossy */
    --btn-primary-bg: linear-gradient(135deg, #c3a4f8 0%, #9d7bf0 55%, #8f6ae6 100%);
    --btn-primary-text: #fff;
    --btn-radius:    999px;

    /* Tables */
    --table-stripe:  rgba(255,255,255,0.30);
    --table-border:  rgba(255,255,255,0.55);
    --table-header-bg: rgba(255,255,255,0.45);

    /* Font */
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
            'Helvetica Neue', Arial, sans-serif;
}

/* ── Liquid — fundo: névoa pastel rosa/lavanda/azul, quase branca */
[data-theme="aurora"] body {
    background:
        radial-gradient(1000px 700px at 12% 15%, rgba(255,190,215,0.50), transparent 60%),
        radial-gradient(900px 650px at 88% 25%, rgba(190,200,255,0.55), transparent 60%),
        radial-gradient(1000px 750px at 75% 88%, rgba(180,225,255,0.50), transparent 65%),
        radial-gradient(700px 550px at 25% 85%, rgba(230,195,255,0.45), transparent 60%),
        linear-gradient(155deg, #f8eef5 0%, #eeeaf9 45%, #e9f1fb 100%);
    background-attachment: fixed;
}

/* ── Liquid — brilhos flutuantes suaves (atrás do conteúdo) */
[data-theme="aurora"] body::before,
[data-theme="aurora"] body::after {
    content: '';
    position: fixed;
    z-index: -1;
    width: 45vmax;
    height: 45vmax;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .30;
    pointer-events: none;
}
[data-theme="aurora"] body::before {
    background: radial-gradient(circle, #ffc9de 0%, transparent 65%);
    top: -12vmax; left: -10vmax;
    animation: liquidFloat1 30s ease-in-out infinite alternate;
}
[data-theme="aurora"] body::after {
    background: radial-gradient(circle, #bcd0ff 0%, transparent 65%);
    bottom: -15vmax; right: -12vmax;
    animation: liquidFloat2 36s ease-in-out infinite alternate;
}
@keyframes liquidFloat1 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(12vmax, 8vmax) scale(1.15); }
}
@keyframes liquidFloat2 {
    from { transform: translate(0, 0) scale(1.1); }
    to   { transform: translate(-10vmax, -9vmax) scale(0.9); }
}

/* ── Liquid — navbar e sidebar de vidro leitoso */
[data-theme="aurora"] .app-navbar {
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
}
[data-theme="aurora"] .app-sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: var(--sidebar-blur);
    -webkit-backdrop-filter: var(--sidebar-blur);
    border-right: var(--sidebar-border);
}
[data-theme="aurora"] .sidebar-nav a { border-radius: 999px; }
[data-theme="aurora"] .sidebar-nav a.active {
    box-shadow: 0 8px 20px rgba(168,150,215,0.30), inset 0 1.5px 0 rgba(255,255,255,0.95);
}

/* ── Liquid — cards: vidro leitoso com borda grossa branca */
[data-theme="aurora"] .card,
[data-theme="aurora"] .app-card {
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

/* ── Liquid — tabelas: painel de vidro, células transparentes */
[data-theme="aurora"] .table-responsive {
    background: rgba(255,255,255,0.40);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1.5px solid rgba(255,255,255,0.85);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(168,150,215,0.22), inset 0 2px 0 rgba(255,255,255,0.90);
}
[data-theme="aurora"] .table { margin-bottom: 0; --bs-table-bg: transparent; }
[data-theme="aurora"] .table tbody tr:last-child td { border-bottom: none !important; }

/* ── Liquid — botão primário: pill roxo glossy com glow */
[data-theme="aurora"] .btn-primary {
    box-shadow: 0 10px 26px rgba(150,110,240,0.45),
                inset 0 1.5px 0 rgba(255,255,255,0.65),
                inset 0 -2px 6px rgba(120,80,220,0.35) !important;
    text-shadow: 0 1px 2px rgba(90,60,180,0.35);
    padding-left: 1.1rem;
    padding-right: 1.1rem;
}
[data-theme="aurora"] .btn-outline-secondary {
    background: rgba(255,255,255,0.50) !important;
    border: 1.5px solid rgba(255,255,255,0.95) !important;
    color: #47598a !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 16px rgba(168,150,215,0.22), inset 0 1px 0 rgba(255,255,255,0.90);
}
[data-theme="aurora"] .btn-danger {
    background: linear-gradient(135deg, #f490ab 0%, #e56a8c 100%) !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(230,110,145,0.40), inset 0 1.5px 0 rgba(255,255,255,0.50) !important;
}
[data-theme="aurora"] .btn-success {
    background: linear-gradient(135deg, #8fd8ae 0%, #5fbe8a 100%) !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(95,190,138,0.40), inset 0 1.5px 0 rgba(255,255,255,0.50) !important;
}
[data-theme="aurora"] .btn-dark {
    background: linear-gradient(135deg, #6a7cb0 0%, #47598a 100%) !important;
    box-shadow: 0 8px 20px rgba(90,110,170,0.35), inset 0 1.5px 0 rgba(255,255,255,0.40) !important;
}

/* ── Liquid — inputs: cápsulas de vidro embutidas (embossed) */
[data-theme="aurora"] .form-control,
[data-theme="aurora"] .form-select {
    box-shadow: inset 0 2px 6px rgba(140,130,190,0.20), inset 0 -1px 0 rgba(255,255,255,0.85) !important;
    padding-left: 1rem;
}
[data-theme="aurora"] textarea.form-control { border-radius: 20px !important; }
[data-theme="aurora"] .form-control:focus,
[data-theme="aurora"] .form-select:focus {
    background: rgba(255,255,255,0.80) !important;
    box-shadow: inset 0 2px 6px rgba(140,130,190,0.15), 0 0 0 3px rgba(169,139,240,0.30) !important;
}

/* ── Liquid — offcanvas mobile: vidro leitoso claro */
[data-theme="aurora"] .app-offcanvas {
    background: rgba(255,255,255,0.60) !important;
    backdrop-filter: blur(40px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(40px) saturate(1.5) !important;
    border-right: 1.5px solid rgba(255,255,255,0.85);
}
[data-theme="aurora"] .app-offcanvas .brand-mobile { color: #3a5484; }
[data-theme="aurora"] .app-offcanvas .user-mobile  { color: #7d8ab0; }
[data-theme="aurora"] .app-offcanvas .sidebar-nav a { color: #47598a; border-radius: 999px; }
[data-theme="aurora"] .app-offcanvas .sidebar-nav a:hover,
[data-theme="aurora"] .app-offcanvas .sidebar-nav a.active {
    background: rgba(255,255,255,0.88);
    color: #8a63e8;
}
[data-theme="aurora"] .app-offcanvas .sidebar-hr { border-color: rgba(120,120,170,0.20); }
[data-theme="aurora"] .app-offcanvas .btn-close-white { filter: none; opacity: .55; }

/* ── Liquid — dropdown / modal de vidro leitoso */
[data-theme="aurora"] .dropdown-menu {
    background: rgba(255,255,255,0.65) !important;
    backdrop-filter: blur(30px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.5) !important;
    border: 1.5px solid rgba(255,255,255,0.85) !important;
    border-radius: 22px !important;
}
[data-theme="aurora"] .modal-content {
    background: rgba(255,255,255,0.70) !important;
    backdrop-filter: blur(30px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.5) !important;
    border: 1.5px solid rgba(255,255,255,0.85) !important;
    border-radius: 26px !important;
}

/* ── Liquid — badges e alerts pastéis */
[data-theme="aurora"] .badge {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.40);
}
[data-theme="aurora"] .alert {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ── Liquid — scrollbar lavanda */
[data-theme="aurora"] ::-webkit-scrollbar-thumb { background: rgba(140,125,210,0.30); }
[data-theme="aurora"] ::-webkit-scrollbar-thumb:hover { background: rgba(140,125,210,0.50); }

/* ── Liquid — login: névoa pastel + cartão de vidro grosso */
[data-theme="aurora"] .login-page {
    background:
        radial-gradient(900px 600px at 18% 22%, rgba(255,190,215,0.55), transparent 60%),
        radial-gradient(800px 600px at 82% 28%, rgba(190,200,255,0.60), transparent 60%),
        radial-gradient(900px 700px at 60% 90%, rgba(180,225,255,0.55), transparent 65%),
        linear-gradient(155deg, #f8eef5 0%, #eeeaf9 45%, #e9f1fb 100%);
}
[data-theme="aurora"] .login-card {
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
    border: 1.5px solid rgba(255,255,255,0.90);
    border-radius: 30px;
    box-shadow: 0 25px 60px rgba(168,150,215,0.35), inset 0 2px 0 rgba(255,255,255,0.95);
}

/* ══════════════════════════════════════════════════════════════
   LIQUID DARK — GLASS ESCURO (dashboard azul-profundo/violeta,
   vidro escuro translúcido, texto branco, acentos vibrantes)
   ══════════════════════════════════════════════════════════════ */
[data-theme="noturno"] {
    /* Palette — acentos vibrantes sobre fundo escuro */
    --color-blue:    #3E9CFF;
    --color-green:   #34D399;
    --color-red:     #FF6B6B;
    --color-orange:  #FF9F43;
    --color-purple:  #A78BFA;
    --color-gray:    #8E93B5;

    /* Surfaces */
    --bg-primary:    #0d1233;
    --bg-elevated:   rgba(45,42,100,0.55);
    --bg-glass:      rgba(35,32,85,0.45);
    --bg-glass-dark: rgba(10,10,30,0.65);

    /* Sidebar */
    --sidebar-bg:    rgba(18,16,50,0.55);
    --sidebar-blur:  blur(30px) saturate(1.6);
    --sidebar-border:1px solid rgba(255,255,255,0.10);
    --sidebar-link:  #b8bde0;
    --sidebar-active-bg: linear-gradient(135deg, rgba(55,140,255,0.35) 0%, rgba(130,85,255,0.35) 100%);
    --sidebar-active-color: #ffffff;
    --sidebar-hr:    rgba(255,255,255,0.10);

    /* Navbar */
    --nav-bg:        rgba(16,14,46,0.60);
    --nav-blur:      blur(28px) saturate(1.6);
    --nav-border:    0 8px 32px rgba(3,4,20,0.50), inset 0 -1px 0 rgba(255,255,255,0.08);
    --nav-text:      #e8eaff;
    --nav-brand:     #ffffff;

    /* Content */
    --content-bg:    transparent;
    --card-bg:       rgba(35,32,85,0.45);
    --card-radius:   24px;
    --card-shadow:   0 12px 40px rgba(4,5,25,0.45), inset 0 1px 0 rgba(255,255,255,0.14);
    --card-border:   1px solid rgba(255,255,255,0.12);

    /* Text — branco / lavanda */
    --text-primary:  #eef0ff;
    --text-secondary:#a9aed3;
    --text-tertiary: #6f74a0;

    /* Inputs — cápsulas de vidro escuro */
    --input-bg:      rgba(255,255,255,0.08);
    --input-border:  rgba(255,255,255,0.14);
    --input-radius:  999px;
    --input-focus:   #3E9CFF;

    /* Buttons — pill azul vibrante com glow */
    --btn-primary-bg: linear-gradient(135deg, #37b1ff 0%, #2470f0 100%);
    --btn-primary-text: #fff;
    --btn-radius:    999px;

    /* Tables */
    --table-stripe:  rgba(255,255,255,0.03);
    --table-border:  rgba(255,255,255,0.10);
    --table-header-bg: rgba(255,255,255,0.06);

    /* Font */
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
            'Helvetica Neue', Arial, sans-serif;
}

/* ── Noturno — fundo: azul profundo → violeta com brilhos */
[data-theme="noturno"] body {
    background:
        radial-gradient(1200px 800px at 80% 8%, rgba(75,60,190,0.55), transparent 60%),
        radial-gradient(1000px 700px at 12% 88%, rgba(30,85,210,0.45), transparent 60%),
        radial-gradient(800px 500px at 60% 55%, rgba(125,70,225,0.28), transparent 60%),
        linear-gradient(120deg, #060a24 0%, #101642 45%, #1c1260 100%);
    background-attachment: fixed;
    color: var(--text-primary);
}

/* ── Noturno — feixes de luz diagonais (atrás do conteúdo) */
[data-theme="noturno"] body::before,
[data-theme="noturno"] body::after {
    content: '';
    position: fixed;
    z-index: -1;
    width: 90vmax;
    height: 14vmax;
    border-radius: 50%;
    filter: blur(50px);
    opacity: .28;
    pointer-events: none;
}
[data-theme="noturno"] body::before {
    background: linear-gradient(90deg, transparent 0%, #3E9CFF 45%, #7C5CFF 60%, transparent 100%);
    top: 62%; left: -20vmax;
    transform: rotate(-18deg);
    animation: liquidDarkBeam1 34s ease-in-out infinite alternate;
}
[data-theme="noturno"] body::after {
    background: linear-gradient(90deg, transparent 0%, #7C5CFF 40%, #2fd4ff 65%, transparent 100%);
    top: 22%; right: -25vmax;
    transform: rotate(-18deg);
    animation: liquidDarkBeam2 40s ease-in-out infinite alternate;
}
@keyframes liquidDarkBeam1 {
    from { transform: rotate(-18deg) translateX(0); opacity: .28; }
    to   { transform: rotate(-14deg) translateX(10vmax); opacity: .38; }
}
@keyframes liquidDarkBeam2 {
    from { transform: rotate(-18deg) translateX(0); opacity: .24; }
    to   { transform: rotate(-22deg) translateX(-8vmax); opacity: .34; }
}

/* ── Noturno — navbar e sidebar de vidro escuro */
[data-theme="noturno"] .app-navbar {
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
}
[data-theme="noturno"] .app-sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: var(--sidebar-blur);
    -webkit-backdrop-filter: var(--sidebar-blur);
    border-right: var(--sidebar-border);
}
[data-theme="noturno"] .sidebar-nav a { border-radius: 999px; }
[data-theme="noturno"] .sidebar-nav a.active {
    box-shadow: 0 6px 18px rgba(60,120,255,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* ── Noturno — cards de vidro escuro */
[data-theme="noturno"] .card,
[data-theme="noturno"] .app-card {
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    color: var(--text-primary);
}

/* ── Noturno — tabelas: painel de vidro escuro */
[data-theme="noturno"] .table-responsive {
    background: rgba(30,28,75,0.40);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(4,5,25,0.40), inset 0 1px 0 rgba(255,255,255,0.12);
}
[data-theme="noturno"] .table { margin-bottom: 0; --bs-table-bg: transparent; --bs-table-color: var(--text-primary); }
[data-theme="noturno"] .table tbody tr:last-child td { border-bottom: none !important; }
[data-theme="noturno"] .table td, [data-theme="noturno"] .table th { color: var(--text-primary); }

/* ── Noturno — botões: pills com glow colorido */
[data-theme="noturno"] .btn-primary {
    box-shadow: 0 8px 24px rgba(55,140,255,0.45), inset 0 1px 0 rgba(255,255,255,0.35) !important;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
}
[data-theme="noturno"] .btn-outline-secondary {
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    color: #dfe3ff !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
[data-theme="noturno"] .btn-danger {
    background: linear-gradient(135deg, #ff8a5c 0%, #f43f5e 100%) !important;
    border: none !important;
    box-shadow: 0 8px 22px rgba(244,63,94,0.40), inset 0 1px 0 rgba(255,255,255,0.30) !important;
}
[data-theme="noturno"] .btn-success {
    background: linear-gradient(135deg, #34d399 0%, #0ea56f 100%) !important;
    border: none !important;
    box-shadow: 0 8px 22px rgba(20,180,120,0.40), inset 0 1px 0 rgba(255,255,255,0.30) !important;
}
[data-theme="noturno"] .btn-dark {
    background: rgba(255,255,255,0.10) !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15) !important;
}

/* ── Noturno — inputs de vidro escuro */
[data-theme="noturno"] textarea.form-control { border-radius: 18px !important; }
[data-theme="noturno"] .form-control:focus,
[data-theme="noturno"] .form-select:focus {
    background: rgba(255,255,255,0.12) !important;
    box-shadow: 0 0 0 3px rgba(62,156,255,0.35) !important;
}
[data-theme="noturno"] .form-control::placeholder { color: #7f85ad; }
[data-theme="noturno"] .form-select option { background: #14173d; color: #eef0ff; }

/* ── Noturno — offcanvas mobile: vidro escuro profundo */
[data-theme="noturno"] .app-offcanvas {
    background: rgba(14,12,42,0.78) !important;
    backdrop-filter: blur(40px) saturate(1.6) !important;
    -webkit-backdrop-filter: blur(40px) saturate(1.6) !important;
    border-right: 1px solid rgba(255,255,255,0.10);
}
[data-theme="noturno"] .app-offcanvas .sidebar-nav a { border-radius: 999px; }

/* ── Noturno — dropdown / modal de vidro escuro */
[data-theme="noturno"] .dropdown-menu {
    background: rgba(25,23,65,0.85) !important;
    backdrop-filter: blur(30px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.5) !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    border-radius: 20px !important;
}
[data-theme="noturno"] .dropdown-menu .dropdown-item { color: #dfe3ff; }
[data-theme="noturno"] .dropdown-menu .dropdown-item:hover { background: rgba(255,255,255,0.10); color: #fff; }
[data-theme="noturno"] .modal-content {
    background: rgba(25,23,65,0.90) !important;
    backdrop-filter: blur(30px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.5) !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    border-radius: 24px !important;
    color: var(--text-primary);
}

/* ── Noturno — scrollbar */
[data-theme="noturno"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); }
[data-theme="noturno"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.38); }

/* ── Noturno — login: fundo profundo + cartão de vidro escuro */
[data-theme="noturno"] .login-page {
    background:
        radial-gradient(900px 600px at 75% 15%, rgba(75,60,190,0.60), transparent 60%),
        radial-gradient(800px 600px at 20% 85%, rgba(30,85,210,0.50), transparent 60%),
        linear-gradient(120deg, #060a24 0%, #101642 45%, #1c1260 100%);
}
[data-theme="noturno"] .login-card {
    background: rgba(30,28,75,0.55);
    backdrop-filter: blur(30px) saturate(1.6);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 26px;
    box-shadow: 0 25px 60px rgba(3,4,20,0.60), inset 0 1px 0 rgba(255,255,255,0.16);
}

/* ══════════════════════════════════════════════════════════════
   BASE STYLES (applied to both themes via CSS vars)
   ══════════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Navbar ────────────────────────────────────────────────── */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 1rem;
    height: 52px;
    background: var(--nav-bg);
    box-shadow: var(--nav-border);
    color: var(--nav-text);
}
[data-theme="cristal"] .app-navbar {
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
}
.app-navbar .brand {
    font-size: 1rem;
    font-weight: 700;
    color: var(--nav-brand);
    letter-spacing: -.3px;
    margin: 0 auto 0 0;
    text-shadow: none;
}
[data-theme="retro"] .app-navbar .brand {
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
    letter-spacing: .5px;
}

/* ── Hamburger button ───────────────────────────────────────── */
.btn-menu {
    background: none;
    border: none;
    color: var(--nav-text);
    padding: .25rem .4rem;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: background .15s;
}
.btn-menu:hover { background: rgba(128,128,128,.15); }
[data-theme="retro"] .btn-menu {
    background: linear-gradient(to bottom, rgba(255,255,255,.3) 0%, rgba(255,255,255,.1) 100%);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 6px;
    padding: .2rem .5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* ── Back button (mobile) ──────────────────────────────────── */
.btn-back {
    background: none;
    border: none;
    color: var(--color-blue);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .5rem;
    border-radius: 8px;
}
[data-theme="retro"] .btn-back {
    color: var(--nav-text);
    font-size: .8rem;
}

/* ── Navbar user / buttons ──────────────────────────────────── */
.nav-user { font-size: .8rem; color: var(--color-gray); }
[data-theme="retro"] .nav-user { color: rgba(255,255,255,.7); }

.btn-nav-action {
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-blue);
    background: none;
    border: none;
    cursor: pointer;
    padding: .2rem .4rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
[data-theme="retro"] .btn-nav-action {
    color: #fff;
    background: linear-gradient(to bottom, rgba(255,255,255,.3) 0%, rgba(255,255,255,.1) 100%);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 6px;
    padding: .2rem .6rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.3);
    text-shadow: 0 1px 1px rgba(0,0,0,.4);
}

/* ── Theme switcher ─────────────────────────────────────────── */
.btn-theme {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: .2rem .4rem;
    border-radius: 8px;
    color: var(--nav-text);
    opacity: .7;
    transition: opacity .2s;
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .75rem;
    font-family: var(--font);
    font-weight: 500;
    white-space: nowrap;
}
.btn-theme:hover { opacity: 1; }
[data-theme="retro"] .btn-theme {
    color: rgba(255,255,255,.85);
    background: linear-gradient(to bottom, rgba(255,255,255,.25) 0%, rgba(255,255,255,.08) 100%);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 6px;
    padding: .2rem .6rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* ── Desktop layout ─────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: calc(100vh - 52px);
}

/* ── Sidebar desktop ─────────────────────────────────────────── */
.app-sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: .75rem .5rem;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    display: none;
}
@media (min-width: 768px) { .app-sidebar { display: block; } }

[data-theme="cristal"] .app-sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: var(--sidebar-blur);
    -webkit-backdrop-filter: var(--sidebar-blur);
    border-right: var(--sidebar-border);
}
[data-theme="retro"] .app-sidebar {
    background: var(--sidebar-bg);
    border-right: var(--sidebar-border);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.08);
}

/* ── Sidebar nav links ──────────────────────────────────────── */
.sidebar-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav li { }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .75rem;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--sidebar-link);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.sidebar-nav a i { width: 20px; text-align: center; font-size: .95rem; flex-shrink: 0; }

.sidebar-nav a:hover {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
}
.sidebar-nav a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
}
[data-theme="retro"] .sidebar-nav a { border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.07); }
[data-theme="retro"] .sidebar-nav a:hover,
[data-theme="retro"] .sidebar-nav a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
    border-radius: 0;
    text-shadow: 0 1px 1px rgba(0,0,60,.4);
}

.sidebar-hr {
    border: none;
    border-top: 1px solid var(--sidebar-hr);
    margin: .4rem .5rem;
}

/* ── Main content ───────────────────────────────────────────── */
.app-main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 1.75rem;
    background: var(--content-bg);
}
@media (max-width: 767.98px) {
    .app-main { padding: 1rem .75rem; }
}

/* ── Cards / Panels ─────────────────────────────────────────── */
.card, .app-card {
    background: var(--card-bg) !important;
    border: var(--card-border) !important;
    border-radius: var(--card-radius) !important;
    box-shadow: var(--card-shadow) !important;
}
[data-theme="retro"] .card,
[data-theme="retro"] .app-card {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%) !important;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table {
    color: var(--text-primary);
    border-color: var(--table-border) !important;
}
.table thead th {
    background: var(--table-header-bg);
    color: var(--text-secondary);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--table-border) !important;
}
[data-theme="retro"] .table thead th {
    text-shadow: 0 1px 0 rgba(255,255,255,.8);
    font-size: .8rem;
}
.table tbody tr:nth-child(even) td { background: var(--table-stripe); }
.table td, .table th { border-color: var(--table-border) !important; }

/* ── Forms / Inputs ──────────────────────────────────────────── */
.form-control, .form-select {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: var(--input-radius) !important;
    color: var(--text-primary) !important;
    font-family: var(--font);
    transition: box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(0,122,255,.25) !important;
    border-color: var(--input-focus) !important;
    background: var(--input-bg) !important;
}
[data-theme="retro"] .form-control,
[data-theme="retro"] .form-select {
    border: 1px solid var(--input-border) !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.12) !important;
}
[data-theme="retro"] .form-control:focus,
[data-theme="retro"] .form-select:focus {
    border-color: #0077ff !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.12), 0 0 0 3px rgba(0,119,255,.2) !important;
}
.form-label { font-weight: 500; font-size: .88rem; color: var(--text-secondary); margin-bottom: .3rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    background: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
    border: none !important;
    border-radius: var(--btn-radius) !important;
    font-weight: 600;
    font-family: var(--font);
}
[data-theme="retro"] .btn-primary {
    box-shadow: 0 1px 3px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.25) !important;
    text-shadow: 0 -1px 0 rgba(0,0,80,.4);
}
.btn-primary:hover { opacity: .88; }

.btn-dark {
    background: #1c1c1e !important;
    border-radius: var(--btn-radius) !important;
    border: none !important;
}
[data-theme="retro"] .btn-dark {
    background: linear-gradient(to bottom, #4a4a5a 0%, #2a2a3a 100%) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.15) !important;
}

.btn-outline-secondary {
    border-radius: var(--btn-radius) !important;
    border-color: var(--table-border) !important;
    color: var(--text-secondary) !important;
}
[data-theme="retro"] .btn-outline-secondary {
    background: linear-gradient(to bottom, #f4f4f4 0%, #e8e8e8 100%) !important;
    border-color: #b0b0b8 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.7) !important;
    color: #333 !important;
}

.btn-danger {
    border-radius: var(--btn-radius) !important;
}
[data-theme="retro"] .btn-danger {
    background: linear-gradient(to bottom, #e05050 0%, #c02020 100%) !important;
    border: 1px solid #901010 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.2) !important;
}

.btn-success {
    border-radius: var(--btn-radius) !important;
}
[data-theme="retro"] .btn-success {
    background: linear-gradient(to bottom, #6ec25e 0%, #4a9e38 100%) !important;
    border: 1px solid #367a28 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.2) !important;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    border-radius: 100px !important;
    font-weight: 600;
}
[data-theme="retro"] .badge {
    border-radius: 12px !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.25);
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    border-radius: var(--card-radius) !important;
    border: var(--card-border) !important;
    font-size: .9rem;
}
[data-theme="retro"] .alert {
    border-radius: var(--card-radius) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.4);
}

/* ── Offcanvas (mobile menu) ─────────────────────────────────── */
.app-offcanvas {
    width: 260px !important;
}
[data-theme="cristal"] .app-offcanvas {
    background: rgba(28,28,30,0.88) !important;
    backdrop-filter: blur(40px) saturate(1.8) !important;
    -webkit-backdrop-filter: blur(40px) saturate(1.8) !important;
}
[data-theme="retro"] .app-offcanvas {
    background: linear-gradient(to bottom, #3a4a6e 0%, #1e2d50 100%) !important;
}

.app-offcanvas .offcanvas-header {
    border-bottom: 1px solid var(--sidebar-hr);
    padding: 1rem;
}
.app-offcanvas .brand-mobile {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}
.app-offcanvas .user-mobile {
    font-size: .75rem;
    color: rgba(255,255,255,.55);
    margin-top: 2px;
}
.app-offcanvas .offcanvas-body { padding: .5rem; }

.app-offcanvas .sidebar-nav a {
    color: rgba(255,255,255,.75);
    background: transparent;
}
.app-offcanvas .sidebar-nav a:hover,
.app-offcanvas .sidebar-nav a.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}
[data-theme="retro"] .app-offcanvas .sidebar-nav a:hover,
[data-theme="retro"] .app-offcanvas .sidebar-nav a.active {
    background: linear-gradient(to bottom, #2266cc 0%, #1144aa 100%);
    color: #fff;
}
.app-offcanvas .sidebar-hr { border-color: rgba(255,255,255,.12); }

/* ── Headings ────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 { font-family: var(--font); font-weight: 700; color: var(--text-primary); }
h4.mb-0 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.3px; }
[data-theme="retro"] h4.mb-0 { font-size: 1rem; }

/* ── Page sections ───────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .5rem;
}

/* ── Cristal: grouped list style panels ─────────────────────── */
[data-theme="cristal"] .table-responsive {
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: var(--card-border);
}
[data-theme="cristal"] .table { margin-bottom: 0; }
[data-theme="cristal"] .table tbody tr:last-child td { border-bottom: none !important; }

/* ── 3GS: embossed separators ──────────────────────────────── */
[data-theme="retro"] .table-responsive {
    border: 1px solid #b0b0b8;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* ── Login page ──────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
[data-theme="cristal"] .login-page {
    background: radial-gradient(ellipse at 30% 40%, rgba(120,180,255,.3) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(180,120,255,.2) 0%, transparent 60%),
                #f2f2f7;
}
[data-theme="retro"] .login-page {
    background: linear-gradient(to bottom, #3a4a6e 0%, #1e2d50 40%, #0e1a38 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
}
[data-theme="cristal"] .login-card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    box-shadow: 0 20px 60px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.08);
}
[data-theme="retro"] .login-card {
    background: linear-gradient(to bottom, #fefefe 0%, #f0f0f0 100%);
    border: 1px solid #b0b0b8;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.8);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-logo h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.login-logo p {
    font-size: .82rem;
    color: var(--text-secondary);
    margin: .25rem 0 0;
}
[data-theme="retro"] .login-logo h2 {
    text-shadow: 0 1px 0 rgba(255,255,255,.8);
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.35); }

/* ── Misc Bootstrap overrides ────────────────────────────────── */
.dropdown-menu {
    border-radius: 14px !important;
    border: var(--card-border) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.16) !important;
    overflow: hidden;
}
[data-theme="cristal"] .dropdown-menu {
    backdrop-filter: blur(24px) !important;
    background: rgba(255,255,255,.88) !important;
}
.modal-content {
    border-radius: 18px !important;
    border: var(--card-border) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
}

@media print {
    .app-sidebar, .app-navbar, .btn, form, .alert .btn-close { display: none !important; }
    .app-main { padding: 0 !important; }
}

/* Correção: títulos invisíveis nos cards Bootstrap text-bg-* do dashboard
   (o tema repinta o fundo do card, mas o texto herdava branco) */
.card[class*="text-bg-"] .card-title { color: var(--text-secondary, #6e6e73) !important; }
.card[class*="text-bg-"] h2 { color: var(--text-primary, #1c1c1e) !important; }
.card[class*="text-bg-"] small { color: var(--text-secondary, #8e8e93) !important; }
