/* ==========================================================================
   Blockway ERP — console styles.

   Follows blockway.io: black ground under a slate glow, Poppins, glass panels
   with generous radii, pill controls, and the pink → silver → blue accent used
   as a hairline rather than a fill. The accent appears in exactly two places —
   under the page title and through the stack band on the overview — so it
   keeps meaning "this is Blockway" instead of becoming wallpaper.

   Dark only, as the site is. Colours are tokens so a light theme can be added
   without touching a component.
   ========================================================================== */
:root {
  --bg: #000;
  --slate-1: #384a53;
  --slate-2: #252d41;
  --surface: #0d111b;
  --card: rgba(255, 255, 255, .04);
  --card-hi: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .08);
  --line-hi: rgba(255, 255, 255, .16);

  --ink: #fff;
  --ink-2: #bababa;
  --ink-3: rgba(255, 255, 255, .5);
  --ink-4: rgba(255, 255, 255, .32);

  --pink: #e87abc;
  --silver: #f9f0f2;
  --blue: #477bba;
  --accent: linear-gradient(90deg, #e87abc, #f9f0f2 50%, #477bba);

  /* Series colours for charts: the brand blue and pink stepped into the dark
     lightness band and checked for colour-blind separation (ΔE 8.6 protan). */
  --s-b2b: #5188cc;
  --s-b2c: #cc5a9c;

  /* Status — reserved, always shipped with a label. */
  --good: #34d399;
  --warn: #f5b454;
  --bad: #ff6b81;
  --info: #8fb4e3;

  /* Fleet lifecycle */
  --compute: #5fb3c9;
  --standby: #5188cc;
  --reclaim: #e87abc;
  --void: rgba(255, 255, 255, .07);

  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --font: "Poppins", "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rail: 256px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 300 14px/1.6 var(--font);
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(56, 74, 83, .55), transparent 62%),
    radial-gradient(900px 480px at -10% 110%, rgba(37, 45, 65, .6), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell -- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 26px 18px 20px;
  background: rgba(13, 17, 27, .55);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(24px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; text-decoration: none; }
/* The wordmark from blockway.io, white on the console. Documents use the black
   cut of the same file rather than a CSS invert, which print does not honour. */
.brand-logo { display: block; height: 18px; width: auto; }
.brand span { white-space: nowrap; }
/* In the rail the wordmark takes the full width; the label sits under it. */
.rail .brand { flex-direction: column; align-items: flex-start; gap: 6px; }
.brand span { font-size: 12px; font-weight: 400; color: var(--ink-3); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group {
  margin: 14px 10px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .22em; color: var(--ink-4);
}
.nav-group:first-child { margin-top: 0; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 400; color: var(--ink-2);
  transition: background-color .15s, color .15s;
}
.nav a:hover { background: var(--card-hi); color: var(--ink); }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .92); color: #1c2230; font-weight: 500; }
.nav-n {
  min-width: 22px; padding: 0 7px; border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 600; line-height: 20px;
  background: var(--card-hi); color: var(--ink-2);
}
.nav-n:empty { display: none; }
.nav-n.hot { background: rgba(255, 107, 129, .18); color: var(--bad); }
.nav a[aria-current="page"] .nav-n { background: rgba(28, 34, 48, .12); color: #1c2230; }

.me {
  margin-top: auto; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--card);
  display: grid; gap: 2px; font-size: 13px;
}
.me b { font-weight: 500; }
.me span { color: var(--ink-3); font-size: 12px; }
.me button { justify-self: start; margin-top: 6px; }

.topbar { display: none; }

main.view { padding: 38px clamp(20px, 3.4vw, 56px) 80px; max-width: 1480px; width: 100%; min-width: 0; }

/* ---------------------------------------------------------- page header -- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head h1 {
  margin: 0; font-size: clamp(28px, 3vw, 42px); font-weight: 700;
  letter-spacing: -.025em; line-height: 1.08;
}
.page-head p { margin: 8px 0 0; color: var(--ink-3); max-width: 62ch; }
.page-head .crumb { font-size: 13px; color: var(--ink-3); text-decoration: none; display: inline-block; margin-bottom: 8px; }
.page-head .crumb:hover { color: var(--ink); }
.hairline { height: 1px; margin: 22px 0 28px; background: var(--accent); opacity: .5; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------- controls -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none;
  background: rgba(255, 255, 255, .1); color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
  transition: background-color .15s, transform .15s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: #fff; color: #0a0a0a; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--silver); }
.btn-danger { color: var(--bad); box-shadow: inset 0 0 0 1px rgba(255, 107, 129, .35); background: rgba(255, 107, 129, .08); }
.btn-sm { min-height: 30px; padding: 0 12px; font-size: 12px; }
.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--card-hi); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid var(--line-hi); }
.seg button {
  border: 0; background: transparent; padding: 5px 13px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
}
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: #1c2230; }
.search {
  min-height: 38px; min-width: 240px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-hi); background: rgba(255, 255, 255, .04); color: var(--ink);
}
.search::placeholder { color: var(--ink-4); }

/* ---------------------------------------------------------------- panels -- */
.panel {
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-lg); padding: 24px 26px;
  backdrop-filter: blur(20px);
}
.panel + .panel { margin-top: 18px; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-h h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.panel-h p { margin: 0; color: var(--ink-3); font-size: 13px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-h { padding: 22px 26px 0; }

.grid { display: grid; gap: 18px; align-items: start; }
.grid > * + .panel, .grid > .panel + .panel { margin-top: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.mt { margin-top: 18px; }

/* --------------------------------------------------------------- figures -- */
/* A row of headline figures, set on one strip rather than as separate tiles:
   they are read together ("what came in, what is owed, what is late"). */
.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card);
  overflow: hidden;
}
.fig { padding: 20px 24px; border-right: 1px solid var(--line); min-width: 0; }
.fig:last-child { border-right: 0; }
.fig-k { font-size: 13px; color: var(--ink-3); }
.fig-v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; white-space: nowrap; }
.fig-n { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.fig-n.bad { color: var(--bad); }
.fig-v.bad { color: var(--bad); }
.fig-v small { font-size: 14px; font-weight: 400; color: var(--ink-3); margin-right: 4px; }

/* ------------------------------------------------------ the stack band -- */
/* The overview's one flourish: Blockway's product stack in the order the
   website tells it — reasoning, acting, workforce, coding, classrooms,
   deployment — with what each part earned. The gradient runs through it like
   the thread on the site's "one stack" section. */
.stack { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.stack::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: 31px; height: 1px;
  background: var(--accent); opacity: .7;
}
.stage { position: relative; padding: 0 14px; min-width: 0; }
.stage-dot {
  width: 14px; height: 14px; margin: 24px 0 18px 10px; border-radius: 50%;
  background: #000; box-shadow: 0 0 0 1px var(--line-hi), inset 0 0 0 3px #000, inset 0 0 0 14px var(--silver);
}
.stage.zero .stage-dot { box-shadow: 0 0 0 1px var(--line-hi); }
.stage-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.stage-role { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.stage-v { font-size: 22px; font-weight: 600; margin-top: 12px; letter-spacing: -.02em; white-space: nowrap; }
.stage.zero .stage-v { color: var(--ink-4); font-weight: 400; }
.stage-bar { height: 3px; margin-top: 10px; border-radius: 3px; background: var(--void); overflow: hidden; }
.stage-bar i { display: block; height: 100%; border-radius: 3px; background: var(--silver); }
.stack-rest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05);
  font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .8);
}
.chip b { font-weight: 600; color: var(--ink); }

/* ---------------------------------------------------------------- charts -- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: rgba(255, 255, 255, .06); }
.chart .baseline { stroke: rgba(255, 255, 255, .2); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + g rect, .chart g.col:hover rect { opacity: 1; }
.chart g.col rect { opacity: .92; }
.chart g.col.dim rect { opacity: .35; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px;
  padding: 10px 12px; border-radius: 14px; font-size: 12.5px;
  background: rgba(13, 17, 27, .96); border: 1px solid var(--line-hi);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.tip b { display: block; font-weight: 600; margin-bottom: 4px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); }
.tip div span:last-child { color: var(--ink); }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink-3); font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }

/* bars */
/* One grid for the whole list, rows as `display: contents`, so the label,
   track and value columns line up from row to row. */
.hbars { display: grid; grid-template-columns: minmax(80px, max-content) minmax(0, 1fr) max-content; align-items: center; gap: 12px 14px; }
.hbar { display: contents; }
.hbar-k { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-t { height: 8px; border-radius: 4px; background: var(--void); overflow: hidden; }
.hbar-t i { display: block; height: 100%; border-radius: 4px; background: var(--s-b2b); }
.hbar-v { font-size: 13px; font-weight: 500; text-align: right; white-space: nowrap; }
.hbar-v small { color: var(--ink-3); font-weight: 400; margin-left: 6px; }

/* ----------------------------------------------------------------- lists -- */
.todo { display: grid; }
.todo-i {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.todo-i:last-child { border-bottom: 0; }
.todo-i:hover .todo-t { text-decoration: underline; text-underline-offset: 3px; }
.todo-t { font-weight: 500; }
.todo-d { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-v { font-weight: 500; white-space: nowrap; }
.empty { padding: 28px 0; color: var(--ink-3); text-align: center; }
.empty .btn { margin-top: 12px; }

/* ---------------------------------------------------------------- badges -- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  border: 1px solid var(--line-hi); background: rgba(255, 255, 255, .05); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.b-good { color: var(--good); border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); }
.b-warn { color: var(--warn); border-color: rgba(245, 180, 84, .4); background: rgba(245, 180, 84, .1); }
.b-bad { color: var(--bad); border-color: rgba(255, 107, 129, .4); background: rgba(255, 107, 129, .1); }
.b-info { color: var(--info); border-color: rgba(143, 180, 227, .4); background: rgba(143, 180, 227, .1); }
.b-pink { color: var(--pink); border-color: rgba(232, 122, 188, .4); background: rgba(232, 122, 188, .1); }

/* ---------------------------------------------------------------- tables -- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th {
  text-align: left; padding: 12px 16px; font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.t td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: rgba(255, 255, 255, .035); }
.t .num { text-align: right; white-space: nowrap; }
.t .dim { color: var(--ink-3); }
.t .strong { font-weight: 500; }
.t .sub { display: block; font-size: 12px; color: var(--ink-3); }
.t th:first-child, .t td:first-child { padding-left: 26px; }
.t th:last-child, .t td:last-child { padding-right: 26px; }
.t .bad { color: var(--bad); }

/* ---------------------------------------------------------------- kanban -- */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col { border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255, 255, 255, .025); padding: 16px 12px 12px; min-height: 180px; }
.col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 12px; }
.col-h b { font-weight: 600; }
.col-h span { font-size: 12.5px; color: var(--ink-3); }
.deal {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-md); background: #121826;
  padding: 13px 14px; margin-bottom: 8px; transition: border-color .15s, background-color .15s;
}
.deal:hover { border-color: var(--line-hi); background: #161d2d; }
.deal-t { font-weight: 500; line-height: 1.35; }
.deal-a { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.deal-m { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; }
.deal-m b { font-weight: 600; }
.closed { margin-top: 18px; }

/* -------------------------------------------------------------- key/vals -- */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ milestones -- */
/* Order progress: delivered / invoiced per line. */
.qty-bar { display: grid; gap: 3px; min-width: 110px; font-size: 12px; color: var(--ink-3); }
.ms { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ms:last-child { border-bottom: 0; }
.ms-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.ms.done .ms-dot { box-shadow: none; background: var(--silver); }
.ms.invoiced .ms-dot { box-shadow: none; background: var(--good); }
.ms-n { font-weight: 500; }
.ms-d { font-size: 12.5px; color: var(--ink-3); }
.progress { height: 6px; border-radius: 6px; background: var(--void); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--silver); border-radius: 6px; }

/* --------------------------------------------------------------- invoice -- */
/* The invoice itself is drawn as paper — the one light surface in the app —
   because it is the document a customer receives, and that is what finance
   needs to check before pressing "issue". It prints as-is. */
.paper {
  background: #fbfbfd; color: #1c2230; border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 48px); font-weight: 400;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.paper-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.paper-logo { display: block; height: 22px; width: auto; margin-bottom: 10px; }
.paper-brand span { font-size: 12px; color: #5b6475; display: block; }
.paper-rule { height: 2px; margin: 24px 0; background: linear-gradient(90deg, #e87abc, #d9c9cf 50%, #477bba); border-radius: 2px; }
.paper h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #5b6475; }
.paper .meta { text-align: right; font-size: 13px; }
.paper .meta b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; display: block; color: #1c2230; }
.paper table { width: 100%; border-collapse: collapse; margin-top: 26px; font-size: 13.5px; }
.paper th { text-align: left; font-weight: 500; color: #5b6475; padding: 10px 8px; border-bottom: 1px solid #dfe3ea; }
.paper td { padding: 12px 8px; border-bottom: 1px solid #eef0f4; }
.paper .num { text-align: right; white-space: nowrap; }
.paper .totals { margin-left: auto; margin-top: 18px; width: min(320px, 100%); font-size: 14px; }
.paper .totals div { display: flex; justify-content: space-between; padding: 5px 8px; }
.paper .totals .grand { font-size: 18px; font-weight: 700; border-top: 2px solid #1c2230; margin-top: 6px; padding-top: 10px; }
.paper .foot { margin-top: 30px; font-size: 12px; color: #5b6475; }
/* Signature boxes on quotes (customer acceptance) and delivery notes (sign-off). */
/* Room above each line for a signature and a company chop, as on the PDF. */
.paper .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 12px; padding-top: 110px;
               font-size: 12px; color: #5b6475; break-inside: avoid; }
.paper .sign div { border-top: 1px solid #1c2230; padding-top: 8px; min-height: 64px; }
.paper .block { margin-top: 22px; font-size: 13px; white-space: pre-line; }
.paper .block h3 { margin-bottom: 6px; }
.paper .meta-rows { font-size: 13px; line-height: 1.7; }
.paper .to-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.paper .dim { color: #5b6475; }
.paper .neg { color: #b4233a; }
@media (max-width: 640px) { .paper .to-grid, .paper .sign { grid-template-columns: 1fr; } }
.stamp { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1.5px solid currentColor; }

/* --------------------------------------------------------------- drawer -- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; backdrop-filter: blur(3px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(520px, 100vw);
  display: flex; flex-direction: column;
  background: rgba(13, 17, 27, .97); border-left: 1px solid var(--line-hi);
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .6);
  animation: slide .22s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { display: flex; justify-content: space-between; align-items: center; padding: 24px 26px 8px; }
.drawer-h h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.drawer-b { flex: 1; overflow-y: auto; padding: 12px 26px 24px; }
.drawer-f { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 26px 24px; border-top: 1px solid var(--line); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 400; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 9px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-hi); background: rgba(255, 255, 255, .04); color: var(--ink);
}
.field textarea { min-height: 84px; resize: vertical; }
.field select option { background: #0d111b; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: rgba(255, 255, 255, .45); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; font-size: 13.5px; }
.check input { width: 18px; height: 18px; accent-color: #fff; }
.form-err { color: var(--bad); font-size: 13px; margin: 0 0 12px; }
.lines { display: grid; gap: 10px; margin-bottom: 12px; }
/* One card per line: product and description get the full drawer width (a
   description is the part the customer reads), numbers sit underneath. */
.line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 28px; gap: 8px; align-items: end;
        padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(255, 255, 255, .02); }
.line .l-prod { grid-column: 1 / 4; }
.line .l-desc { grid-column: 1 / -1; }
.line .l-num { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); }
.line .x { align-self: start; }
.line input { min-height: 38px; }
.line .x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 18px; line-height: 38px; }
.gpu-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.gpu-pick label {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-hi); font-size: 12.5px; color: var(--ink-2);
}
.gpu-pick input { accent-color: #fff; }
.gpu-pick label:has(input:checked) { background: rgba(255, 255, 255, .92); color: #1c2230; }

/* ----------------------------------------------------------------- toast -- */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: grid; gap: 8px; }
.toast {
  padding: 12px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: #fff; color: #0a0a0a; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  animation: slide .2s ease both;
}
.toast.err { background: var(--bad); color: #fff; }
.alert { padding: 12px 18px; border-radius: var(--r-md); margin-bottom: 18px; background: rgba(255, 107, 129, .12); border: 1px solid rgba(255, 107, 129, .4); color: #ffc2cc; }

/* ------------------------------------------------------------ fleet rack -- */
.rack { display: grid; gap: 12px; }
.chassis {
  display: grid; grid-template-columns: minmax(210px, 250px) auto minmax(0, 1fr); align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); overflow: hidden;
}
.chassis-id { padding: 16px 20px; border-right: 1px solid var(--line); }
.chassis-name { font-weight: 600; font-size: 15px; }
.chassis-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.chassis-tags { display: flex; gap: 5px; margin-top: 9px; flex-wrap: wrap; }
.slots { display: flex; gap: 4px; padding: 16px 20px; border-right: 1px solid var(--line); align-items: center; }
.slot { width: 15px; height: 48px; border-radius: 4px; background: var(--void); position: relative; overflow: hidden; }
.slot i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0 0 4px 4px; }
.slot-computing i { background: var(--compute); }
.slot-warm_standby i { background: var(--standby); }
.slot-idle_reclaimable i { background: var(--reclaim); opacity: .85; }
.slot-unknown { background: repeating-linear-gradient(135deg, var(--void) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--ink-4); }
.chassis-run { padding: 14px 20px; min-width: 0; font-size: 13px; }
.run { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.run b { font-weight: 500; }
.run em { font-style: normal; color: var(--ink-3); }
.run.flag { color: var(--bad); }
.fleet-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }
.fleet-legend span { display: inline-flex; align-items: center; gap: 7px; }

.ev { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev-bar { border-radius: 4px; background: var(--ink-4); }
.ev-page .ev-bar, .ev-critical .ev-bar { background: var(--bad); }
.ev-warning .ev-bar { background: var(--warn); }
.ev-info .ev-bar { background: var(--info); }
.ev.acked { opacity: .5; }
.ev-t { font-weight: 500; }
.ev-d { font-size: 13px; color: var(--ink-3); margin-top: 2px; max-width: 90ch; }
.ev-m { font-size: 12px; color: var(--ink-4); margin-top: 4px; }

.code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); word-break: break-all; }

/* ------------------------------------------------------------- responsive -- */
@media (max-width: 1180px) {
  .g-main, .g3 { grid-template-columns: minmax(0, 1fr); }
  .stack { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .stack::before { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; height: 100vh;
    transform: translateX(-102%); transition: transform .25s ease; background: rgba(13, 17, 27, .98);
  }
  body.nav-open .rail { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 45; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 30; padding: 12px 16px;
    background: rgba(0, 0, 0, .7); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; }
  main.view { padding: 24px 16px 64px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .chassis { grid-template-columns: minmax(0, 1fr); }
  .chassis-id, .slots { border-right: 0; border-bottom: 1px solid var(--line); }
  .slots { flex-wrap: wrap; }
  .board { grid-template-columns: repeat(4, 240px); }
  .fig { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel { padding: 20px 18px; }
  .t th:first-child, .t td:first-child { padding-left: 18px; }
  .t th:last-child, .t td:last-child { padding-right: 18px; }
  .search { min-width: 0; flex: 1; }
}
@media (max-width: 560px) {
  .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .line { padding: 10px; }
}
/* ------------------------------------------------------------- phones -- */
/* Measured at 390px on 2026-09-27: every list scrolled sideways by 90–430px,
   documents overflowed by up to 93px, and filter chips broke into one character
   per line. On a phone a row becomes a card: the first column is its title, the
   rest are "label … value" lines. Print is unaffected (these are screen-only). */
.m-unit { display: none; }
@media screen and (max-width: 720px) {
  .table-wrap { overflow: visible; }
  .t, .t tbody { display: block; }
  .t thead { display: none; }
  /* Two fields per row, label above value: half the height of one-per-line,
     so a phone screen shows several records rather than two. */
  .t tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px;
                padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .t tbody tr:last-child { border-bottom: 0; }
  .t td, .t td:first-child, .t td:last-child {
    display: block; padding: 0; border: 0; font-size: 13px; text-align: left; min-width: 0;
  }
  .t td::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 1px; }
  .t td .cv { min-width: 0; overflow-wrap: anywhere; }
  .t td.num { text-align: left; }
  .t td:first-child { grid-column: 1 / -1; font-size: 15px; }
  .t td:first-child::before, .t td[data-label=""]::before { display: none; }
  .t td[data-label=""], .t td:has(.code) { grid-column: 1 / -1; }
  .t td:has(> .cv:empty) { display: none; }
  .t .sub { max-width: none; }

  /* Search takes its own row; a long set of status chips scrolls sideways
     inside its pill rather than breaking a word per line. */
  .filters .search[type=search] { flex: 1 0 100%; }
  .filters select.search { flex: 1 1 auto; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { white-space: nowrap; flex: none; }
  .search { min-width: 0; }

  .page-head { gap: 14px; }
  .page-head h1 { font-size: 28px; overflow-wrap: anywhere; }
  .actions .btn { min-height: 36px; padding: 0 14px; font-size: 12.5px; }
  .hairline { margin: 18px 0 20px; }

  /* Two figures per row: the overview's first screen should show the numbers
     side by side, not one per screenful. */
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
  .fig { padding: 14px 16px; border: 0; background: #07090d; }
  .fig-v { font-size: 20px; white-space: normal; overflow-wrap: anywhere; }
  .fig-n { font-size: 11.5px; }
  .fig:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stack .stage-dot { margin: 14px 0 12px 10px; }
  .stage-v { font-size: 18px; margin-top: 8px; }

  .board { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .col { min-height: 0; }

  .panel.flush .panel-h { padding: 18px 18px 0; }
  .panel-h { flex-wrap: wrap; }
  .run { white-space: normal; }
  .hbars { grid-template-columns: minmax(64px, max-content) minmax(0, 1fr) max-content; gap: 10px; }
  .hbar-k { max-width: 110px; }

  .drawer { width: 100vw; border-radius: 0; border-left: 0; }
  .drawer-h, .drawer-b, .drawer-f { padding-left: 18px; padding-right: 18px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { border-radius: var(--r-md); }

  /* Documents: same paper, lines as cards. */
  .paper { padding: 22px 18px; border-radius: var(--r-md); }
  .paper-top { flex-direction: column; gap: 18px; }
  .paper .meta { text-align: left; }
  .paper-logo { height: 18px; }
  .paper table, .paper tbody { display: block; }
  .paper thead { display: none; }
  .paper tbody tr { display: grid; gap: 3px; padding: 12px 0; border-bottom: 1px solid #eef0f4; }
  .paper td { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; font-size: 13px; }
  .paper td::before { content: attr(data-label); color: #5b6475; }
  .paper td:first-child { display: block; font-weight: 500; font-size: 14px; }
  .paper td:first-child::before, .paper td.d-unit { display: none; }
  .paper td:empty { display: none; }
  .paper td.amt { font-weight: 600; }
  .paper .m-unit { display: inline; color: #5b6475; }
  .paper .totals { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- print -- */
@media print {
  body { background: #fff; }
  .rail, .topbar, .page-head .actions, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  main.view { padding: 0; }
  .hairline { display: none; }
  .paper { box-shadow: none; border-radius: 0; padding: 0; }
}

/* Project management: GitHub progress under a milestone, repo list, acceptance */
.field[hidden] { display: none; }
.ms-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ms-gh { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.ms-gh-bar { display: flex; align-items: center; gap: 10px; }
.ms-gh-bar .progress { width: 110px; flex: none; }
.ms-gh .good { color: var(--good); }
.ms-gh .bad, .gh-status .bad { color: var(--bad); }
.ms-issues { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.ms-issues a { color: var(--ink-2); }
.repo-list { list-style: none; margin: 0; padding: 0; }
.repo-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.repo-list li:last-child { border-bottom: 0; }
.gh-status { margin: 0 0 14px; }
@media (max-width: 720px) {
  .ms { grid-template-columns: 22px minmax(0, 1fr); }
  .ms > .badge, .ms-act { grid-column: 2; justify-content: flex-start; }
}
