/* ================================================================
   SYRPTS NETWORK — CORE DESIGN SYSTEM v2.0
   Shared foundation for all terminals and pages.
   Import this BEFORE any terminal-specific CSS.
   ================================================================ */

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

/* ════════════════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES — Premium Dark Theme
   ════════════════════════════════════════════════════════════════════ */
:root {
    /* ── Backgrounds ─────────────────────────────────────────────── */
    --bg-primary:     #06070b;
    --bg-secondary:   #0c0d14;
    --bg-tertiary:    #11121b;
    --bg-elevated:    #161724;
    --bg-overlay:     rgba(6, 7, 11, 0.92);

    /* ── Surfaces / Panels ───────────────────────────────────────── */
    --panel-bg:       #0d0e17;
    --panel-bg-hover: #12131f;
    --panel-border:   rgba(255, 255, 255, 0.06);
    --panel-border-hover: rgba(255, 255, 255, 0.1);

    /* ── Glass effect ────────────────────────────────────────────── */
    --glass-bg:       rgba(13, 14, 23, 0.8);
    --glass-border:   rgba(255, 255, 255, 0.06);
    --glass-blur:     12px;

    /* ── Accent colors (overridden per terminal) ─────────────────── */
    --accent:         #3b82f6;
    --accent-rgb:     59, 130, 246;
    --accent-hover:   #2563eb;
    --accent-dim:     rgba(59, 130, 246, 0.08);
    --accent-glow:    rgba(59, 130, 246, 0.25);
    --accent-gradient: linear-gradient(135deg, #3b82f6, #06b6d4);

    /* ── Semantic colors ─────────────────────────────────────────── */
    --success:        #10b981;
    --success-dim:    rgba(16, 185, 129, 0.08);
    --danger:         #ef4444;
    --danger-dim:     rgba(239, 68, 68, 0.08);
    --warning:        #f59e0b;
    --warning-dim:    rgba(245, 158, 11, 0.08);
    --info:           #06b6d4;
    --info-dim:       rgba(6, 182, 212, 0.08);

    /* ── Brand colors (always available) ─────────────────────────── */
    --cyan:           #06b6d4;
    --purple:         #a855f7;
    --orange:         #f97316;
    --gold:           #eab308;
    --pink:           #ec4899;

    /* ── Text ────────────────────────────────────────────────────── */
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #475569;
    --text-disabled:  #334155;

    /* ── Typography ──────────────────────────────────────────────── */
    --font-sans:      'Inter', 'Rajdhani', system-ui, -apple-system, sans-serif;
    --font-display:   'Rajdhani', 'Inter', sans-serif;
    --font-mono:      'Share Tech Mono', 'Fira Code', monospace;

    /* ── Sizing / Spacing ────────────────────────────────────────── */
    --radius-sm:      4px;
    --radius-md:      8px;
    --radius-lg:      12px;
    --radius-xl:      16px;
    --radius-full:    9999px;

    --header-h:       56px;
    --mobile-nav-h:   60px;
    --sidebar-w:      240px;

    /* ── Shadows ─────────────────────────────────────────────────── */
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.5);
    --shadow-xl:      0 16px 48px rgba(0,0,0,0.6);
    --shadow-glow:    0 0 20px rgba(var(--accent-rgb), 0.15);

    /* ── Z-index scale ───────────────────────────────────────────── */
    --z-base:         1;
    --z-sticky:       100;
    --z-dropdown:     500;
    --z-sidebar:      900;
    --z-modal:        1000;
    --z-toast:        2000;
    --z-tooltip:      3000;

    /* ── Transitions ─────────────────────────────────────────────── */
    --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out:    cubic-bezier(0.45, 0, 0.55, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast:  150ms;
    --duration-base:  250ms;
    --duration-slow:  400ms;
}

/* ── Light theme overrides ───────────────────────────────────────── */
[data-theme="light"] {
    --bg-primary:     #f8fafc;
    --bg-secondary:   #f1f5f9;
    --bg-tertiary:    #e2e8f0;
    --bg-elevated:    #ffffff;
    --bg-overlay:     rgba(248, 250, 252, 0.92);
    --panel-bg:       #ffffff;
    --panel-bg-hover: #f8fafc;
    --panel-border:   rgba(0, 0, 0, 0.08);
    --panel-border-hover: rgba(0, 0, 0, 0.12);
    --glass-bg:       rgba(255, 255, 255, 0.85);
    --glass-border:   rgba(0, 0, 0, 0.06);
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --text-disabled:  #cbd5e1;
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.1);
}

/* ════════════════════════════════════════════════════════════════════
   2. RESET & BASE
   ════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

a { color: var(--accent); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ── Scrollbars (Webkit) ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ════════════════════════════════════════════════════════════════════
   3. TYPOGRAPHY
   ════════════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1.1rem; }

.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); }
.text-accent   { color: var(--accent); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }

/* ════════════════════════════════════════════════════════════════════
   4. LAYOUT UTILITIES
   ════════════════════════════════════════════════════════════════════ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}
.container-narrow { max-width: 860px; }
.container-wide   { max-width: 1440px; }

.flex       { display: flex; }
.flex-col   { display: flex; flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-xs  { gap: 4px; }
.gap-sm  { gap: 8px; }
.gap-md  { gap: 12px; }
.gap-lg  { gap: 20px; }
.gap-xl  { gap: 32px; }

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

.hidden     { display: none !important; }
.sr-only    { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── Responsive visibility ───────────────────────────────────────── */
@media (max-width: 767px) {
    .desktop-only { display: none !important; }
}
@media (min-width: 768px) {
    .mobile-only { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════
   5. BUTTONS
   ════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    white-space: nowrap;
    min-height: 44px; /* Touch-friendly */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--panel-border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--panel-bg-hover);
    border-color: var(--panel-border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.btn-accent-dim {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.2);
}
.btn-accent-dim:hover:not(:disabled) {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.3);
}

.btn-success {
    background: var(--success-dim);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}
.btn-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; min-height: 32px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 40px; height: 40px; border-radius: var(--radius-md); }

/* ════════════════════════════════════════════════════════════════════
   6. FORM INPUTS
   ════════════════════════════════════════════════════════════════════ */
.input, .select, .textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-base), box-shadow var(--duration-base);
    min-height: 44px;
    outline: none;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}
.input::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 100px; font-family: var(--font-sans); }
.select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.input-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* ════════════════════════════════════════════════════════════════════
   7. GLASS PANELS
   ════════════════════════════════════════════════════════════════════ */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 16px;
    transition: border-color var(--duration-base);
}
.glass-panel:hover { border-color: var(--panel-border-hover); }

.panel-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-title i { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════
   8. DATA TABLES
   ════════════════════════════════════════════════════════════════════ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
.data-table th {
    padding: 8px 10px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--panel-border);
    position: sticky;
    top: 0;
    background: var(--panel-bg);
    z-index: 2;
}
.data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    white-space: nowrap;
}
.data-table tbody tr { transition: background var(--duration-fast); }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.scrollable-box {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 300px;
}

/* ════════════════════════════════════════════════════════════════════
   9. BADGES & TAGS
   ════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.badge-accent  { background: var(--accent-dim);  color: var(--accent); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-muted   { background: rgba(255,255,255,0.04); color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════
   10. TABS
   ════════════════════════════════════════════════════════════════════ */
.tab-bar {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--panel-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 10px 16px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration-base);
    min-height: 44px;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ════════════════════════════════════════════════════════════════════
   11. MODALS
   ════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn var(--duration-base) var(--ease-out);
}
.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--duration-slow) var(--ease-spring);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}
.modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

/* ════════════════════════════════════════════════════════════════════
   12. TOAST NOTIFICATIONS
   ════════════════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    z-index: var(--z-toast);
    opacity: 0;
    pointer-events: none;
    transition: all var(--duration-slow) var(--ease-spring);
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.toast.ok {
    background: var(--success-dim);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}
.toast.err {
    background: var(--danger-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}
.toast.warn {
    background: var(--warning-dim);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* ════════════════════════════════════════════════════════════════════
   13. ANIMATIONS
   ════════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.animate-fade-in    { animation: fadeIn var(--duration-base) var(--ease-out); }
.animate-slide-up   { animation: slideUp var(--duration-slow) var(--ease-spring); }
.animate-slide-down { animation: slideDown var(--duration-base) var(--ease-out); }
.animate-scale-in   { animation: scaleIn var(--duration-base) var(--ease-out); }
.animate-pulse      { animation: pulse 2s var(--ease-in-out) infinite; }

.spin { animation: spin 1s linear infinite; }

/* ── Skeleton loading ────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; width: 80%; margin-bottom: 8px; }
.skeleton-card { height: 120px; width: 100%; }

/* ════════════════════════════════════════════════════════════════════
   14. HEADER
   ════════════════════════════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--bg-overlay);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--panel-border);
    height: var(--header-h);
}

.site-header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.logo i {
    font-size: 1.3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}
@media (max-width: 480px) {
    .logo-text { display: none; }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--duration-fast);
    position: relative;
    flex-shrink: 0;
}
.header-btn:hover {
    color: var(--text-primary);
    border-color: var(--panel-border-hover);
    background: rgba(255,255,255,0.02);
}

/* Notification badge on bell */
.notif-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    line-height: 1;
}

/* ════════════════════════════════════════════════════════════════════
   15. SIDEBAR
   ════════════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base);
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--panel-border);
    z-index: var(--z-sidebar);
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-out);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--panel-border);
    flex-shrink: 0;
}
.sidebar-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.sidebar-links {
    padding: 12px 0;
    flex: 1;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--duration-fast);
}
.sidebar-links a:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
}
.sidebar-links a.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-right: 2px solid var(--accent);
}
.sidebar-links a i { width: 18px; text-align: center; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════
   16. MOBILE BOTTOM NAVIGATION
   ════════════════════════════════════════════════════════════════════ */
.mobile-tab-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-h);
    background: var(--bg-overlay);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--panel-border);
    z-index: var(--z-sticky);
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 900px) {
    .mobile-tab-nav { display: flex; }
}

.mobile-tab-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    cursor: pointer;
    padding: 6px 2px;
    transition: color var(--duration-fast);
    position: relative;
    min-height: 44px;
}
.mobile-tab-nav button i { font-size: 1.1rem; }
.mobile-tab-nav button span { letter-spacing: 0.5px; }

.mobile-tab-nav button.active { color: var(--accent); }
.mobile-tab-nav button.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 var(--radius-full) var(--radius-full);
}

/* ════════════════════════════════════════════════════════════════════
   17. MEGA FOOTER
   ════════════════════════════════════════════════════════════════════ */
.mega-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--panel-border);
    padding: 60px 0 0;
    margin-top: 80px;
}

.mega-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 48px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-brand .logo i {
    font-size: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.footer-brand .logo span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.footer-brand .tagline {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 280px;
}

.footer-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 6px 12px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-full);
    width: fit-content;
}
.footer-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.footer-col a {
    display: block;
    padding: 6px 0;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: color var(--duration-fast), transform var(--duration-fast);
}
.footer-col a:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid var(--panel-border);
    margin-top: 48px;
    padding: 20px clamp(16px, 4vw, 40px);
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-copyright {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.footer-powered {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}
.footer-powered span { color: var(--accent); }

/* ── Footer responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .mega-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 500px) {
    .mega-footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .mega-footer { padding-top: 40px; }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ════════════════════════════════════════════════════════════════════
   18. NOTIFICATION DRAWER
   ════════════════════════════════════════════════════════════════════ */
.notif-drawer {
    display: none;
    position: fixed;
    top: calc(var(--header-h) + 4px);
    right: 12px;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 70vh;
    background: var(--bg-elevated);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    z-index: var(--z-dropdown);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideDown var(--duration-base) var(--ease-out);
}
.notif-drawer.show { display: block; }

.notif-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    z-index: 2;
}

/* ════════════════════════════════════════════════════════════════════
   19. UTILITY CLASSES
   ════════════════════════════════════════════════════════════════════ */
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-shrink { flex-shrink: 0; }
.full-w    { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 40px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.p-sm  { padding: 8px; }
.p-md  { padding: 16px; }
.p-lg  { padding: 24px; }

/* ── Empty states ────────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}
.empty-state i { font-size: 2rem; opacity: 0.4; }
.empty-state p { font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6; }

/* ── Alert boxes ─────────────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-info    { background: var(--info-dim);    border: 1px solid rgba(6,182,212,0.2);   color: var(--info); }
.alert-success { background: var(--success-dim); border: 1px solid rgba(16,185,129,0.2);  color: var(--success); }
.alert-warning { background: var(--warning-dim); border: 1px solid rgba(245,158,11,0.2);  color: var(--warning); }
.alert-danger  { background: var(--danger-dim);  border: 1px solid rgba(239,68,68,0.2);   color: var(--danger); }

/* ── Divider ─────────────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--panel-border);
    margin: 16px 0;
}

/* ── Network ticker bar ──────────────────────────────────────────── */
.ticker-bar {
    width: 100%;
    overflow: hidden;
    background: rgba(var(--accent-rgb), 0.03);
    border-bottom: 1px solid var(--panel-border);
    padding: 6px 0;
}
.ticker-track {
    display: flex;
    gap: 24px;
    white-space: nowrap;
    animation: tickerScroll 35s linear infinite;
    padding: 0 12px;
}
.ticker-bar:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.ticker-item {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ticker-val { color: var(--accent); font-weight: 600; }

/* ════════════════════════════════════════════════════════════════════
   20. RESPONSIVE: Global safe-guards
   ════════════════════════════════════════════════════════════════════ */

/* Prevent ANYTHING from causing horizontal scroll */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Mobile body padding for fixed bottom nav */
@media (max-width: 900px) {
    body { padding-bottom: var(--mobile-nav-h); }
}

/* Touch targets — minimum 44×44px on mobile */
@media (max-width: 767px) {
    button, a, .btn, input, select, textarea {
        min-height: 44px;
    }
    .data-table td, .data-table th {
        padding: 10px 8px;
        font-size: 0.75rem;
    }
}
