:root {
  color-scheme: dark;
  --bg: #0b0e10;
  --rail: #111517;
  --surface: #181d20;
  --surface-2: #20262a;
  --line: #30393d;
  --text: #f4f6f7;
  --muted: #9da8ad;
  --cyan: #21b7d4;
  --gold: #e0a83d;
  --green: #45cf84;
  --red: #ff7777;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.portal { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.brand { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: 48px 1fr; padding: 0 6px 20px; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; }
.brand span { color: var(--muted); font-size: 11px; margin-top: 3px; }
.nav { display: grid; gap: 4px; margin-top: 20px; }
.nav button { background: transparent; border: 0; border-left: 3px solid transparent; border-radius: 4px; color: #abb4b8; cursor: pointer; min-height: 48px; padding: 0 13px; text-align: left; }
.nav button:hover { background: #202629; color: #fff; }
.nav button.active { background: #17343d; border-left-color: var(--cyan); color: #fff; font-weight: 800; }
.rail-foot { border-top: 1px solid var(--line); color: var(--muted); display: grid; gap: 9px; margin-top: auto; padding: 17px 6px 0; }
.rail-foot a { font-size: 12px; text-decoration: none; }
.rail-foot a:hover { color: #fff; }
.main { min-width: 0; }
.topbar { align-items: center; background: rgba(11, 14, 16, .94); border-bottom: 1px solid var(--line); display: flex; gap: 18px; justify-content: space-between; min-height: 76px; padding: 14px clamp(20px, 4vw, 54px); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(16px); }
.topbar h1 { font-size: clamp(20px, 2.2vw, 29px); margin: 0; }
.topbar p { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.content { margin: 0 auto; max-width: 1320px; padding: 28px clamp(20px, 4vw, 54px) 60px; }
.view { display: none; }
.view.active { display: block; }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.section-head { align-items: end; border-bottom: 1px solid var(--line); display: flex; gap: 20px; justify-content: space-between; margin-bottom: 18px; padding-bottom: 16px; }
.section-head h2 { font-size: clamp(24px, 3vw, 38px); margin: 5px 0 0; }
.section-head p { color: var(--muted); line-height: 1.5; margin: 7px 0 0; max-width: 700px; }
.metrics { border: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.metric { background: var(--surface); border-right: 1px solid var(--line); min-height: 104px; padding: 18px; }
.metric:last-child { border-right: 0; }
.metric span { color: var(--muted); display: block; font-size: 12px; }
.metric strong { display: block; font-size: 27px; margin-top: 10px; }
.band { background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.band-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 14px; justify-content: space-between; min-height: 62px; padding: 13px 17px; }
.band-head h3 { font-size: 17px; margin: 0; }
.band-head p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.list { display: grid; }
.row { align-items: center; border-top: 1px solid #2a3236; display: grid; gap: 16px; grid-template-columns: minmax(180px, 1.5fr) repeat(2, minmax(120px, 1fr)) auto; min-height: 70px; padding: 12px 17px; }
.row:first-child { border-top: 0; }
.row:hover { background: #202629; }
.primary { display: block; font-weight: 800; }
.secondary { color: var(--muted); display: block; font-size: 12px; margin-top: 4px; }
.pill { border: 1px solid #536066; border-radius: 999px; color: #c8d0d3; display: inline-flex; font-size: 11px; font-weight: 800; padding: 4px 8px; width: fit-content; }
.pill.good { background: #173526; border-color: #35694c; color: #72dfa3; }
.pill.info { background: #15343d; border-color: #356a76; color: #70d7ea; }
.pill.warn { background: #3c2d17; border-color: #725b31; color: #ffc661; }
.empty { color: var(--muted); padding: 38px 20px; text-align: center; }
.empty strong { color: var(--text); display: block; margin-bottom: 5px; }
.actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.button { align-items: center; background: #1595b0; border: 1px solid #2abbd6; border-radius: 5px; color: #fff; cursor: pointer; display: inline-flex; font-weight: 800; justify-content: center; min-height: 44px; padding: 0 15px; text-decoration: none; }
.button:hover { background: #1aabc8; }
.button.secondary { background: #242b2f; border-color: #4b565b; color: #f4f6f7; margin: 0; }
.button.danger { background: #3a2225; border-color: #744149; color: #ff9aa2; }
.button.small { min-height: 36px; padding: 0 11px; font-size: 12px; }
.split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); }
.note { border-left: 3px solid var(--gold); background: #2b2418; color: #e6c98d; line-height: 1.5; padding: 14px; }
.login-shell { align-items: center; display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.login-panel { background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(260px, 1fr) minmax(330px, .8fr); max-width: 920px; width: 100%; }
.login-copy { background: #111517; border-right: 1px solid var(--line); padding: 42px; }
.login-copy img { height: 58px; width: 58px; object-fit: contain; }
.login-copy h1 { font-size: clamp(29px, 4vw, 48px); line-height: 1.04; margin: 28px 0 16px; }
.login-copy p { color: var(--muted); line-height: 1.6; }
.login-form { align-content: center; display: grid; gap: 15px; padding: 42px; }
.login-form h2 { margin: 0 0 5px; }
.field { display: grid; gap: 7px; }
.field span { color: #bdc6ca; font-size: 12px; font-weight: 800; }
.field input { background: #0f1315; border: 1px solid #465157; border-radius: 4px; color: #fff; min-height: 50px; padding: 0 13px; }
.field input:focus { border-color: var(--cyan); outline: 2px solid rgba(33,183,212,.18); }
.status { color: var(--muted); font-size: 12px; min-height: 18px; }
.status.error { color: var(--red); }
.mobile-title { display: none; }
@media (max-width: 940px) {
  .portal { grid-template-columns: 210px minmax(0,1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric { border-bottom: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .split { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(170px,1.5fr) minmax(120px,1fr) auto; }
  .row > :nth-child(3) { display: none; }
}
@media (max-width: 700px) {
  .portal { display: block; padding-bottom: 78px; }
  .rail { border-right: 0; border-top: 1px solid var(--line); bottom: 0; display: block; height: auto; left: 0; padding: 7px 8px max(7px, env(safe-area-inset-bottom)); position: fixed; right: 0; top: auto; z-index: 20; }
  .brand, .rail-foot { display: none; }
  .nav { display: grid; grid-template-columns: repeat(var(--nav-count, 5), minmax(0,1fr)); gap: 3px; margin: 0; }
  .nav button { border-bottom: 3px solid transparent; border-left: 0; font-size: 10px; min-height: 55px; padding: 6px 3px; text-align: center; }
  .nav button.active { border-bottom-color: var(--cyan); border-left: 0; }
  .topbar { min-height: 64px; padding: 10px 16px; }
  .topbar p { display: none; }
  .topbar h1 { font-size: 19px; }
  .content { padding: 22px 15px 40px; }
  .section-head { align-items: start; display: block; }
  .section-head .actions { margin-top: 14px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric { min-height: 88px; padding: 14px; }
  .metric strong { font-size: 23px; }
  .row { align-items: start; grid-template-columns: 1fr; gap: 7px; padding: 14px; }
  .row > :nth-child(3) { display: block; }
  .login-shell { padding: 0; }
  .login-panel { border: 0; display: block; min-height: 100vh; }
  .login-copy { border-bottom: 1px solid var(--line); border-right: 0; padding: 28px 22px 23px; }
  .login-copy h1 { font-size: 32px; margin: 20px 0 10px; }
  .login-form { padding: 28px 22px 40px; }
}
