/*
 * ELEKTRON ANALYTICS - Custom Styles
 * Branding: Elektron Energy
 * Aesthetic: Minimalist + 90s DOS/ANSI Terminal
 * 
 * Color Palette:
 * - Background: #161616 (Charcoal Black)
 * - Foreground: #F5F5F5 (Off-White)  
 * - Accent: #85D94A (Elektron Green - for graphs only)
 * - Muted: #888888 (Gray)
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-primary: #161616;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #202020;
    --bg-card: #1c1c1c;
    --fg-primary: #F5F5F5;
    --fg-secondary: #D8D8D8;
    --fg-muted: #AAAAAA;
    --fg-dim: #777777;
    --accent: #85D94A;
    --accent-dim: rgba(133, 217, 74, 0.15);
    --border: #333333;
    --border-light: #444444;
    --danger: #FF6B6B;
    --warning: #FFB347;
    --info: #6BB3FF;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    background-color: var(--bg-primary);
    color: var(--fg-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY - Clean with monospace accents
   ═══════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-top: 0;
    color: var(--fg-primary);
}

.mono, code, pre, .terminal, .stat-value {
    font-family: 'IBM Plex Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
}

code {
    background: var(--bg-tertiary);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.9em;
}

pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1rem;
    overflow-x: auto;
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION - Horizontal top bar
   ═══════════════════════════════════════════════════════════════ */

.navbar {
    background: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    padding: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--fg-primary) !important;
    flex-shrink: 0;
}

.navbar-brand img {
    height: 24px;
    width: auto;
}

.navbar-brand span {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: auto;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 1rem 1rem;
    color: var(--fg-muted) !important;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 400;
    transition: color 0.15s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--fg-primary) !important;
}

.nav-link.active {
    color: var(--fg-primary) !important;
    border-bottom-color: var(--fg-primary);
}

/* ═══════════════════════════════════════════════════════════════
   DOS/ANSI DECORATIVE ELEMENTS
   ═══════════════════════════════════════════════════════════════ */

.box-drawing {
    color: var(--fg-dim);
    font-family: 'IBM Plex Mono', monospace;
    white-space: pre;
    line-height: 1.2;
}

.terminal-header {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--fg-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.terminal-header::before {
    content: "┌─ ";
    color: var(--fg-dim);
}

.terminal-header::after {
    content: " ─────────────────────────────────────────";
    color: var(--fg-dim);
}

.ascii-divider {
    color: var(--fg-dim);
    font-family: 'IBM Plex Mono', monospace;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.875rem;
}

.prompt::before {
    content: "› ";
    color: var(--fg-dim);
}

/* ═══════════════════════════════════════════════════════════════
   CARDS - Minimal bordered boxes
   ═══════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 0;
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: var(--border-light) !important;
    transform: none;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 0.75rem 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--fg-primary);
}

/* ═══════════════════════════════════════════════════════════════
   STAT CARDS - For metrics display
   ═══════════════════════════════════════════════════════════════ */

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 2rem;
    font-weight: 500;
    color: var(--fg-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--fg-muted);
}

.stat-change {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: var(--accent);
}

.stat-change.negative {
    color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS - Minimal with borders
   ═══════════════════════════════════════════════════════════════ */

.btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 0 !important;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary, .btn-success {
    background: var(--fg-primary) !important;
    border-color: var(--fg-primary) !important;
    color: var(--bg-primary) !important;
}

.btn-primary:hover, .btn-success:hover {
    background: var(--fg-secondary) !important;
    border-color: var(--fg-secondary) !important;
    color: var(--bg-primary) !important;
}

.btn-outline, .btn-outline-light, .btn-outline-success {
    background: transparent !important;
    border-color: var(--border-light) !important;
    color: var(--fg-primary) !important;
}

.btn-outline:hover, .btn-outline-light:hover, .btn-outline-success:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--fg-muted) !important;
    color: var(--fg-primary) !important;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--fg-muted);
}

.btn-ghost:hover {
    color: var(--fg-primary);
}

/* ═══════════════════════════════════════════════════════════════
   TABLES - Clean data display
   ═══════════════════════════════════════════════════════════════ */

.table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
    background: transparent;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-primary);
    background: transparent;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--fg-primary);
    background: transparent;
}

.table tbody tr {
    background: transparent;
}

.table tr:hover td {
    background: var(--bg-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   FORMS - Terminal-style inputs
   ═══════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 0.625rem 0.875rem;
    color: var(--fg-primary) !important;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--fg-muted) !important;
    background: var(--bg-tertiary) !important;
    box-shadow: none !important;
}

.form-control::placeholder {
    color: var(--fg-dim);
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION - Homepage (compact)
   ═══════════════════════════════════════════════════════════════ */

.hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 2.5rem 2rem;
}

.hero-content {
    max-width: 720px;
}

.hero-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: flex-start;
}

.hero-logo {
    width: 40px;
    height: 40px;
    opacity: 0.9;
    flex-shrink: 0;
}

.hero-title {
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.03em;
    color: var(--fg-primary);
    display: flex;
    align-items: center;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--fg-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.dashboard {
    padding: 2rem;
}

.dashboard-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--fg-primary);
}

.dashboard-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.stats-grid .stat-card {
    border: none;
}

.chart-container {
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.chart-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
}

/* ═══════════════════════════════════════════════════════════════
   GRID SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-fluid {
    padding: 0 2rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col {
    flex: 1;
    padding: 0 0.75rem;
}

.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 0.75rem; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 0.75rem; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 0.75rem; }

@media (max-width: 768px) {
    .col-6, .col-4, .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--fg-dim);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--fg-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--fg-primary);
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.text-muted { color: var(--fg-muted) !important; }
.text-dim { color: var(--fg-dim); }
.text-accent { color: var(--accent); }
.text-success { color: var(--accent) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: 'IBM Plex Mono', monospace; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }

.bg-dark { background-color: var(--bg-secondary) !important; }
.bg-black { background-color: var(--bg-primary) !important; }
.border-success { border-color: var(--border) !important; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════
   FEATURE GRID - Homepage
   ═══════════════════════════════════════════════════════════════ */

.features {
    padding: 4rem 2rem;
    border-top: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}

.feature-item {
    background: var(--bg-primary);
    padding: 2rem;
}

.feature-icon {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.feature-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.feature-desc {
    font-size: 0.8125rem;
    color: var(--fg-muted);
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   LOADING STATES
   ═══════════════════════════════════════════════════════════════ */

.loading {
    color: var(--fg-dim);
    font-family: 'IBM Plex Mono', monospace;
}

.loading::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fg-dim);
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS / NOTICES
   ═══════════════════════════════════════════════════════════════ */

.alert {
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    border-radius: 0;
}

.alert-info {
    border-left: 3px solid var(--info);
    background: var(--bg-secondary);
}

.alert-warning {
    border-left: 3px solid var(--warning);
    background: var(--bg-secondary);
}

.alert-success {
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   API ENDPOINT LIST
   ═══════════════════════════════════════════════════════════════ */

.api-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.api-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8125rem;
}

.api-list li:last-child {
    border-bottom: none;
}

.api-method {
    display: inline-block;
    width: 40px;
    color: var(--fg-dim);
}

.api-path {
    color: var(--fg-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   LIST GROUPS - Bootstrap Override
   ═══════════════════════════════════════════════════════════════ */

.list-group {
    border-radius: 0;
}

.list-group-item {
    background-color: var(--bg-primary);
    border-color: var(--border);
    color: var(--fg-secondary);
    padding: 0.75rem 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8125rem;
}

.list-group-item:hover {
    background-color: var(--bg-secondary);
    color: var(--fg-primary);
}

.list-group-item-dark {
    background-color: var(--bg-primary);
    border-color: var(--border);
    color: var(--fg-secondary);
}

.list-group-item-dark:hover {
    background-color: var(--bg-secondary);
    color: var(--fg-primary);
}

/* ═══════════════════════════════════════════════════════════════
   TERMINAL OUTPUT BOX
   ═══════════════════════════════════════════════════════════════ */

.terminal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8125rem;
    padding: 1rem;
    overflow-x: auto;
}

.terminal-box .prompt {
    color: var(--fg-muted);
}

.terminal-box .output {
    color: var(--fg-secondary);
}

.terminal-box .cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: var(--fg-primary);
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
}

/* ═══════════════════════════════════════════════════════════════
   AUTO-UPDATE STATUS CARDS
   ═══════════════════════════════════════════════════════════════ */

.update-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
}

.update-status-card:hover {
    border-color: var(--border-light);
}

.update-status-header {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--fg-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.update-status-icon {
    font-size: 1rem;
}

.update-status-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.status-label {
    color: var(--fg-muted);
    font-family: 'IBM Plex Mono', monospace;
    min-width: 85px;
}

.status-value {
    color: var(--fg-primary);
    font-family: 'IBM Plex Mono', monospace;
    text-align: right;
}

.status-value.loading {
    color: var(--fg-dim);
    opacity: 0.5;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: 'IBM Plex Mono', monospace;
}

.status-badge.idle {
    background: rgba(170, 170, 170, 0.15);
    color: var(--fg-muted);
}

.status-badge.running {
    background: rgba(107, 179, 255, 0.15);
    color: var(--info);
}

.status-badge.success {
    background: rgba(133, 217, 74, 0.15);
    color: var(--accent);
}

.status-badge.failure {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.status-badge.error {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

/* Check Now Buttons */
.btn-check-now,
.btn-check-now-small {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    color: var(--fg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-check-now:hover,
.btn-check-now-small:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--fg-primary);
}

.btn-check-now:disabled,
.btn-check-now-small:disabled,
.btn-check-now.disabled,
.btn-check-now-small.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-primary);
    color: var(--fg-dim);
    border-color: var(--border);
}

.btn-check-now:disabled:hover,
.btn-check-now-small:disabled:hover,
.btn-check-now.disabled:hover,
.btn-check-now-small.disabled:hover {
    background: var(--bg-primary);
    color: var(--fg-dim);
    border-color: var(--border);
}

.btn-check-now-small {
    font-size: 0.65rem;
    padding: 3px 10px;
    width: 100%;
}

.checking {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ═══════════════════════════════════════════════════════════════
   DATA SOURCES PAGE
   ═══════════════════════════════════════════════════════════════ */

.data-selector-container {
    margin-bottom: 2rem;
}

.selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.source-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.source-btn:hover {
    border-color: var(--border-light);
    background: var(--bg-secondary);
}

.source-btn.active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.source-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.source-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg-primary);
}

.source-desc {
    font-size: 0.75rem;
    color: var(--fg-muted);
    line-height: 1.3;
}

.data-summary-section {
    margin-bottom: 2rem;
}

.metadata-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metadata-item {
    display: flex;
    gap: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
}

.metadata-label {
    color: var(--fg-muted);
    font-weight: 600;
    min-width: 120px;
}

.metadata-value {
    color: var(--fg-primary);
}

.metadata-value a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.metadata-value a:hover {
    border-bottom-color: var(--accent);
}

.metadata-value code {
    background: var(--bg-card);
    padding: 2px 6px;
    border: 1px solid var(--border);
    color: var(--accent);
}

.metadata-description {
    font-size: 0.8rem;
    color: var(--fg-secondary);
    line-height: 1.5;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-style: italic;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.25rem;
    color: var(--fg-primary);
    font-weight: 600;
}

.btn-download {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    padding: 4px 12px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
    float: right;
    margin-left: 1rem;
}

.btn-download:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.data-table-section {
    margin-bottom: 2rem;
}

.table-container {
    margin-top: 1rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    max-height: 600px;
    overflow: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--fg-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
}

.data-table th:hover {
    background: var(--bg-tertiary);
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-indicator {
    color: var(--fg-dim);
    font-size: 0.8rem;
    margin-left: 0.25rem;
    opacity: 0.3;
    transition: all 0.2s ease;
}

.sort-indicator.active {
    color: var(--accent);
    opacity: 1;
}

.column-header:hover .sort-indicator {
    opacity: 0.6;
}

.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--fg-primary);
}

.data-table tr:hover {
    background: var(--bg-tertiary);
}

.data-table .numeric-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table .null-value {
    color: var(--fg-dim);
    font-style: italic;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--fg-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-state {
    padding: 3rem 2rem;
    text-align: center;
}

.error-text {
    color: var(--danger);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
}
