:root { --bg: #12141b; --panel: #1b1e28; --panel2: #232735; --line: #303545; --text: #e8e6df; --mute: #9197a8; --gold: #e8c34a; --gold-d: #9a7420; --red: #e2574c; --green: #4fbf6b; --blue: #5aa8ff; --purple: #b98aff; --orange: #ffa13d; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, 'Segoe UI', sans-serif; }
h1, h2, h3, .logo b { font-family: Cinzel, Georgia, serif; letter-spacing: .5px; }
.hidden { display: none !important; }
.crest { width: 64px; height: 76px; display: grid; place-items: center; font: 800 38px Cinzel, serif; color: #fff0a8; margin: 0 auto; background: linear-gradient(160deg, #c8323c, #7a1620); clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%); box-shadow: inset 0 0 0 2px var(--gold); }
.crest.sm { width: 30px; height: 36px; font-size: 18px; margin: 0; }
.login { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #2a2238, #0b0c11 75%); }
.login-box { width: min(440px, 92vw); text-align: center; background: var(--panel); border: 1px solid var(--gold-d); border-radius: 14px; padding: 34px 28px; box-shadow: 0 30px 80px #000a; }
.login-box h1 { color: var(--gold); margin: 16px 0 6px; font-size: 24px; } .login-box p { color: var(--mute); } .msg { min-height: 20px; color: var(--orange) !important; }

.app { display: grid; grid-template-columns: 228px 1fr; height: 100%; }
aside { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 14px; }
.logo { display: flex; gap: 10px; align-items: center; padding: 0 6px 12px; border-bottom: 1px solid var(--line); } .logo b { color: var(--gold); font-size: 17px; display: block; } .logo small, .who small { color: var(--mute); }
nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
nav button { text-align: left; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 600 14px Inter, sans-serif; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
nav button:hover { background: var(--panel2); } nav button.on { background: linear-gradient(90deg, #3a2f12, #2a2616); color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.who { display: flex; flex-direction: column; gap: 6px; font-size: 12px; word-break: break-all; border-top: 1px solid var(--line); padding-top: 12px; }
main { overflow: auto; display: flex; flex-direction: column; }
main header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
main header h2 { margin: 0; font-size: 22px; color: var(--gold); } #headRight { display: flex; gap: 8px; align-items: center; color: var(--mute); }
#view { padding: 20px 24px 60px; display: flex; flex-direction: column; gap: 18px; }

.btn { border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 7px 13px; border-radius: 7px; font: 600 13px Inter, sans-serif; cursor: pointer; text-decoration: none; text-align: center; display: inline-block; }
.btn:hover { filter: brightness(1.2); } .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #f0c84a, #c8921e); color: #23160a; border-color: #7a5a10; } .btn.danger { background: #5a1f1c; border-color: #8a2f2a; color: #ffd9d4; } .btn.ok { background: #1f4a2a; border-color: #2f7a42; color: #d6ffe0; }
.btn.ghost { background: none; } .btn.big { padding: 12px 22px; font-size: 15px; } .btn.sm { padding: 3px 9px; font-size: 12px; }
input, select, textarea { background: #11131a; border: 1px solid var(--line); color: var(--text); padding: 7px 9px; border-radius: 6px; font: 500 13px Inter, sans-serif; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--gold-d); } input.changed { border-color: var(--orange); background: #2a2010; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.kpi small { color: var(--mute); text-transform: uppercase; letter-spacing: .6px; font-size: 11px; font-weight: 600; } .kpi b { display: block; font-size: 24px; font-weight: 700; margin-top: 3px; } .kpi span { color: var(--mute); font-size: 12px; }
.kpi.good b { color: var(--green); } .kpi.bad b { color: var(--red); } .kpi.gold b { color: var(--gold); } .kpi.warn b { color: var(--orange); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; color: var(--gold); display: flex; justify-content: space-between; align-items: center; gap: 10px; } .panel h3 small { font: 400 12px Inter, sans-serif; color: var(--mute); letter-spacing: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } .cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.alert { padding: 10px 14px; border-radius: 8px; border: 1px solid; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.alert.red { background: #3a1614; border-color: #8a2f2a; } .alert.orange { background: #3a2810; border-color: #8a5a1a; } .alert.green { background: #14301c; border-color: #2f7a42; }
table { width: 100%; border-collapse: collapse; } th { text-align: left; color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid #262a37; vertical-align: middle; } tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel2); } td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: Consolas, 'SF Mono', monospace; font-size: 12px; } .mute { color: var(--mute); } .scroll { overflow: auto; max-height: 520px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--panel2); white-space: nowrap; }
.tag.red { background: #5a1f1c; color: #ffd9d4; } .tag.green { background: #1f4a2a; color: #d6ffe0; } .tag.orange { background: #5a3d10; color: #ffe2b0; } .tag.blue { background: #1c3a5a; color: #d4e9ff; } .tag.purple { background: #3a2a5a; color: #e6d6ff; }
.r0 { color: #b9b4a8; } .r1 { color: #4da3ff; } .r2 { color: #b266ff; } .r3 { color: #ffb020; } .r4 { color: #ff4060; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .toolbar input { width: 280px; } .toolbar select { width: auto; } .grow { flex: 1; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; } .chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; width: 100%; justify-content: center; } .chart i { display: block; width: 42%; max-width: 16px; border-radius: 3px 3px 0 0; min-height: 1px; } .chart small { font-size: 10px; color: var(--mute); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--mute); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.hbar { display: grid; grid-template-columns: 170px 1fr 50px; gap: 10px; align-items: center; margin: 5px 0; font-size: 13px; } .hbar div { height: 10px; background: #11131a; border-radius: 5px; overflow: hidden; } .hbar i { display: block; height: 100%; background: var(--gold); border-radius: 5px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; } .form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mute); font-weight: 600; } .form label small { font-weight: 400; color: #6f7587; }
.switches { display: flex; gap: 22px; flex-wrap: wrap; } .switches label { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.sticky { position: sticky; bottom: 0; background: var(--panel); border: 1px solid var(--gold-d); border-radius: 10px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; box-shadow: 0 -10px 30px #000a; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 5px 12px; font-size: 13px; } .kv span:nth-child(odd) { color: var(--mute); } .kv span { word-break: break-all; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modal { position: fixed; inset: 0; background: #000b; display: grid; place-items: center; z-index: 10; padding: 20px; }
.modal-box { background: var(--panel); border: 1px solid var(--gold-d); border-radius: 12px; width: min(1080px, 100%); max-height: 92vh; overflow: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px #000; }
.modal-box.small { width: min(460px, 100%); } .modal-box h3 { margin: 0; color: var(--gold); font-size: 18px; display: flex; justify-content: space-between; align-items: center; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 20; } .toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--green); padding: 10px 14px; border-radius: 8px; max-width: 420px; box-shadow: 0 8px 24px #000a; } .toast.err { border-left-color: var(--red); }
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } aside { flex-direction: row; flex-wrap: wrap; } nav { flex-direction: row; flex-wrap: wrap; } .who { display: none; } .cols, .cols3 { grid-template-columns: 1fr; } }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
.panel.wide { overflow-x: auto; } .panel.wide td, .panel.wide th { white-space: nowrap; }
.legend { font-family: Inter, sans-serif; font-weight: 400; letter-spacing: 0; }
td input { min-width: 84px; }
#toasts { top: 18px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); align-items: center; } .toast { font-size: 15px; font-weight: 600; padding: 12px 18px; } .toast.err { background: #5a1f1c; border-color: #e2574c; color: #fff; }
.login-logo { display: block; margin: 0 auto; filter: drop-shadow(0 6px 14px #000a) drop-shadow(0 0 18px rgba(255, 176, 32, .3)); } .logo img { filter: drop-shadow(0 2px 4px #000a); }
.panel.runway { border-color: var(--gold-d); background: linear-gradient(180deg, #25210f, var(--panel) 70%); }
