:root {
    --bg: #030711; --panel: rgba(9, 18, 36, 0.92); --panel-2: #0f1e3a; --panel-hover: #15284d;
    --border: rgba(45, 78, 138, 0.55); --sapphire: #0d47a1; --royal: #1e66f5;
    --gold: #d4af37; --gold-bright: #f5c84c;
    --emerald: #10b981; --amber: #f59e0b; --rose: #f43f5e;
    --text: #f8fafc; --muted: #94a3b8;
    --glow: rgba(212, 175, 55, 0.22);
}
body[data-lx-theme="ice_blue"] {
    --gold: #38bdf8; --gold-bright: #7dd3fc; --royal: #0284c7;
    --border: rgba(56, 189, 248, 0.42); --glow: rgba(56, 189, 248, 0.22);
}
body[data-lx-theme="aurora"] {
    --gold: #10b981; --gold-bright: #34d399; --royal: #059669;
    --border: rgba(16, 185, 129, 0.42); --glow: rgba(16, 185, 129, 0.22);
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #040915; }
::-webkit-scrollbar-thumb { background: #1e3560; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

body {
    background: radial-gradient(1100px circle at 85% -10%, rgba(23,93,220,0.20), transparent 55%),
                radial-gradient(800px circle at 10% 10%, rgba(212,175,55,0.08), transparent 50%),
                var(--bg);
    color: var(--text); min-height: 100vh; letter-spacing: -0.005em;
}
.topbar {
    position: sticky; top: 0; z-index: 60;
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
    padding: 10px 24px; background: rgba(0, 0, 0, 0.94); backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(212,175,55,0.42); box-shadow: 0 8px 30px rgba(0,0,0,0.65);
}
.brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand-logo { height: 48px; width: auto; object-fit: contain; display: block; filter: drop-shadow(0 2px 10px rgba(212,175,55,0.2)); }
.mode-tabs, .subnav-tabs { display: flex; flex-wrap: wrap; gap: 5px; background: #060d1b; padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.mode-btn, .subnav-btn { background: transparent; color: var(--muted); padding: 8px 13px; border-radius: 9px; font-weight: 800; font-size: 12px; border: 1px solid transparent; transition: all .16s ease; }
.mode-btn:hover, .subnav-btn:hover { color: #fff; background: rgba(255,255,255,0.04); }
.mode-btn.active { background: linear-gradient(135deg, #0b3b8c, var(--royal)); color: #fff; border-color: var(--gold); box-shadow: 0 0 16px var(--glow); }
.subnav-btn.active { background: linear-gradient(135deg, rgba(15,30,58,0.95), rgba(25,52,102,0.9)); color: var(--gold-bright); border-color: var(--gold); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }

.lx-app-shell { display: grid; grid-template-columns: 266px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.lx-sidebar {
    background: linear-gradient(180deg, rgba(5,10,22,0.98) 0%, rgba(7,15,32,0.95) 100%);
    border-right: 1px solid var(--border); padding: 18px 14px;
    display: flex; flex-direction: column; gap: 18px;
    position: sticky; top: 70px; height: calc(100vh - 70px); overflow-y: auto;
}
.lx-nav-group-title { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; color: #64748b; padding: 0 10px 6px; }
.lx-nav-stack { display: flex; flex-direction: column; gap: 4px; }
.lx-sidebar .subnav-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 9px 12px; font-size: 12.5px; border-radius: 10px; }
.lx-nav-badge { font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,0.08); color: var(--gold-bright); }

.wrap { max-width: 1520px; width: 100%; margin: 0 auto; padding: 20px 26px 48px; display: grid; gap: 18px; align-content: start; }
.lx-status-strip {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 16px; background: rgba(8, 16, 33, 0.85); border: 1px solid var(--border); border-radius: 14px;
}
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 15px; }
.card {
    background: var(--panel); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: 16px; padding: 20px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: rgba(148, 163, 184, 0.4); }
.card-gold { border-color: rgba(212, 175, 55, 0.5); box-shadow: 0 10px 30px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.05); }
.kpi-grid .card { position: relative; overflow: hidden; }
.kpi-grid .card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--royal), var(--gold-bright)); opacity: 0.85; }
.explain-box { background: linear-gradient(90deg, rgba(16,185,129,0.12), rgba(9,18,36,0.9)); border: 1px solid rgba(16,185,129,0.45); border-radius: 14px; padding: 13px 18px; font-size: 13px; line-height: 1.5; }
.kpi-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; display: block; margin-bottom: 6px; }
.kpi-val { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

input, select, textarea {
    background: #040a16; color: var(--text); border: 1px solid #26406e;
    border-radius: 10px; padding: 9px 12px; font-size: 13px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-bright); box-shadow: 0 0 0 3px var(--glow); }
button { cursor: pointer; border: none; border-radius: 10px; padding: 9px 14px; font-weight: 800; font-size: 12px; transition: all .15s ease; }
button:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: #040914; font-weight: 900; white-space: nowrap; box-shadow: 0 4px 14px var(--glow); }
.btn-gold:hover:not(:disabled) { filter: brightness(1.08); }
.btn-gold:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid #284373; }
.btn-ghost:hover { border-color: var(--gold-bright); background: var(--panel-hover); }

table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--gold-bright); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 8px; border-bottom: 1px solid var(--border); }
td { padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
tbody tr:hover { background: rgba(56, 189, 248, 0.04); }
.num { text-align: right; }
.form-row { display: grid; grid-template-columns: 160px 175px 1fr; gap: 12px; margin-bottom: 14px; }
.simple-grid { display: grid; grid-template-columns: 145px minmax(190px, 1.2fr) minmax(290px, 1.3fr) 150px auto; gap: 12px; align-items: end; margin-top: 12px; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; margin-top: 12px; }
.hidden { display: none !important; }

.lx-modal-backdrop {
    position: fixed; inset: 0; z-index: 200; background: rgba(2, 6, 16, 0.78); backdrop-filter: blur(6px);
    display: flex; justify-content: center; align-items: flex-start; padding-top: 8vh;
}
.lx-cmd-box {
    width: min(680px, 94vw); background: #081226; border: 1px solid var(--gold);
    border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,0.85); overflow: hidden;
}
.lx-cmd-item {
    display: flex; justify-content: space-between; align-items: center; padding: 11px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; font-size: 13px;
}
.lx-cmd-item:hover, .lx-cmd-item.active { background: rgba(30, 102, 245, 0.22); color: var(--gold-bright); }
.lx-kbd { font-family: monospace; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: #040915; border: 1px solid #2d4a7c; color: #cbd5e1; }

.white-sheet { background: #fff; color: #0f172a; border-radius: 16px; padding: 32px; border: 2px solid var(--gold); box-shadow: 0 18px 50px rgba(0,0,0,0.5); }
.white-sheet th { color: #1e3a8a; border-bottom: 2px solid #cbd5e1; }
.white-sheet td { border-bottom: 1px solid #e2e8f0; color: #0f172a; }
.white-sheet tbody tr:hover { background: transparent; }

@media (max-width: 1140px) {
    .lx-app-shell { grid-template-columns: 1fr; }
    .lx-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; }
    .lx-nav-stack { flex-direction: row; flex-wrap: wrap; }
    .lx-sidebar .subnav-btn { width: auto; gap: 8px; }
    .simple-grid { grid-template-columns: 1fr 1fr; }
}
@media print {
    body { background: #fff !important; }
    .topbar, .lx-sidebar, .no-print, .lx-modal-backdrop { display: none !important; }
    .lx-app-shell { display: block !important; }
    .wrap { padding: 0 !important; max-width: 100% !important; }
    .white-sheet { border: none !important; box-shadow: none !important; padding: 0 !important; }
}