/* ==========================================================================
   BBMS PROTOTYPE - STYLES
   Design intent: a counter clerk uses this all day on a small office monitor.
   Large hit targets, one decision per screen, colour used only for status.
   ========================================================================== */

:root {
  --ink:        #14171c;
  --ink-2:      #4a525e;
  --ink-3:      #79828f;
  --line:       #dde1e7;
  --line-2:     #eceff3;
  --paper:      #ffffff;
  --canvas:     #f4f6f8;

  --red:        #c8102e;
  --red-dark:   #9a0c23;
  --red-tint:   #fdeef0;

  --green:      #17794c;
  --green-tint: #e8f5ee;
  --amber:      #a35c00;
  --amber-tint: #fdf2e0;
  --blue:       #1f5faa;
  --blue-tint:  #eaf1fa;

  --r:          6px;
  --shadow:     0 1px 2px rgba(20,23,28,.06), 0 4px 14px rgba(20,23,28,.05);
  --mono:       ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--canvas); color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- shell ------------------------------------------------------- */
#app { display: flex; flex-direction: column; min-height: 100vh; }

header.topbar {
  display: flex; align-items: center; gap: 18px;
  background: var(--ink); color: #fff;
  padding: 0 18px; height: 52px; flex: 0 0 52px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .01em; }
.topbar .drop { width: 22px; height: 22px; }
.topbar .brand small { display: block; font-weight: 400; font-size: 11px; color: #a7b0bd; letter-spacing: .04em; text-transform: uppercase; }

nav.stations { display: flex; gap: 2px; margin-left: 12px; height: 100%; }
nav.stations button {
  background: none; border: 0; color: #b7bfca; cursor: pointer;
  padding: 0 16px; height: 100%; font: inherit; font-size: 14px;
  border-bottom: 3px solid transparent; transition: color .12s, border-color .12s;
}
nav.stations button:hover { color: #fff; }
nav.stations button[aria-current="true"] { color: #fff; border-bottom-color: var(--red); font-weight: 600; }
nav.stations button .kbd { font-size: 10px; color: #6b7480; margin-right: 6px; font-family: var(--mono); }

.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: #b7bfca; text-align: right; line-height: 1.25; }
.topbar .who b { display: block; color: #fff; font-weight: 600; }
.topbar .reset {
  background: none; border: 1px solid #3b424d; color: #b7bfca; border-radius: var(--r);
  padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.topbar .reset:hover { border-color: #6b7480; color: #fff; }

main { flex: 1; padding: 22px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- page furniture ---------------------------------------------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.page-head .step {
  font-family: var(--mono); font-size: 12px; color: var(--red);
  background: var(--red-tint); border: 1px solid #f6d3d9;
  padding: 3px 9px; border-radius: 20px; letter-spacing: .06em;
}
.page-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.page-head .spacer { flex: 1; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.card > h2 {
  margin: 0 0 4px; font-size: 15px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2);
}
.card > h2 + .hint { margin-top: 0; margin-bottom: 16px; }
.hint { color: var(--ink-3); font-size: 13px; margin: 6px 0 0; }
.hint.src { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .g2, .g3, .g4, .split { grid-template-columns: 1fr; } }

/* ---------- forms -------------------------------------------------------- */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; letter-spacing: .02em; }
label.f > span .req { color: var(--red); }

input[type=text], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint);
}
input:disabled, select:disabled { background: var(--line-2); color: var(--ink-3); }
textarea { resize: vertical; min-height: 66px; }

.cnic-input {
  font-family: var(--mono); font-size: 26px !important; letter-spacing: .06em;
  padding: 14px 16px !important; text-align: center;
}

/* ---------- buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: var(--r); transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ok:hover { filter: brightness(1.08); }
.btn.big { padding: 14px 26px; font-size: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .kbd { font-family: var(--mono); font-size: 11px; opacity: .6; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row .spacer { flex: 1; }

/* ---------- chips / badges ---------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 20px;
  border: 1px solid; letter-spacing: .02em; white-space: nowrap;
}
.badge.ok    { color: var(--green); background: var(--green-tint); border-color: #bfe3d0; }
.badge.warn  { color: var(--amber); background: var(--amber-tint); border-color: #f0dcb8; }
.badge.bad   { color: var(--red);   background: var(--red-tint);   border-color: #f6d3d9; }
.badge.info  { color: var(--blue);  background: var(--blue-tint);  border-color: #cfe0f3; }
.badge.mute  { color: var(--ink-3); background: var(--line-2);     border-color: var(--line); }

.group-tag {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: var(--red); background: var(--red-tint); border: 1px solid #f6d3d9;
  padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}

/* ---------- tables ------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.pick:hover { background: var(--line-2); cursor: pointer; }
td.mono, .mono { font-family: var(--mono); font-size: 13px; }
.empty { padding: 34px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---------- station picker (home) --------------------------------------- */
/* ---------- flow strip --------------------------------------------------- */
.flowstrip { display: flex; align-items: stretch; gap: 0; margin-bottom: 20px; }
.flowstrip .f {
  flex: 1; background: var(--paper); border: 1px solid var(--line); padding: 12px 16px;
  font-size: 13px; position: relative;
}
.flowstrip .f:first-child { border-radius: var(--r) 0 0 var(--r); }
.flowstrip .f:last-child  { border-radius: 0 var(--r) var(--r) 0; }
.flowstrip .f + .f { border-left: 0; }
.flowstrip .f .n { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em; }
.flowstrip .f .t { font-weight: 600; }
.flowstrip .f.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.flowstrip .f.on .n { color: #9aa3b0; }
.flowstrip .f.done { background: var(--green-tint); border-color: #bfe3d0; }

/* ---------- queue list --------------------------------------------------- */
.queue { display: flex; flex-direction: column; gap: 8px; }
.qrow {
  display: flex; align-items: center; gap: 14px; padding: 13px 15px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.qrow:hover { border-color: var(--red); background: #fffafb; }
.qrow .idx {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
}
.qrow .nm { font-weight: 600; }
.qrow .sub { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); }
.qrow .spacer { flex: 1; }

/* ---------- donor identity banner --------------------------------------- */
.identity {
  display: flex; align-items: center; gap: 20px; padding: 18px 20px;
  border: 1px solid var(--line); border-left: 4px solid var(--ink);
  background: var(--paper); border-radius: var(--r); margin-bottom: 16px; box-shadow: var(--shadow);
}
.identity.ok   { border-left-color: var(--green); }
.identity.warn { border-left-color: var(--amber); }
.identity.bad  { border-left-color: var(--red); }
.identity .nm { font-size: 19px; font-weight: 650; }
.identity .meta { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.identity .meta .mono { color: var(--ink); }
.identity .spacer { flex: 1; }
.identity .stat { text-align: right; }

.alert {
  padding: 14px 16px; border-radius: var(--r); border: 1px solid; font-size: 14px; margin-bottom: 16px;
}
.alert b { display: block; margin-bottom: 3px; }
.alert.bad  { background: var(--red-tint);   border-color: #f6d3d9; color: var(--red-dark); }
.alert.warn { background: var(--amber-tint); border-color: #f0dcb8; color: #7a4500; }
.alert.ok   { background: var(--green-tint); border-color: #bfe3d0; color: #0f5a38; }
.alert.info { background: var(--blue-tint);  border-color: #cfe0f3; color: #17497f; }

/* ---------- UDHQ question ------------------------------------------------ */
.qprogress { display: flex; gap: 3px; margin-bottom: 18px; flex-wrap: wrap; }
.qprogress i {
  width: 100%; max-width: 34px; flex: 1; height: 5px; border-radius: 3px;
  background: var(--line); display: block;
}
.qprogress i.done { background: var(--green); }
.qprogress i.now  { background: var(--ink); }
.qprogress i.defer{ background: var(--red); }

.qbox { padding: 4px 0 0; }
.qbox .qn { font-family: var(--mono); font-size: 12px; color: var(--red); letter-spacing: .08em; margin-bottom: 8px; }
.qbox .qt { font-size: 21px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; letter-spacing: -.01em; }
.qbox .qref { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-bottom: 18px; }

.opts { display: flex; flex-direction: column; gap: 7px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left;
  border: 1px solid var(--line); background: var(--paper); border-radius: var(--r);
  cursor: pointer; font: inherit; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: var(--ink-3); background: #fbfcfd; }
.opt .code { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); flex: 0 0 42px; }
.opt .lab { flex: 1; }
.opt .act { flex: 0 0 auto; }
.opt.sel { border-color: var(--ink); background: var(--line-2); }

/* ---------- vitals ------------------------------------------------------- */
.vital {
  display: grid; grid-template-columns: 150px 130px 1fr auto; gap: 14px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line-2);
}
.vital:last-child { border-bottom: 0; }
.vital .vl { font-weight: 600; font-size: 14px; }
.vital .vl small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11.5px; font-family: var(--mono); }
.vital .vr { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); }
.vital input { text-align: center; font-family: var(--mono); font-size: 16px; }

.checkline { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; }
.checkline input[type=checkbox] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--red); flex: 0 0 auto; }
.checkline label { font-size: 14px; cursor: pointer; }
.checkline label small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }

/* ---------- verdict ------------------------------------------------------ */
.verdict { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.verdict button {
  padding: 18px 14px; border-radius: var(--r); border: 2px solid var(--line);
  background: var(--paper); cursor: pointer; font: inherit; text-align: center;
}
.verdict button b { display: block; font-size: 16px; margin-bottom: 3px; }
.verdict button small { color: var(--ink-3); font-size: 12px; }
.verdict button.a:hover, .verdict button.a.on { border-color: var(--green); background: var(--green-tint); }
.verdict button.t:hover, .verdict button.t.on { border-color: var(--amber); background: var(--amber-tint); }
.verdict button.p:hover, .verdict button.p.on { border-color: var(--red);   background: var(--red-tint); }

/* ---------- stock matrix ------------------------------------------------- */
.matrix { width: 100%; border-collapse: separate; border-spacing: 4px; }
.matrix th { text-align: center; padding: 6px; }
.matrix td { text-align: center; padding: 0; border: 0; }
.matrix td .cell {
  padding: 12px 6px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--paper); font-family: var(--mono); font-size: 18px; font-weight: 700;
}
.matrix td .cell.zero { color: var(--ink-3); background: var(--line-2); font-weight: 400; }
.matrix td .cell.low  { color: var(--amber); background: var(--amber-tint); border-color: #f0dcb8; }
.matrix td .cell.good { color: var(--green); background: var(--green-tint); border-color: #bfe3d0; }
.matrix th.rowh { text-align: right; padding-right: 12px; font-size: 12px; color: var(--ink); }

/* ---------- misc --------------------------------------------------------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-size: 12.5px; }
.kv dd { margin: 0; font-weight: 500; }

.din {
  font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: .1em;
  padding: 14px 18px; background: var(--ink); color: #fff; border-radius: var(--r);
  display: inline-block;
}
.din-parts { display: flex; gap: 18px; margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.din-parts b { display: block; color: var(--ink); font-size: 13px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px;
  font: inherit; font-size: 14px; color: var(--ink-3); cursor: pointer; margin-bottom: -1px;
}
.tabs button[aria-current="true"] { color: var(--ink); border-bottom-color: var(--red); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: var(--r);
  font-size: 14px; box-shadow: 0 6px 26px rgba(0,0,0,.28); z-index: 99;
  animation: rise .2s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

.footnote {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}
.footnote b { color: var(--ink-2); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button {
  border: 0; background: var(--paper); padding: 8px 16px; font: inherit; font-size: 13.5px;
  cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }

.result-r { color: var(--red);   font-weight: 700; }
.result-n { color: var(--green); font-weight: 700; }

/* ==========================================================================
   DASHBOARD
   Dense on purpose: a supervisor should get the whole morning picture without
   scrolling twice. Colour never carries a meaning on its own - every status
   also has a word next to it.
   ========================================================================== */

/* ---------- counter strip ------------------------------------------------ */
.counterbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.counterbar button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 62px; padding: 10px 12px; cursor: pointer; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  font: inherit; color: var(--ink); box-shadow: var(--shadow);
  transition: border-color .12s, box-shadow .12s;
}
.counterbar button:hover  { border-color: var(--red); box-shadow: 0 3px 14px rgba(200,16,46,.13); }
.counterbar button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.counterbar .cb-k { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: .08em; }
.counterbar .cb-t { font-weight: 650; font-size: 15px; }
.counterbar .cb-q { font-size: 12.5px; color: var(--ink-3); }
.counterbar .cb-q b { color: var(--ink-2); }
.counterbar .cb-q.on b { color: var(--red); }
@media (max-width: 980px) { .counterbar { grid-template-columns: repeat(2, 1fr); } }

/* ---------- attention cards ---------------------------------------------- */
.alertgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .alertgrid { grid-template-columns: 1fr; } }
.acard {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--ink-3);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.acard.crit { border-left-color: var(--red);   background: linear-gradient(90deg, var(--red-tint) 0%, var(--paper) 46%); }
.acard.warn { border-left-color: var(--amber); background: linear-gradient(90deg, var(--amber-tint) 0%, var(--paper) 46%); }
.acard .ac-n {
  flex: 0 0 auto; min-width: 46px; font-size: 30px; font-weight: 700; line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.acard.crit .ac-n { color: var(--red); }
.acard.warn .ac-n { color: var(--amber); }
.acard .ac-n small { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .07em; margin-top: 3px; }
.acard .ac-b { flex: 1; min-width: 0; }
.acard .ac-b b { display: block; font-size: 14.5px; }
.acard .ac-b p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.acard .btn { flex: 0 0 auto; }

/* ---------- KPI tiles ----------------------------------------------------- */
.kpigrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1080px) { .kpigrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .kpigrid { grid-template-columns: 1fr; } }
.kpi {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 14px 16px 12px;
}
.kpi .k-lab { font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .07em; }
.kpi .k-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 6px; }
.kpi .k-val { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.kpi .k-val small { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-left: 1px; }
.kpi .spark { flex: 1; min-width: 0; height: 30px; align-self: flex-end; }
.kpi .k-foot { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; font-size: 12px; }
.kpi .k-sub { color: var(--ink-3); }
.kpi .k-delta { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .k-delta.up   { color: var(--green); }
.kpi .k-delta.down { color: var(--red); }
.kpi .k-bar { height: 4px; border-radius: 3px; background: var(--line-2); margin-top: 10px; overflow: hidden; }
.kpi .k-bar span { display: block; height: 100%; background: var(--ink-3); border-radius: 3px; }
.kpi.ok   .k-bar span { background: var(--green); }
.kpi.warn .k-bar span { background: var(--amber); }
.kpi.crit .k-bar span { background: var(--red); }
.kpi.crit { border-color: #f0c6cd; }
.kpi.warn { border-color: #f0dcb6; }

/* ---------- charts -------------------------------------------------------- */
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .ax { font-family: var(--mono); font-size: 9.5px; fill: #79828f; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- horizontal bar lists ------------------------------------------ */
.barlist .bl { display: grid; grid-template-columns: minmax(150px, 1.5fr) 1.5fr 46px;
  align-items: center; gap: 10px; padding: 5px 0; }
.barlist .bl-l { font-size: 13px; line-height: 1.35; color: var(--ink); }
.barlist .bl-t { height: 12px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.barlist .bl-t span { display: block; height: 100%; border-radius: 3px; min-width: 2px; }
.barlist .bl-n { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.barlist .bl-s { font-size: 11px; color: var(--ink-3); margin: -3px 0 5px; }

/* ---------- days of cover -------------------------------------------------- */
.cover { display: grid; grid-template-columns: 78px 1fr 58px 66px 108px;
  align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-2); }
.cover:first-child { border-top: 0; }
.cover .cv-t { position: relative; height: 16px; background: var(--line-2); border-radius: 3px; }
.cover .cv-t .fill { display: block; height: 100%; border-radius: 3px; background: var(--green); min-width: 2px; }
.cover.low  .cv-t .fill { background: var(--amber); }
.cover.crit .cv-t .fill { background: var(--red); }
.cover.over .cv-t .fill { background: var(--blue); }
.cover .cv-t .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; }
.cover .cv-d { font-family: var(--mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.cover .cv-u { font-size: 12px; color: var(--ink-3); text-align: right; }
.cover .cv-s { text-align: right; }
@media (max-width: 820px) { .cover { grid-template-columns: 70px 1fr 52px; } .cover .cv-u, .cover .cv-s { display: none; } }

/* ---------- donut ---------------------------------------------------------- */
.donut-wrap { display: flex; align-items: center; gap: 20px; margin-top: 14px; }
.donut { width: 140px; height: 140px; flex: 0 0 140px; }
.donut .dn-v { font-size: 24px; font-weight: 700; fill: var(--ink); }
.donut .dn-l { font-size: 9px; fill: #79828f; letter-spacing: .1em; text-transform: uppercase; }
.donut-key { flex: 1; font-size: 13px; color: var(--ink-2); }
.donut-key div { padding: 4px 0; }
.donut-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.donut-key b { float: right; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .donut-wrap { flex-direction: column; align-items: stretch; } .donut { align-self: center; } }

/* ---------- stock matrix ---------------------------------------------------- */
table.matrix th, table.matrix td { text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; }
table.matrix td { font-variant-numeric: tabular-nums; }
table.matrix td.zero { color: #c3c9d2; }
table.matrix tr.short { background: var(--red-tint); }
table.matrix tfoot td { border-top: 2px solid var(--line); color: var(--ink-2); }

/* ---------- misc ------------------------------------------------------------ */
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--red);
  text-decoration: underline; cursor: pointer;
}
.linkbtn:hover { color: var(--red-dark); }
.f small.hint { display: block; margin-top: 4px; font-size: 11.5px; }

/* the collection volume band the current draw falls into */
#d-crit tr.on { background: var(--line-2); }

/* ==========================================================================
   KEYBOARD
   ========================================================================== */
.hot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; margin-right: 9px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--canvas);
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  vertical-align: 1px; flex: 0 0 auto;
}
.opt .hot { margin-right: 0; }
.opt.sel .hot { border-color: var(--red); color: var(--red); background: var(--red-tint); }
.verdict button .hot { margin-right: 7px; }

.modal {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 23, 28, .45); padding: 24px;
}
.modal .sheet {
  background: var(--paper); border-radius: var(--r); padding: 24px 26px;
  width: min(560px, 100%); box-shadow: 0 12px 48px rgba(20, 23, 28, .28);
}
.modal .sheet h2 { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.modal .sheet td { padding: 7px 10px 7px 0; }
