:root {
    /* "The Void" Theme Palette */
    --bg-deep: #0B0F19;
    --bg-card: rgba(31, 41, 55, 0.4); /* Glassmorphism base */
    --bg-card-hover: rgba(31, 41, 55, 0.6);
    
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    /* Neon Accents */
    --accent-blue: #3B82F6;
    --accent-blue-glow: rgba(59, 130, 246, 0.5);
    
    --accent-success: #10B981;
    --accent-success-glow: rgba(16, 185, 129, 0.5);
    
    --accent-danger: #EF4444;
    --accent-danger-glow: rgba(239, 68, 68, 0.5);
    
    --accent-warning: #F59E0B;

    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 25%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 16px;
}

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #fff, #9CA3AF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Components: Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.card h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Components: KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 12px 0 4px 0;
    letter-spacing: -0.03em;
}

.kpi-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Components: Buttons & Controls */
.controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn.primary {
    background: var(--accent-blue);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 15px var(--accent-blue-glow);
}

.btn.primary:hover {
    filter: brightness(1.1);
}

.btn.danger {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.2);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    width: max-content;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Charts */
.chart-container {
    position: relative;
    width: 100%;
    margin-top: 16px;
}
.chart-container.main { height: 400px; }
.chart-container.small { height: 300px; }

canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Alert / Status Indicators */
.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 99px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 8px currentColor;
}
.status-dot.ok { background: var(--accent-success); color: var(--accent-success-glow); }
.status-dot.bad { background: var(--accent-danger); color: var(--accent-danger-glow); }

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-light);
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.875rem;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent-blue);
}

/* Overlay & Modals */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
    border-radius: var(--radius-lg);
}
.overlay.show { opacity: 1; pointer-events: all; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-backdrop.show { display: flex; animation: fadeIn 0.2s ease-out; }

.modal {
    background: #1F2937;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-light);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}
.input:focus { border-color: var(--accent-blue); }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Utilities */
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }

/* Mobile */
@media (max-width: 768px) {
    .kpi-grid, .breakdown-cols { grid-template-columns: 1fr !important; }
    .tabs { width: 100%; overflow-x: auto; }
}
