/* ============================================================
   TR069 Monitor - Premium Dark Theme CSS
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Colors */
    --bg-primary:    #0f1117;
    --bg-secondary:  #161b27;
    --bg-tertiary:   #1c2333;
    --bg-card:       #1e2536;
    --bg-hover:      #252d42;
    --bg-active:     #2a3349;

    --border:        rgba(255, 255, 255, 0.07);
    --border-active: rgba(99, 102, 241, 0.4);

    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;

    /* Brand */
    --brand:         #6366f1;
    --brand-hover:   #5558e3;
    --brand-glow:    rgba(99, 102, 241, 0.25);
    --brand-light:   rgba(99, 102, 241, 0.12);

    /* Status Colors */
    --green:         #22c55e;
    --green-bg:      rgba(34, 197, 94, 0.12);
    --green-border:  rgba(34, 197, 94, 0.25);
    --red:           #ef4444;
    --red-bg:        rgba(239, 68, 68, 0.12);
    --red-border:    rgba(239, 68, 68, 0.25);
    --yellow:        #f59e0b;
    --yellow-bg:     rgba(245, 158, 11, 0.12);
    --yellow-border: rgba(245, 158, 11, 0.25);
    --blue:          #3b82f6;
    --blue-bg:       rgba(59, 130, 246, 0.12);
    --blue-border:   rgba(59, 130, 246, 0.25);
    --purple:        #a855f7;
    --purple-bg:     rgba(168, 85, 247, 0.12);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg:    #111827;

    /* Typography */
    --font-base:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:     'JetBrains Mono', 'Courier New', monospace;

    /* Shadows */
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg:     0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow:   0 0 20px var(--brand-glow);

    /* Transitions */
    --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-base);
    background: radial-gradient(circle at top left, #1e293b, #0f1117 100%);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 16px; left: 16px; bottom: 16px;
    width: var(--sidebar-width);
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.2);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-slow);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, transparent 100%);
}

.brand-icon { flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(99,102,241,0.4)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }
.brand-sub  { font-size: 0.68rem; font-weight: 500; color: var(--brand); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 2px; }

.nav-section { margin-bottom: 8px; }
.nav-section-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 12px 18px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: pointer;
    border-left: 3px solid transparent;
    margin: 4px 12px 4px 0;
    border-radius: 0 12px 12px 0;
    transform: perspective(400px) translateZ(0);
}

.nav-item:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
    color: var(--text-primary);
    border-left-color: var(--border-active);
    transform: perspective(400px) translateZ(8px) translateX(4px);
    box-shadow: 2px 4px 12px rgba(0,0,0,0.15), inset 1px 1px 0 rgba(255,255,255,0.05);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99,102,241,0.2), transparent);
    color: var(--brand);
    border-left-color: var(--brand);
    box-shadow: 2px 4px 12px rgba(0,0,0,0.2), inset 1px 1px 0 rgba(255,255,255,0.05);
}

.nav-item.active .nav-icon { color: var(--brand); filter: drop-shadow(0 0 4px rgba(99,102,241,0.5)); }

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
    transition: var(--transition);
}

.nav-badge {
    margin-left: auto;
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

/* Sidebar User */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; color: white;
    flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-name { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 0.72rem; color: var(--text-muted); }

.logout-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: 6px;
    border-radius: 8px; transition: var(--transition);
    display: flex; align-items: center;
}
.logout-btn:hover { background: var(--red-bg); color: var(--red); }
.logout-btn svg { width: 16px; height: 16px; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: calc(var(--sidebar-width) + 32px);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition-slow);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
    height: 70px;
    background: rgba(22, 27, 39, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }

.sidebar-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); padding: 8px; border-radius: 8px;
    transition: var(--transition); display: none;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.page-breadcrumb { font-size: 0.875rem; color: var(--text-secondary); }
.page-breadcrumb span { color: var(--text-primary); font-weight: 600; }

.status-indicator {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem; color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 5px 12px; border-radius: 999px;
}

.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    animation: pulse 2s infinite;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.current-time { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ============================================================
   ALERTS
   ============================================================ */
.alerts-container { padding: 0 24px; position: relative; z-index: 40; }

.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: 10px; margin-top: 12px;
    font-size: 0.875rem; font-weight: 500;
    border: 1px solid transparent;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert span { flex: 1; }
.alert button { background: none; border: none; cursor: pointer; color: inherit; opacity: 0.6; padding: 2px; }
.alert button svg { width: 14px; height: 14px; }

.alert-success { background: var(--green-bg); border-color: var(--green-border); color: #86efac; }
.alert-error   { background: var(--red-bg); border-color: var(--red-border); color: #fca5a5; }
.alert-warning { background: var(--yellow-bg); border-color: var(--yellow-border); color: #fcd34d; }
.alert-info    { background: var(--blue-bg); border-color: var(--blue-border); color: #93c5fd; }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content { padding: 24px; flex: 1; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: rgba(30, 37, 54, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover { 
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(99,102,241,0.4); 
    transform: translateY(-2px);
}

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1rem; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 10px;
}

.card-title svg { width: 18px; height: 18px; color: var(--brand); }
.card-body { padding: 20px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(30, 37, 54, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    transform: perspective(1000px) translateZ(0);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--gradient, var(--brand));
    box-shadow: 0 2px 15px var(--brand);
}

.stat-card:hover {
    transform: perspective(1000px) rotateX(8deg) rotateY(-8deg) translateZ(30px) translateY(-10px);
    box-shadow: 20px 30px 50px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(99,102,241,0.6);
}

.stat-card.green::before { background: var(--green); }
.stat-card.red::before   { background: var(--red); }
.stat-card.blue::before  { background: var(--blue); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.purple::before { background: var(--purple); }

.stat-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.stat-icon svg { width: 20px; height: 20px; }

.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.red   { background: var(--red-bg); color: var(--red); }
.stat-icon.blue  { background: var(--blue-bg); color: var(--blue); }
.stat-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.brand { background: var(--brand-light); color: var(--brand); }

.stat-value {
    font-size: 2rem; font-weight: 800; line-height: 1;
    color: var(--text-primary); margin-bottom: 4px;
}

.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper { 
    overflow-x: auto; 
    overflow-y: auto;
    max-height: 60vh;
}

table {
    width: 100%; border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

tbody td {
    padding: 12px 16px;
    color: var(--text-secondary);
    vertical-align: middle;
}

/* ============================================================
   BADGES / STATUS CHIPS
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-online   { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge-offline  { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.badge-unknown  { background: var(--bg-tertiary); color: var(--text-muted); }
.badge-pppoe    { background: var(--purple-bg); color: var(--purple); border-color: rgba(168,85,247,0.3); }
.badge-static   { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.badge-dhcp     { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }

.badge-admin    { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: var(--red-border); }
.badge-operator { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }
.badge-selective{ background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.badge-user     { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }

.badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 8px 16px; border-radius: 8px;
    font-size: 0.875rem; font-weight: 500;
    border: 1px solid transparent; cursor: pointer;
    text-decoration: none; transition: var(--transition);
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--brand); color: white;
    border-color: var(--brand);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    background: var(--brand-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary); color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
    background: var(--red-bg); color: var(--red);
    border-color: var(--red-border);
}
.btn-danger:hover { background: var(--red); color: white; }

.btn-success {
    background: var(--green-bg); color: var(--green);
    border-color: var(--green-border);
}
.btn-success:hover { background: var(--green); color: white; }

.btn-warning {
    background: var(--yellow-bg); color: var(--yellow);
    border-color: var(--yellow-border);
}

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-sm svg { width: 14px; height: 14px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block; font-size: 0.82rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%; padding: 9px 13px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-primary);
    font-size: 0.875rem; font-family: var(--font-base);
    transition: var(--transition); outline: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
    background: var(--bg-secondary);
}

.form-control::placeholder { color: var(--text-muted); }
.form-select option { background: var(--bg-secondary); }

.form-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 0.78rem; color: var(--red); margin-top: 5px; }

.input-group { display: flex; gap: 0; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; }

/* Toggle/Checkbox */
.toggle-wrapper { display: flex; align-items: center; gap: 10px; }
.toggle {
    position: relative; width: 42px; height: 24px;
    cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 999px;
    transition: var(--transition);
}
.toggle-slider::before {
    content: ''; position: absolute;
    height: 16px; width: 16px; left: 3px; bottom: 3px;
    background: var(--text-muted); border-radius: 50%;
    transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--brand); border-color: var(--brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: white; }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-box {
    position: relative; display: flex; align-items: center;
}
.search-box svg {
    position: absolute; left: 12px;
    width: 16px; height: 16px; color: var(--text-muted);
    pointer-events: none;
}
.search-box .form-control { padding-left: 38px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 20px; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 0.875rem;
    text-decoration: none; transition: var(--transition);
}
.page-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-link.active { background: var(--brand); color: white; border-color: var(--brand); }

/* ============================================================
   SIGNAL STRENGTH BAR
   ============================================================ */
.signal-bar {
    display: flex; align-items: flex-end; gap: 3px; height: 16px;
}
.signal-bar span {
    width: 4px; border-radius: 2px; background: var(--bg-tertiary);
    transition: var(--transition);
}
.signal-bar span:nth-child(1) { height: 4px; }
.signal-bar span:nth-child(2) { height: 8px; }
.signal-bar span:nth-child(3) { height: 12px; }
.signal-bar span:nth-child(4) { height: 16px; }

.signal-excellent span { background: var(--green); }
.signal-good span:nth-child(1), .signal-good span:nth-child(2), .signal-good span:nth-child(3) { background: var(--green); }
.signal-fair span:nth-child(1), .signal-fair span:nth-child(2) { background: var(--yellow); }
.signal-poor span:nth-child(1) { background: var(--red); }

/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.chart-container { position: relative; height: 280px; }

/* ============================================================
   DEVICE DETAIL
   ============================================================ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.info-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.info-item-label {
    font-size: 0.72rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.6px; margin-bottom: 5px;
}

.info-item-value {
    font-size: 0.9rem; font-weight: 600;
    color: var(--text-primary); font-family: var(--font-mono);
    word-break: break-all;
}

/* SSID Card */
.ssid-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    transition: var(--transition);
}

.ssid-card:hover {
    border-color: var(--border-active);
    background: var(--bg-hover);
}

.ssid-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}

.ssid-band {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 600;
    padding: 3px 10px; border-radius: 999px;
}

.ssid-band.band-24 { background: var(--green-bg); color: var(--green); }
.ssid-band.band-5  { background: var(--blue-bg); color: var(--blue); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary);
    position: relative; overflow: hidden;
}

.login-bg-orb {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.15; pointer-events: none;
}

.login-bg-orb:nth-child(1) {
    width: 500px; height: 500px;
    background: var(--brand); top: -150px; left: -150px;
}

.login-bg-orb:nth-child(2) {
    width: 400px; height: 400px;
    background: var(--purple); bottom: -100px; right: -100px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%; max-width: 420px;
    position: relative; z-index: 1;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 12px; margin-bottom: 36px;
}

.login-logo-icon {
    width: 64px; height: 64px; border-radius: 18px;
    background: linear-gradient(135deg, var(--brand), var(--purple));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

.login-logo-icon svg { width: 32px; height: 32px; color: white; }

.login-title {
    font-size: 1.6rem; font-weight: 800;
    color: var(--text-primary); text-align: center;
}

.login-subtitle {
    font-size: 0.875rem; color: var(--text-muted); text-align: center;
    margin-top: -8px; margin-bottom: 32px;
}

.login-form .form-label { color: var(--text-secondary); }
.login-form .form-control {
    background: var(--bg-secondary);
    border-color: var(--border);
    padding: 11px 14px; font-size: 0.9rem;
}

.login-btn {
    width: 100%; padding: 12px;
    font-size: 0.95rem; font-weight: 600;
    margin-top: 8px;
}

.login-footer {
    text-align: center; margin-top: 28px;
    font-size: 0.78rem; color: var(--text-muted);
}

/* ============================================================
   PAGE HEADERS
   ============================================================ */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; gap: 16px;
    flex-wrap: wrap;
}

.page-header-left h1 {
    font-size: 1.5rem; font-weight: 800; color: var(--text-primary);
    display: flex; align-items: center; gap: 10px;
}

.page-header-left h1 svg { width: 24px; height: 24px; color: var(--brand); }
.page-header-left p { font-size: 0.875rem; color: var(--text-muted); margin-top: 2px; }

.filter-bar {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   MONOSPACE CODE DISPLAY
   ============================================================ */
.mono { font-family: var(--font-mono); font-size: 0.82rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open { transform: translateX(0); }

    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .page-content { padding: 16px; }

    .login-card { padding: 32px 24px; margin: 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-green     { color: var(--green) !important; }
.text-red       { color: var(--red) !important; }
.text-yellow    { color: var(--yellow) !important; }
.text-blue      { color: var(--blue) !important; }
.text-brand     { color: var(--brand) !important; }
.text-mono      { font-family: var(--font-mono) !important; }

.d-flex         { display: flex; }
.align-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-8          { gap: 8px; }
.gap-12         { gap: 12px; }
.gap-16         { gap: 16px; }
.gap-20         { gap: 20px; }
.mt-8           { margin-top: 8px; }
.mt-16          { margin-top: 16px; }
.mt-20          { margin-top: 20px; }
.mt-24          { margin-top: 24px; }
.mb-0           { margin-bottom: 0; }
.fw-600         { font-weight: 600; }
.fw-700         { font-weight: 700; }
.fs-sm          { font-size: 0.8rem; }

.divider {
    height: 1px; background: var(--border); margin: 20px 0; border: none;
}

.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}

.empty-state svg { width: 48px; height: 48px; opacity: 0.3; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p  { font-size: 0.875rem; }

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }
