/* ═══════════════════════════════════════════════════════════
   ORFAM ERP — Scientific Premium × ORCA Brand Design System
   ─ Precision · Depth · Motion ─
   ═══════════════════════════════════════════════════════════ */

/* ── Theme Variables ── */
:root {
    --font: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
    --font-mono: 'Inter', 'SF Mono', 'Menlo', monospace;
    --sidebar-w: 260px;
    --topbar-h: 56px;

    /* Scientific Premium — Light (Default) */
    --bg: #F5F5F7;           /* Apple-style light gray canvas */
    --bg2: #FFFFFF;           /* Pure white cards */
    --bg3: #FAFAFA;           /* Subtle off-white */
    --bg-glass: rgba(255, 255, 255, 0.72);
    --text: #1D1D1F;          /* Apple-style near-black */
    --text2: #6E6E73;         /* Subtle body */
    --text3: #86868B;         /* Tertiary */
    --border: rgba(0, 0, 0, 0.06);
    --border2: rgba(0, 0, 0, 0.1);

    /* ORCA Brand Colors (Blue & Grayscale Scheme) */
    --orca-blue: #0090D2;      /* Primary — Trust / Medical */
    --orca-blue-light: #E8F4FD;
    --orca-blue-dark: #006FA3;
    
    /* Replaced colorful elements with grayscale/blue */
    --orca-green: #6E6E73;     /* Replaced with Gray */
    --orca-green-light: #F5F5F7;
    --orca-cyan: #3A3A3C;      /* Replaced with Dark Gray */
    --orca-cyan-light: #E5E5EA;
    --orca-gold: #8E8E93;      /* Replaced with Gray */
    --orca-gold-light: #F2F2F7;

    /* Functional Colors (Professional Semantic) */
    --accent: var(--orca-blue);
    --accent-bg: var(--orca-blue-light);
    --accent-dark: var(--orca-blue-dark);
    --green: #34C759;         /* Positive / Growth */
    --red: #FF3B30;           /* Negative / Alert */
    --amber: #FF9F0A;         /* Warning / Caution */
    --purple: #AF52DE;        /* Info / Expense */

    /* KPI Tints */
    --kpi-blue: rgba(0, 144, 210, 0.08);
    --kpi-green: rgba(52, 199, 89, 0.08);
    --kpi-green-bg: rgba(52, 199, 89, 0.08);
    --kpi-cyan: rgba(0, 144, 210, 0.06);
    --kpi-gold: rgba(255, 159, 10, 0.08);
    --kpi-red: rgba(255, 59, 48, 0.06);
    --kpi-red-bg: rgba(255, 59, 48, 0.06);
    --kpi-purple: rgba(175, 82, 222, 0.06);

    /* Scientific Premium Shadows (Deep & Soft) */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.18);

    /* Generous Radius (Scientific Premium) */
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-card: 24px;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
    --bg: #0F172A;
    --bg2: #1E293B;
    --bg3: #2A3347;
    --bg-glass: rgba(30, 41, 59, 0.85);
    --text: #F1F5F9;
    --text2: #94A3B8;
    --text3: #64748B;
    --border: rgba(255, 255, 255, 0.06);
    --border2: rgba(255, 255, 255, 0.1);

    --orca-blue-light: rgba(0, 144, 210, 0.15);
    --orca-green-light: rgba(255, 255, 255, 0.03);
    --orca-cyan-light: rgba(255, 255, 255, 0.05);
    --orca-gold-light: rgba(255, 255, 255, 0.04);
    --accent-bg: rgba(0, 144, 210, 0.12);

    --kpi-blue: rgba(0, 144, 210, 0.12);
    --kpi-green: rgba(52, 199, 89, 0.10);
    --kpi-green-bg: rgba(52, 199, 89, 0.10);
    --kpi-cyan: rgba(0, 144, 210, 0.10);
    --kpi-gold: rgba(255, 159, 10, 0.10);
    --kpi-red: rgba(255, 59, 48, 0.08);
    --kpi-red-bg: rgba(255, 59, 48, 0.08);
    --kpi-purple: rgba(175, 82, 222, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   ICONIC ANIMATIONS (Scientific Premium)
   ═══════════════════════════════════════════ */
@keyframes pulse {
    0% { opacity: 0.4; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1.04); }
    100% { opacity: 0.4; transform: scale(0.96); }
}

@keyframes flow {
    0% { transform: translateX(-100%); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(400%); opacity: 0; }
}

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 144, 210, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(0, 144, 210, 0); }
}

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

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

@keyframes soundBar {
    0% { height: 6px; }
    50% { height: 20px; }
    100% { height: 6px; }
}

/* ── Scientific Loader ── */
.scientific-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 60px 0;
    position: relative;
    width: 100%;
}

.scientific-loader .flow-line {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--orca-blue), transparent);
    animation: flow 2s infinite linear;
    opacity: 0.5;
}

.scientific-loader .pulse-node {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orca-blue);
    box-shadow: 0 0 10px rgba(0, 144, 210, 0.4);
    animation: pulse 1.5s infinite ease-in-out;
    z-index: 1;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main { margin-left: 0; }

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    font-weight: 700;
    font-size: 17px;
    display: block;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand-sub {
    font-size: 11px;
    color: var(--text3);
    display: block;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Navigation */
nav {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text3);
    padding: 18px 12px 6px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    color: var(--text2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.nav-item:hover {
    background: var(--accent-bg);
    color: var(--orca-blue);
}

.nav-item.active {
    background: var(--accent-bg);
    color: var(--orca-blue);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--orca-blue);
}

.nav-item .icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-item .icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Sidebar Bottom */
.sidebar-bottom {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: background 0.2s;
}

.theme-toggle:hover { background: var(--bg3); }
.theme-toggle .icon { width: 16px; height: 16px; }
.theme-toggle .icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--text3);
    stroke-width: 1.8;
}

.theme-label {
    font-size: 13px;
    color: var(--text3);
    flex: 1;
}

.toggle-track {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--border2);
    position: relative;
    transition: background 0.3s;
}

[data-theme="dark"] .toggle-track { background: var(--orca-blue); }

.toggle-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

[data-theme="dark"] .toggle-dot { left: 18px; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    margin-top: 4px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orca-blue), var(--orca-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.uname { font-size: 14px; font-weight: 600; display: block; }
.urole { font-size: 11px; color: var(--text3); display: block; letter-spacing: 0.02em; }

/* ═══════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════ */
.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar {
    height: var(--topbar-h);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    transition: background 0.15s;
}

.hamburger:hover { background: var(--bg3); }
.hamburger svg { width: 20px; height: 20px; stroke: var(--text2); stroke-width: 1.8; fill: none; }

.page-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-right .refresh-btn {
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-family: inherit;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.topbar-right .refresh-btn:hover {
    border-color: var(--orca-blue);
    color: var(--orca-blue);
    background: var(--orca-blue-light);
}

.fy-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg2);
    color: var(--text);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.fy-select:focus { border-color: var(--orca-blue); }

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text3);
    font-family: inherit;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    transition: 0.2s;
}

.logout-btn:hover { color: var(--red); background: rgba(255,59,48,0.06); }

/* ═══════════════════════════════════════════
   CONTENT
   ═══════════════════════════════════════════ */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    min-width: 0;
    scroll-behavior: smooth;
}

/* ── Scientific Scrollbars ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: var(--border2); 
    border-radius: 4px; 
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { border-color: var(--bg); }

.page { display: none; }
.page.active { display: block; animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

/* ═══════════════════════════════════════════
   KPI CARDS (Scientific Premium)
   ═══════════════════════════════════════════ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpi {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--orca-blue), var(--orca-cyan), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.kpi:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.kpi:hover::before { opacity: 1; }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kpi-icon.green { background: var(--kpi-green); }
.kpi-icon.green svg { stroke: var(--green); }
.kpi-icon.blue { background: var(--kpi-blue); }
.kpi-icon.blue svg { stroke: var(--orca-blue); }
.kpi-icon.amber { background: var(--kpi-gold); }
.kpi-icon.amber svg { stroke: var(--amber); }
.kpi-icon.purple { background: var(--kpi-purple); }
.kpi-icon.purple svg { stroke: var(--purple); }
.kpi-icon.red { background: var(--kpi-red); }
.kpi-icon.red svg { stroke: var(--red); }

.kpi-body { flex: 1; min-width: 0; }

.kpi-val {
    font-size: 27px;
    font-weight: 700;
    display: block;
    letter-spacing: -0.03em;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.kpi-lbl {
    font-size: 15px;
    color: var(--text2);
    display: block;
    margin-top: 4px;
    letter-spacing: 0.01em;
    font-weight: 500;
}

.kpi-trend {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════
   CARDS (Scientific Premium)
   ═══════════════════════════════════════════ */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent);
}

.card-head h3 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.card-body { padding: 24px; }

/* ── Grids ── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

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

/* ═══════════════════════════════════════════
   DATA TABLES (Precision Layout)
   ═══════════════════════════════════════════ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 12px 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
    background: rgba(245, 245, 247, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: sticky;
    top: 0;
    z-index: 10;
}

[data-theme="dark"] .data-table th { background: rgba(30, 41, 59, 0.6); }

.data-table td {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    transition: background 0.15s;
}

.data-table tbody tr {
    transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s;
}

.data-table tbody tr:hover td { 
    background: var(--bg3);
}

.data-table .amount {
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.data-table .positive { color: var(--green); }
.data-table .negative { color: var(--red); font-weight: 600; }

.data-table .total-row {
    background: var(--bg3);
}

.data-table .total-row td {
    font-weight: 700;
    color: var(--text);
    border-top: 1px solid var(--border2);
    border-bottom: 1px solid var(--border2);
    background: transparent;
}

.data-table .indicator-row {
    font-weight: 700;
    background: var(--orca-blue-light);
}

.data-table .indicator-row td {
    border-top: 2px solid var(--orca-blue);
    color: var(--orca-blue-dark);
}

[data-theme="dark"] .data-table .indicator-row td {
    color: var(--orca-cyan);
}

.data-table .category-header td {
    font-weight: 600;
    color: var(--text3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-top: 18px;
    background: transparent;
}

/* ── Filter Row ── */
.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg3);
}

.filter-select, .filter-input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg2);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--orca-blue);
    box-shadow: 0 0 0 3px rgba(0, 144, 210, 0.1);
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn-primary {
    background: linear-gradient(135deg, var(--orca-blue-dark), var(--orca-blue));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(0, 144, 210, 0.3);
    transform: translateY(-1px);
}

.btn-primary:hover::before { opacity: 1; }

.btn-outline {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
[data-theme="dark"] .btn-outline { background: rgba(30, 41, 59, 0.4); }

.btn-outline:hover {
    border-color: var(--orca-blue);
    color: var(--orca-blue);
    background: var(--orca-blue-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 144, 210, 0.15);
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
}

/* ── Tab Bar Small (Annual Page) ── */
.tab-bar-small {
    display: flex;
    background: rgba(0,0,0,0.04);
    border-radius: var(--radius-xs);
    padding: 4px;
    gap: 2px;
}
[data-theme="dark"] .tab-bar-small { background: rgba(255,255,255,0.05); }

.tab-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn.active {
    background: var(--bg2);
    color: var(--orca-blue);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.tab-btn:hover:not(.active) { color: var(--text); background: rgba(0,0,0,0.02); }

.details-container::-webkit-scrollbar { width: 4px; }
.details-container::-webkit-scrollbar-track { background: transparent; }
.details-container::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.empty-state-small {
    color: var(--text3);
    font-size: 13px;
    padding: 16px;
    text-align: center;
    background: rgba(0,0,0,0.02);
    border-radius: var(--radius-xs);
    margin-top: 8px;
}

.action-bar { display: flex; gap: 8px; }

/* ═══════════════════════════════════════════
   CHART (Scientific Visualization)
   ═══════════════════════════════════════════ */
.chart-container {
    padding: 24px;
    min-height: 260px;
    display: flex;
    align-items: flex-end;
    gap: 0;
    position: relative;
}

/* Subtle grid lines */
.chart-container::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 50px;
    background: repeating-linear-gradient(
        to bottom,
        var(--border) 0px,
        var(--border) 1px,
        transparent 1px,
        transparent 45px
    );
    pointer-events: none;
    opacity: 0.5;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.chart-bar-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 3px;
    height: 200px;
}

.chart-bar {
    width: 20px;
    border-radius: 6px 6px 0 0;
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    transform-origin: bottom;
}

.chart-bar.revenue {
    background: linear-gradient(180deg, var(--orca-blue), var(--orca-blue-dark));
    box-shadow: 0 0 10px rgba(0, 144, 210, 0.15);
}

.chart-bar.cost {
    background: linear-gradient(180deg, #94A3B8, #64748B);
    box-shadow: 0 0 8px rgba(100, 116, 139, 0.1);
}

.chart-bar.profit {
    background: linear-gradient(180deg, #1D1D1F, #3A3A3C);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
}

.chart-bar:hover { 
    filter: brightness(1.15); 
    transform: scaleY(1.04);
}

.chart-bar .tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-weight: 500;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.chart-bar:hover .tooltip { 
    display: block; 
    opacity: 1;
    animation: fadeIn 0.15s ease-out forwards;
}

.chart-month-label {
    font-size: 12px;
    color: var(--text3);
    font-weight: 500;
}

.chart-legend {
    display: flex;
    gap: 20px;
    padding: 4px 24px 20px;
    font-size: 13px;
    color: var(--text2);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.legend-dot.revenue { background: var(--orca-blue); }
.legend-dot.cost { background: var(--orca-gold); }
.legend-dot.profit { background: var(--orca-green); }

/* ═══════════════════════════════════════════
   GAUGE (Scientific Instrument)
   ═══════════════════════════════════════════ */
.gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
}

.gauge {
    width: 160px;
    height: 80px;
    position: relative;
    overflow: hidden;
}

.gauge-bg, .gauge-fill {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 14px solid var(--border);
    position: absolute;
    top: 0;
    left: 0;
    clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
}

.gauge-fill {
    border-color: var(--orca-blue);
    transform: rotate(0deg);
    transform-origin: center center;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-val {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 31px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
    letter-spacing: -0.03em;
}

.gauge-label {
    font-size: 12px;
    color: var(--text3);
    margin-top: 10px;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════
   TAB BAR
   ═══════════════════════════════════════════ */
.tab-bar {
    display: flex;
    gap: 8px; /* Slightly more space */
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    background: transparent;
    padding: 0;
}

.tab-item {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.tab-item:hover { 
    color: var(--text); 
    background: var(--bg-glass);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-item.active {
    color: var(--orca-blue);
    border-bottom-color: var(--orca-blue);
    font-weight: 600;
    background: var(--bg2);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.02);
}

/* ═══════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════ */
.st {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
    font-family: var(--font-mono);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.st.good { background: var(--kpi-green); color: var(--orca-green); box-shadow: inset 0 0 0 1px rgba(120,192,0,0.2); }
.st.warn { background: var(--kpi-gold); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255,149,0,0.2); }
.st.bad { background: var(--kpi-red); color: var(--red); box-shadow: inset 0 0 0 1px rgba(255,59,48,0.2); }

/* ═══════════════════════════════════════════
   STATES
   ═══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text3);
}

.empty-state .empty-icon {
    font-size: 41px;
    margin-bottom: 14px;
    opacity: 0.6;
}

.empty-state h4 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text3);
    font-size: 14px;
}

.spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border);
    border-top-color: var(--orca-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

/* ═══════════════════════════════════════════
   FLOW INDICATOR (Scientific Premium Signature)
   data-flow line at the top of the content area
   ═══════════════════════════════════════════ */
.content::before {
    content: '';
    display: block;
    height: 2px;
    margin-bottom: 28px;
    border-radius: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--orca-blue) 20%,
        var(--orca-cyan) 40%,
        var(--orca-green) 60%,
        var(--orca-gold) 80%,
        transparent
    );
    opacity: 0.25;
}

/* ═══════════════════════════════════════════
   DRILL-DOWN & CAUSAL ANALYSIS (PHASE 2)
   ═══════════════════════════════════════════ */

tr.category-row.expandable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}
tr.category-row.expandable:hover {
    background-color: var(--hover-bg);
}
.expander {
    display: inline-block;
    width: 20px;
    font-size: 11px;
    color: var(--orca-blue);
    transition: transform 0.2s ease;
}

tr.expanded-child.sub-item {
    cursor: pointer;
    background-color: rgba(0,0,0,0.01);
    transition: background-color 0.2s ease;
}
[data-theme='dark'] tr.expanded-child.sub-item {
    background-color: rgba(255,255,255,0.02);
}
tr.expanded-child.sub-item:hover {
    background-color: var(--hover-bg);
}
.item-expander {
    display: inline-block;
    width: 16px;
    font-size: 10px;
    color: var(--text3);
}

tr.analysis-panel {
    background-color: var(--bg-color);
}
.panel-cell {
    padding: 0 !important;
    border-bottom: none !important;
}
.panel-content.glass-panel {
    margin: 4px 16px 20px 48px;
    padding: 16px;
    border-left: 3px solid var(--orca-green);
    background: var(--surface);
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    animation: slideDownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideDownFade {
    0% { opacity: 0; transform: translateY(-4px) scale(0.99); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-content h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text2);
    font-weight: 600;
}

.comment-box {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text1);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.comment-box:focus {
    outline: none;
    border-color: var(--orca-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.panel-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
    gap: 16px;
}
.save-status {
    font-size: 13px;
    color: var(--text3);
    font-weight: 500;
}
.save-status.success { color: var(--orca-green); }
.save-status.error { color: var(--negative-red); }

/* Variance Highlight overrides for strict colors */
.positive { color: var(--orca-green) !important; font-weight: 500; }
.negative { color: var(--negative-red) !important; font-weight: 500; }

/* ═══════════════════════════════════════════
   SEARCH ENHANCEMENTS
   ═══════════════════════════════════════════ */
.search-chip {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 20px;
    background: var(--accent-bg);
    color: var(--orca-blue);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    border: 1px solid transparent;
    user-select: none;
}
.search-chip:hover {
    background: var(--orca-blue);
    color: white;
    transform: translateY(-1px);
}

.search-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.search-type-badge.type-actual { background: var(--accent-bg); color: var(--orca-blue); }
.search-type-badge.type-plan { background: var(--kpi-green); color: var(--text2); }
.search-type-badge.type-forecast { background: var(--kpi-gold); color: var(--text2); }

.btn-sm {
    padding: 4px 10px !important;
    font-size: 12px !important;
}
.btn-outline.active {
    background: var(--accent-bg);
    border-color: var(--orca-blue);
    color: var(--orca-blue);
}

.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-primary { background: var(--accent-bg); color: var(--orca-blue); }
.badge-neutral { background: var(--bg3); color: var(--text2); }

/* ═══════════════════════════════════════════
   SIDEBAR OVERLAY
   ═══════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* ═══════════════════════════════════════════
   MOBILE BOTTOM NAV
   ═══════════════════════════════════════════ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text3);
    transition: color 0.15s;
    flex: 1;
    max-width: 72px;
}
.mob-nav-item svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.mob-nav-item span {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.mob-nav-item.active {
    color: var(--orca-blue);
}
.mob-nav-item:active {
    background: var(--accent-bg);
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
    #dashRow2 { grid-template-columns: 1fr !important; }

    .topbar-right .refresh-btn span,
    .logout-btn { font-size: 12px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Sidebar: hidden by default, slide in on toggle */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0,0,0,0.15);
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    /* Main layout */
    .main { margin-left: 0; }
    .content {
        padding: 12px;
        padding-bottom: 80px; /* space for bottom nav */
    }

    /* Topbar */
    .topbar { padding: 0 12px; height: 48px; }
    .topbar-left { gap: 8px; }
    .page-title { font-size: 15px; }
    .topbar-right { gap: 6px; }
    .topbar-right .refresh-btn { padding: 4px 8px; font-size: 12px; }
    .fy-select { padding: 4px 8px; font-size: 13px; }
    .logout-btn { padding: 4px 8px; font-size: 12px; }

    /* Show bottom nav */
    .mobile-bottom-nav { display: flex; }

    /* KPIs — 2 columns */
    .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
    .kpi { padding: 14px 12px; }
    .kpi-val { font-size: 19px; }
    .kpi-lbl { font-size: 11px; }
    .kpi-icon { width: 32px; height: 32px; }
    .kpi-icon svg { width: 16px; height: 16px; }

    /* Dashboard row 2 */
    #dashRow2 { grid-template-columns: 1fr !important; gap: 8px !important; margin-bottom: 8px !important; }
    #dashProgressCard { padding: 16px !important; }
    #dashProgressRing { width: 120px !important; height: 120px !important; }

    /* Cards */
    .card { border-radius: var(--radius-xs); }
    .card-head {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-head h3 { font-size: 14px; }
    .action-bar { gap: 6px !important; }

    /* Tables — horizontal scroll */
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 6px 8px; }

    /* Chart */
    .chart-container { overflow-x: auto; min-height: 160px; }
    .chart-bar-group { min-width: 40px; }
    .chart-legend { font-size: 11px; padding: 8px 12px; }

    /* Filter selects */
    .filter-select { font-size: 13px; padding: 6px 8px; }

    /* Tab bars */
    .tab-bar, .tab-bar-small { gap: 2px; }
    .tab-btn { padding: 6px 10px; font-size: 12px; }

    /* Modals */
    .modal-content { width: 95% !important; max-width: none !important; margin: 16px; }

    /* Analysis card */
    .analysis-card { padding: 12px !important; }

    /* BI */
    .bi-heatmap-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Outsourcing */
    .outsource-chart { min-height: 140px; }

    /* Search */
    #searchFilters { flex-direction: column; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤480px)
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
    .kpi-row { grid-template-columns: 1fr 1fr; gap: 6px; }
    .kpi { padding: 10px; }
    .kpi-val { font-size: 17px; }
    .kpi-icon { width: 28px; height: 28px; }
    .kpi-trend { font-size: 10px; padding: 2px 6px; }

    .content { padding: 8px; padding-bottom: 80px; }
    .topbar-right .refresh-btn { display: none; }
    .page-title { font-size: 14px; }
}

/* ═══════════════════════════════════════════
   KPI CLICK-THROUGH
   ═══════════════════════════════════════════ */
.kpi[onclick] { transition: transform 0.15s, box-shadow 0.15s; }
.kpi[onclick]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.kpi[onclick]:active { transform: translateY(0); }

/* ═══════════════════════════════════════════
   DATA ENTRY GRID
   ═══════════════════════════════════════════ */
.entry-cell {
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.entry-cell:hover {
    border-color: var(--border2) !important;
    background: var(--bg3) !important;
}
.entry-cell:focus {
    border-color: var(--accent) !important;
    background: var(--bg2) !important;
    box-shadow: 0 0 0 2px rgba(0,144,210,0.12);
}
#entryTable tr:hover td {
    background: rgba(0,144,210,0.03);
}
#entryTable th {
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 3;
}

/* ═══════════════════════════════════════════
   FORM INPUTS & MODAL
   ═══════════════════════════════════════════ */
.form-input {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,144,210,0.1);
}
[data-theme="dark"] .form-input {
    background: var(--bg3);
    border-color: rgba(255,255,255,0.1);
}

.type-radio-card { cursor: pointer; }
input[type="radio"]:checked + .type-radio-card {
    border-color: var(--accent) !important;
    background: rgba(0,144,210,0.06) !important;
    box-shadow: 0 0 0 1px var(--accent);
}
.type-radio-card:hover {
    border-color: var(--text3) !important;
}

/* ═══════════════════════════════════════════
   ANALYSIS TIMELINE POLISH
   ═══════════════════════════════════════════ */
#analysisTimeline .empty-state {
    padding: 40px 20px;
    text-align: center;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS (Scientific Premium)
   ═══════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 480px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.toast-out {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.toast-msg { font-size: 13px; color: var(--text2); line-height: 1.4; }

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    font-size: 15px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.toast-close:hover { background: var(--bg3); color: var(--text); }

/* Toast variants */
.toast.toast-success { border-left: 3px solid var(--orca-blue); }
.toast.toast-error { border-left: 3px solid #EF4444; }
.toast.toast-warning { border-left: 3px solid #F59E0B; }
.toast.toast-info { border-left: 3px solid var(--orca-blue); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════
   STICKY FIRST COLUMN FOR DATA TABLES
   ═══════════════════════════════════════════ */
.data-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.data-table-wrap .data-table td:first-child,
.data-table-wrap .data-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--bg2);
    border-right: 1px solid var(--border);
}

.data-table-wrap .data-table th:first-child {
    z-index: 15;
    background: rgba(245, 245, 247, 0.95);
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .data-table-wrap .data-table th:first-child {
    background: rgba(30, 41, 59, 0.95);
}

[data-theme="dark"] .data-table-wrap .data-table td:first-child {
    background: var(--bg2);
}

/* ═══════════════════════════════════════════
   CONFIRMATION DIALOG
   ═══════════════════════════════════════════ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.confirm-dialog {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-dialog h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.confirm-dialog p {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ═══════════════════════════════════════════
   DARK MODE CONTRAST IMPROVEMENTS
   ═══════════════════════════════════════════ */
[data-theme="dark"] .data-table .negative {
    color: #F87171;
    font-weight: 600;
}

[data-theme="dark"] .data-table .positive {
    color: var(--text);
}

[data-theme="dark"] .kpi {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .card {
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .data-table .category-header td {
    color: var(--orca-blue);
    opacity: 0.8;
}

[data-theme="dark"] .badge {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .badge-primary {
    background: rgba(0, 144, 210, 0.15);
    color: #5CB8E6;
}

/* ═══════════════════════════════════════════
   SYSTEM VERSION FOOTER
   ═══════════════════════════════════════════ */
.sys-version {
    padding: 12px 20px;
    font-size: 11px;
    color: var(--text3);
    text-align: center;
    letter-spacing: 0.04em;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

