/* ================================================================
   LifeAdmin — Void Glass Design System v3
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ================================================================
   1. TOKENS
   ================================================================ */
:root {
    --emerald:        #00e5a0;
    --emerald-dim:    rgba(0, 229, 160, 0.14);
    --emerald-glow:   rgba(0, 229, 160, 0.30);
    --sapphire:       #3b82f6;
    --sapphire-dim:   rgba(59, 130, 246, 0.14);
    --sapphire-glow:  rgba(59, 130, 246, 0.28);
    --violet:         #8b5cf6;
    --rose:           #f43f5e;
    --rose-dim:       rgba(244, 63, 94, 0.14);
    --amber:          #f59e0b;

    --void:           #060b17;
    --deep:           #0a1020;
    --layer-1:        rgba(12, 20, 38, 0.72);
    --layer-2:        rgba(16, 26, 50, 0.65);
    --layer-3:        rgba(20, 32, 60, 0.55);

    --glass-border:   rgba(96, 160, 255, 0.10);
    --glass-border-h: rgba(96, 160, 255, 0.22);
    --glass-shine:    rgba(255, 255, 255, 0.04);
    --glass-blur:     blur(24px) saturate(180%);
    --glass-blur-xl:  blur(40px) saturate(200%);

    --t1: #f0f6ff;
    --t2: #7a9acc;
    --t3: #3d5a80;

    --sidebar-w:      264px;
    --sidebar-w-mini: 66px;
    --navbar-h:       60px;
    --gap:            10px;
    --pad:            16px;

    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 26px;

    --font-brand: 'Outfit', system-ui, sans-serif;
    --font-body:  'Space Grotesk', system-ui, sans-serif;

    --ease:   cubic-bezier(.4,0,.2,1);
    --spring: cubic-bezier(.34,1.56,.64,1);
}

/* ================================================================
   THEMES  (body data-theme="X")
   Default :root = Dark (Void)
   ================================================================ */

/* --- LIGHT --- */
[data-theme="light"] {
    --void:           #eef3fb;
    --deep:           #e2ecf8;
    --layer-1:        rgba(220, 234, 255, 0.82);
    --layer-2:        rgba(208, 225, 255, 0.72);
    --layer-3:        rgba(196, 216, 255, 0.58);
    --glass-border:   rgba(59, 130, 246, 0.16);
    --glass-border-h: rgba(59, 130, 246, 0.32);
    --glass-shine:    rgba(255, 255, 255, 0.60);
    --t1: #0d1f3c;
    --t2: #3a5580;
    --t3: #7a9ab5;
    /* accent stays same but dimmed */
    --emerald:        #059669;
    --emerald-dim:    rgba(5, 150, 105, 0.13);
    --emerald-glow:   rgba(5, 150, 105, 0.26);
    /* bg orbs */
    --orb-a: rgba(0, 200, 140, 0.07);
    --orb-b: rgba(59, 130, 246, 0.07);
    --orb-c: rgba(139, 92, 246, 0.04);
}

/* --- FOREST --- */
[data-theme="forest"] {
    --void:           #050f0a;
    --deep:           #081409;
    --layer-1:        rgba(8, 24, 12, 0.75);
    --layer-2:        rgba(10, 30, 15, 0.68);
    --layer-3:        rgba(14, 38, 18, 0.58);
    --glass-border:   rgba(52, 211, 102, 0.12);
    --glass-border-h: rgba(52, 211, 102, 0.26);
    --glass-shine:    rgba(52, 211, 102, 0.04);
    --t1: #e8fdf0;
    --t2: #6bbf82;
    --t3: #305a3c;
    --emerald:        #34d366;
    --emerald-dim:    rgba(52, 211, 102, 0.15);
    --emerald-glow:   rgba(52, 211, 102, 0.32);
    --sapphire:       #34d366;
    --sapphire-dim:   rgba(52, 211, 102, 0.14);
    --sapphire-glow:  rgba(52, 211, 102, 0.28);
    --orb-a: rgba(52, 211, 102, 0.10);
    --orb-b: rgba(16, 185, 60, 0.07);
    --orb-c: rgba(6, 120, 40, 0.06);
}

/* --- NORD --- */
[data-theme="nord"] {
    --void:           #0d1117;
    --deep:           #131923;
    --layer-1:        rgba(18, 28, 44, 0.75);
    --layer-2:        rgba(22, 34, 52, 0.68);
    --layer-3:        rgba(28, 42, 62, 0.58);
    --glass-border:   rgba(136, 192, 208, 0.12);
    --glass-border-h: rgba(136, 192, 208, 0.26);
    --glass-shine:    rgba(236, 239, 244, 0.04);
    --t1: #eceff4;
    --t2: #81a0b8;
    --t3: #4c6478;
    --emerald:        #88c0d0;
    --emerald-dim:    rgba(136, 192, 208, 0.14);
    --emerald-glow:   rgba(136, 192, 208, 0.28);
    --sapphire:       #81a1c1;
    --sapphire-dim:   rgba(129, 161, 193, 0.14);
    --sapphire-glow:  rgba(129, 161, 193, 0.26);
    --orb-a: rgba(136, 192, 208, 0.09);
    --orb-b: rgba(94, 129, 172, 0.07);
    --orb-c: rgba(59, 66, 82, 0.08);
}

/* --- PURPLE --- */
[data-theme="purple"] {
    --void:           #0b0614;
    --deep:           #10091e;
    --layer-1:        rgba(20, 10, 40, 0.75);
    --layer-2:        rgba(26, 14, 52, 0.68);
    --layer-3:        rgba(34, 18, 64, 0.58);
    --glass-border:   rgba(167, 139, 250, 0.12);
    --glass-border-h: rgba(167, 139, 250, 0.28);
    --glass-shine:    rgba(167, 139, 250, 0.04);
    --t1: #f3eeff;
    --t2: #a88ec8;
    --t3: #5a3e80;
    --emerald:        #c084fc;
    --emerald-dim:    rgba(192, 132, 252, 0.15);
    --emerald-glow:   rgba(192, 132, 252, 0.32);
    --sapphire:       #a78bfa;
    --sapphire-dim:   rgba(167, 139, 250, 0.14);
    --sapphire-glow:  rgba(167, 139, 250, 0.28);
    --orb-a: rgba(192, 132, 252, 0.10);
    --orb-b: rgba(139, 92, 246, 0.09);
    --orb-c: rgba(236, 72, 153, 0.06);
}

/* --- SUNSET --- */
[data-theme="sunset"] {
    --void:           #0f0810;
    --deep:           #180a12;
    --layer-1:        rgba(30, 12, 20, 0.76);
    --layer-2:        rgba(38, 16, 26, 0.68);
    --layer-3:        rgba(48, 20, 32, 0.58);
    --glass-border:   rgba(251, 113, 72, 0.12);
    --glass-border-h: rgba(251, 113, 72, 0.28);
    --glass-shine:    rgba(251, 191, 36, 0.04);
    --t1: #fff1ee;
    --t2: #c87060;
    --t3: #6b3030;
    --emerald:        #fb7148;
    --emerald-dim:    rgba(251, 113, 72, 0.15);
    --emerald-glow:   rgba(251, 113, 72, 0.32);
    --sapphire:       #f59e0b;
    --sapphire-dim:   rgba(245, 158, 11, 0.14);
    --sapphire-glow:  rgba(245, 158, 11, 0.28);
    --orb-a: rgba(251, 113, 72, 0.10);
    --orb-b: rgba(245, 158, 11, 0.08);
    --orb-c: rgba(236, 72, 153, 0.07);
}
/* --- ATELIÊ --- */
[data-theme="atelie"] {
    --void:           #fbefef;
    --deep:           #f5f0f3;
    --layer-1:        rgba(255, 240, 245, 0.85);
    --layer-2:        rgba(252, 232, 240, 0.78);
    --layer-3:        rgba(248, 222, 233, 0.65);
    --glass-border:   rgba(244, 124, 180, 0.18);
    --glass-border-h: rgba(244, 124, 180, 0.38);
    --glass-shine:    rgba(255, 255, 255, 0.70);
    --t1: #3a2030;
    --t2: #a05070;
    --t3: #c899ae;
    --emerald:        #F47CB4;
    --emerald-dim:    rgba(244, 124, 180, 0.15);
    --emerald-glow:   rgba(244, 124, 180, 0.35);
    --sapphire:       #5bbcbc;
    --sapphire-dim:   rgba(91, 188, 188, 0.15);
    --sapphire-glow:  rgba(91, 188, 188, 0.30);
    --rose:           #e05590;
    --rose-dim:       rgba(224, 85, 144, 0.14);
    --orb-a: rgba(244, 124, 180, 0.14);
    --orb-b: rgba(142, 214, 214, 0.12);
    --orb-c: rgba(244, 124, 180, 0.07);
}
/* --- DOCERIA --- */
[data-theme="doceria"] {
    --void:           #fff9fb;
    --deep:           #f9f0f4;
    --layer-1:        rgba(255, 245, 250, 0.88);
    --layer-2:        rgba(252, 235, 243, 0.80);
    --layer-3:        rgba(248, 224, 235, 0.68);
    --glass-border:   rgba(138, 100, 118, 0.16);
    --glass-border-h: rgba(138, 100, 118, 0.34);
    --glass-shine:    rgba(255, 255, 255, 0.72);
    --t1: #3d1a24;
    --t2: #8a6476;
    --t3: #c4a0b0;
    --emerald:        #c0607c;
    --emerald-dim:    rgba(192, 96, 124, 0.14);
    --emerald-glow:   rgba(192, 96, 124, 0.32);
    --sapphire:       #8a6476;
    --sapphire-dim:   rgba(138, 100, 118, 0.15);
    --sapphire-glow:  rgba(138, 100, 118, 0.30);
    --rose:           #b03060;
    --rose-dim:       rgba(176, 48, 96, 0.13);
    --orb-a: rgba(244, 180, 196, 0.20);
    --orb-b: rgba(138, 100, 118, 0.12);
    --orb-c: rgba(244, 180, 196, 0.10);
}

/* ================================================================
   2. RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--t1);
    background-color: var(--void);
background-image:
radial-gradient(ellipse 70% 60% at 15% 0%,   var(--orb-a, rgba(0,229,160,.08))  0%, transparent 55%),
radial-gradient(ellipse 55% 45% at 90% 15%,  var(--orb-b, rgba(59,130,246,.07)) 0%, transparent 50%),
radial-gradient(ellipse 50% 70% at 50% 110%, var(--orb-c, rgba(139,92,246,.05)) 0%, transparent 50%);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    transition: background-color .5s var(--ease), color .3s var(--ease);
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   3. APP SHELL
   ================================================================ */
.app-shell {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 0;
    padding: var(--gap);
    transition: grid-template-columns .3s var(--ease);
}
.app-shell.sidebar-mini {
    grid-template-columns: var(--sidebar-w-mini) 1fr;
}

/* ================================================================
   4. SIDEBAR
   ================================================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    border-radius: var(--r-xl);
    background: var(--layer-1);
    backdrop-filter: var(--glass-blur-xl);
    -webkit-backdrop-filter: var(--glass-blur-xl);
    border: 1px solid var(--glass-border);
    margin-right: var(--gap);
    overflow: hidden;
    transition: margin .3s var(--ease), padding .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
    position: relative;
    z-index: 30;
}
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 12%; right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--emerald-glow), transparent);
    pointer-events: none;
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 18px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 14px;
    flex-shrink: 0;
}
.brand-mark {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 12px;
    background: conic-gradient(from 200deg, var(--emerald), #00b4d8, var(--sapphire), var(--violet), var(--emerald));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 16px var(--emerald-glow), 0 0 32px rgba(59,130,246,.15);
    transition: box-shadow .3s var(--ease);
}
.sidebar:hover .brand-mark { box-shadow: 0 0 24px var(--emerald-glow), 0 0 40px rgba(59,130,246,.2); }
.brand-mark svg { color: #060b17; }

.brand-text {
    display: flex; flex-direction: column; line-height: 1;
    white-space: nowrap; overflow: hidden;
    transition: opacity .2s var(--ease), width .3s var(--ease);
}
.brand-name {
    font-family: var(--font-brand);
    font-size: 17px; font-weight: 900; letter-spacing: -.04em;
    background: linear-gradient(100deg, var(--t1) 40%, var(--emerald) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.brand-sub {
    font-size: 10px; font-weight: 500; letter-spacing: .12em;
    text-transform: uppercase; color: var(--t3); margin-top: 3px;
}

/* Nav */
.sidebar-nav {
    flex: 1; display: flex; flex-direction: column; gap: 2px;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
    font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--t3); padding: 10px 10px 5px; white-space: nowrap; overflow: hidden;
    transition: opacity .2s var(--ease);
}

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--r-md);
    border: 1px solid transparent; color: var(--t2);
    font-size: 13.5px; font-weight: 500; text-decoration: none;
    white-space: nowrap; transition: all .15s var(--ease); position: relative; overflow: hidden;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.75; transition: transform .2s var(--spring); }
.nav-link:hover { background: var(--layer-3); border-color: var(--glass-border); color: var(--t1); text-decoration: none; }
.nav-link:hover .nav-icon { transform: scale(1.12); }

.nav-link.active {
    background: var(--sapphire-dim);
    border-color: rgba(59,130,246,.2);
    color: var(--sapphire); font-weight: 600;
}
.nav-link.active::before {
    content: ''; position: absolute; left: 0; top: 22%; bottom: 22%;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--sapphire); box-shadow: 0 0 10px var(--sapphire-glow);
}

.nav-arrow {
    width: 13px !important; height: 13px !important; stroke-width: 2.5 !important;
    margin-left: auto; transition: transform .25s var(--ease) !important; flex-shrink: 0;
}
.nav-item.open > .nav-link > .nav-arrow { transform: rotate(180deg); }

/* Submenu */
.submenu {
    list-style: none; max-height: 0; overflow: hidden;
    transition: max-height .3s var(--ease), padding .25s var(--ease);
    padding: 0 0 0 8px;
}
.nav-item.open > .submenu { max-height: 500px; padding: 3px 0 3px 8px; }
.sub-link {
    display: flex; align-items: center;
    padding: 6px 10px 6px 20px; border-radius: var(--r-sm);
    color: var(--t3); font-size: 12.5px; font-weight: 500;
    text-decoration: none; transition: all .15s var(--ease); position: relative; white-space: nowrap;
}
.sub-link::before {
    content: ''; position: absolute; left: 8px; top: 50%;
    width: 7px; height: 1px; background: var(--glass-border-h); transition: background .15s var(--ease);
}
.sub-link:hover { color: var(--t1); background: rgba(255,255,255,.04); text-decoration: none; }
.sub-link:hover::before { background: var(--sapphire); }
.sub-link.active { color: var(--emerald); font-weight: 600; }
.sub-link.active::before { background: var(--emerald); }

/* Sidebar footer */
.sidebar-footer { padding-top: 12px; border-top: 1px solid var(--glass-border); margin-top: 6px; flex-shrink: 0; overflow: hidden; }
.sidebar-footer .nav-link { color: var(--rose); }
.sidebar-footer .nav-link:hover { background: var(--rose-dim); color: var(--rose); border-color: rgba(244,63,94,.2); text-decoration: none; }

/* Sidebar mini */
.app-shell.sidebar-mini .sidebar { padding: 14px 6px; }

/* Oculta textos e elementos desnecessários com display:none
   (evita que width:0 ainda reserve espaço de gap no flexbox) */
.app-shell.sidebar-mini .brand-text,
.app-shell.sidebar-mini .nav-section-label,
.app-shell.sidebar-mini .nav-arrow,
.app-shell.sidebar-mini .submenu { display: none; pointer-events: none; }

/* Span de texto dentro dos nav-links (ex: "Finance", "Home") */
.app-shell.sidebar-mini .nav-link > span:not(.nav-icon) { display: none; }

.app-shell.sidebar-mini .sidebar-brand { justify-content: center; padding-bottom: 14px; }

/* Todos os nav-links: ícone centralizado, sem gap residual */
.app-shell.sidebar-mini .nav-link {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
}
.app-shell.sidebar-mini .nav-link .nav-icon { margin: 0; flex-shrink: 0; }
.app-shell.sidebar-mini .nav-link.active::before { display: none; }
.app-shell.sidebar-mini .sidebar-footer .nav-link { justify-content: center; }

/* ================================================================
   5. MAIN COLUMN
   ================================================================ */
.main-col {
    display: flex; flex-direction: column;
    gap: var(--gap); overflow: hidden; min-width: 0;
}

/* ================================================================
   6. NAVBAR
   ================================================================ */
.navbar {
    flex-shrink: 0; height: var(--navbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; border-radius: var(--r-xl);
    background: var(--layer-1); backdrop-filter: var(--glass-blur-xl); -webkit-backdrop-filter: var(--glass-blur-xl);
    border: 1px solid var(--glass-border);
    transition: background .3s var(--ease), border-color .3s var(--ease);
    position: relative;
    z-index: 60;
}
.navbar::after {
    content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-shine), transparent); pointer-events: none;
}
.navbar-left { display: flex; align-items: center; gap: 12px; }

.toggle-btn {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm); border: 1px solid var(--glass-border);
    background: var(--layer-3); color: var(--t2); cursor: pointer; transition: all .15s var(--ease); flex-shrink: 0;
}
.toggle-btn:hover { background: var(--layer-2); border-color: var(--glass-border-h); color: var(--t1); }
.toggle-btn svg { width: 16px; height: 16px; stroke-width: 2; }

.navbar-title { font-family: var(--font-brand); font-size: 15px; font-weight: 700; color: var(--t1); letter-spacing: -.02em; }
.navbar-sub   { font-size: 11.5px; color: var(--t3); margin-top: 1px; font-weight: 400; }

.navbar-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm); border: 1px solid var(--glass-border);
    background: var(--layer-3); color: var(--t2); cursor: pointer;
    transition: all .15s var(--ease); position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: var(--layer-2); border-color: var(--glass-border-h); color: var(--t1); }
.icon-btn svg { width: 16px; height: 16px; stroke-width: 2; }
.notif-dot {
    position: absolute; top: 7px; right: 7px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--rose); border: 1.5px solid var(--void);
    box-shadow: 0 0 6px var(--rose);
}

.navbar-divider { width: 1px; height: 28px; background: var(--glass-border); flex-shrink: 0; }

/* User pill */
.user-pill-wrap { position: relative; z-index: 70; }
.user-pill {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 12px 5px 5px; border-radius: 999px;
    border: 1px solid var(--glass-border); background: var(--layer-3);
    cursor: pointer; transition: all .15s var(--ease);
}
.user-pill:hover { background: var(--layer-2); border-color: var(--glass-border-h); }
.user-pill.open .user-arrow { transform: rotate(180deg); }

.user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid var(--emerald); box-shadow: 0 0 0 2px var(--emerald-dim);
    object-fit: cover; flex-shrink: 0;
}
.user-info  { display: flex; flex-direction: column; line-height: 1; }
.user-name  { font-size: 12.5px; font-weight: 600; color: var(--t1); white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.user-online {
    font-size: 10px; color: var(--emerald); font-weight: 500; margin-top: 2px;
    display: flex; align-items: center; gap: 3px;
}
.user-online::before {
    content: ''; width: 5px; height: 5px; border-radius: 50%;
    background: var(--emerald); box-shadow: 0 0 5px var(--emerald-glow);
    animation: blink 2.5s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.4; } }

.user-arrow { width: 13px; height: 13px; color: var(--t3); stroke-width: 2.5; transition: transform .2s var(--ease); flex-shrink: 0; }

/* Dropdown */
.user-dropdown {
    display: none; position: absolute;
    top: calc(100% + 10px); right: 0; width: 270px;
    background: rgba(10,16,32,.92); backdrop-filter: var(--glass-blur-xl); -webkit-backdrop-filter: var(--glass-blur-xl);
    border: 1px solid var(--glass-border-h); border-radius: var(--r-lg);
    overflow: hidden; z-index: 200; box-shadow: 0 20px 60px rgba(0,0,0,.65);
}
.user-dropdown::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--emerald-glow), transparent);
}
.user-dropdown.open {
    display: flex; flex-direction: column;
    animation: drop-in .2s var(--spring) both;
}
@keyframes drop-in { from { opacity:0; transform:translateY(-8px) scale(.97); } to { opacity:1; transform:none; } }

.dd-header { padding: 14px 14px 12px; }
.dd-name   { font-family: var(--font-brand); font-size: 14px; font-weight: 700; color: var(--t1); }
.dd-status { font-size: 11px; color: var(--emerald); margin-top: 2px; font-weight: 500; }
.dd-sep    { border: none; border-top: 1px solid var(--glass-border); margin: 0; }

.dd-item {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 14px; color: var(--t2); font-size: 13px; font-weight: 500;
    text-decoration: none; cursor: pointer; transition: all .12s var(--ease);
    border: none; background: none; width: 100%; text-align: left;
}
.dd-item svg { width: 15px; height: 15px; stroke-width: 2; flex-shrink: 0; }
.dd-item:hover { background: rgba(255,255,255,.04); color: var(--t1); text-decoration: none; }
.dd-item.danger { color: var(--rose); }
.dd-item.danger:hover { background: var(--rose-dim); }

.dd-theme-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.dd-theme-label { display: flex; align-items: center; gap: 9px; color: var(--t2); font-size: 13px; font-weight: 500; }
.dd-theme-label svg { width: 15px; height: 15px; stroke-width: 2; }

/* Theme toggle pill */
.toggle-pill { position: relative; width: 38px; height: 21px; cursor: pointer; display: block; }
.toggle-pill input { display: none; }
.pill-track {
    position: absolute; inset: 0; border-radius: 999px;
    background: var(--layer-3); border: 1px solid var(--glass-border);
    transition: background .2s var(--ease), border-color .2s var(--ease);
}
.toggle-pill input:checked + .pill-track { background: var(--emerald-dim); border-color: var(--emerald); }
.pill-thumb {
    position: absolute; top: 2px; left: 3px;
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--t2); transition: transform .2s var(--spring), background .2s var(--ease);
}
.toggle-pill input:checked ~ .pill-thumb {
    transform: translateX(17px); background: var(--emerald); box-shadow: 0 0 8px var(--emerald-glow);
}

/* ================================================================
   7. CONTENT AREA
   ================================================================ */
.content-area {
    flex: 1; border-radius: var(--r-xl);
    background: var(--layer-1); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); padding: 20px 22px;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
    transition: background .3s var(--ease), border-color .3s var(--ease);
    position: relative; z-index: 1;
}
.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 5px; }

.page-header {
    margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--glass-border); position: relative;
}
.page-header::after {
    content: ''; position: absolute; bottom: -1px; left: 0;
    width: 48px; height: 2px;
    background: linear-gradient(90deg, var(--emerald), var(--sapphire));
    border-radius: 2px;
}
.page-header h1 {
    font-family: var(--font-brand); font-size: 22px; font-weight: 800; letter-spacing: -.03em;
    background: linear-gradient(120deg, var(--t1) 40%, var(--t2) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ================================================================
   8. LOGIN PAGE
   ================================================================ */
.login-page {
    width: 100%; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem; position: relative; overflow: hidden;
}

.orb { position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; will-change: transform; }
.orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(0,229,160,.12), transparent 65%); top: -200px; left: -150px; animation: orb-drift 18s ease-in-out infinite; }
.orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(59,130,246,.10), transparent 65%); bottom: -150px; right: -100px; animation: orb-drift 14s ease-in-out infinite reverse; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(139,92,246,.08), transparent 65%); top: 50%; left: 60%; animation: orb-drift 22s ease-in-out infinite 4s; }
@keyframes orb-drift { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(40px,-50px) scale(1.06); } 66% { transform: translate(-25px,30px) scale(.94); } }

.login-card {
    width: 100%; max-width: 430px; padding: 2.5rem 2rem;
    background: var(--layer-1); backdrop-filter: var(--glass-blur-xl); -webkit-backdrop-filter: var(--glass-blur-xl);
    border: 1px solid var(--glass-border); border-radius: var(--r-xl);
    box-shadow: 0 32px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03) inset;
    position: relative; z-index: 1; animation: card-rise .65s var(--spring) both;
}
@keyframes card-rise { from { opacity:0; transform:translateY(28px) scale(.97); } to { opacity:1; transform:none; } }
.login-card::before {
    content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--emerald-glow), var(--sapphire-glow), transparent);
}

.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 2rem; }
.login-brand-mark {
    width: 42px; height: 42px; border-radius: 14px;
    background: conic-gradient(from 200deg, var(--emerald), #00b4d8, var(--sapphire), var(--violet), var(--emerald));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 24px var(--emerald-glow);
}
.login-brand-mark svg { color: #060b17; }
.login-brand-name {
    font-family: var(--font-brand); font-size: 28px; font-weight: 900; letter-spacing: -.05em;
    background: linear-gradient(110deg, var(--t1) 45%, var(--emerald) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.login-title { font-family: var(--font-brand); font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; color: var(--t1); text-align: center; margin-bottom: .35rem; }
.login-sub   { font-size: .875rem; color: var(--t2); text-align: center; margin-bottom: 1.75rem; font-weight: 400; }

.alert-error {
    display: flex; align-items: center; gap: 8px;
    background: var(--rose-dim); border: 1px solid rgba(244,63,94,.25);
    color: var(--rose); padding: .7rem 1rem; margin-bottom: 1.25rem;
    border-radius: var(--r-md); font-size: .85rem;
}
.alert-error svg { flex-shrink: 0; }

.btn-google {
    width: 100%; padding: .8rem 1.25rem;
    background: rgba(255,255,255,.06); border: 1px solid var(--glass-border); border-radius: var(--r-md);
    color: var(--t1); font-family: var(--font-body); font-size: .9rem; font-weight: 500;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .75rem;
    transition: all .2s var(--ease); text-decoration: none;
}
.btn-google:hover {
    background: rgba(255,255,255,.10); border-color: var(--glass-border-h);
    transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.25);
    color: var(--t1); text-decoration: none;
}
.btn-google:active { transform: none; }

.login-footer { margin-top: 1.75rem; text-align: center; color: var(--t3); font-size: .78rem; position: relative; z-index:1; }
.login-footer a { color: var(--emerald); font-weight: 500; }
.login-footer a:hover { text-decoration: underline; }

/* ================================================================
   9. MOBILE
   ================================================================ */
@media (max-width: 768px) {
    body { overflow: hidden; }
    .app-shell { grid-template-columns: 1fr; padding: var(--gap); }
    .sidebar {
        position: fixed; left: var(--gap); top: var(--gap); bottom: var(--gap);
    width: calc(var(--sidebar-w) - 20px); margin-right: 0;
    transform: translateX(calc(-100% - var(--gap) - 10px));
    transition: transform .3s var(--ease); z-index: 50;
}
    .sidebar.mobile-open { transform: translateX(0); }
    .main-col { width: 100%; }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(6,11,23,.65); backdrop-filter: blur(4px); z-index: 40;
    }
    .sidebar-overlay.active { display: block; }
    .user-info { display: none; }
}

/* ================================================================
   10. UTILITIES
   ================================================================ */
a { color: var(--sapphire); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 5px; }

/* ================================================================
   THEME PICKER (inside user dropdown)
   ================================================================ */
.dd-themes-section {
    padding: 10px 14px 12px;
}
.dd-themes-title {
    font-size: 10px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--t3); margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.dd-themes-title svg { width: 12px; height: 12px; stroke-width: 2; }

.theme-swatches {
    display: flex; gap: 8px; flex-wrap: wrap;
}

.theme-swatch {
    position: relative; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.theme-swatch input { display: none; }

.swatch-dot {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2px solid transparent;
    transition: transform .2s var(--spring), border-color .2s var(--ease), box-shadow .2s var(--ease);
    position: relative; overflow: hidden;
}
.swatch-dot::after {
    content: '✓';
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff;
    opacity: 0; transition: opacity .15s var(--ease);
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

.theme-swatch input:checked + .swatch-dot {
    border-color: var(--t1);
    transform: scale(1.12);
    box-shadow: 0 0 0 3px rgba(255,255,255,.12), 0 4px 12px rgba(0,0,0,.4);
}
.theme-swatch input:checked + .swatch-dot::after { opacity: 1; }
.theme-swatch:hover .swatch-dot { transform: scale(1.08); }
.theme-swatch input:checked + .swatch-dot:hover { transform: scale(1.12); }

.swatch-label {
    font-size: 9.5px; font-weight: 500; color: var(--t3);
    white-space: nowrap; transition: color .15s;
}
.theme-swatch input:checked ~ .swatch-label { color: var(--t1); }

/* Swatch colors */
.swatch-dark   { background: conic-gradient(from 160deg, #060b17, #0a1628, #1e3a5f, #060b17); }
.swatch-light  { background: conic-gradient(from 160deg, #eef3fb, #c8deff, #a0c4ff, #eef3fb); }
.swatch-forest { background: conic-gradient(from 160deg, #050f0a, #081e0d, #1a4d22, #050f0a); }
.swatch-nord   { background: conic-gradient(from 160deg, #0d1117, #1e2d40, #4c6478, #0d1117); }
.swatch-purple { background: conic-gradient(from 160deg, #0b0614, #1a0a2e, #5a2080, #0b0614); }
.swatch-sunset { background: conic-gradient(from 160deg, #0f0810, #3d1020, #c0440a, #0f0810); }
.swatch-atelie { background: conic-gradient(from 160deg, #fbefef, #f9d0e4, #8ed6d6, #fbefef); }
.swatch-doceria { background: conic-gradient(from 160deg, #fff9fb, #f4b4c4, #8a6476, #3d1a24); }