:root {
  --bg: #0c1014;
  --bg-2: #12181f;
  --panel: #161d26;
  --panel-2: #1b2430;
  --line: rgba(212, 175, 106, 0.14);
  --line-strong: rgba(212, 175, 106, 0.28);
  --gold: #d4af6a;
  --gold-2: #f0d9a0;
  --gold-dim: rgba(212, 175, 106, 0.12);
  --ink: #f4efe6;
  --muted: #9aa3ad;
  --soft: #6d7680;
  --green: #6fbf9a;
  --green-bg: rgba(111, 191, 154, 0.12);
  --red: #e07a6a;
  --red-bg: rgba(224, 122, 106, 0.12);
  --blue: #7aa2c8;
  --blue-bg: rgba(122, 162, 200, 0.12);
  --amber: #e0b15a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --nav: 268px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; height: 100%; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(212, 175, 106, 0.08), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(122, 162, 200, 0.06), transparent 45%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.app { display: flex; min-height: 100vh; }
.nav {
  width: var(--nav); flex: none; background: #0e141b;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.nav-brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; border-bottom: 1px solid var(--line); }
.crest {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, #2a2116, #1a1610);
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  color: var(--gold); font-family: "Instrument Serif", serif; font-size: 22px;
}
.nav-brand h1 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 18px; line-height: 1.15; }
.nav-brand h1 span { color: var(--gold-2); }
.nav-brand p { color: var(--soft); font-size: 11px; margin-top: 2px; }
.nav-sec { padding: 14px 12px 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); font-weight: 600; }
.nav a.item, .nav button.item {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 10px; padding: 9px 10px; border-radius: 10px;
  background: transparent; border: 0; width: calc(100% - 20px);
  text-align: left; color: var(--muted); cursor: pointer; font-size: 13.5px;
}
.nav a.item:hover, .nav button.item:hover { background: var(--gold-dim); color: var(--ink); }
.nav a.item.active { background: var(--gold-dim); color: var(--gold-2); border: 1px solid var(--line); }
.nav-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.who { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.who b { color: var(--ink); }
.main { flex: 1; min-width: 0; padding: 22px 24px 48px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.topbar h2 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 28px; }
.topbar h2 em { font-style: italic; color: var(--gold-2); }
.topbar p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  border: 1px solid var(--line); background: var(--panel);
  padding: 7px 11px; border-radius: 999px; font-size: 12px; color: var(--muted);
}
.chip b { color: var(--ink); font-weight: 600; }
.chip.live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); margin-right: 7px; box-shadow: 0 0 0 4px rgba(111,191,154,0.15);
}
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.card {
  background: linear-gradient(180deg, var(--panel) 0%, #141b23 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: var(--shadow);
  position: relative; overflow: hidden; cursor: pointer; text-align: left; width: 100%; color: inherit;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.card::after {
  content: ""; position: absolute; inset: auto -20% -40% auto; width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(212,175,106,0.09), transparent 70%);
  pointer-events: none;
}
.card .label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); font-weight: 600; }
.card .value { font-family: "Instrument Serif", serif; font-size: 30px; line-height: 1.15; margin: 8px 0 6px; }
.card .value.gold { color: var(--gold-2); }
.card .sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .hint { margin-top: 8px; font-size: 11px; color: var(--gold); }
.delta { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.delta.up { color: var(--green); background: var(--green-bg); }
.delta.down { color: var(--red); background: var(--red-bg); }
.delta.flat { color: var(--blue); background: var(--blue-bg); }
.grid-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: 1.2fr 1fr .9fr; gap: 14px; margin-bottom: 14px; }
.grid-4 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }
.cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.panel h3 {
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.panel h3 em { font-style: normal; color: var(--soft); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 12px; }
.chart-box { position: relative; height: 260px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--soft); font-weight: 600; padding: 0 8px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,.04); }
td.num, th.num { text-align: right; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.bar-wrap { width: 72px; height: 6px; background: #0e141a; border-radius: 99px; display: inline-block; vertical-align: middle; overflow: hidden; }
.bar { height: 100%; background: linear-gradient(90deg, var(--gold), #f3d89a); border-radius: 99px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 118px; flex: 1; }
.pill .k { font-size: 11px; color: var(--soft); text-transform: uppercase; letter-spacing: .08em; }
.pill .v { font-size: 18px; margin-top: 4px; font-weight: 600; }
.pill .v small { font-size: 12px; color: var(--muted); font-weight: 500; }
.alerts { display: grid; gap: 8px; }
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.dot.warn { background: var(--amber); }
.dot.ok { background: var(--green); }
.dot.bad { background: var(--red); }
.alert span { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; }
.ue { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed rgba(212,175,106,.12); }
.ue:last-child { border-bottom: none; }
.ue b { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--gold-2); font-weight: 500; }
.footnote { margin-top: 18px; color: var(--soft); font-size: 12px; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 14px; }
.btn {
  border: 1px solid var(--line-strong); background: var(--gold-dim); color: var(--gold-2);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn.solid { background: var(--gold); color: #1a1610; border-color: var(--gold); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form { display: grid; gap: 12px; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
label.f { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
input, select, textarea {
  background: #0e141a; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { font-family: "Instrument Serif", serif; font-size: 32px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.role-pick button {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 14px; cursor: pointer; text-align: left;
}
.role-pick button.on { border-color: var(--gold); background: var(--gold-dim); }
.role-pick b { display: block; color: var(--gold-2); margin-bottom: 4px; }
.role-pick span { color: var(--muted); font-size: 12px; }
.err { color: var(--red); font-size: 13px; }
.ok { color: var(--green); font-size: 13px; }
.menu-btn { display: none; }
.tile { display: block; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-align: left; width: 100%; color: inherit; }
.tile:hover { border-color: var(--line-strong); }
.tile kbd { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 4px; }
.tile b { display: block; font-family: "Instrument Serif", serif; font-size: 22px; font-weight: 400; }
.tile span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.toast { position: fixed; right: 18px; bottom: 18px; background: #1b2430; border: 1px solid var(--line-strong); padding: 12px 14px; border-radius: 12px; display: none; z-index: 20; }
@media (max-width: 1200px) {
  .kpis, .cols-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-3, .grid-4, .cols-3, .fields { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav { position: fixed; z-index: 10; transform: translateX(-110%); transition: .2s; }
  .nav.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .main { padding: 16px; }
}
.chart-box svg { display: block; }
.hbar { display: grid; grid-template-columns: 110px 1fr 48px; gap: 8px; align-items: center; margin: 7px 0; font-size: 12px; color: var(--muted); }
.hbar .track { height: 8px; background: #0e141a; border-radius: 99px; overflow: hidden; }
.hbar .track div { height: 100%; border-radius: 99px; }
.hbar b { text-align: right; color: var(--ink); font-weight: 600; font-family: "JetBrains Mono", monospace; font-size: 11px; }
.donut-wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; min-height: 180px; }
.legs { display: grid; gap: 6px; }
.leg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.leg i { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }

