:root {
  color-scheme: light;
  --ink: #172a3b;
  --muted: #526577;
  --navy: #192d40;
  --blue: #2157a7;
  --line: #dce4eb;
  --paper: #fff;
  --ground: #f3f6f8;
  --radius: 8px;
  font: 15px/1.45 system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ground);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid #286bca; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 2; top: 8px; left: 8px; background: #fff; padding: 10px; }

.topbar { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; color: #fff; background: var(--navy); }
.brand { display: inline-flex; gap: 7px; align-items: center; font-weight: 720; font-size: 19px; letter-spacing: -.025em; }
.bolt { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 6px; margin-right: 4px; background: #d8e7fb; color: #193656; font-size: 24px; line-height: 1; }
.brand-suffix { color: #aebfd1; font-weight: 550; }
.workspace { display: flex; align-items: center; gap: 10px; color: #deebf5; font-size: 12px; }
.demo-label { padding: 3px 7px; border: 1px solid #839cad; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.shell { display: grid; grid-template-columns: 205px minmax(0, 1fr); min-height: calc(100vh - 62px); }
.sidebar { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: 24px 12px 19px; border-right: 1px solid var(--line); background: var(--paper); }
nav { display: grid; gap: 5px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 5px; color: #425568; font-size: 14px; font-weight: 550; }
nav a:hover, nav a[aria-current="page"] { background: #e9f0f9; color: #17447b; }
nav a[aria-current="page"] { font-weight: 700; }
nav a span { display: inline-block; width: 18px; text-align: center; font-size: 17px; line-height: 1; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 14px 4px 0; border-top: 1px solid var(--line); font-size: 12px; }
.sidebar-footer small { display: block; color: var(--muted); font-size: 11px; }
.avatar { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 50%; background: #e9f0f9; color: #255396; font-size: 11px; font-weight: 750; }

main { width: 100%; max-width: 1550px; padding: 29px clamp(18px, 3vw, 44px) 38px; }
.page-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.04em; }
h2 { font-size: 16px; letter-spacing: -.01em; }
.page-head p, .panel-head p { margin-top: 4px; color: var(--muted); }
.panel-head p { font-size: 13px; }
.range { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
select, input { border: 1px solid #c6d1dc; border-radius: 5px; background: var(--paper); padding: 7px 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.metric, .panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.metric { padding: 14px 16px; }
.metric h2 { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric strong { display: block; margin: 3px 0; font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.change { color: #146547; font-size: 12px; font-weight: 650; }
.comparison { margin-left: 5px; color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 15px; margin-bottom: 15px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; }
.unit { border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; color: var(--muted); font-size: 11px; }
.plot { height: 200px; margin: 0 13px 12px; }
canvas { display: block; width: 100%; height: 100%; }
.queue { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 45px; padding: 6px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.queue:hover { background: #f1f6fc; }
.queue strong { font-weight: 650; }
.queue-arrow { color: var(--muted); }
.pill { display: inline-block; width: max-content; padding: 2px 7px; border-radius: 4px; background: #edf1f5; color: #435569; font-size: 11px; font-weight: 650; white-space: nowrap; }
.pill.good { background: #e5f3ec; color: #165944; }
.pill.warn { background: #fff1d7; color: #755000; }
.pill.info { background: #e8f0fc; color: #244e90; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; white-space: nowrap; }
th, td { padding: 8px 16px; border-top: 1px solid var(--line); }
th { background: #eff3f6; color: #41566a; font-size: 12px; font-weight: 700; }
tr:nth-child(even) td { background: #f9fbfc; }
tbody tr:hover td { background: #f0f6fd; }
td button { padding: 0; border: 0; background: none; color: var(--blue); font-weight: 650; text-align: left; }
td button:hover { text-decoration: underline; }
.list-head { flex-wrap: wrap; }
.search input { max-width: 100%; font-size: 13px; }

dialog { width: min(460px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
dialog::backdrop { background: #14263e7d; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dialog-head button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); font-size: 22px; line-height: 1; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 20px 22px; margin: 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 1020px) {
  .shell { grid-template-columns: 165px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { height: 54px; padding: 0 16px; }
  .shell { display: block; min-height: calc(100vh - 54px); }
  .sidebar { display: block; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  nav { display: flex; width: max-content; gap: 4px; }
  nav a { gap: 5px; padding: 7px 8px; font-size: 13px; }
  .sidebar-footer { display: none; }
  main { padding-top: 20px; }
  .metric { padding: 10px 12px; }
  .plot { height: 177px; }
}
