:root {
  color-scheme: light;
  --bg: #f4f5f7; --surface: #fff; --surface-2: #f7f8fa; --line: #e2e5ea;
  --ink: #16181d; --ink-2: #4b5160; --muted: #6b7180;
  --brand: #1f3864; --brand-ink: #fff; --accent: #2a78d6;
  --series-1: #2a78d6; --track: #eef0f3;
  --input-bg: #fff; --hover: #f2f5fa;
  --ok-bg: #e7f5ec; --ok-ink: #17643a; --err-bg: #fdecec; --err-ink: #a12a2a;
  --st-requested: #6a4fc8; --st-booked: #4b5b78; --st-pi: #b26b00; --st-confirmed: #0e7c6b;
  --st-prod: #1f63b8; --st-delivered: #2b7a2b; --st-cancelled: #8a8f99; --st-piappr: #8a4b9e; --st-prodappr: #0b6f8a;
  --warn-bg: #fff6e0; --warn-ink: #7a5200; --m-ok: #17643a; --m-low: #a35a00; --m-neg: #b42323; --row-low: #fff8ec; --row-neg: #fdf0f0;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121315; --surface: #1a1b1e; --surface-2: #202226; --line: #2e3137;
    --ink: #eceef1; --ink-2: #c0c4cc; --muted: #9298a3;
    --brand: #22324f; --accent: #5598e7; --series-1: #3987e5; --track: #262a30;
    --input-bg: #15161a; --hover: #23262c;
    --ok-bg: #133222; --ok-ink: #8fdcaa; --err-bg: #3a1717; --err-ink: #f2a3a3;
    --st-requested: #a796ee; --st-booked: #9fb0cc; --st-pi: #e7a440; --st-confirmed: #4cc7b2;
    --st-prod: #6aa8f0; --st-delivered: #78c878; --st-cancelled: #9aa0aa; --st-piappr: #d39be6; --st-prodappr: #5cc3dd;
    --warn-bg: #3a2e12; --warn-ink: #f3cf7c; --m-ok: #8fdcaa; --m-low: #f0b45c; --m-neg: #f29a9a; --row-low: #2c2516; --row-neg: #2f1a1a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 18px 0 10px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 0; }
.mt0 { margin-top: 4px; } .mt { margin-top: 12px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* top bar */
.topbar { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 54px; }
.brand { color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand.big { color: var(--ink); font-size: 20px; }
.logo { color: #7fb2ff; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { color: #d9e2f3; padding: 6px 10px; border-radius: 6px; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav .who { margin-left: auto; color: #b8c6e0; font-size: 12px; padding: 0 8px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 54px; left: 0; right: 0; background: var(--brand); flex-direction: column; align-items: stretch; padding: 8px 16px 14px; }
  body.nav-open .nav { display: flex; }
  .nav .who { margin: 6px 0 0; padding: 6px 10px; }
}

/* cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.head-row .actions { margin: 0; }
.cols { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.cols .grow { flex: 1 1 560px; min-width: 0; } .cols .side { flex: 0 1 360px; }
.grid2, .grid3 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
.foot { color: var(--muted); font-size: 12px; padding: 20px 16px 30px; }

/* forms */
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.form label.check, .form label.radio { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--input-bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[readonly], input[disabled] { background: var(--surface-2); color: var(--ink-2); }
input.b, select.b { font-weight: 700; }
textarea { resize: vertical; }
.form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 220px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 7px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: #b42323; border-color: #b42323; }
.btn.block { width: 100%; margin-top: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; background: var(--ok-bg); color: var(--ok-ink); }
.flash.err { background: var(--err-bg); color: var(--err-ink); }
.note { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; margin: 0 0 10px; font-size: 12.5px; color: var(--ink-2); }
.hp { position: absolute; left: -9999px; }

/* tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.items thead th, .list thead th { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.r { text-align: right; }
td.calc { color: var(--ink-2); background: var(--surface-2); }
tfoot td { border-bottom: 0; background: var(--surface-2); }
.items.edit input, .items.edit select { width: 100%; padding: 6px 7px; }
.items.edit input.wide { min-width: 180px; }
.items.edit td { padding: 4px; min-width: 70px; }
.items.edit td.sl { min-width: 30px; text-align: center; color: var(--muted); }
.items.edit td:last-child { min-width: 30px; }
.items input.price { width: 110px; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 6px; }
.x:hover { color: #b42323; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--hover); }
tr.dim td { opacity: .55; }
.empty { color: var(--muted); text-align: center; padding: 18px; }
.tag { font-size: 10.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--ink-2); }
.pager { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.pager a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; }
.pager a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; }
.filters .inl { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.search { display: flex; gap: 6px; }

/* status badges (always text + color, never color alone) */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; border: 1px solid currentColor; background: var(--surface); }
.st-requested { color: var(--st-requested); } .st-booked { color: var(--st-booked); } .st-pi-issued { color: var(--st-pi); }
.st-confirmed { color: var(--st-confirmed); } .st-pi-approval { color: var(--st-piappr); } .st-production-approved { color: var(--st-prodappr); } .st-in-production { color: var(--st-prod); } .st-delivered { color: var(--st-delivered); } .st-cancelled { color: var(--st-cancelled); }

/* order view */
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; margin: 0; }
.meta dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.meta dd { margin: 2px 0 0; }
.notes { margin: 12px 0 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; color: var(--ink); }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.k-l { font-size: 12px; color: var(--muted); }
.k-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.k-s { font-size: 12px; color: var(--ink-2); }
.pipeline { display: grid; grid-template-columns: repeat(9, minmax(0,1fr)); gap: 8px; }
@media (max-width: 1150px) { .pipeline { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 520px) { .pipeline { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.stage { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); border-top: 3px solid currentColor; }
.stage:hover { text-decoration: none; background: var(--hover); }
.stage-n { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stage-l { font-size: 12px; font-weight: 600; line-height: 1.25; }
.grid-dash { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.grid-dash .card { margin: 0; }
@media (max-width: 900px) { .grid-dash { grid-template-columns: 1fr; } }
.pa + .pa { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.count { background: var(--brand); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.pa-list { list-style: none; padding: 0; margin: 6px 0 0; }
.pa-list li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pa-list li:last-child { border-bottom: 0; }
.due { font-size: 12px; color: var(--ink-2); }
.due.late { color: var(--err-ink); font-weight: 600; }

/* charts: one series = one color (series-1); thin bars, rounded data end, recessive track */
.cols-chart { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; height: 190px; align-items: end; padding-top: 6px; border-bottom: 1px solid var(--line); }
.cc { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; cursor: default; }
.cc-bar { width: 100%; max-width: 34px; height: 150px; display: flex; align-items: flex-end; }
.cc-bar > span { display: block; width: 100%; background: var(--series-1); border-radius: 4px 4px 0 0; position: relative; }
.cc:hover .cc-bar > span { filter: brightness(1.15); }
.cc-v { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 3px; font-style: normal; font-size: 11px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-l { font-size: 11px; color: var(--muted); margin-top: 4px; margin-bottom: -22px; }
.cols-chart { margin-bottom: 26px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 10px; align-items: center; cursor: default; padding: 2px 0; }
.hb-l { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 12px; background: var(--track); border-radius: 0 4px 4px 0; overflow: hidden; }
.hb-f { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hb:hover .hb-f { filter: brightness(1.15); }
.hb-v { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.tip { position: fixed; z-index: 50; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 6px; font-size: 12px; pointer-events: none; max-width: 280px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }

/* share link */
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.linkbox input { flex: 1 1 360px; font-family: ui-monospace, monospace; font-size: 12.5px; }
.done .big { font-size: 22px; }

/* auth & install */
body.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 100%; max-width: 400px; }
.auth-card.wide { max-width: 720px; }
.auth-card .form { display: flex; flex-direction: column; gap: 12px; }
.auth-card h2 { margin-top: 10px; }
.demo-box { margin-top: 18px; font-size: 12.5px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.demo-box ul { margin: 6px 0; padding-left: 18px; }

/* proforma invoice document */
body.doc { background: var(--bg); }
.doc-bar { max-width: 1100px; margin: 0 auto; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.sheet { background: #fff; color: #111; max-width: 1100px; margin: 0 auto 30px; padding: 32px 36px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; }
.sheet th, .sheet td { border: 1px solid #c9ccd2; padding: 5px 7px; }
.sheet th { color: #333; background: #f1f3f6; }
.pi-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #1f3864; padding-bottom: 12px; margin-bottom: 14px; gap: 16px; }
.pi-co { font-size: 18px; font-weight: 700; color: #1f3864; }
.pi-title { font-size: 22px; font-weight: 800; color: #1f3864; letter-spacing: .04em; }
.pre { white-space: pre-line; }
.pi-meta { margin-bottom: 14px; }
.pi-meta th { width: 15%; text-transform: none; font-size: 12px; letter-spacing: 0; }
.pi-items thead th { background: #1f3864; color: #fff; text-transform: none; letter-spacing: 0; font-size: 11.5px; white-space: normal; }
.pi-items tfoot td { background: #d9e2f3; }
.grand { text-align: right; font-size: 15px; color: #1f3864; margin: 12px 0; }
.pi-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 10px; }
.pi-foot h3 { font-size: 12.5px; margin-bottom: 6px; color: #1f3864; }
.pi-foot ul { margin: 0; padding-left: 16px; }
.kv th { width: 34%; text-transform: none; letter-spacing: 0; }
.sign { display: flex; justify-content: space-between; margin: 56px 0 18px; }
.sign div { border-top: 1px solid #333; padding-top: 6px; width: 40%; font-weight: 600; }
@media (max-width: 700px) { .sheet { padding: 16px; overflow-x: auto; } .pi-foot { grid-template-columns: 1fr; } }
@media print {
  .no-print { display: none !important; }
  body, body.doc { background: #fff; }
  .sheet { border: 0; margin: 0; padding: 0; max-width: none; font-size: 10.5px; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* costing & approvals */
.flash.warn { background: var(--warn-bg); color: var(--warn-ink); }
.flash.small, p.flash { font-size: 12.5px; }
.m-ok { color: var(--m-ok); } .m-low { color: var(--m-low); font-weight: 600; } .m-neg { color: var(--m-neg); font-weight: 600; }
tr.row-m-low td { background: var(--row-low); } tr.row-m-neg td { background: var(--row-neg); }
.tag.sample { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; font-weight: 600; }
.approve { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.approve h3 { font-size: 14px; margin-bottom: 6px; }
.kpis.inner { margin: 4px 0 10px; }
.kpis.inner .kpi { background: var(--surface-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 12.5px; background: var(--surface-2); }
.list .c { text-align: center; } th.grp { border-bottom: 1px solid var(--line); }
tr.tot td { background: var(--surface-2); }
.nowrap { white-space: nowrap; } .wrapcell { min-width: 220px; }
.mats .price-in { width: 110px; } .mats select { padding: 6px; }
label.check.sm { font-size: 12px; margin: 0; }
.costbox table td:first-child { white-space: nowrap; }
.draft { background: #fff3cd; color: #7a5200; border: 1px solid #f0d58a; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-weight: 700; }
#rlines select.mat { min-width: 260px; } #rlines select.basis { min-width: 170px; } #rlines .rq { width: 110px; }
.inline-row { display: flex; gap: 6px; } .inline-row input { width: 90px; }
.review { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
#approve .sp { width: 120px; }

/* QR code (top-right corner) */
.qrbox { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qrbox svg { display: block; background: #fff; border-radius: 4px; }
.qrbox figcaption { font-size: 10px; color: var(--muted); white-space: nowrap; }
.card.has-qr { position: relative; }
.card.has-qr .meta { padding-right: 130px; min-height: 120px; }
.qr-corner { position: absolute; top: 12px; right: 14px; }
@media (max-width: 600px) {
  .qr-corner svg { width: 76px; height: 76px; }
  .card.has-qr .meta { padding-right: 92px; }
}
.pi-right { display: flex; align-items: flex-start; gap: 16px; }
.pi-right .pi-title { padding-top: 4px; }
.sheet .qrbox figcaption { color: #555; }
@media print { .qrbox svg { width: 26mm; height: 26mm; } }

/* inventory */
.alarm-card { border-color: var(--m-neg); background: var(--row-neg); }
.alarm-card h2 { color: var(--m-neg); }
.alarm-list { margin: 0; padding-left: 18px; } .alarm-list li { margin: 4px 0; }
a.alarm-banner { display: block; text-decoration: none; } a.alarm-banner:hover { filter: brightness(.97); }
.k-v.small-v { font-size: 15px; padding: 8px 0 6px; }
.grp-row td { background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding-top: 10px; }
tr.inv-alarm td { background: var(--row-low); } tr.inv-out td { background: var(--row-neg); }
.barcell { min-width: 150px; white-space: nowrap; }
.sbar { display: inline-block; position: relative; width: 100px; height: 10px; background: var(--track); border-radius: 0 4px 4px 0; vertical-align: middle; }
.sbar > span { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
tr.inv-alarm .sbar > span, tr.inv-out .sbar > span { background: var(--m-neg); }
.sbar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); }
.spct { font-size: 12px; margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.chip-st { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid currentColor; }
.st-ok { color: var(--m-ok); } .st-alarm { color: var(--m-low); } .st-out { color: var(--m-neg); } .st-nolevel { color: var(--muted); }
.sm-in { width: 90px; padding: 5px 7px; }
.tabs { display: flex; gap: 4px; margin: 6px 0 12px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); }
.tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.stockbox { grid-column: 1 / -1; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.stockbox.warn { background: var(--warn-bg); color: var(--warn-ink); } .stockbox.bad { background: var(--err-bg); color: var(--err-ink); }
.span3 { grid-column: 1 / -1; }
.mv { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 4px; }
.mv-in { color: var(--m-ok); background: var(--ok-bg); } .mv-out { color: var(--ink-2); background: var(--surface-2); } .mv-adjust { color: var(--warn-ink); background: var(--warn-bg); }
.inv td:first-child { min-width: 200px; }
.inv th, .inv td { padding-left: 6px; padding-right: 6px; }
.inv .sbar { width: 70px; } .inv .barcell { min-width: 120px; }
.inv td:last-child { white-space: nowrap; }

/* dashboard sheet tiles */
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.module { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); }
.module:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.module.m-orders { border-top-color: #2a78d6; } .module.m-pi { border-top-color: #b26b00; } .module.m-cost { border-top-color: #8a4b9e; } .module.m-inv { border-top-color: #0e7c6b; }
.mod-t { font-size: 16px; font-weight: 700; } .mod-d { font-size: 12.5px; color: var(--muted); }
.mod-n { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; } .mod-n b { font-size: 20px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.mod-go { font-size: 12.5px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }

/* delivery challan */
.module.m-dc { border-top-color: #6b5b2e; }
.st-ch-issued { color: var(--st-pi); } .st-ch-received { color: var(--st-delivered); }
.dprog { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; margin: 2px 0 12px; }
.dprog span { display: block; height: 100%; background: var(--st-delivered); }
.dc-sub { font-size: 11.5px; color: #666; text-align: right; }
.dc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 4px 0 14px; }
.dc-grid h3 { font-size: 12.5px; color: #1f3864; margin-bottom: 4px; } .dc-grid p { margin: 0; }
.dc-pack { margin: 10px 0 6px; } .dc-note { font-size: 11.5px; color: #555; margin: 8px 0; }
.dc-recv { color: #17643a; font-weight: 600; }
.sign.four { gap: 18px; } .sign.four div { width: 24%; font-size: 12px; } .sign small { font-weight: 400; color: #666; }
.powered { text-align: center; font-size: 10.5px; color: #888; margin: 18px 0 0; }
.dc-actions { display: flex; flex-direction: column; gap: 10px; }
.dc-actions input { min-width: 220px; }
.doc-bar { gap: 10px; } .doc-bar .grow { flex: 1; } .doc-flash { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
@media (max-width: 700px) { .dc-grid { grid-template-columns: 1fr; } .sign.four { flex-wrap: wrap; } .sign.four div { width: 46%; } }
/* developer credit */
.foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.credit { color: var(--muted); font-size: 12px; } .credit a { color: var(--ink-2); font-weight: 600; }
.auth-credit { text-align: center; margin: 16px 0 0; }

/* ---------- v1.3: Sample sheet ---------- */
:root { --sst-req: #6a4fc8; --sst-dev: #1f63b8; --sst-ready: #0b6f8a; --sst-sent: #b26b00; --sst-rev: #a35a00; --sst-ok: #2b7a2b; --sst-rej: #b42323; --sst-can: #8a8f99;
        --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; }
@media (prefers-color-scheme: dark) {
  :root { --sst-req: #a796ee; --sst-dev: #6aa8f0; --sst-ready: #5cc3dd; --sst-sent: #e7a440; --sst-rev: #f0b45c; --sst-ok: #78c878; --sst-rej: #f29a9a; --sst-can: #9aa0aa;
          --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; }
}
.sst-requested { color: var(--sst-req); } .sst-in-development { color: var(--sst-dev); } .sst-ready { color: var(--sst-ready); } .sst-dispatched { color: var(--sst-sent); }
.sst-revision-needed { color: var(--sst-rev); } .sst-approved { color: var(--sst-ok); } .sst-rejected { color: var(--sst-rej); } .sst-cancelled { color: var(--sst-can); }
.pipeline.samples-pipe { grid-template-columns: repeat(8, minmax(0,1fr)); }
@media (max-width: 1150px) { .pipeline.samples-pipe { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 520px) { .pipeline.samples-pipe { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.note.warn { background: var(--warn-bg); border-left-color: var(--m-low); color: var(--warn-ink); }
.module.m-smp { border-top-color: #c2410c; } .module.m-pnl { border-top-color: #17643a; }
tr.sel td { background: var(--hover); }

/* ---------- v1.3: P&L ---------- */
.presets { display: flex; gap: 4px; flex-wrap: wrap; width: 100%; }
.presets a { padding: 4px 11px; border: 1px solid var(--line); border-radius: 99px; font-size: 12.5px; color: var(--ink); background: var(--surface); }
.presets a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.presets a:hover { text-decoration: none; background: var(--hover); }
.presets a.on:hover { background: var(--brand); }
.pnl-chart { overflow-x: auto; }
.pnl-chart svg { width: 100%; height: auto; max-height: 300px; display: block; }
.pc-grid { stroke: var(--line); stroke-width: 1; }
.pc-zero { stroke: var(--ink-2); stroke-width: 1; }
.pc-gl { fill: var(--muted); font-size: 10.5px; }
.pc-l { fill: var(--muted); font-size: 11px; }
.pc-hit { fill: transparent; }
.pc-b:hover rect:not(.pc-hit) { filter: brightness(1.12); }
.pc-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.pc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.pnl-stmt td:first-child { white-space: nowrap; }
.pnl-stmt tr.pl-key td { font-weight: 600; background: var(--surface-2); }
.pnl-stmt tr.pl-sub td { font-weight: 600; border-top: 1px solid var(--ink-2); }
.pnl-stmt tr.pl-sub2 td { font-weight: 600; }
.pnl-stmt tr.pl-net td { border-top: 2px solid var(--ink-2); font-size: 14.5px; }
.pnl-stmt tr.pl-opex td:first-child { padding-left: 22px; }
.pnl-stmt tr.pl-pct td { font-size: 12px; border-bottom: 0; }
@media print { .pnl-chart svg { max-height: 220px; } .grid-dash { grid-template-columns: 1fr 1fr; } }
.pnl-tbl td.num, .pnl-stmt td.num { white-space: nowrap; }
.grid-dash > * { min-width: 0; }
