@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;800;900&family=Inter:wght@400;700;900&display=swap');

/* --- UNIFIED BRAND COLORS (THE MIDAS PALETTE) --- */
:root {
    --midas-gold: #ffcc00;
    --midas-green: #b6ff00;
    --midas-red-orange: #ff9355;
    --midas-sky: #228d99;
    --midas-terminal: #3bb159;
    --midas-hazard: #ff4136;
    --midas-accent: #ff8c00;
}

/* --- THEME DEFINITIONS --- */
    :root[data-theme="dark"], html[data-theme="dark"] {
        --bg-main: #050505;
        --bg-card: #121212;
        --bg-nav: #111111;
        --bg-toolbar: #111111;
        --text-head: var(--midas-gold);
        --text-body: #ffffff;
        --text-dim: #88929b;
        --accent: var(--midas-accent);
        --accent-sky: var(--midas-sky);
        --border: #4a4a4a;
        --hazard: var(--midas-hazard);
        --color-grey: #b7b7b7;
        /* Industrial Status Colors */
        --status-info: var(--midas-green);
        --status-success: #57c243;
        --status-warn: var(--midas-gold);
        --status-error: var(--midas-hazard);
        --nav-height: 56px;
        --toolbar-height: 64px;
    }

    :root[data-theme="light"], html[data-theme="light"] {
        --bg-main: #f5f5f7;
        --bg-card: #fcfcfc;
        --bg-nav: #ffffff;
        --bg-toolbar: #f0f0f2;
        --text-head: #78350f; /* Even darker Amber */
        --text-body: #0f172a; /* Near black slate */
        --text-dim: #475569;
        --accent: #c2410c;
        --accent-sky: var(--midas-sky);
        --border: #abadb0;
        --hazard: #991b1b;
        --overlay-bg: rgba(255, 255, 255, 0.6);
        --color-grey: #565656;
        /* Ultra-Dark Industrial Status Colors for Light Mode */
        --status-info: #1a2e05; /* Deepest Forest */
        --status-success: #57c243;
        --status-warn: #713f12; /* Deepest Ochre */
        --status-error: #7f1d1d; /* Deepest Red */

        --nav-height: 56px;
        --toolbar-height: 64px;
    }

/* --- STATUS UTILITIES --- */
.text-status-success { color: var(--status-success) !important; }
.text-status-info { color: var(--status-info) !important; }
.text-status-warn { color: var(--status-warn) !important; }
.text-status-error { color: var(--status-error) !important; }

.bg-status-success { background-color: var(--status-success) !important; }
.bg-status-info { background-color: var(--status-info) !important; }
.bg-status-warn { background-color: var(--status-warn) !important; }
.bg-status-error { background-color: var(--status-error) !important; }

/* Default Theme (Dark) if not specified */
:root, html {
    --bg-main: #050505;
    --bg-card: #121212;
    --bg-nav: #111111;
    --bg-toolbar: #111111;
    --text-head: var(--midas-gold);
    --text-body: #ffffff;
    --text-dim: #88929b;
    --accent: var(--midas-accent);
    --accent-sky: var(--midas-sky);
    --border: #222222;
    --hazard: var(--midas-hazard);
    --overlay-bg: rgba(0, 0, 0, 0.85);
    --nav-height: 56px;
    --toolbar-height: 64px;
}

/* --- CORE SYSTEM RESET --- */
html, body {
    min-height: 100vh;
    width: 100vw;
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-main) !important;
    color: var(--text-body) !important;
    font-family: 'JetBrains Mono', monospace !important;
}

/* --- LAB DATE PICKER (MINI) --- */
.lab-date-picker-mini {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-body);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.lab-date-picker-mini::-webkit-calendar-picker-indicator {
    filter: invert(var(--calendar-invert, 1));
    cursor: pointer;
}

/* --- THEME SPECIFIC OVERRIDES --- */
:root[data-theme="dark"], html[data-theme="dark"] {
    --calendar-invert: 1;
}

:root[data-theme="light"], html[data-theme="light"] {
    --calendar-invert: 0;
}

/* --- GLOBAL THEMED SCROLLBARS (From Queen) --- */
* {
    scrollbar-width: thin;
    scrollbar-color: #333333 var(--bg-main); /* Thumb color | Track color */
}

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

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

::-webkit-scrollbar-thumb {
    background: #222222; 
    border-radius: 10px;
    border: 1px solid var(--bg-main); 
}

::-webkit-scrollbar-thumb:hover {
    background: var(--midas-gold);
    box-shadow: 0 0 10px var(--midas-gold); 
}

::-webkit-scrollbar-corner {
    background: var(--bg-main);
}

/* Specific styling for the Log Console to keep it low-profile */
.log-console::-webkit-scrollbar-thumb {
    background: #1a1a1a;
}

.log-console::-webkit-scrollbar-thumb:hover {
    background: var(--accent-sky); /* Sky blue for log hover */
}

/* --- TABLE THEMING --- */
.hive-panel table, .table-midas, .table-midas-forensic {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--text-body) !important;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05) !important;
    --bs-table-hover-color: var(--text-body) !important;
    --bs-table-border-color: var(--border) !important;
    color: var(--text-body) !important;
}

[data-theme="light"] .hive-panel table, [data-theme="light"] .table-midas {
    --bs-table-hover-bg: rgba(0, 0, 0, 0.05) !important;
}

/* --- UTILITIES --- */
.text-terminal {
    color: var(--midas-terminal) !important;
}

.text-hazard {
    color: var(--hazard) !important;
}

.text-dim {
    color: var(--text-dim) !important;
}

.text-body {
    color: var(--text-body) !important;
}

.text-head {
    color: var(--text-head) !important;
}

.text-non-white {
    color: var(--color-grey) !important;
}