* { margin: 0; padding: 0; box-sizing: border-box; }
*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════
   2. BACKGROUND ATMOSPHERE
   ═══════════════════════════════════════════════════ */
.bg-canvas {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 800px 600px at 10% 15%, var(--canvas-grad-1), transparent),
        radial-gradient(ellipse 500px 400px at 85% 10%, var(--canvas-grad-2), transparent),
        radial-gradient(ellipse 400px 350px at 55% 85%, var(--canvas-grad-3), transparent),
        radial-gradient(ellipse 350px 300px at 20% 80%, var(--canvas-grad-4), transparent);
}

.orb {
    position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
    filter: blur(90px); opacity: 0;
    animation: orbFloat 22s ease-in-out infinite, orbFade 3s ease-out forwards;
}
.orb-1 { width: 300px; height: 300px; background: var(--orb-1); left: 5%; top: 8%; }
.orb-2 { width: 240px; height: 240px; background: var(--orb-2); right: 6%; top: 3%; animation-delay: -8s; }
.orb-3 { width: 180px; height: 180px; background: var(--orb-3); left: 45%; bottom: 8%; animation-delay: -14s; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(25px, -15px) scale(1.04); }
    66% { transform: translate(-18px, 20px) scale(0.96); }
}
@keyframes orbFade { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════
   3. LAYOUT — SIDEBAR + MAIN
   ═══════════════════════════════════════════════════ */
.app-layout {
    position: relative; z-index: 1;
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(30px) saturate(1.3);
    -webkit-backdrop-filter: blur(30px) saturate(1.3);
    position: relative;
    z-index: 10;
}

.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-icon {
    width: 36px; height: 36px;
    opacity: 0.65;
    filter: drop-shadow(0 0 8px rgba(0, 184, 255, 0.15));
    margin-bottom: 10px;
}

.sidebar-brand-govt {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
}

.sidebar-brand-system {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 16px var(--accent-glow);
    margin-top: 2px;
    line-height: 1.2;
}

.sidebar-brand-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 8px;
    letter-spacing: -0.2px;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    position: relative;
}
.nav-link:hover {
    background: var(--nav-hover-bg);
    color: var(--text-primary);
}
.nav-link.active {
    background: var(--accent-dim);
    color: var(--accent);
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}
.nav-link svg { width: 18px; height: 18px; opacity: 0.7; flex-shrink: 0; }
.nav-link.active svg { opacity: 1; }

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--avatar-gradient);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: var(--accent);
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-logout:hover { color: var(--danger); background: var(--danger-dim); }
.sidebar-logout svg { width: 16px; height: 16px; }

/* ── Main area ── */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

.topbar {
    height: var(--topbar-h);
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 28px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--topbar-bg);
    backdrop-filter: blur(20px);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.breadcrumb-sep { font-size: 11px; }
.breadcrumb-current { color: var(--text-secondary); font-weight: 500; }

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

.content-inner {
    max-width: 100%;
    margin: 0 auto;
    animation: viewIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes viewIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

