/* Ops Hub — shared styles. Light system (white canvas, ink text, cobalt
   actions), matching the Armovex partner hub. Loaded by every page. */

:root {
  --canvas: #FFFFFF;
  --soft: #F1F4F7;
  --soft-2: #E8EDF2;
  --ink: #0A1317;
  --ink-2: #1C1E21;
  --steel: #5D6C7B;
  --stone: #8595A4;
  --hair: #DEE3E9;
  --hair-2: #CED0D4;
  --cobalt: #0064E0;
  --cobalt-deep: #0457CB;
  --cobalt-soft: rgba(0, 100, 224, .10);
  --success: #31A24C;
  --success-soft: rgba(49, 162, 76, .12);
  --warning: #F7B928;
  --warning-soft: rgba(247, 185, 40, .22);
  --attention: #F2A918;
  --attention-soft: rgba(242, 169, 24, .18);
  --critical: #E41E3F;
  --critical-soft: rgba(228, 30, 63, .10);
  --violet: #6D28D9;
  --violet-soft: rgba(109, 40, 217, .10);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .06), 0 4px 14px rgba(20, 22, 26, .06);
  --shadow-lg: 0 12px 40px rgba(20, 22, 26, .18);
  --nav-w: 232px;
  --top-h: 56px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--soft); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .92rem; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--steel); }
.faint { color: var(--stone); }
.small { font-size: .8rem; }
.xs { font-size: .72rem; }
.strong { font-weight: 600; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; background: var(--canvas); border-right: 1px solid var(--hair);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 4px; overflow-y: auto; z-index: 10;
}
.nav .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 8px 14px; }
.nav .brand img { height: 46px; width: auto; margin-left: -6px; }
.nav .brand .t { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }
.nav .brand .s { font-size: .68rem; color: var(--steel); text-transform: uppercase; letter-spacing: .08em; }
.nav .group { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); padding: 12px 10px 4px; }
.nav a.item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; font-size: .875rem;
}
.nav a.item:hover { background: var(--soft); text-decoration: none; }
.nav a.item[aria-current="page"] { background: var(--cobalt-soft); color: var(--cobalt-deep); font-weight: 600; }
.nav a.item svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav a.item .badge { margin-left: auto; }
.nav .foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--hair); }
.userchip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; flex: none;
}
.avatar.sm { width: 22px; height: 22px; font-size: .6rem; }
.userchip .n { font-weight: 600; font-size: .82rem; line-height: 1.1; }
.userchip .r { font-size: .7rem; color: var(--steel); text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 9; height: var(--top-h); background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair); display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.topbar h1 { font-size: 1.05rem; }
.topbar .sub { color: var(--steel); font-size: .8rem; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.content { padding: 18px 20px 60px; }
.content.flush { padding: 0; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; left: 0; top: 0; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  .nav.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px 12px 60px; }
}
.scrim { position: fixed; inset: 0; background: rgba(10, 19, 23, .45); z-index: 8; opacity: 0; pointer-events: none; transition: opacity .15s; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ----------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; min-height: 36px;
  border-radius: var(--radius-sm); border: 1px solid var(--hair-2); background: var(--canvas); color: var(--ink);
  font-weight: 600; font-size: .85rem; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover:not(:disabled) { background: var(--soft); border-color: var(--stone); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover:not(:disabled) { filter: brightness(.95); }
.btn.danger { color: var(--critical); border-color: var(--critical); }
.btn.danger:hover:not(:disabled) { background: var(--critical-soft); }
.btn.danger.solid { background: var(--critical); color: #fff; }
.btn.warn { color: #7a4d00; border-color: var(--attention); background: var(--attention-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--steel); }
.btn.ghost:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: .78rem; }
.btn.lg { padding: 12px 20px; min-height: 46px; font-size: .95rem; }
.btn.icon { padding: 0; width: 36px; }
.btn.icon.sm { width: 30px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------- inputs */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .lbl { font-size: .74rem; font-weight: 600; color: var(--steel); letter-spacing: .02em; }
.input, select.input, textarea.input {
  width: 100%; padding: 8px 10px; min-height: 36px; border: 1px solid var(--hair-2); border-radius: var(--radius-sm);
  background: var(--canvas); color: var(--ink); font-size: .875rem;
}
.input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px var(--cobalt-soft); }
.input.sm { min-height: 30px; padding: 4px 8px; font-size: .8rem; }
textarea.input { min-height: 72px; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235D6C7B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input.err { border-color: var(--critical); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-grid .span2 { grid-column: span 2; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--cobalt); }
.search { position: relative; }
.search .input { padding-left: 32px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--stone); fill: none; stroke-width: 2; pointer-events: none; }
.seg { display: inline-flex; border: 1px solid var(--hair-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--canvas); }
.seg button { border: 0; background: transparent; padding: 6px 12px; font-size: .8rem; font-weight: 600; color: var(--steel); min-height: 34px; }
.seg button + button { border-left: 1px solid var(--hair); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg.soft button[aria-pressed="true"] { background: var(--cobalt-soft); color: var(--cobalt-deep); }

/* ------------------------------------------------------------ chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; color: var(--ink); background: var(--soft-2); white-space: nowrap; line-height: 1.5;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.stage-new { background: var(--cobalt-soft); }
.chip.stage-picking { background: var(--attention-soft); }
.chip.stage-packed { background: var(--success-soft); }
.chip.stage-ready { background: var(--violet-soft); }
.chip.stage-shipped { background: var(--soft-2); }
.chip.stage-picked_up, .chip.stage-delivered { background: var(--success-soft); }
.chip.stage-hold { background: var(--warning-soft); }
.chip.stage-cancelled { background: var(--soft-2); color: var(--steel); text-decoration: line-through; }
.chip.method-ship { background: var(--cobalt-soft); }
.chip.method-will_call { background: var(--violet-soft); }
.chip.method-local_delivery { background: var(--success-soft); }
.chip.method-none { background: var(--critical-soft); color: var(--critical); }
.chip.src-qbo { background: #E8F5EC; }
.chip.src-shopify { background: #E6F2E9; }
.chip.src-manual { background: var(--soft-2); }
.chip.warn { background: var(--attention-soft); }
.chip.bad { background: var(--critical-soft); color: var(--critical); }
.chip.good { background: var(--success-soft); }
.chip.info { background: var(--cobalt-soft); }
.chip.hot { background: var(--critical); color: #fff; }
.chip.rush { background: var(--attention); color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--soft-2); color: var(--steel); font-size: .7rem; font-weight: 700;
}
.badge.alert { background: var(--critical); color: #fff; }
.badge.warn { background: var(--attention); color: var(--ink); }
.badge.info { background: var(--cobalt); color: #fff; }

/* ------------------------------------------------------------- cards */
.card { background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20,22,26,.04); }
.card .card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.card .card-b { padding: 14px 16px; }
.card.pad { padding: 16px; }
.panel-title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--steel); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; cursor: default; }
.kpi.link { cursor: pointer; }
.kpi.link:hover { border-color: var(--stone); }
.kpi .l { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); }
.kpi .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi .s { font-size: .74rem; color: var(--steel); }
.kpi.bad .v { color: var(--critical); }
.kpi.warn .v { color: #8a5a00; }
.kpi.good .v { color: #1f7a38; }
.empty { padding: 36px 16px; text-align: center; color: var(--steel); font-size: .88rem; }
.empty strong { display: block; color: var(--ink); font-size: .95rem; margin-bottom: 4px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .84rem; font-weight: 500; }
.banner.good { background: var(--success-soft); }
.banner.warn { background: var(--attention-soft); }
.banner.bad { background: var(--critical-soft); color: var(--critical); }
.banner.info { background: var(--cobalt-soft); }
.banner strong { font-weight: 700; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.t th, table.t td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.t th { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--steel); background: var(--soft); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.t th button { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
table.t th button[aria-sort="ascending"]::after { content: "↑"; }
table.t th button[aria-sort="descending"]::after { content: "↓"; }
table.t tbody tr:hover { background: var(--soft); }
table.t tbody tr.row-link { cursor: pointer; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.selected { background: var(--cobalt-soft); }
table.t .sub { display: block; font-size: .74rem; color: var(--steel); }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 4px; font-size: .8rem; color: var(--steel); }
.skeleton td > span, .skeleton td { position: relative; }
.skel { display: inline-block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--soft-2), var(--soft), var(--soft-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ----------------------------------------------------------- toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar .input { width: auto; min-width: 120px; }
.toolbar .search .input { width: 240px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border: 1px solid var(--hair-2); background: var(--canvas); border-radius: 999px; padding: 4px 11px; font-size: .78rem; font-weight: 600; color: var(--steel);
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px;
}
.pill:hover { border-color: var(--stone); color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill .badge { height: 16px; min-width: 16px; font-size: .64rem; }
.pill[aria-pressed="true"] .badge { background: rgba(255,255,255,.22); color: #fff; }

/* -------------------------------------------------------------- board */
.board { display: flex; gap: 12px; padding: 14px 20px 30px; overflow-x: auto; min-height: calc(100vh - var(--top-h) - 62px); align-items: flex-start; }
.col { flex: 1 1 0; min-width: 250px; max-width: 360px; display: flex; flex-direction: column; background: var(--soft-2); border-radius: var(--radius); max-height: calc(100vh - var(--top-h) - 90px); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--steel); }
.col-h .badge { margin-left: 2px; }
.col-h .sum { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: .72rem; }
.col-b { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 12px; min-height: 80px; }
.col.over .col-b { outline: 2px dashed var(--cobalt); outline-offset: -4px; border-radius: var(--radius); }
.col-b:empty::after { content: "Nothing here"; color: var(--stone); font-size: .8rem; padding: 14px 6px; }
.ocard {
  background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; border-left: 3px solid var(--hair-2); box-shadow: 0 1px 2px rgba(20,22,26,.04);
  transition: box-shadow .12s, transform .12s;
}
.ocard:hover { box-shadow: var(--shadow); border-color: var(--stone); }
.ocard.dragging { opacity: .5; }
.ocard.method-ship { border-left-color: var(--cobalt); }
.ocard.method-will_call { border-left-color: var(--violet); }
.ocard.method-local_delivery { border-left-color: var(--success); }
.ocard.method-none { border-left-color: var(--critical); }
.ocard.late { background: linear-gradient(0deg, var(--critical-soft), var(--critical-soft)), var(--canvas); }
.ocard .top { display: flex; align-items: center; gap: 6px; }
.ocard .ref { font-weight: 700; font-size: .86rem; }
.ocard .age { margin-left: auto; font-size: .72rem; color: var(--steel); white-space: nowrap; }
.ocard .cust { font-size: .84rem; color: var(--ink-2); }
.ocard .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .72rem; color: var(--steel); }
.ocard .meta .warn { color: #8a5a00; font-weight: 600; }
.ocard .meta .bad { color: var(--critical); font-weight: 600; }
.ocard .prog { height: 4px; border-radius: 2px; background: var(--soft-2); overflow: hidden; }
.ocard .prog i { display: block; height: 100%; background: var(--success); }
.ocard .prog i.partial { background: var(--attention); }
.hold-strip { display: flex; align-items: center; gap: 8px; padding: 8px 20px; background: var(--warning-soft); border-bottom: 1px solid var(--hair); overflow-x: auto; }
.hold-strip .lbl { color: #6b4700; }
.hold-chip { flex: none; background: var(--canvas); border: 1px solid var(--hair-2); border-radius: var(--radius-sm); padding: 5px 10px; font-size: .78rem; cursor: pointer; }
.hold-chip b { font-weight: 700; }
.hold-chip span { color: var(--steel); }

/* ------------------------------------------------------------ drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(10,19,23,.4); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .15s; }
.drawer-scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--canvas); z-index: 31;
  transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.show { transform: none; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-scrim, .nav { transition: none; } }
.drawer .d-head { flex: none; padding: 14px 18px 10px; border-bottom: 1px solid var(--hair); display: flex; flex-direction: column; gap: 8px; }
.drawer .d-head .row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer .d-head h2 { font-size: 1.15rem; }
.drawer .d-head .x { margin-left: auto; }
.drawer .d-body { flex: 1; overflow-y: auto; padding: 14px 18px 30px; display: flex; flex-direction: column; gap: 16px; }
.drawer .d-foot { flex: none; padding: 12px 18px; border-top: 1px solid var(--hair); display: flex; flex-wrap: wrap; gap: 8px; background: var(--canvas); }
.section { display: flex; flex-direction: column; gap: 8px; }
.section .sh { display: flex; align-items: center; gap: 8px; }
.section .sh .panel-title { flex: 1; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: .84rem; }
.kv dt { color: var(--steel); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.line-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--canvas); }
.line-row.done { border-color: var(--success); background: var(--success-soft); }
.line-row.nonship { opacity: .6; }
.line-row .info { flex: 1; min-width: 0; }
.line-row .desc { font-size: .85rem; font-weight: 500; }
.line-row .sku { font-size: .72rem; color: var(--steel); display: flex; gap: 8px; flex-wrap: wrap; }
.line-row .bin { font-weight: 700; color: var(--ink); background: var(--soft-2); padding: 0 6px; border-radius: 4px; }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--hair-2); background: var(--canvas); font-size: 1.1rem; line-height: 1; }
.stepper button:hover:not(:disabled) { border-color: var(--stone); background: var(--soft); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper .q { min-width: 58px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: .88rem; }
.stepper .q .short { color: #8a5a00; }
.stepper .q .ok { color: #1f7a38; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.ev { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 6px 0; font-size: .82rem; }
.ev .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--stone); margin: 6px auto 0; }
.ev.stage .dot { background: var(--cobalt); }
.ev.note .dot { background: var(--attention); }
.ev.shipment .dot { background: var(--success); }
.ev.hold .dot, .ev.exception .dot { background: var(--critical); }
.ev .m { color: var(--ink-2); }
.ev .w { font-size: .72rem; color: var(--steel); }
.ev.note .m { background: var(--soft); padding: 6px 10px; border-radius: 6px; white-space: pre-wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hair); }
.tabs button { border: 0; background: transparent; padding: 8px 12px; font-weight: 600; font-size: .82rem; color: var(--steel); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ------------------------------------------------------------ dialog */
dialog.dlg { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); background: var(--canvas); color: var(--ink); }
dialog.dlg.wide { width: min(820px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: rgba(10,19,23,.45); }
dialog.dlg .dl-h { padding: 16px 20px 6px; }
dialog.dlg .dl-h h2 { font-size: 1.05rem; }
dialog.dlg .dl-h p { margin: 4px 0 0; color: var(--steel); font-size: .84rem; }
dialog.dlg .dl-b { padding: 10px 20px; display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow-y: auto; }
dialog.dlg .dl-f { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--hair); }
.dl-err { color: var(--critical); font-size: .82rem; min-height: 1em; }

/* ------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(8px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: .86rem; max-width: min(520px, 92vw); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 60; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--critical); }
.toast.good { background: #1f7a38; }

/* ------------------------------------------------------------ charts */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 120px 1fr 60px; align-items: center; gap: 10px; font-size: .8rem; }
.bar .track { height: 10px; background: var(--soft-2); border-radius: 5px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--cobalt); border-radius: 5px; }
.bar .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar.warn .track i { background: var(--attention); }
.bar.bad .track i { background: var(--critical); }
.bar.good .track i { background: var(--success); }
.bar.muted .track i { background: var(--stone); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .74rem; color: var(--steel); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* -------------------------------------------------------------- misc */
.split { display: grid; grid-template-columns: 1fr 380px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pickup-card { background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.pickup-card .who { font-size: 1.05rem; font-weight: 700; }
.pickup-card.due { border-color: var(--violet); box-shadow: 0 0 0 2px var(--violet-soft); }
.pickup-card .acts { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 4px; }
.pickup-card .acts .btn.primary { grid-column: 1 / -1; }
@media (max-width: 960px) { .topbar h1 { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; } .topbar .actions { overflow-x: auto; } }
.sig-pad { border: 1px dashed var(--hair-2); border-radius: var(--radius-sm); background: var(--soft); touch-action: none; width: 100%; height: 140px; }
.help { font-size: .78rem; color: var(--steel); }
code.k { background: var(--soft-2); padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, Menlo, monospace; font-size: .8em; }
pre.code { background: var(--ink); color: #e8eef4; padding: 12px 14px; border-radius: 8px; font-size: .78rem; overflow-x: auto; margin: 0; }
.dropzone { border: 2px dashed var(--hair-2); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--steel); font-size: .84rem; }
.dropzone.over { border-color: var(--cobalt); background: var(--cobalt-soft); }
kbd { font-family: inherit; font-size: .7rem; border: 1px solid var(--hair-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--steel); background: var(--canvas); }

@media print {
  .nav, .topbar, .drawer, .drawer-scrim, .toast, .toolbar, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .content { padding: 0; }
}
