/* ═══════════════════════════════════════════════════════════════
   CYBER/TECH DASHBOARD · Clean White & Tech Blue
   Futuristic | Precise | Top-Navigation | Data-Driven
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.loli.net/css2?family=Exo+2:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    /* ── Tech Blue & Pure White Palette ── */
    --bg-page:        #FFFFFF;
    --bg-panel:       #FFFFFF;
    --bg-card:        rgba(255, 255, 255, 0.6);
    --bg-card-hover:  #FFFFFF;
    
    --text-primary:   #0B1121; /* Very dark slate blue/black */
    --text-secondary: #475569;
    --text-muted:     #94A3B8;
    --text-inverse:   #FFFFFF;

    /* Core Tech Blue */
    --accent:         #0055FF; 
    --accent-light:   #3377FF;
    --accent-cyan:    #00D1FF; /* For gradients */
    --accent-glow:    rgba(0, 85, 255, 0.15);
    
    --border-color:   rgba(0, 85, 255, 0.15);
    --border-soft:    rgba(0, 85, 255, 0.08);

    /* ── Type ── */
    --font-display: 'Exo 2', sans-serif;
    --font-body:    'Exo 2', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    /* ── Spatial & Tech ── */
    --ease:         cubic-bezier(0.16, 1, 0.3, 1);
    --duration:     300ms;
    --radius-sm:    4px;
    --radius-md:    8px;
    --radius-lg:    12px;
}

/* ── Reset & Core ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Tech Grid Background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    z-index: -1;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at top, black 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at top, black 0%, transparent 80%);
}

a { color: var(--accent); text-decoration: none; transition: all var(--duration) var(--ease); }
a:hover { color: var(--accent-cyan); text-shadow: 0 0 8px var(--accent-glow); }

/* ── Layout Shift: Top Navigation Bar ── */
body.material-layout {
    display: block; /* Removed flex row */
    min-height: 100vh;
}

/* Force the drawer into a sleek top header */
.material-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 24px rgba(0, 85, 255, 0.04);
    z-index: 1000;
    transform: none !important;
}

.material-drawer-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 40px;
}

.material-user-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0;
    border: none;
}

.material-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
    margin: 0;
    position: relative;
}

.material-avatar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #00E676; /* Tech Green online indicator */
    border: 2px solid #FFF;
    border-radius: 50%;
}

.material-user-info { display: flex; flex-direction: column; }

.material-user-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
}

.material-user-email {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Nav Menu (Horizontal) */
.material-nav { flex: 1; display: flex; justify-content: flex-end; }
.material-nav-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: row; gap: 8px; align-items: center;}

.material-nav-item a {
    display: block;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all var(--duration) var(--ease);
}

.material-nav-item a:hover {
    color: var(--accent);
    background: var(--accent-glow);
    border-color: var(--border-color);
}

.material-nav-item.is-active a {
    color: var(--accent);
    background: linear-gradient(90deg, rgba(0, 85, 255, 0.1), rgba(0, 209, 255, 0.05));
    border-color: var(--border-color);
    box-shadow: inset 2px 0 0 var(--accent); /* Tech accent line */
}

.material-nav-item-logout { margin: 0; padding: 0; border: none; margin-left: 16px; }
.material-nav-item-logout a { 
    color: #FF3366; 
    border: 1px solid rgba(255, 51, 102, 0.2); 
}
.material-nav-item-logout a:hover {
    background: rgba(255, 51, 102, 0.1);
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.2);
}

/* Hide old mobile appbar elements since we made the main drawer a topbar */
.material-appbar, .brutal-menu-toggle { display: none !important; }

/* ── Content Shell ── */
.portal-shell {
    margin-left: 0;
    margin-top: 70px; /* Offset for fixed topbar */
    padding: 60px 40px;
    max-width: 1400px;
    margin-inline: auto;
    min-height: calc(100vh - 70px);
}

/* ── Typography & Hero ── */
.portal-hero {
    margin-bottom: 60px;
    position: relative;
    padding-left: 20px;
}

.portal-hero::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), var(--accent-cyan));
    border-radius: 4px;
}

.portal-hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 12px;
}

.portal-hero-title {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 300;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.portal-hero-title em {
    font-style: normal;
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-hero-sub {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
}

/* ── Data Grid (Dashboard Vibe) ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 85, 255, 0.03);
    transition: all var(--duration) var(--ease);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.5;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 85, 255, 0.08);
    border-color: var(--accent-light);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-meta {
    margin-top: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Content Panels & Boxes ── */
.portal-panel, .brutal-main, .box, .brutal-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 85, 255, 0.02);
}

.brutal-card-header, .page-header h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
    position: relative;
}

/* Tech Accent on Headers */
.brutal-card-header::after, .page-header h1::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
}

/* ── Forms & Inputs ── */
.brutal-input, .brutal-select, .brutal-textarea, .form-control {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    transition: all var(--duration) var(--ease);
}

.brutal-input:focus, .brutal-select:focus, .brutal-textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #FFFFFF;
}

.brutal-label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

/* ── Buttons ── */
.brutal-btn, .btn {
    background: linear-gradient(135deg, var(--accent), #0044CC);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 28px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    box-shadow: 0 4px 12px rgba(0, 85, 255, 0.2);
}

.brutal-btn:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 85, 255, 0.3);
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
}

.brutal-btn-secondary, .btn-default {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.brutal-btn-secondary:hover, .btn-default:hover {
    background: var(--accent-glow);
    color: var(--accent);
    box-shadow: none;
}

/* Tables */
.brutal-table th {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    background: rgba(0, 85, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    text-align: left;
}

.brutal-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
    color: var(--text-primary);
}

.brutal-table tr:hover td {
    background: rgba(0, 85, 255, 0.01);
}

/* ── Quick Actions (Tech Grid Offset) ── */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.quick-tile {
    padding: 32px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--duration) var(--ease);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.quick-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top right, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}

.quick-tile:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 12px 32px rgba(0, 85, 255, 0.06);
}

.quick-tile:hover::before { opacity: 1; }

.quick-tile-cn {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
    position: relative;
}

.quick-tile-en {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    position: relative;
}

/* ── Footer ── */
#footer {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid var(--border-soft);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.05em;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .material-drawer {
        height: auto;
        padding: 16px 20px;
    }
    
    .material-drawer-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 16px;
    }
    
    .material-nav-list {
        flex-wrap: wrap;
    }
    
    .portal-shell {
        margin-top: 140px; /* Adjust for taller header */
        padding: 40px 20px;
    }
    
    .stat-grid { grid-template-columns: 1fr; }
}