/* LPM Stocks */
@font-face { font-family: 'Archivo'; font-weight: 400; font-display: swap; src: url('../fonts/archivo-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 500; font-display: swap; src: url('../fonts/archivo-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 600; font-display: swap; src: url('../fonts/archivo-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 700; font-display: swap; src: url('../fonts/archivo-latin-700-normal.woff2') format('woff2'); }

:root {
  --paper: #F3F5F9;
  --surface: #FFFFFF;
  --ink: #1B2A3A;
  --muted: #5D6B79;
  --line: #D8DFE3;
  --line-soft: #E9EEF0;
  --accent: #1F5FAE;
  --accent-ink: #174A88;
  --accent-soft: #E6EEF9;
  --warn: #9A5A00;
  --warn-soft: #FFF2DC;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --radius: 6px;
  --font: 'Archivo', 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { accent-color: var(--accent); margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--font); }
a { color: var(--accent); }
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 32px 0 6px; }
h3 { font-size: 16px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__in { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; min-height: 60px; }
.brand { display: inline-flex; align-items: stretch; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 18px; }
.brand__mark { background: var(--accent); color: #fff; padding: 3px 7px; border-radius: 4px 0 0 4px; letter-spacing: 0.04em; }
.brand__name { border: 2px solid var(--accent); border-left: 0; padding: 1px 8px; border-radius: 0 4px 4px 0; }
.brand--big { font-size: 26px; margin-bottom: 8px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-toggle { display: none; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer; }
.nav-toggle span:first-child { font-size: 20px; line-height: 1; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 18px 10px 16px; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a.is-on { color: var(--ink); border-bottom-color: var(--accent); }
/* naye menu ke baad bhi naam ek line me: medium screen par thoda chhota */
@media (min-width: 641px) {
  .nav { flex-wrap: wrap; }
  .nav a { white-space: nowrap; }
}
@media (min-width: 641px) {
  .nav { gap: 0; }
  .nav a { padding: 18px 7px 16px; font-size: 14px; }
}
@media (min-width: 641px) and (max-width: 1180px) {
  .nav a { padding: 14px 5px 12px; font-size: 13px; }
}
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; text-align: center; }
.logout { color: var(--muted); font-size: 14px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 20px 60px; }

/* ---------- page head ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head p { margin: 0; max-width: 70ch; }
.head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { font: 500 14px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #B9C4CA; background: #FAFBFB; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #92190F; border-color: #92190F; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--sm { padding: 7px 11px; font-size: 13px; }
.btn--lg { padding: 13px 22px; font-size: 15px; }
.btn--block { width: 100%; }
.icon { font: 500 13px var(--font); background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.icon:hover { background: var(--accent-soft); }
.icon--danger { color: var(--danger); }
.icon--danger:hover { background: var(--danger-soft); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
input, select { font: 400 14px var(--font); color: var(--ink); }
.search { flex: 1 1 280px; }
.search input, .select select, .field input, .field select, .src__map input, .src__map select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.search input { padding-left: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235D6B79' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 11px center; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 8px; background: var(--ink); color: #fff; border-radius: var(--radius); }
.bulkbar .btn--ghost { color: #fff; }
.bulkbar .btn--ghost:hover { background: rgba(255, 255, 255, .1); }

/* ---------- table ---------- */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.grid th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); background: #F7F9F9; padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: #F8FAFA; }
.grid tr.is-sel td { background: var(--accent-soft); }
.grid tr.is-skip td { opacity: .45; }
.grid td.none { text-align: center; color: var(--muted); padding: 28px; }
.c-check { width: 40px; text-align: center !important; }
.c-sr { width: 76px; color: var(--muted); }
.c-hsn { width: 210px; }
.c-src { width: 180px; color: var(--muted); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-act { width: 120px; text-align: right; white-space: nowrap; }
.c-item { min-width: 220px; }
.grid--tight td, .grid--tight th { padding: 7px 10px; }
.grid--tight th { position: static; }

/* HSN stamp: the one place the design speaks up */
.hsn { display: inline-flex; align-items: center; font-weight: 600; font-size: 14.5px; letter-spacing: 0.06em; color: var(--accent-ink); border: 1.5px solid var(--accent); border-radius: 3px; padding: 2px 8px; background: var(--accent-soft); line-height: 1.3; }
.hsn i { display: inline-block; width: 6px; height: 1.5px; margin: 0 4px; background: currentColor; opacity: .45; }
.hsn--warn { color: var(--warn); border-color: #D9A44F; background: var(--warn-soft); }
.hsn--none { color: var(--muted); border: 1.5px dashed var(--line); background: transparent; font-weight: 500; letter-spacing: 0; font-size: 13px; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; text-decoration: none; vertical-align: 1px; }
.tag--dup, .tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--ok { background: var(--accent-soft); color: var(--accent-ink); }

.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; font-size: 14px; }
.pager .muted { margin-right: auto; }
.pager__go input { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); margin: 0 4px; }

.empty { text-align: center; padding: 48px 20px; }
.empty p { margin: 6px 0; }
.empty .btn { margin: 10px 4px 0; }

.danger-zone { margin-top: 48px; color: var(--muted); font-size: 14px; }
.danger-zone summary { cursor: pointer; }
.danger-zone[open] { border: 1px solid #F2C4BF; background: var(--danger-soft); padding: 12px 16px; border-radius: var(--radius); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field--inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field--inline > span { margin: 0; white-space: nowrap; color: var(--muted); font-weight: 500; }
.field--inline input, .field--inline select { width: auto; min-width: 0; padding: 7px 9px; }
.field--inline input[data-name] { width: min(340px, 50vw); }
.field--inline input[data-hsn-custom] { width: 110px; }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.hint--warn { color: var(--warn); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.alert { padding: 10px 12px; border-radius: var(--radius); font-size: 14px; margin: 0 0 14px; }
.alert--warn { background: var(--warn-soft); color: #6E4100; }
.alert--danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- modal ---------- */
.modal { border: 0; border-radius: 10px; padding: 0; width: min(520px, 94vw); color: var(--ink); box-shadow: 0 20px 60px rgba(27, 42, 58, .28); }
.modal::backdrop { background: rgba(27, 42, 58, .45); }
.modal form { padding: 22px 24px 20px; }
.modal h2 { margin: 0 0 16px; font-size: 20px; }
.modal__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.modal__foot .check { font-size: 13px; color: var(--muted); }

/* ---------- upload ---------- */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 44px 20px; border: 2px dashed #A9B6BD; border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop__title { font-size: 18px; font-weight: 600; }
.status { margin: 14px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.status--warn { background: var(--warn-soft); border-color: #F0D19B; color: #6E4100; }

.sources { display: grid; gap: 8px; }
.src { display: grid; grid-template-columns: minmax(180px, 1.1fr) 110px 3fr auto; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; }
.src.is-off { border-left-color: var(--line); opacity: .6; }
.src__name span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.src__name small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.src__count { font-weight: 600; font-variant-numeric: tabular-nums; }
.src__count.is-zero { color: var(--danger); }
.src__map { display: flex; gap: 10px; flex-wrap: wrap; }
.src__map label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.src__map select { width: auto; max-width: 230px; padding: 6px 8px; font-size: 13px; }
.src__map input { width: 64px; padding: 6px 8px; font-size: 13px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg__b { font: 500 13.5px var(--font); border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--muted); border-right: 1px solid var(--line); }
.seg__b:last-child { border-right: 0; }
.seg__b span { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; margin-left: 2px; }
.seg__b.is-on { background: var(--ink); color: #fff; }
.seg__b.is-on span { color: #fff; }

.importbox { display: grid; grid-template-columns: 1fr 1fr auto; gap: 20px; align-items: end; margin-top: 24px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.opts { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.opts legend { font-size: 13px; font-weight: 600; margin-bottom: 4px; padding: 0; }
.opts p { margin: 0; }
.importbox__go { display: grid; gap: 8px; justify-items: end; }
.progress { width: 220px; height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.result { margin-top: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.result h2 { margin-top: 0; }
.result .btn { margin: 6px 6px 0 0; }

/* ---------- duplicates ---------- */
.groups { display: grid; gap: 14px; margin-top: 16px; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group--conflict { border-left: 4px solid #D9A44F; }
.group__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.group__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; background: #F7F9F9; border-top: 1px solid var(--line-soft); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--radius); font-size: 14px; transition: opacity .2s, transform .2s; z-index: 60; max-width: 90vw; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast--err { background: var(--danger); }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 0 0; }
.login-page .login { margin: auto 0; }
.login-page .sitefoot { width: 100%; }
.login { width: min(380px, calc(100% - 40px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 30px 28px; }
.login > p.muted { margin: 0 0 20px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .src { grid-template-columns: 1fr auto; }
  .src__map { grid-column: 1 / -1; }
  .importbox { grid-template-columns: 1fr; }
  .importbox__go { justify-items: stretch; }
  .progress { width: 100%; }
}
@media (max-width: 640px) {
  .topbar__in { flex-wrap: wrap; gap: 10px 12px; padding: 10px 14px; }
  .brand { margin-right: auto; }
  .nav-toggle { display: inline-flex; order: 2; }
  .logout { order: 3; margin-left: 0; }
  .nav { order: 4; flex: 0 0 100%; flex-direction: column; gap: 2px; padding: 8px 0 2px; border-top: 1px solid var(--line-soft); overflow: visible; }
  .nav[hidden] { display: none !important; }
  .nav:not([hidden]) { display: flex; }
  .nav a { display: block; padding: 12px 10px; white-space: normal; border: 0; border-radius: 4px; }
  .nav a.is-on { background: var(--accent-soft); }
  h1 { font-size: 24px; }
  .c-src { display: none; }
  .head__actions { width: 100%; }
  .head__actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.src__count small { display: block; font-weight: 400; font-size: 12px; color: var(--warn); }
.grid th.c-act { text-align: right; padding-right: 18px; }
#src { max-width: 260px; }

/* ---------- site footer ---------- */
body:not(.login-page) { min-height: 100vh; display: flex; flex-direction: column; }
body:not(.login-page) > .wrap { flex: 1; width: 100%; }
.sitefoot { border-top: 1px solid var(--line); background: var(--surface); text-align: center; padding: 16px 20px; font-size: 13px; color: var(--muted); }
.sitefoot p { margin: 2px 0; }
.sitefoot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sitefoot a:hover { text-decoration: underline; }

/* ================= Store Stocks ================= */
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin: -8px 0 22px; padding-bottom: 0; border-bottom: 1px solid var(--line); }
.subnav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; padding: 8px 12px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a.is-on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }

.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.card__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card__head h2 { margin: 0; font-size: 17px; }
.card__foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.tablewrap--flat { border: 0; border-radius: 0; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.tile:hover { border-color: #B9C4CA; border-top-color: var(--accent); }
.tile--warn { border-top-color: #D9A44F; }
.tile--danger { border-top-color: var(--danger); }
.tile__n { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile__l { font-size: 13px; color: var(--muted); }

.qty { display: inline-block; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); }
.qty small { font-weight: 500; opacity: .8; }
.qty--low { background: var(--warn-soft); color: var(--warn); }
.qty--out { background: var(--danger-soft); color: var(--danger); }
.q-in { color: #1E7B45; font-weight: 600; }
.q-out { color: var(--danger); font-weight: 600; }

.ttype { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.ttype--out { background: var(--danger-soft); color: var(--danger); }
.ttype--in { background: #E3F4EA; color: #1E7B45; }
.ttype--adj { background: var(--warn-soft); color: var(--warn); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 6px; align-items: stretch; }
.inline select { flex: 1; min-width: 0; }

/* entry form */
.seg--types { margin-bottom: 16px; }
.seg--types .seg__b { padding: 10px 14px; font-size: 14px; }
.seg--types .seg__b.is-on { background: var(--accent); }
.seg--sm { margin-bottom: 6px; }
.seg--sm .seg__b { padding: 6px 12px; }
.seg--sm .seg__b.is-on { background: var(--accent); }
.entry__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 16px; }
.entry__grid .field { margin-bottom: 10px; }
.entry__grid > .field > span:first-child { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.entry__wide { grid-column: span 2; }
a.icon { text-decoration: none; display: inline-block; }
.entry__actions { display: flex; justify-content: flex-end; gap: 8px; }
.lines input.in-item { width: 100%; min-width: 220px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.lines select { padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.lines .is-bad { border-color: var(--danger) !important; }
.c-qty { width: 170px; }
.qtybox { display: inline-flex; align-items: center; gap: 6px; }
.qtybox input { width: 100px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); text-align: right; }
.qtybox span { min-width: 34px; text-align: left; color: var(--muted); font-size: 13px; }
.line-msg { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.line-msg:empty { display: none; }
.line-msg.is-bad { color: var(--danger); }
.linkbtn { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline dotted; }

/* entries + filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; }
.filters .field { margin: 0; flex: 1 1 150px; min-width: 130px; }
.filters .field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.filters .field input, .filters .field select { padding: 8px 9px; }
.filters__q { flex: 2 1 220px !important; }
.entries td { vertical-align: top; }
.lines-cell div { line-height: 1.6; }
.slipno { font-weight: 600; white-space: nowrap; }

.addrow { display: flex; gap: 10px 12px; align-items: flex-end; flex-wrap: wrap; }
.addrow .field { margin: 0; flex: 1 1 180px; }
.addrow__note { flex: 2 1 240px !important; }

/* reports */
.report-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.report-tabs button { font: 500 13.5px var(--font); padding: 8px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--muted); cursor: pointer; }
.report-tabs button:hover { color: var(--ink); border-color: #B9C4CA; }
.report-tabs button.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.report__title { margin: 6px 0 10px; }
.report__title h2 { margin: 0; }
.report__title p { margin: 2px 0 0; }
.report-grid tfoot td { padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.row-total td { background: #F7F9F9; }

@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry__grid { grid-template-columns: 1fr 1fr; }
  .entry__wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .entry__grid, .field-row { grid-template-columns: 1fr; }
  .subnav { overflow-x: auto; flex-wrap: nowrap; }
  .subnav a { white-space: nowrap; }
  .seg--types { display: flex; }
  .seg--types .seg__b { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
  .entry__actions .btn { flex: 1; }
  .entry__wide { grid-column: auto; }
  /* item lines as stacked cards */
  .lines thead { display: none; }
  .lines tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .lines td { border: 0 !important; padding: 0 !important; background: none !important; }
  .lines td.c-sr { width: 22px; }
  .lines td:nth-child(2) { flex: 1 1 calc(100% - 40px); }
  .lines td.c-act { margin-left: auto; width: auto; }
  .lines td.c-qty { width: auto; }
  .lines td[data-label] { text-align: left !important; font-size: 13px; }
  .lines td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  .lines input.in-item { min-width: 0; }
  .lines td.none { flex: 1 1 100%; text-align: center; }
}

/* printable slip */
.slip-page { background: var(--paper); }
.slip-tools { max-width: 800px; margin: 20px auto 0; display: flex; justify-content: space-between; padding: 0 16px; }
.slip { max-width: 800px; margin: 12px auto 40px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; }
.slip__head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.slip__head p { margin: 4px 0 0; }
.slip__no { text-align: right; }
.slip__no h1 { font-size: 20px; margin: 0 0 4px; }
.slip__meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin: 16px 0; }
.slip__meta dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.slip__meta dd { margin: 2px 0 0; font-weight: 600; }
.slip__table { width: 100%; border-collapse: collapse; }
.slip__table th, .slip__table td { border: 1px solid #B9C4CA; padding: 7px 10px; text-align: left; font-size: 14px; }
.slip__table th { background: #F3F5F9; font-size: 12px; }
.slip__remarks { margin: 14px 0 0; }
.slip__signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 64px; text-align: center; font-size: 13px; }
.slip__signs div { border-top: 1px solid var(--ink); padding-top: 6px; }
.slip__foot { margin-top: 28px; font-size: 12px; text-align: center; }

@media print {
  .topbar, .subnav, .sitefoot, .head__actions, .filters, .report-tabs, .no-print, .toast, .slip-tools { display: none !important; }
  body, .slip-page { background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .head { margin-bottom: 6px; }
  .tablewrap { border: 0; overflow: visible; }
  .grid th { position: static; }
  .grid td, .grid th { padding: 5px 7px; font-size: 12px; }
  .slip { border: 0; margin: 0; padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
}
