:root {
  --bg: #07080c; --panel: rgba(255,255,255,.035); --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.14);
  --text: #eef0f6; --muted: #8b90a0; --faint: #5b6070; --accent: #f5b942; --accent2: #ff8a4c;
  --ok: #3ddc97; --warn: #f5b942; --bad: #ff5d6c; --info: #5cc8ff; --violet: #7c8cff;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
td code { white-space: nowrap; }
body {
  font: 13.5px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; color: var(--text);
  background: radial-gradient(900px 500px at 85% -10%, rgba(245,185,66,.09), transparent 60%), radial-gradient(700px 480px at 0% 110%, rgba(124,140,255,.07), transparent 60%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .num { font-variant-numeric: tabular-nums; }
.center { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.brand { font-weight: 800; letter-spacing: .2em; font-size: 20px; }
.brand small { display: block; font-size: 10px; letter-spacing: .26em; color: var(--accent); font-weight: 600; margin-top: 2px; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 50px -28px #000; }
.card h3 { font-size: 15px; font-weight: 650; margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .spacer { flex: 1; }
.grid { display: grid; gap: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px; border-radius: 11px; font-weight: 600; cursor: pointer; text-decoration: none;
  background: rgba(255,255,255,.06); border: 1px solid var(--line2); color: var(--text); transition: background .2s, border-color .2s, transform .12s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: rgba(255,255,255,.1); } .btn:active:not(:disabled) { transform: scale(.98); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #14100a; box-shadow: 0 10px 28px -12px rgba(245,185,66,.8); }
.btn.danger { background: rgba(255,93,108,.12); border-color: rgba(255,93,108,.38); color: #ff8b96; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 11px; background: rgba(255,255,255,.05); border: 1px solid var(--line2); outline: none; transition: border-color .2s, box-shadow .2s; }
textarea.input { height: auto; padding: 9px 12px; resize: vertical; }
.input:focus { border-color: rgba(245,185,66,.65); box-shadow: 0 0 0 3px rgba(245,185,66,.14); }
select.input option { background: #14161d; }
label.field { display: block; } label.field > span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }

.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100%; }
.side { padding: 22px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 10px 20px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; color: var(--muted); cursor: pointer; border: 0; background: none; width: 100%; text-align: left; transition: all .2s; }
.nav:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav.on { color: var(--text); background: linear-gradient(90deg, rgba(245,185,66,.18), rgba(245,185,66,.02)); box-shadow: inset 0 0 0 1px rgba(245,185,66,.25); }
.main { padding: 26px 30px 40px; min-width: 0; }
.main h1 { font-size: 23px; font-weight: 650; letter-spacing: -.01em; } .main > .sub { color: var(--muted); margin: 2px 0 20px; }

.tiles { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.tile { padding: 15px 16px; }
.tile .label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.tile .value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; } tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: rgba(255,255,255,.03); }
.badge { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 7px; font-size: 10.5px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.05); white-space: nowrap; }
.badge.ok { color: var(--ok); background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.26); }
.badge.warn { color: var(--warn); background: rgba(245,185,66,.1); border-color: rgba(245,185,66,.28); }
.badge.bad { color: var(--bad); background: rgba(255,93,108,.1); border-color: rgba(255,93,108,.3); }
.badge.info { color: var(--info); background: rgba(92,200,255,.09); border-color: rgba(92,200,255,.26); }
.badge.violet { color: #a9b3ff; background: rgba(124,140,255,.13); border-color: rgba(124,140,255,.3); }
code.key { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; padding: 6px 10px; border-radius: 9px; background: rgba(245,185,66,.08); border: 1px solid rgba(245,185,66,.3); color: #ffe1a0; user-select: all; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 12px; color: var(--muted); }
.notice { padding: 11px 13px; border-radius: 12px; background: rgba(92,200,255,.06); border: 1px solid rgba(92,200,255,.2); color: #b9dff2; font-size: 12.5px; }
.notice.warn { background: rgba(245,185,66,.07); border-color: rgba(245,185,66,.28); color: #f3d596; }
.error { color: #ff8b96; font-size: 12.5px; min-height: 18px; }

#modal:empty { display: none; }
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(4,5,8,.7); backdrop-filter: blur(8px); padding: 20px; }
.dialog { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: linear-gradient(180deg, #171922, #0f1118); border: 1px solid var(--line2); border-radius: 20px; padding: 24px; box-shadow: 0 40px 100px #000; animation: in .25s ease-out; }
.dialog.wide { width: min(880px, 100%); }
.dialog h2 { font-size: 18px; margin-bottom: 6px; } .dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@keyframes in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; width: 360px; }
.toast { padding: 12px 14px; border-radius: 13px; background: #171a24; border: 1px solid var(--line2); box-shadow: 0 20px 50px #000; animation: in .3s ease-out; font-size: 12.5px; }
.toast.ok { border-color: rgba(61,220,151,.4); } .toast.bad { border-color: rgba(255,93,108,.45); }
.chart text { fill: var(--faint); font-size: 9px; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1100px) { .split, .form-grid { grid-template-columns: 1fr; } }
