:root {
        --bg: #080d14;
        --cyan: #00f5d4;
        --amber: #f5a623;
        --surface: rgba(12, 20, 32, 0.85);
        --border: rgba(0, 245, 212, 0.15);
        --text: #e8eef4;
        --muted: #6b7a90;
        --font-mono: 'Space Mono', monospace;
        --font-sans: 'DM Sans', sans-serif;
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    html { height: 100%; overflow: hidden; }
    body {
        font-family: var(--font-sans);
        background-color: var(--bg);
        color: var(--text);
        height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
        pointer-events: none;
        z-index: 0;
        opacity: 0.6;
    }

    body::after {
        content: '';
        position: fixed;
        inset: 0;
        background-image:
            linear-gradient(rgba(0, 245, 212, 0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 245, 212, 0.03) 1px, transparent 1px);
        background-size: 48px 48px;
        pointer-events: none;
        z-index: 0;
    }

    /* NAVBAR */
    .navbar {
        position: sticky; top: 0; z-index: 100;
        height: 60px;
        background: rgba(8, 13, 20, 0.92);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        display: flex; align-items: center; justify-content: space-between;
        padding: 0 2rem;
        box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    }
    .navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
    .navbar-brand img { width: 30px; height: 30px; border-radius: 6px; box-shadow: 0 0 16px rgba(0, 245, 212, 0.5); }
    .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
    .brand-name { font-size: 1.15rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
    .brand-name span { color: var(--muted); }
    .brand-sub { font-size: 0.5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.7; }
    .nav-links { display: flex; gap: 4px; margin-left: 2rem; }
    .nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--muted); text-decoration: none; padding: 0.4rem 0.85rem; border-radius: 6px; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
    .nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
    .nav-links a.active { color: var(--cyan); background: rgba(0, 245, 212, 0.08); }
    .navbar-right { display: flex; align-items: center; gap: 12px; }
    .user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--amber)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; cursor: pointer; box-shadow: 0 0 16px rgba(0, 245, 212, 0.3); }

    /* MAIN */
    .page-scroll {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(0,245,212,0.2) transparent;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .page-scroll::-webkit-scrollbar { width: 6px; }
    .page-scroll::-webkit-scrollbar-track { background: transparent; }
    .page-scroll::-webkit-scrollbar-thumb { background: rgba(0,245,212,0.2); border-radius: 3px; }

    .main { position: relative; z-index: 1; padding: 1.5rem 2rem 2rem; max-width: 1600px; margin: 0 auto; }

    /* WELCOME */
    .welcome-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); opacity: 0; transform: translateY(20px); animation: slideUp 0.5s ease forwards; }
    .welcome-left h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
    .welcome-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
    .badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.75rem; padding: 4px 10px; border-radius: 4px; font-weight: 700; letter-spacing: 0.05em; }
    .badge-active { background: rgba(0, 245, 212, 0.1); color: var(--cyan); border: 1px solid rgba(0, 245, 212, 0.3); }
    .badge-active::before { content: ''; width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; animation: pulse 2s ease-in-out infinite; box-shadow: 0 0 8px var(--cyan); }
    .badge-blocked { background: rgba(255, 115, 115, 0.1); color: #ff7373; border: 1px solid rgba(255, 115, 115, 0.3); }
    .badge-blocked::before { content: ''; width: 7px; height: 7px; background: #ff7373; border-radius: 50%; box-shadow: 0 0 8px #ff7373; }
    .badge-info { background: rgba(107, 122, 144, 0.15); color: var(--muted); border: 1px solid rgba(107, 122, 144, 0.2); }

    /* KPI PILLS */
    .kpi-pills { display: flex; gap: 1rem; flex-wrap: wrap; }
    .kpi-pill { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 1.1rem; backdrop-filter: blur(12px); transition: all 0.2s; }
    .kpi-pill:hover { border-color: rgba(0, 245, 212, 0.3); box-shadow: 0 0 16px rgba(0, 245, 212, 0.08); }
    .pill-ring { position: relative; width: 42px; height: 42px; flex-shrink: 0; }
    .pill-ring canvas { position: absolute; inset: 0; }
    .pill-icon { font-size: 1.4rem; }
    .pill-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
    .pill-value { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; color: var(--text); }

    /* CARDS */
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; backdrop-filter: blur(20px); overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; opacity: 0; transform: translateY(24px); }
    .card:hover { transform: translateY(-3px); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3); }
    .card-top-border { height: 3px; width: 100%; }
    .card-body { padding: 1.5rem; }
    .card-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }

    /* ROW 1: KPI */
    .kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
    .kpi-card:nth-child(1) .card-top-border { background: linear-gradient(90deg, var(--cyan), transparent); }
    .kpi-card:nth-child(2) .card-top-border { background: linear-gradient(90deg, var(--amber), transparent); }
    .kpi-card:nth-child(3) .card-top-border { background: linear-gradient(90deg, #a855f7, transparent); }
    .kpi-card:nth-child(4) .card-top-border { background: linear-gradient(90deg, #22c55e, transparent); }
    .kpi-big-value { font-family: var(--font-mono); font-size: 2.4rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-bottom: 0.5rem; }
    .kpi-big-value.cyan { color: var(--cyan); text-shadow: 0 0 20px rgba(0, 245, 212, 0.2); }
    .kpi-big-value.amber { color: var(--amber); text-shadow: 0 0 20px rgba(245, 166, 35, 0.2); }
    .kpi-big-value.purple { color: #a855f7; text-shadow: 0 0 20px rgba(168, 85, 247, 0.2); }
    .kpi-big-value.green { color: #22c55e; text-shadow: 0 0 20px rgba(34, 197, 94, 0.2); }
    .kpi-sub { font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); }

    /* Donut */
    .donut-wrap { display: flex; align-items: center; gap: 1.5rem; }
    .donut-wrap canvas { flex-shrink: 0; }
    .donut-legend { display: flex; flex-direction: column; gap: 0.4rem; }
    .legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
    .legend-dot { width: 8px; height: 8px; border-radius: 50%; }

    /* Gauge + Memory bars */
    .gauge-bar-wrap, .mem-track { margin-top: 0.75rem; }
    .gauge-track, .mem-track { width: 100%; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
    .gauge-track { margin-top: 0.75rem; }
    .mem-track { margin-top: 0.75rem; }
    .gauge-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan), #a855f7); box-shadow: 0 0 12px rgba(0, 245, 212, 0.4); transition: width 1.2s ease-out; width: 0; }
    .mem-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #22c55e, var(--amber)); box-shadow: 0 0 12px rgba(34, 197, 94, 0.4); transition: width 1s ease-out; width: 0; }

    /* Sparkline */
    .sparkline-wrap { position: relative; height: 60px; margin-top: 0.5rem; }
    .sparkline-wrap canvas { width: 100%; height: 60px; }

    /* ROW 2: CHARTS */
    .charts-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
    .area-chart-wrap, .stacked-chart-wrap { position: relative; height: 200px; }
    .area-chart-wrap canvas, .stacked-chart-wrap canvas { width: 100%; height: 200px; }

    /* ROW 3: LAYERS + ACTIVITY */
    .bottom-row { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.25rem; margin-bottom: 2rem; }
    .layers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
    .layer-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; backdrop-filter: blur(12px); text-align: center; transition: all 0.25s; opacity: 0; transform: scale(0.95); }
    .layer-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
    .layer-icon { font-size: 2rem; margin-bottom: 0.5rem; }
    .layer-name { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
    .layer-count { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; }
    .layer-card.bronze { border-top: 3px solid #cd7f32; }
    .layer-card.bronze .layer-count { color: #cd7f32; }
    .layer-card.silver { border-top: 3px solid #c0c0c0; }
    .layer-card.silver .layer-count { color: #c0c0c0; }
    .layer-card.gold { border-top: 3px solid #ffd866; }
    .layer-card.gold .layer-count { color: #ffd866; }
    .layer-card.warehouse { border-top: 3px solid #9b59b6; }
    .layer-card.warehouse .layer-count { color: #9b59b6; }

    /* Activity */
    .activity-feed { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; padding-right: 4px; }
    .activity-feed::-webkit-scrollbar { width: 4px; }
    .activity-feed::-webkit-scrollbar-track { background: transparent; }
    .activity-feed::-webkit-scrollbar-thumb { background: rgba(0,245,212,0.2); border-radius: 2px; }
    .activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 0.6rem 0.8rem; border-radius: 8px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); transition: all 0.2s; font-size: 0.83rem; }
    .activity-item:hover { background: rgba(0,245,212,0.04); border-color: rgba(0,245,212,0.1); }
    .act-icon { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }
    .act-text { color: var(--text); line-height: 1.4; }
    .act-time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-left: auto; flex-shrink: 0; }

    /* QUICK ACCESS */
    .quick-access-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
    .quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
    .quick-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem 1.5rem; text-align: center; backdrop-filter: blur(16px); text-decoration: none; transition: all 0.3s; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; opacity: 0; transform: translateY(20px); cursor: pointer; position: relative; overflow: hidden; }
    .quick-card::before { content: ''; position: absolute; inset: 0; border-radius: 12px; opacity: 0; transition: opacity 0.3s; background: radial-gradient(ellipse at top, rgba(0,245,212,0.08), transparent 70%); }
    .quick-card:hover::before { opacity: 1; }
    .quick-card:hover { transform: translateY(-6px); border-color: rgba(0,245,212,0.4); box-shadow: 0 16px 40px rgba(0,245,212,0.1), 0 0 0 1px rgba(0,245,212,0.15); }
    .qc-icon { font-size: 2.8rem; }
    .qc-title { font-size: 1rem; font-weight: 600; color: var(--text); }
    .qc-sub { font-size: 0.8rem; color: var(--muted); }

    /* FOOTER */
    .footer { position: sticky; bottom: 0; z-index: 1; border-top: 1px solid var(--border); padding: 1.5rem 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: rgba(8,13,20,0.8); backdrop-filter: blur(12px); }
    .footer-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
    .footer-brand img { width: 22px; height: 22px; border-radius: 4px; box-shadow: 0 0 10px rgba(0,245,212,0.3); }
    .footer-tagline { font-size: 0.78rem; color: var(--muted); font-style: italic; }
    .footer-links { display: flex; gap: 1.5rem; }
    .footer-links a { font-size: 0.78rem; color: var(--muted); text-decoration: none; transition: color 0.2s; }
    .footer-links a:hover { color: var(--cyan); }
    .footer-copy { font-size: 0.75rem; color: rgba(107,122,144,0.6); font-family: var(--font-mono); }

    .main::-webkit-scrollbar { width: 6px; }
    .main::-webkit-scrollbar-track { background: transparent; }
    .main::-webkit-scrollbar-thumb { background: rgba(0,245,212,0.2); border-radius: 3px; }

    /* ANIMATIONS */
    @keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
    @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.85); } }

    /* Staggered */
    .card:nth-child(1) { animation: slideUp 0.5s 0.1s ease forwards; }
    .card:nth-child(2) { animation: slideUp 0.5s 0.2s ease forwards; }
    .card:nth-child(3) { animation: slideUp 0.5s 0.3s ease forwards; }
    .card:nth-child(4) { animation: slideUp 0.5s 0.4s ease forwards; }
    .charts-row .card:nth-child(1) { animation: slideUp 0.5s 0.5s ease forwards; }
    .charts-row .card:nth-child(2) { animation: slideUp 0.5s 0.6s ease forwards; }
    .bottom-row .card:nth-child(1) { animation: slideUp 0.5s 0.7s ease forwards; }
    .bottom-row .card:nth-child(2) { animation: slideUp 0.5s 0.8s ease forwards; }
    .quick-card:nth-child(1) { animation: slideUp 0.5s 0.9s ease forwards; }
    .quick-card:nth-child(2) { animation: slideUp 0.5s 1.0s ease forwards; }
    .quick-card:nth-child(3) { animation: slideUp 0.5s 1.1s ease forwards; }
    .layer-card:nth-child(1) { animation: slideUp 0.4s 0.15s ease forwards; }
    .layer-card:nth-child(2) { animation: slideUp 0.4s 0.25s ease forwards; }
    .layer-card:nth-child(3) { animation: slideUp 0.4s 0.35s ease forwards; }
    .layer-card:nth-child(4) { animation: slideUp 0.4s 0.45s ease forwards; }

    /* Responsive */
    @media (max-width: 1200px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } .charts-row { grid-template-columns: 1fr; } .bottom-row { grid-template-columns: 1fr; } .layers-grid { grid-template-columns: repeat(2, 1fr); } .quick-grid { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 768px) { .nav-links { display: none; } .kpi-row { grid-template-columns: 1fr; } .layers-grid { grid-template-columns: repeat(2, 1fr); } .quick-grid { grid-template-columns: 1fr; } .welcome-header { flex-direction: column; gap: 1rem; align-items: flex-start; } .kpi-pills { flex-wrap: wrap; } }

    /* Avatar dropdown (standard) */
    .nav-avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,var(--cyan),var(--amber)); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.9rem; cursor:pointer; box-shadow:0 0 16px rgba(0,245,212,0.3); }
    .nav-avatar:hover { filter: brightness(1.1); }
    .avatar-dropdown { position:absolute; top:50px; right:20px; background:var(--surface-high); border:1px solid var(--border-ghost); border-radius:10px; padding:6px; width:200px; box-shadow:0 8px 24px rgba(0,0,0,0.5); z-index:1000; opacity:0; visibility:hidden; transform:translateY(-8px); transition:all 0.2s; }
    .avatar-dropdown.show { opacity:1; visibility:visible; transform:translateY(0); }
    .avatar-dropdown::before { content:''; position:absolute; top:-6px; right:12px; width:12px; height:12px; background:var(--surface-high); border-left:1px solid var(--border-ghost); border-top:1px solid var(--border-ghost); transform:rotate(45deg); }
    .dd-item { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:6px; cursor:pointer; color:var(--text-primary); font-size:0.85rem; transition:background 0.15s; }
    .dd-item:hover { background:rgba(255,255,255,0.06); }
    .dd-item.danger { color:var(--error); }
    .dd-item.danger:hover { background:rgba(255,115,115,0.1); }
    .dd-divider { height:1px; background:var(--border-ghost); margin:4px 8px; }