/* ==========================================================================
   Nasksoft Stock Reconciler - interface styles
   Palette and layout follow the approved dashboard design: deep indigo rail,
   light neutral canvas, white cards, amber/green/violet data accents.
   Single stylesheet on purpose - under CGI every extra file is another
   round trip, and the whole thing is ~14 KB.
   ========================================================================== */

/* The interface commits to one light world - it is an operations console,
   not a reading surface. Declared explicitly so a dark-mode browser cannot
   paint native selects, inputs and scrollbars dark inside the white cards. */
:root { color-scheme: light; }

:root {
  /* Brand */
  --rail:          #2a2f6b;
  --rail-deep:     #21255a;
  --rail-hover:    #363c85;
  --brand:         #3b5bfd;
  --brand-dark:    #2743d6;
  --brand-soft:    #eaefff;

  /* Data accents */
  --amber:         #f2b34b;
  --amber-soft:    #fbe7c6;
  --amber-pale:    #fdf3e2;
  --green:         #2f8659;
  --green-soft:    #dff3e7;
  --violet:        #5b21b6;
  --violet-mid:    #8b5cf6;
  --sky:           #7cc2f7;
  --red:           #d64545;
  --red-soft:      #fdecec;

  /* Neutrals */
  --canvas:        #f5f6fa;
  --card:          #ffffff;
  --line:          #e5e8ef;
  --line-soft:     #eef1f6;
  --ink:           #1b1e2b;
  --ink-2:         #4a5060;
  --muted:         #838a9c;

  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 2px rgba(24,28,50,.05), 0 8px 24px rgba(24,28,50,.05);
  --rail-w:        76px;
  --rail-w-open:   248px;
  --header-h:      68px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ---------- Layout shell ------------------------------------------------ */
.shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar rail ------------------------------------------------ */
/* Collapsed to icons; expands on hover, or is pinned open by the toggle.
   The pinned state is remembered in localStorage (see app.js). */
.rail {
  width: var(--rail-w);
  background: var(--rail);
  color: #c9cdf0;
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  transition: width .18s ease;
  overflow: hidden;
}
.rail:hover, body.rail-pinned .rail { width: var(--rail-w-open); }

.rail-brand {
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px; flex: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.rail-logo { width: 40px; height: 40px; flex: none; }
.rail-word { white-space: nowrap; opacity: 0; transition: opacity .14s ease .04s; }
.rail:hover .rail-word, body.rail-pinned .rail-word { opacity: 1; }
.rail-word b { display: block; color: #fff; font-size: 14px; letter-spacing: .06em; }
.rail-word span { display: block; color: #9aa0d8; font-size: 11px; }

.rail-nav { flex: 1 1 auto; overflow-y: auto; padding: 14px 0 20px; }
.rail-nav::-webkit-scrollbar { width: 0; }

.rail-group { margin-bottom: 6px; }
.rail-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  color: #767db8; padding: 12px 26px 6px; white-space: nowrap;
  opacity: 0; transition: opacity .14s ease;
}
.rail:hover .rail-group-label, body.rail-pinned .rail-group-label { opacity: 1; }

.rail-link {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; margin: 2px 12px;
  border-radius: var(--radius-sm);
  color: #c9cdf0; white-space: nowrap;
}
.rail-link:hover { background: var(--rail-hover); color: #fff; text-decoration: none; }
.rail-link.active { background: #fff; color: var(--rail); font-weight: 650; }
.rail-link.active svg { color: var(--brand); }
.rail-link svg { width: 20px; height: 20px; flex: none; }
.rail-link span { opacity: 0; transition: opacity .14s ease .04s; }
.rail:hover .rail-link span, body.rail-pinned .rail-link span { opacity: 1; }

.rail-foot {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px; color: #767db8; white-space: nowrap;
  opacity: 0; transition: opacity .14s ease;
}
.rail:hover .rail-foot, body.rail-pinned .rail-foot { opacity: 1; }

/* ---------- Main column ------------------------------------------------- */
.main {
  flex: 1 1 auto; min-width: 0;
  margin-left: var(--rail-w);
  transition: margin-left .18s ease;
}
body.rail-pinned .main { margin-left: var(--rail-w-open); }

.topbar {
  height: var(--header-h); background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px; position: sticky; top: 0; z-index: 30;
}
.icon-btn {
  width: 38px; height: 38px; border: 0; background: transparent;
  border-radius: var(--radius-sm); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:hover { background: var(--canvas); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

.search {
  position: relative; flex: 0 1 340px;
}
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 40px;
  border: 1px solid var(--line); border-radius: 22px;
  background: var(--canvas); font: inherit; color: var(--ink);
}
.search input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); background:#fff; }
.search svg { position: absolute; left: 14px; top: 10px; width: 18px; height: 18px; color: var(--muted); }

.topbar-spacer { flex: 1 1 auto; }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { color: var(--brand); font-weight: 500; }
.avatar {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}

.page { padding: 24px 26px 60px; max-width: 1560px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .grow { flex: 1 1 auto; }

/* ---------- Cards ------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 20px;
}
.card-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.card-head h2 { font-size: 15px; }
.card-head .grow { flex: 1 1 auto; }
.card.flush { padding: 0; }
.card.flush .card-head { padding: 18px 22px 0; margin-bottom: 12px; }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.main-side { grid-template-columns: minmax(0,2.05fr) minmax(320px,1fr); }
@media (max-width: 1100px) {
  .grid.cols-2, .grid.main-side { grid-template-columns: 1fr; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; }
}

/* ---------- Stat strip -------------------------------------------------- */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 24px;
  display: flex; gap: 30px; flex: 1 1 auto;
}
.stat-item { text-align: center; min-width: 92px; }
.stat-item .num {
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat-item .lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat-item .num.warn { color: var(--amber); }
.stat-item .num.bad  { color: var(--red); }
.stat-item .num.good { color: var(--green); }
.stat-divider { width: 1px; background: var(--line-soft); }

/* ---------- Coverage grid (channel match density) ----------------------- */
.coverage-row { margin-bottom: 22px; }
.coverage-row:last-child { margin-bottom: 4px; }
.coverage-meta {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px;
}
.coverage-meta strong { font-size: 13px; }
.coverage-meta .muted { font-size: 12px; }
.cells { display: flex; flex-wrap: wrap; gap: 7px; }
.cell {
  width: 26px; height: 26px; border-radius: 7px; background: var(--amber-pale);
}
.cell.on { background: var(--amber); }
.legend { display: flex; gap: 22px; align-items: center; margin-top: 18px;
          padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-2); }
.legend i { width: 16px; height: 16px; border-radius: 5px; display: inline-block;
            vertical-align: -3px; margin-right: 8px; }

/* ---------- Donut ------------------------------------------------------- */
.donut-card {
  background: var(--green); color: #fff; border: 0;
  display: flex; flex-direction: column;
}
.donut-card h2 { color: #fff; }
.donut-wrap { display: flex; justify-content: center; padding: 6px 0 4px; }
.donut { transform: rotate(-90deg); }
.donut .track { stroke: rgba(255,255,255,.28); }
.donut .value { stroke: var(--amber); stroke-linecap: round;
                transition: stroke-dashoffset .6s ease; }
.donut-centre { text-align: center; margin-top: -132px; margin-bottom: 96px; }
.donut-centre .big { font-size: 38px; font-weight: 700; letter-spacing: -.02em; }
.donut-centre .sub { font-size: 13px; opacity: .85; }
.donut-foot {
  display: flex; gap: 12px; margin-top: auto; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.2);
}
.donut-foot div { flex: 1; text-align: center; }
.donut-foot .k { font-size: 11px; opacity: .75; }
.donut-foot .v { font-size: 17px; font-weight: 650; }

/* ---------- Bars -------------------------------------------------------- */
.hbar { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.hbar .name { width: 132px; text-align: right; font-size: 12px; color: var(--ink-2);
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { flex: 1 1 auto; height: 14px; background: var(--line-soft); border-radius: 8px; }
/* display:block matters: .track is not a flex container, so an inline
   span ignores both height and width and the bar never appears. */
.hbar .fill { display: block; height: 100%; border-radius: 8px;
              background: var(--sky); min-width: 4px; }
.hbar .val { width: 54px; font-size: 12px; color: var(--muted);
             font-variant-numeric: tabular-nums; }

.vbars { display: flex; align-items: flex-end; gap: 20px; height: 210px;
         padding: 10px 4px 0; }
.vbar { flex: 1 1 0; display: flex; flex-direction: column;
        align-items: center; height: 100%; justify-content: flex-end; }
.vbar .stack { width: 46px; display: flex; flex-direction: column-reverse;
               border-radius: 6px 6px 0 0; overflow: hidden; }
.vbar .seg { width: 100%; }
.vbar .seg.crit { background: var(--violet); }
.vbar .seg.warn { background: var(--violet-mid); }
.vbar .seg.info { background: var(--sky); }
.vbar .cap { margin-top: 10px; font-size: 11px; color: var(--muted);
             text-align: center; max-width: 78px; }
.chart-legend { display: flex; gap: 20px; justify-content: center; font-size: 12px;
                color: var(--ink-2); margin-bottom: 4px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px;
                  display: inline-block; margin-right: 7px; }

/* ---------- Ranked list ------------------------------------------------- */
.rank { border-top: 1px solid var(--line-soft); padding: 14px 0;
        display: flex; align-items: center; gap: 14px; }
.rank:first-of-type { border-top: 0; }
.rank .who { flex: 1 1 auto; min-width: 0; }
.rank .who b { display: block; font-size: 13px; overflow: hidden;
               text-overflow: ellipsis; white-space: nowrap; }
.rank .who span { font-size: 11.5px; color: var(--muted); }
.rank .qty { text-align: right; }
.rank .qty b { font-size: 17px; font-variant-numeric: tabular-nums; }
.rank .qty span { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------- Tables ------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
         white-space: nowrap; }
th { background: #fafbfd; font-weight: 600; color: var(--ink-2); font-size: 12px;
     position: sticky; top: 0; }
tbody tr:hover { background: #fbfcfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 220px; }

/* ---------- Pills, badges ---------------------------------------------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px;
        font-size: 11px; font-weight: 650; letter-spacing: .01em; }
.pill.COMPLETED, .pill.good, .pill.INFO { background: var(--green-soft); color: #1d6b45; }
.pill.FAILED, .pill.CRITICAL           { background: var(--red-soft);   color: #9c2b2b; }
.pill.RUNNING, .pill.PENDING, .pill.WARNING { background: var(--amber-soft); color: #8a5b12; }
.pill.SKIPPED, .pill.muted             { background: #eceef4;           color: #5b6273; }
.pill.brand                            { background: var(--brand-soft);  color: var(--brand-dark); }

/* ---------- Forms ------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: 12.5px; margin: 0 0 6px; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input[type=search],
select, input[type=file] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; font: inherit; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type=number] { text-align: right; }
.field { margin-bottom: 16px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font: inherit; font-weight: 600;
  padding: 10px 20px; border-radius: var(--radius-sm);
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--canvas); color: var(--ink); }
.btn.green { background: var(--green); }
.btn.green:hover { background: #256d48; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }

/* ---------- Flash messages --------------------------------------------- */
.flashes { margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 10px;
         border: 1px solid; font-size: 13px; }
.flash.success { background: var(--green-soft); border-color: #b9e2cb; color: #1d6b45; }
.flash.error   { background: var(--red-soft);   border-color: #f2c4c4; color: #9c2b2b; }
.flash.warning { background: var(--amber-soft); border-color: #f0d5a4; color: #8a5b12; }
.flash.info    { background: var(--brand-soft); border-color: #c9d5ff; color: var(--brand-dark); }

/* ---------- Misc -------------------------------------------------------- */
.muted { color: var(--muted); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 10px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
code { background: var(--canvas); padding: 2px 6px; border-radius: 5px;
       font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end;
         padding: 14px 22px; font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Login ------------------------------------------------------- */
.login-page { min-height: 100vh; display: grid; place-items: center;
              background: linear-gradient(135deg, var(--rail) 0%, #3a2f78 100%); padding: 24px; }
.login-card { width: 100%; max-width: 396px; background: #fff;
              border-radius: 16px; padding: 34px; box-shadow: 0 24px 60px rgba(10,12,35,.34); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand b { font-size: 15px; letter-spacing: .06em; }
.login-brand span { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: 0; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-foot { text-align: center; margin-top: 20px; font-size: 11.5px; color: rgba(255,255,255,.6); }

/* ---------- Product tree ------------------------------------------------ */
/* Parents expand with a native <details>, so the tree works with no
   JavaScript and stays keyboard-operable. */
.parent-row summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 14px; list-style: none; user-select: none;
}
.parent-row summary::-webkit-details-marker { display: none; }
.parent-row summary:hover { background: #fbfcfe; }
.parent-row summary .grow { flex: 1 1 auto; }
.parent-row summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.tree-mark {
  width: 17px; height: 17px; flex: none; border-radius: 4px;
  border: 1px solid var(--line); background: #fff; position: relative;
}
.tree-mark::before, .tree-mark::after {
  content: ""; position: absolute; background: var(--ink-2);
  left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.tree-mark::before { width: 9px; height: 1.5px; }
.tree-mark::after  { width: 1.5px; height: 9px; }
/* Open: the vertical stroke goes, leaving a minus. */
details[open] .tree-mark::after { display: none; }
details[open] .tree-mark { background: var(--brand-soft); border-color: var(--brand); }

.tree-leaf {
  display: inline-block; width: 17px; height: 17px; margin-right: 10px;
  vertical-align: -4px;
}
.tree-leaf::after {
  content: ""; display: block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--line); margin: 6px auto;
}

table.inner { background: #fbfcfe; }
table.inner td { border-bottom: 1px solid var(--line-soft); padding: 7px 14px 7px 42px; }
table.inner tr:last-child td { border-bottom: 0; }

/* ---------- Print ------------------------------------------------------- */
@media print {
  .rail, .topbar, .btn, .pager { display: none !important; }
  .main { margin-left: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Import progress -------------------------------------------- */
.bar { height: 8px; background: var(--line-soft); border-radius: 5px;
       overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 5px;
            background: var(--brand); transition: width .4s ease; }
.bar-fill.done { background: var(--green); }
.bar-note { font-size: 11px; margin-top: 4px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .bar-fill { transition: none; } }

/* A destructive action should not look like the others. */
.btn.ghost.danger { color: var(--red); border-color: #f0cccc; padding: 6px 12px; }
.btn.ghost.danger:hover { background: var(--red-soft); color: #8f2222; }

/* ---------- Report issue groups ---------------------------------------- */
/* Two rows carry the whole report; the third is deliberately quieter. */
.issue { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0;
         border-top: 1px solid var(--line-soft); text-decoration: none;
         color: inherit; }
.issue:first-of-type { border-top: 0; }
.issue:hover { text-decoration: none; }
.issue:hover .issue-t strong { color: var(--brand); }
.issue-n { font-size: 24px; font-weight: 700; min-width: 76px; text-align: right;
           font-variant-numeric: tabular-nums; color: var(--muted); }
.issue-n.hot { color: var(--red); }
.issue-t { font-size: 13px; line-height: 1.45; padding-top: 4px; }
.issue.quiet .issue-n { font-size: 17px; font-weight: 600; }
.issue.quiet { opacity: .72; }

/* ---------------------------------------------------------------------- */
/* Analytics panels                                                        */
/*                                                                         */
/* Semantic colour is separate from the brand accent: red always means     */
/* "promising stock we do not have", sky always means "stock we are not    */
/* selling". Neither is used decoratively anywhere else on these pages.    */
/* ---------------------------------------------------------------------- */

.chan-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chan-picker .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); font-size: 13px;
  text-decoration: none; transition: border-color .12s, color .12s;
}
.chan-picker .chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chan-picker .chip.on {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}
.chan-picker .chip .n {
  font-variant-numeric: tabular-nums; font-size: 11px; opacity: .7;
  padding-left: 8px; border-left: 1px solid currentColor;
}

.stat-row { margin-bottom: 4px; }
.card.stat { padding: 16px 18px; }
.card.stat .k { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.card.stat .v {
  font-size: 28px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.card.stat .v.good { color: var(--green); }
.card.stat .v.bad  { color: var(--red); }
.card.stat .v.cool { color: #2a72b5; }
.card.stat .s { font-size: 11px; margin-top: 4px; }

p.small, span.small { font-size: 12px; }

/* Two-sided comparison: oversold against under-listed. */
.dir { display: flex; flex-direction: column; gap: 16px; margin: 14px 0 4px; }
.dir-row { display: flex; align-items: center; gap: 14px; }
.dir-row .lab { width: 170px; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.dir-row .lab .muted { font-size: 11px; }
.dir-row .track {
  flex: 1 1 auto; height: 20px; background: var(--line-soft); border-radius: 6px;
}
.dir-row .fill { display: block; height: 100%; border-radius: 6px; min-width: 3px; }
.dir-row .fill.bad  { background: var(--red); }
.dir-row .fill.cool { background: var(--sky); }
.dir-row .val {
  width: 74px; text-align: right; font-weight: 650;
  font-variant-numeric: tabular-nums; font-size: 14px;
}
.val.bad { color: var(--red); } .val.cool { color: #2a72b5; }
td.num.bad { color: var(--red); font-weight: 600; }
td.num.cool { color: #2a72b5; font-weight: 600; }
.note {
  margin-top: 16px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--canvas); font-size: 12.5px; color: var(--ink-2);
}

/* One bar, three parts - proportions readable at a glance. */
.mix {
  display: flex; height: 30px; border-radius: 8px; overflow: hidden;
  margin: 16px 0 18px; background: var(--line-soft);
}
.mix .seg.m { background: var(--violet); }
.mix .seg.n { background: var(--amber); }
.mix .seg.o { background: var(--sky); }
.mix-key { display: flex; flex-direction: column; gap: 10px; }
.mix-key a {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  color: var(--ink-2); text-decoration: none; padding: 4px 0;
}
.mix-key a:hover { color: var(--brand-dark); }
.mix-key i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.mix-key i.m { background: var(--violet); }
.mix-key i.n { background: var(--amber); }
.mix-key i.o { background: var(--sky); }
.mix-key b {
  margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650;
  color: var(--ink);
}
.mix-key span.muted { width: 38px; text-align: right; font-size: 12px; }

/* Distribution of how far out each listing is. */
.hist {
  display: flex; align-items: flex-end; gap: 12px; height: 190px;
  padding: 14px 4px 0;
}
.hist .col { flex: 1; display: flex; flex-direction: column;
             justify-content: flex-end; height: 100%; text-align: center; }
.hist .bar {
  background: linear-gradient(180deg, var(--violet-mid), var(--violet));
  border-radius: 5px 5px 0 0; min-height: 3px; width: 100%;
}
.hist .n { font-size: 11.5px; font-weight: 600; margin-top: 6px;
           font-variant-numeric: tabular-nums; }
.hist .cap { font-size: 11px; color: var(--muted); margin-top: 2px; }

@media (max-width: 900px) {
  .dir-row .lab { width: 120px; }
  .hist { height: 150px; gap: 6px; }
}

/* Combined per-channel accuracy, on the dashboard. */
.acc-totals { display: flex; gap: 28px; padding: 4px 0 12px; }
.acc-totals > div { display: flex; flex-direction: column; }
.acc-totals .k { font-size: 11.5px; color: var(--muted); }
.acc-totals .v { font-size: 25px; font-weight: 700; letter-spacing: -.02em;
                 font-variant-numeric: tabular-nums; line-height: 1.2; }
.acc-totals .v.bad { color: var(--red); } .acc-totals .v.cool { color: #2a72b5; }
.acc-totals .s { font-size: 11px; }

.acc-row {
  display: flex; align-items: center; gap: 14px; padding: 11px 8px;
  border-radius: var(--radius-sm); text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--line-soft);
}
.acc-row:last-of-type { border-bottom: 0; }
.acc-row:hover { background: var(--canvas); }
.acc-row .who { width: 190px; display: flex; flex-direction: column; gap: 2px;
                font-size: 13px; }
.acc-row .who .muted { font-size: 11px; }
.acc-row .rate {
  width: 62px; text-align: right; font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.acc-row .rate.ok  { color: var(--green); }
.acc-row .rate.mid { color: #b07d1a; }
.acc-row .rate.low { color: var(--red); }
.acc-row .units { flex: 1 1 auto; display: flex; flex-direction: column; gap: 5px; }
.acc-row .u { display: flex; align-items: center; gap: 8px; }
.acc-row .u .bar { height: 9px; border-radius: 5px; min-width: 2px; }
.acc-row .u .bar.bad { background: var(--red); }
.acc-row .u .bar.cool { background: var(--sky); }
.acc-row .u b { font-size: 11.5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.acc-row .u b.bad { color: var(--red); } .acc-row .u b.cool { color: #2a72b5; }

/* A stat tile that is also a way into the detail behind it. */
a.card.stat.link { text-decoration: none; color: inherit; display: block;
                   transition: border-color .12s, box-shadow .12s; }
a.card.stat.link:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.card.stat .v.muted-num { color: var(--muted); }
.acc-totals .v.good { color: var(--green); }

/* The headline agreement rate, with the flattering all-listings figure kept
   beside it in small type rather than replacing it. */
.acc-row .rate { display: flex; flex-direction: column; align-items: flex-end;
                 line-height: 1.15; width: 92px; }
.acc-row .rate .sub { font-size: 10px; font-weight: 500; }

/* The three-case account of a channel. Numbering is not decoration: these
   are the order a team works them in, and they sum to the whole file. */
.card.breakdown { padding-bottom: 8px; }
.case {
  display: flex; align-items: center; gap: 14px; padding: 13px 6px;
  border-bottom: 1px solid var(--line-soft); text-decoration: none;
  color: inherit;
}
.case:last-of-type { border-bottom: 0; }
a.case:hover { background: var(--canvas); }
.case .num {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: var(--line-soft);
  color: var(--ink-2);
}
.case.ok .num   { background: var(--green-soft); color: #1d6b45; }
.case.warn .num { background: var(--amber-soft); color: #8a5b12; }
.case .body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px;
              font-size: 13.5px; }
.case .body .muted { font-size: 11.5px; }
.case .count {
  font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; min-width: 86px; text-align: right;
}
.case.ok .count { color: var(--green); }
.case .count.bad { color: var(--red); } .case .count.cool { color: #2a72b5; }
.case.sub { padding-left: 34px; background: linear-gradient(90deg,
            var(--canvas) 0 3px, transparent 3px); }
.case.sub .num { width: 22px; height: 22px; border-radius: 6px;
                 background: transparent; color: var(--muted); font-weight: 600; }
strong.bad { color: var(--red); } strong.cool { color: #2a72b5; }

/* The arithmetic proof that the report accounts for every listing. Stated
   whether it passes or fails - a silent check reassures nobody. */
.balance {
  margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.55; border: 1px solid transparent;
}
.balance.ok  { background: var(--green-soft); border-color: #b9e2cb; color: #1d6b45; }
.balance.bad { background: var(--red-soft);   border-color: #f2c4c4; color: #9c2b2b; }
.acc-totals .v.warn-num { color: #8a5b12; }

/* "N more channels" link at the foot of a capped list. */
.acc-more {
  display: block; padding: 11px 8px; font-size: 12px; color: var(--brand-dark);
  text-decoration: none; border-top: 1px solid var(--line-soft);
}
.acc-more:hover { background: var(--canvas); }

/* Channel picker for installs with many channels. */
.chan-select { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.chan-select label { font-size: 12px; color: var(--muted); }
.chan-select select { width: auto; min-width: 320px; }
.chan-select .muted { font-size: 12px; }

/* SKU lookup: one product's stock beside what each channel is showing. */
.lk-total { display: flex; flex-direction: column; margin-bottom: 12px; }
.lk-total .k { font-size: 12px; color: var(--muted); }
.lk-total .v { font-size: 30px; font-weight: 700; letter-spacing: -.02em;
               font-variant-numeric: tabular-nums; }
table.lk-wh { width: 100%; }
table.lk-wh tr.muted td { color: var(--muted); }
.pill.good { background: var(--green-soft); color: #1d6b45; }
.pill.warn { background: var(--amber-soft); color: #8a5b12; }
.pill.bad  { background: var(--red-soft);   color: #9c2b2b; }
