/* WastyMrf: design system */
:root {
  --page: #f3f3f1;
  --surface: #ffffff;
  --band: #f7f7f5;
  --hover: #f4f4f2;
  --active: #ececea;
  --ink: #1c1c1a;
  --ink-2: #45443f;
  --muted: #7d7c75;
  --faint: #a9a8a1;
  --line: #ebeae6;
  --line-2: #dedcd5;

  --brand: #2457f5;
  --brand-d: #1840c4;
  --brand-l: #eaf0ff;
  --green: #1f9d48;
  --green-l: #e7f6ec;
  --amber: #d98a07;
  --amber-l: #fdf3e0;
  --red: #e5383b;
  --red-l: #fdeaea;
  --tick: #dcdbd6;

  --c-plastic: #2f6fec;
  --c-paper: #b0772a;
  --c-metal: #5f6b7a;
  --c-glass: #0e9384;
  --c-textile: #cf4a8b;
  --c-other: #8a8880;

  --sans: "Inter Tight", "Noto Sans Oriya", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(28, 28, 26, .04), 0 10px 30px -14px rgba(28, 28, 26, .14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink);
  background: var(--page); -webkit-font-smoothing: antialiased; letter-spacing: .003em;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ── Shell ─────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 76px 252px 1fr; min-height: 100vh; }

.rail {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0;
  position: sticky; top: 0; height: 100vh;
}
.fac {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 600; font-size: 16px; letter-spacing: -.02em; color: #fff; position: relative;
  background: linear-gradient(160deg, #2b2b29, #0d0d0c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 2px rgba(0,0,0,.2);
}
.fac.on { outline: 2px solid var(--ink); outline-offset: 3px; }
.fac.alt { background: linear-gradient(160deg, #3c6cff, #1a43d6); }
.fac .dot {
  position: absolute; top: -6px; right: -8px; background: var(--red); color: #fff; font-size: 10px;
  font-weight: 600; border-radius: 99px; padding: 1px 6px; border: 2px solid var(--surface);
}
.fac.add { background: var(--hover); color: var(--faint); border: 1.5px dashed var(--line-2); box-shadow: none; }
.rail .grow { flex: 1; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #e9e4d8; color: #6b5d3f;
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
}

.side {
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brandrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.brandmark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.brandrow b { font-weight: 600; font-size: 16px; letter-spacing: -.02em; }
.brandrow > div { min-width: 0; }
.brandrow small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; margin-top: -1px; }
.brandrow .chev { margin-left: auto; color: var(--faint); }

.nav-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 18px 12px 8px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--ink-2); font-size: 15px; transition: background .15s;
}
.nav a svg { color: var(--ink-2); }
.nav a:hover { background: var(--hover); }
.nav a.on { background: var(--active); color: var(--ink); font-weight: 500; }
.nav a.on svg { color: var(--ink); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--active); color: var(--ink-2); }
.nav a.on .count:not(.red) { background: #fff; }
.nav .count.red { background: var(--red); color: #fff; box-shadow: 0 0 0 3px var(--red-l); }
.nav .soon { margin-left: auto; font-size: 10px; color: var(--faint); letter-spacing: .04em; }
.side .foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

.main { background: var(--surface); min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 22px 32px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); z-index: 5;
}
.topbar h1 { font-size: 30px; font-weight: 500; letter-spacing: -.03em; white-space: nowrap; margin-right: 8px; }
.topbar .menu-btn { display: none; }
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 10px; color: var(--faint); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 14px; color: var(--ink); background: none; }
.search input::placeholder { color: var(--faint); }
.search kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
.topbar .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500; white-space: nowrap; background: var(--hover); color: var(--ink);
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--active); }
.btn:active { transform: translateY(1px); }
.btn.line { background: #fff; border: 1px solid var(--line-2); }
.btn.line:hover { border-color: var(--ink-2); background: #fff; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(24,64,196,.35); }
.btn.primary:hover { background: var(--brand-d); }
.btn.danger { background: #fff; color: #b42318; border: 1px solid #f3b4ae; }
.btn.danger:hover { background: #fef3f2; border-color: #b42318; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--hover); }
.icon-btn .pip { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }

select.btn { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%237d7c75' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; outline: 0; }

.page { padding: 0 0 48px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Statistic band ────────────────────────────────────────────── */
.band { background: var(--band); border-bottom: 1px solid var(--line); padding: 26px 32px 30px; }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.band-head h2 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.band-head .sub { color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 0 26px; border-left: 1px solid var(--line-2); min-width: 0; }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat .k { color: var(--muted); font-size: 15px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; white-space: nowrap; }
.stat .v small { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--ink-2); }
.stat .foot { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

/* ── Sections & cards ──────────────────────────────────────────── */
.section { padding: 28px 32px 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-head h3 { font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.card-head .sub { color: var(--muted); font-size: 13px; }
.card-head .right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.link { color: var(--brand); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* quick actions */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.qa {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.qa:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.qa .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--hover); color: var(--ink); }
.qa b { font-weight: 500; display: block; }
.qa small { color: var(--muted); font-size: 13px; }
.qa .go { margin-left: auto; color: var(--faint); transition: transform .15s, color .15s; }
.qa:hover .go { transform: translateX(3px); color: var(--ink); }

/* chart */
.chart { position: relative; }
.chart svg text { font-family: var(--sans); font-size: 11px; fill: var(--faint); }
.chart .col:hover .hit { fill: rgba(28,28,26,.035); }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 12px;
  font-size: 12px; min-width: 150px; box-shadow: var(--shadow); opacity: 0; transition: opacity .1s; z-index: 3;
}
.tip b { display: block; font-weight: 500; margin-bottom: 6px; font-size: 12px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; color: #d6d5cf; line-height: 1.7; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* lists */
.rows > * + * { border-top: 1px solid var(--line); }
.alert-row, .act-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.alert-row:first-child, .act-row:first-child { padding-top: 0; }
.alert-row .t, .act-row .t { min-width: 0; flex: 1; }
.alert-row b, .act-row b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row small, .act-row small { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row .r, .act-row .r { text-align: right; white-space: nowrap; }
.act-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.act-ic.inward { background: var(--brand-l); color: var(--brand); }
.act-ic.sorted { background: var(--green-l); color: var(--green); }
.act-ic.sold { background: #f1ecfb; color: #6d3fd1; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--green-l); color: var(--green); }
.pill.low { background: var(--amber-l); color: var(--amber); }
.pill.out { background: var(--red-l); color: var(--red); }
.pill.over { background: var(--brand-l); color: var(--brand); }

/* category bar */
.catbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 3px; margin: 4px 0 18px; }
.catbar span { display: block; height: 100%; border-radius: 3px; }
.cat-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; }
.cat-row .t { flex: 1; min-width: 0; }
.cat-row b { font-weight: 500; }
.cat-row .r { text-align: right; }
.cat-row .r small, .cat-row .t small { display: block; color: var(--muted); font-size: 13px; }

/* material tile (stands in for a product photo) */
.tile {
  width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(180deg, #f6f6f4, #ececea); box-shadow: inset 0 0 0 1px rgba(0,0,0,.03);
}
.tile.sm { width: 40px; height: 40px; border-radius: 11px; }
.tile svg { filter: drop-shadow(0 2px 3px rgba(0,0,0,.08)); }

/* ── Stock list (mirrors reference) ────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 18px 32px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chip {
  white-space: nowrap; flex-shrink: 0;
  height: 34px; padding: 0 14px; border-radius: 99px; font-size: 14px; color: var(--ink-2);
  border: 1px solid var(--line-2); background: #fff; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font-size: 12px; color: var(--faint); }
.chip.on .n { color: #b9b8b2; }
.chip .sw { width: 8px; height: 8px; border-radius: 50%; }
.toolbar .right { margin-left: auto; color: var(--muted); font-size: 13px; }

.mrow {
  display: grid; align-items: center; padding: 16px 32px; border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(250px, 1.35fr) minmax(220px, 1.15fr) 96px 0.7fr 0.75fr 0.8fr 20px;
  column-gap: 0; transition: background .12s;
}
.mrow:hover { background: #fbfbfa; }
.mrow > .c { padding: 0 22px; border-left: 1px solid var(--line); min-width: 0; }
.mrow > .c.first, .mrow > .c.gauge-c, .mrow > .c.go { border-left: 0; }
.mrow > .c.first { padding-left: 0; display: flex; align-items: center; gap: 18px; }
.mrow > .c.gauge-c { padding: 0 6px; }
.mrow .name { font-size: 17px; font-weight: 400; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .meta { color: var(--muted); font-size: 14px; margin-top: 4px; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.mrow .meta .mono { color: var(--ink-2); }
.mrow .lbl { font-size: 15px; color: var(--ink); white-space: nowrap; }
.mrow .lbl em { font-style: normal; color: var(--muted); margin-left: 6px; }
.mrow .lbl em.low { color: var(--amber); }
.mrow .lbl em.out { color: var(--red); }
.mrow .lbl em.over { color: var(--brand); }
.mrow .val { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--ink-2); font-size: 15px; white-space: nowrap; }
.mrow .val svg { color: var(--muted); }
.mrow .val .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); margin: 0 2px; }
.mrow .go { color: var(--faint); }
.mrow:hover .go { color: var(--ink); }
.list-head {
  display: grid; padding: 12px 32px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
  grid-template-columns: minmax(250px, 1.35fr) minmax(220px, 1.15fr) 96px 0.7fr 0.75fr 0.8fr 20px; border-bottom: 1px solid var(--line);
}
.list-head > span { padding: 0 22px; white-space: nowrap; }
.list-head > span:first-child { padding-left: 0; }
.list-head button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.list-head button:hover, .list-head button.on { color: var(--ink); }

.empty { padding: 64px 32px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); font-weight: 500; font-size: 18px; margin: 14px 0 6px; }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--hover); display: grid; place-items: center; margin: 0 auto; color: var(--ink-2); }

/* skeleton */
.sk { background: linear-gradient(90deg, #f0f0ee 25%, #f7f7f5 50%, #f0f0ee 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* coming soon */
.soon-wrap { padding: 80px 32px; display: grid; place-items: center; text-align: center; }
.soon-wrap .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--hover); display: grid; place-items: center; margin-bottom: 18px; }
.soon-wrap h2 { font-weight: 500; letter-spacing: -.02em; font-size: 24px; }
.soon-wrap p { color: var(--muted); max-width: 440px; margin: 8px auto 22px; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1360px) {
  .mrow, .list-head { grid-template-columns: minmax(230px, 1.4fr) minmax(200px, 1.1fr) 90px 0.8fr 0.8fr 20px; }
  .mrow .c.value-c, .list-head .value-h { display: none; }
}
@media (max-width: 1180px) {
  .app { grid-template-columns: 236px 1fr; }
  .rail { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .qa { padding: 14px; gap: 12px; }
  .qa .go { display: none; }
  .mrow, .list-head { grid-template-columns: minmax(210px, 1.3fr) minmax(180px, 1fr) 90px minmax(130px, .8fr) 8px; }
  .mrow .c.rate-c, .list-head .rate-h { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 30; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .app.nav-open .side { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(28,28,26,.3); z-index: 20; }
  .topbar .menu-btn { display: grid; margin-left: -8px; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar h1 { font-size: 24px; }
  .topbar .search { order: 5; max-width: none; flex-basis: 100%; }
  .topbar .actions .hide-sm { display: none; }
  .band, .section, .toolbar { padding-left: 16px; padding-right: 16px; }
  .stats { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat { padding: 0 16px; }
  .stat .v { font-size: 24px; flex-wrap: wrap; row-gap: 2px; white-space: normal; }
  .stat .v small { font-size: 13px; color: var(--muted); }
  .stat .foot { white-space: normal; flex-wrap: wrap; }
  .band-head { flex-direction: column; gap: 4px; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .right { display: none; }
  .quick { grid-template-columns: 1fr; }
  .list-head { display: none; }
  .mrow { grid-template-columns: 1fr auto; row-gap: 12px; padding: 16px; }
  .mrow > .c { border-left: 0; padding: 0; }
  .mrow > .c.first { grid-column: 1 / -1; }
  .mrow .c.perf-c { grid-column: 1; }
  .mrow .c.gauge-c { grid-column: 2; grid-row: 2; }
  .mrow .c.value-c { display: block; }
  .mrow .c.go { display: none; }
  .mrow .c.stock-c, .mrow .c.rate-c, .mrow .c.value-c { grid-column: auto; }
  .mrow { grid-template-columns: 1fr 1fr 1fr; }
  .mrow .c.perf-c { grid-column: 1 / 3; }
  .mrow .c.gauge-c { grid-column: 3; grid-row: 2; justify-self: end; }
  .tile { width: 52px; height: 52px; }
}

/* ── Part 2: forms, drawer, toast, print ───────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(28,28,26,.28); z-index: 40; opacity: 0; transition: opacity .2s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 41;
  display: flex; flex-direction: column; box-shadow: -20px 0 60px -20px rgba(28,28,26,.25);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.drawer.wide { width: min(760px, 100vw); }
.drawer.open { transform: none; }
.scrim.open { opacity: 1; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.drawer-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.drawer-head .icon-btn { margin: -6px -10px 0 auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 26px 30px; }
.drawer-foot { display: flex; gap: 10px; align-items: center; padding: 16px 26px; border-top: 1px solid var(--line); background: var(--band); }
.drawer-foot .grow { flex: 1; }
.drawer-foot .err { color: var(--red); font-size: 13px; flex: 1; }

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.fgrid .full { grid-column: 1 / -1; }
.field label, .flabel { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field label .opt { color: var(--faint); font-weight: 400; }
.input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
  font-size: 15px; outline: 0; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: 76px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.input.bad { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-l); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%237d7c75' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.unit { position: relative; }
.unit .input { padding-right: 44px; font-variant-numeric: tabular-nums; }
.unit::after { content: attr(data-unit); position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; pointer-events: none; }
.input.upper { text-transform: uppercase; font-family: var(--mono); letter-spacing: .04em; font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; font-size: 14px; color: var(--ink-2); }
.seg button:hover { border-color: var(--ink-2); }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.netbox {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 14px;
  background: var(--band); border: 1px solid var(--line);
}
.netbox .k { color: var(--muted); font-size: 13px; }
.netbox .v { font-size: 30px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.netbox .eq { margin-left: auto; text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.fsection { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.fsection:first-child { margin-top: 0; }
.fsection::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 11px 12px 11px 16px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow); animation: toast .25s ease;
}
.toast .ok { color: #6ee7a0; }
.toast .err { color: #ff9a9c; }
.toast button { color: #fff; background: rgba(255,255,255,.12); border-radius: 8px; height: 30px; padding: 0 10px; font-size: 13px; font-weight: 500; }
.toast button:hover { background: rgba(255,255,255,.2); }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } }

/* day group + generic list rows */
.dayhead { display: flex; align-items: baseline; gap: 10px; padding: 18px 32px 8px; font-size: 14px; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); background: #fff; }
.dayhead span { color: var(--muted); font-weight: 400; font-size: 13px; }
.lrow {
  display: grid; align-items: center; padding: 14px 32px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s;
}
.lrow:hover { background: #fbfbfa; }
.lrow > .c { padding: 0 20px; border-left: 1px solid var(--line); min-width: 0; }
.lrow > .c:first-child { padding-left: 0; border-left: 0; display: flex; align-items: center; gap: 16px; }
.lrow > .c.nb { border-left: 0; }
.lrow .name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .meta { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .meta .mono { color: var(--ink-2); }
.lrow .lbl { font-size: 13px; color: var(--muted); white-space: nowrap; }
.lrow .val { font-size: 15px; margin-top: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.lrow .big { font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.lrow.cancelled { opacity: .55; }
.ic-tile { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; background: linear-gradient(180deg, #f6f6f4, #ececea); color: var(--ink-2); }
.ic-tile.blue { background: var(--brand-l); color: var(--brand); }
.ic-tile.green { background: var(--green-l); color: var(--green); }
.inward-row { grid-template-columns: minmax(240px, 1.5fr) minmax(170px, 1fr) minmax(150px, .9fr) minmax(110px, .7fr) 130px; }
.sort-row { grid-template-columns: minmax(230px, 1.3fr) minmax(130px, .8fr) minmax(120px, .7fr) minmax(130px, .8fr) 84px minmax(130px, .8fr); }

/* pending loads picker */
.pending-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pick {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-2); border-radius: 14px;
  background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: left; width: 100%;
}
.pick:hover { border-color: var(--ink-2); }
.pick.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.pick .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex-shrink: 0; margin-top: 2px; color: #fff; }
.pick.on .box { background: var(--brand); border-color: var(--brand); }
.pick b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick small { display: block; color: var(--muted); font-size: 13px; }
.pick .t { min-width: 0; flex: 1; }
.pick .kg { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.select-bar { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.select-bar .muted { font-size: 14px; }

/* mass balance */
.balance { position: sticky; top: 0; z-index: 2; background: #fff; margin: -22px -26px 18px; padding: 16px 26px; border-bottom: 1px solid var(--line); }
.balance .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.balance .nums .k { font-size: 12px; color: var(--muted); }
.balance .nums .v { font-size: 18px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.balance .bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--hover); gap: 2px; }
.balance .bar span { height: 100%; transition: width .2s; }
.balance .warn { color: var(--red); font-size: 13px; margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.mat-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.mat-in { display: flex; align-items: center; gap: 10px; }
.mat-in .nm { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-in .nm small { display: block; color: var(--faint); font-size: 11px; font-family: var(--mono); }
.mat-in .unit { width: 120px; flex-shrink: 0; }
.mat-in .input { height: 38px; font-size: 14px; text-align: right; padding-right: 36px; }
.mat-in .unit::after { right: 12px; font-size: 12px; }

/* detail */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.kv .k { font-size: 13px; color: var(--muted); }
.kv .v { font-size: 15px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.outbar { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.outbar .nm { width: 170px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outbar .track { flex: 1; height: 8px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.outbar .track span { display: block; height: 100%; border-radius: 99px; }
.outbar .n { width: 80px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }

/* printable slip (hidden on screen) */
#print-area { display: none; }
@media print {
  @page { size: A5; margin: 12mm; }
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #000; font-family: var(--sans); }
  .slip h1 { font-size: 20px; font-weight: 600; }
  .slip .top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
  .slip .no { font-family: var(--mono); font-size: 16px; text-align: right; }
  .slip table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .slip td { padding: 6px 0; border-bottom: 1px solid #ddd; }
  .slip td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
  .slip .net td { font-size: 18px; font-weight: 600; border-bottom: 2px solid #000; }
  .slip .sign { display: flex; justify-content: space-between; margin-top: 50px; font-size: 12px; }
  .slip .sign div { border-top: 1px solid #000; padding-top: 4px; width: 40%; text-align: center; }
  .slip .foot { margin-top: 18px; font-size: 10px; color: #555; }
}

@media (max-width: 1180px) {
  .inward-row { grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 1fr) minmax(100px, .7fr) 120px; }
  .inward-row .c.weigh-c { display: none; }
  .sort-row { grid-template-columns: minmax(200px, 1.3fr) minmax(110px, .8fr) 84px minmax(110px, .8fr); }
  .sort-row .c.in-c, .sort-row .c.from-c { display: none; }
}
@media (max-width: 900px) {
  .dayhead { padding: 16px 16px 8px; }
  .lrow { padding: 14px 16px; }
  .inward-row { grid-template-columns: 1fr auto; row-gap: 10px; }
  .inward-row .c.veh-c { display: none; }
  .inward-row .c.net-c { border-left: 0; text-align: right; padding-right: 0; }
  .inward-row .c.st-c { grid-column: 1 / -1; border-left: 0; padding: 0; display: flex; align-items: center; gap: 8px; }
  .inward-row .c.st-c .meta { margin-top: 0 !important; }
  .sort-row { grid-template-columns: 1fr auto; row-gap: 10px; }
  .sort-row .c.rec-c { border-left: 0; text-align: right; padding-right: 0; }
  .sort-row .c.g-c, .sort-row .c.rej-c { display: none; }
  .fgrid, .mat-inputs, .kv { grid-template-columns: 1fr; }
  .balance .nums { grid-template-columns: 1fr 1fr; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 18px; padding-right: 18px; }
  .balance { margin: -22px -18px 18px; padding: 14px 18px; }
}

/* ── Part 3: sales, ledger, adjust ─────────────────────────────── */
.sale-row { grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 1.2fr) minmax(110px, .7fr) minmax(130px, .8fr) 150px; }
.ic-tile.violet { background: #f1ecfb; color: #6d3fd1; }
.mat-chips { display: flex; gap: 6px; overflow: hidden; }
.mat-chips span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.mat-chips span i { width: 7px; height: 7px; border-radius: 50%; }

.items { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.items-head, .item { display: grid; grid-template-columns: minmax(0, 1fr) 120px 110px 110px 36px; gap: 10px; align-items: center; }
.items-head { padding: 10px 14px; background: var(--band); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.items-head span:nth-child(n+2) { text-align: right; }
.item { padding: 10px 14px; border-top: 1px solid var(--line); }
.item .input { height: 40px; font-size: 14px; }
.item .unit .input { text-align: right; padding-right: 34px; }
.item .unit::after { right: 12px; font-size: 12px; }
.item .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.item .avail { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -4px; }
.item .avail.bad { color: var(--red); }
.item .rm { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--faint); }
.item .rm:hover { background: var(--red-l); color: var(--red); }
.items-foot { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); background: #fff; }
.items-foot .tot { margin-left: auto; text-align: right; }
.items-foot .tot small { display: block; color: var(--muted); font-size: 12px; }
.items-foot .tot b { font-size: 22px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 400; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
.tbl .r { text-align: right; }
.tbl tfoot td { font-weight: 500; border-bottom: 0; padding-top: 14px; }
.tbl .kind { display: inline-flex; align-items: center; gap: 8px; }
.tbl .kind .act-ic { width: 28px; height: 28px; }
.tbl .kind .act-ic.adjust { background: var(--amber-l); color: var(--amber); }
.tbl .kind .act-ic.returned { background: var(--hover); color: var(--ink-2); }
.tbl small { display: block; color: var(--muted); font-size: 12px; }
.plus { color: var(--green); }
.minus { color: var(--ink); }

.mat-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.mat-hero .big { font-size: 30px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mat-hero .sub { color: var(--muted); font-size: 14px; }
.mat-hero .g { margin-left: auto; text-align: center; font-size: 13px; }
.adjust-box { border: 1px solid var(--line-2); border-radius: 14px; padding: 18px; margin-bottom: 22px; background: var(--band); }
.mrow { cursor: pointer; }

@media (max-width: 1180px) {
  .sale-row { grid-template-columns: minmax(220px, 1.4fr) minmax(110px, .7fr) minmax(130px, .8fr) 140px; }
  .sale-row .c.mats-c { display: none; }
}
@media (max-width: 900px) {
  .sale-row { grid-template-columns: 1fr auto; row-gap: 10px; }
  .sale-row .c.qty-c { display: none; }
  .sale-row .c.amt-c { border-left: 0; text-align: right; padding-right: 0; }
  .sale-row .c.pay-c { grid-column: 1 / -1; border-left: 0; padding: 0; display: flex; gap: 8px; align-items: center; }
  .items-head { display: none; }
  .item { grid-template-columns: 1fr 1fr 36px; }
  .item .msel { grid-column: 1 / -1; }
  .item .amt { grid-column: 1 / 3; text-align: left; }
  .mat-hero { flex-wrap: wrap; }
  .drawer-foot { flex-wrap: wrap; }
  .drawer-foot .err { flex-basis: 100%; }
  .drawer-foot .err:empty { display: none; }
  .drawer-foot .grow { display: none; }
  .drawer-foot .btn { flex: 1; justify-content: center; padding: 0 10px; }
}

/* ── Part 4: materials, suppliers, buyers ──────────────────────── */
.mat-row { grid-template-columns: minmax(240px, 1.5fr) minmax(120px, .8fr) minmax(140px, .9fr) minmax(120px, .8fr) 110px 24px; }
.sup-row { grid-template-columns: minmax(240px, 1.5fr) minmax(90px, .6fr) minmax(120px, .8fr) minmax(150px, 1fr) minmax(110px, .7fr) 24px; }
.buy-row { grid-template-columns: minmax(240px, 1.5fr) minmax(90px, .6fr) minmax(110px, .7fr) minmax(130px, .8fr) minmax(130px, .8fr) minmax(110px, .7fr) 24px; }
.lrow .go { color: var(--faint); border-left: 0; padding: 0; }
.lrow:hover .go { color: var(--ink); }
.lrow.inactive { opacity: .5; }
.cathead { display: flex; align-items: center; gap: 10px; padding: 18px 32px 8px; font-weight: 500; font-size: 14px; border-bottom: 1px solid var(--line); }
.cathead i { width: 9px; height: 9px; border-radius: 50%; }
.cathead span { color: var(--muted); font-weight: 400; font-size: 13px; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; margin-left: 6px; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }

.avatar-tile { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; font-weight: 600; font-size: 16px; letter-spacing: -.02em; }
.meter { display: flex; align-items: center; gap: 10px; }
.meter .track { flex: 1; max-width: 90px; height: 6px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.meter .track span { display: block; height: 100%; border-radius: 99px; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .knob { width: 40px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; flex-shrink: 0; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .knob { background: var(--green); }
.switch input:checked + .knob::after { transform: translateX(16px); }
.switch input:focus-visible + .knob { box-shadow: 0 0 0 3px var(--brand-l); }
.switch small { display: block; color: var(--muted); font-size: 12px; }

.mini-list .act-row { padding: 10px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 22px; }
.stat-grid > div { padding: 14px 16px; border-left: 1px solid var(--line); }
.stat-grid > div:first-child { border-left: 0; }
.stat-grid .k { font-size: 12px; color: var(--muted); }
.stat-grid .v { font-size: 18px; font-weight: 500; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.contact { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); font-size: 14px; margin-bottom: 20px; }
.contact span { display: inline-flex; align-items: center; gap: 6px; }
.contact svg { color: var(--muted); }

@media (max-width: 1180px) {
  .mat-row { grid-template-columns: minmax(220px, 1.5fr) minmax(110px, .8fr) minmax(110px, .8fr) 100px 24px; }
  .mat-row .c.minmax-c { display: none; }
  .sup-row { grid-template-columns: minmax(220px, 1.5fr) minmax(110px, .8fr) minmax(140px, 1fr) 24px; }
  .sup-row .c.cnt-c, .sup-row .c.last-c { display: none; }
  .buy-row { grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .8fr) minmax(120px, .8fr) 24px; }
  .buy-row .c.cnt-c, .buy-row .c.kg-c, .buy-row .c.last-c { display: none; }
}
@media (max-width: 900px) {
  .cathead { padding: 16px 16px 8px; }
  .mat-row, .sup-row, .buy-row { grid-template-columns: 1fr auto; row-gap: 8px; }
  .mat-row .c.stock-c, .mat-row .c.st-c, .buy-row .c.due-c, .lrow .go { display: none; }
  .sup-row .c.rej-c { grid-column: 1 / -1; border-left: 0; padding: 0 0 0 64px; display: flex; align-items: center; gap: 10px; }
  .sup-row .c.rej-c .val { margin-top: 0; }
  .mat-row .c.rate-c, .sup-row .c.kg-c, .buy-row .c.amt-c { border-left: 0; text-align: right; padding-right: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .stat-grid > div:nth-child(4) { border-top: 1px solid var(--line); }
}

/* ── Part 5: reports ───────────────────────────────────────────── */
.report-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 22px 32px; }
.rtab {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border: 1px solid var(--line);
  border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.rtab:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.rtab.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.rtab .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--hover); display: grid; place-items: center; flex-shrink: 0; }
.rtab.on .ic { background: var(--ink); color: #fff; }
.rtab b { display: block; font-weight: 500; font-size: 14px; }
.rtab small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.filters { border-top: 1px solid var(--line); gap: 10px; }
.sm-input { height: 34px; width: auto; font-size: 13px; padding: 0 10px; border-radius: 8px; }
.sep-v { width: 1px; height: 22px; background: var(--line-2); margin: 0 6px; }
.btn.sm { height: 34px; }
select.btn.sm { padding-right: 30px; background-position: right 10px center; }

.rtable-wrap { overflow: visible; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.rtable th {
  position: sticky; top: 87px; background: #fff; z-index: 1; text-align: left; font-weight: 400; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; cursor: pointer; user-select: none;
}
.rtable th:hover, .rtable th.on { color: var(--ink); }
.rtable th svg { display: inline-block; vertical-align: -2px; margin-left: 3px; }
.rtable td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rtable th:first-child, .rtable td:first-child { padding-left: 32px; }
.rtable th:last-child, .rtable td:last-child { padding-right: 32px; }
.rtable .n { text-align: right; }
.rtable td.mono { font-size: 13px; color: var(--ink-2); }
.rtable tbody tr:hover { background: #fbfbfa; }
.rtable tfoot td { font-weight: 600; background: var(--band); border-bottom: 0; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; }

@media print {
  @page report { size: A4 landscape; margin: 10mm; }
  .report-print { page: report; }
  .report-print .psum { display: flex; gap: 28px; margin-bottom: 14px; }
  .report-print .psum small { display: block; font-size: 10px; color: #555; }
  .report-print .psum b { font-size: 15px; }
  .ptable { width: 100%; border-collapse: collapse; font-size: 10px; }
  .ptable th { text-align: left; border-bottom: 1.5px solid #000; padding: 4px 6px; font-weight: 600; }
  .ptable td { border-bottom: 1px solid #ddd; padding: 4px 6px; }
  .ptable .n { text-align: right; }
  .ptable tfoot td { font-weight: 700; border-top: 1.5px solid #000; border-bottom: 0; }
  .ptable thead { display: table-header-group; }
  .ptable tr { break-inside: avoid; }
}

@media (max-width: 1180px) {
  .report-tabs { grid-template-columns: repeat(5, minmax(150px, 1fr)); overflow-x: auto; }
  .rtable-wrap { overflow-x: auto; }
  .rtable th, .rtable tfoot td { position: static; }
  .rtab small { display: none; }
}
@media (max-width: 900px) {
  .report-tabs { display: flex; padding: 14px 16px; gap: 8px; scrollbar-width: none; }
  .report-tabs::-webkit-scrollbar { display: none; }
  .rtab { flex-shrink: 0; padding: 8px 12px 8px 8px; align-items: center; }
  .rtab .ic { width: 30px; height: 30px; }
  .filters { flex-wrap: wrap; }
  .filters .sep-v { display: none; }
  .rtable th:first-child, .rtable td:first-child { padding-left: 16px; }
  .rtable th:last-child, .rtable td:last-child { padding-right: 16px; }
}

/* ── Part 6: sign-in, users, help ──────────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 40px 48px; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 0% 0%, #3b6cff 0%, #2457f5 40%, #1534a8 100%);
}
.login-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 60%);
}
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; position: relative; z-index: 1; }
.login-brand b { font-weight: 600; letter-spacing: -.02em; }
.login-brand .brandmark, .login-mobile-brand .brandmark { background: #fff; color: var(--brand); }
.login-pitch { margin-top: auto; position: relative; z-index: 1; max-width: 520px; }
.login-pitch h1 { font-size: clamp(30px, 3.2vw, 44px); font-weight: 500; letter-spacing: -.03em; line-height: 1.08; }
.login-pitch p { margin-top: 14px; color: rgba(255,255,255,.75); font-size: 17px; }
.login-flow { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.lf { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.12); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18); }
.lf .ic { width: 32px; height: 32px; border-radius: 9px; background: #fff; color: var(--brand); display: grid; place-items: center; }
.lf b { display: block; font-weight: 500; font-size: 14px; }
.lf small { display: block; font-size: 12px; color: rgba(255,255,255,.7); }
.login-flow .arrow { color: rgba(255,255,255,.6); }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 30px; font-weight: 500; letter-spacing: -.03em; }
.login-card > p { margin: 6px 0 26px; }
.login-card form { display: grid; gap: 16px; }
.login-btn { height: 46px; justify-content: center; font-size: 15px; width: 100%; }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin: -4px 0 -6px; }
.login-forgot { margin-top: 14px; }
.login-mobile-brand { display: none; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 28px; }
.login-mobile-brand .brandmark { background: var(--brand); color: #fff; width: 28px; height: 28px; }
.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--faint); }
.pw-toggle:hover { background: var(--hover); color: var(--ink); }
.demo { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-h { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.demo-u { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; text-align: left; transition: border-color .15s, background .15s; }
.demo-u:hover { border-color: var(--ink-2); background: #fbfbfa; }
.demo-u span:nth-child(2) { flex: 1; }
.demo-u b { display: block; font-weight: 500; font-size: 14px; }
.demo-u small { display: block; color: var(--muted); font-size: 12px; }
.demo-u > svg { color: var(--faint); }
.demo-av { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }

.user-card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin-top: 8px; border-radius: 12px; text-align: left; color: var(--muted); }
.user-card:hover { background: var(--hover); }
.user-card .avatar { width: 34px; height: 34px; font-size: 12px; }
.user-card .t { flex: 1; min-width: 0; }
.user-card b { display: block; font-weight: 500; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card small { display: block; font-size: 12px; }
button.avatar { border: 0; cursor: pointer; }
.user-menu { position: fixed; z-index: 50; width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; animation: toast .15s ease; }
.um-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.um-head b { display: block; font-weight: 500; }
.um-head small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.user-menu a, .user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.user-menu a:hover, .user-menu button:hover { background: var(--hover); }
.user-menu #sign-out { color: var(--red); }

.user-row { grid-template-columns: minmax(260px, 1.6fr) minmax(110px, .6fr) minmax(120px, .7fr) 110px 24px; }
.role-pick { display: grid; gap: 8px; }
.role-pick button { text-align: left; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; }
.role-pick button:hover:not(:disabled) { border-color: var(--ink-2); }
.role-pick button.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.role-pick button:disabled { opacity: .55; cursor: not-allowed; }
.role-pick b { display: block; font-weight: 500; }
.role-pick small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.help-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.help-step { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; transition: box-shadow .15s, transform .15s; }
.help-step:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.help-step .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.help-step b { font-weight: 500; font-size: 16px; }
.help-step p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.roles-tbl td.me { background: var(--brand-l); }
.roles-tbl td { padding: 10px 8px; }
.roles-tbl .r svg { display: inline-block; }
.kbd { min-width: 44px; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 8px; display: inline-grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--ink-2); flex-shrink: 0; }

@media (max-width: 1180px) { .help-steps { grid-template-columns: 1fr 1fr; } .user-row .c.last-c { display: none; } .user-row { grid-template-columns: minmax(220px, 1.6fr) minmax(100px, .6fr) 100px 24px; } }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-mobile-brand { display: flex; }
  .login-main { place-items: start center; padding-top: 56px; }
  .help-steps { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 1fr auto; }
  .user-row .c.nb, .user-row .go { display: none; }
  .user-row .c:nth-child(2) { border-left: 0; padding-right: 0; }
}

/* ── Part 7a: owner, facility switcher, all MRFs ───────────────── */
.rail .fac { border: 0; cursor: pointer; color: #fff; }
.rail .fac.all { background: var(--hover); color: var(--ink); box-shadow: none; }
.rail .fac.all.on, .rail .fac[data-fac].on { outline: 2px solid var(--ink); outline-offset: 3px; }
.rail .rail-sep { width: 28px; height: 1px; background: var(--line); }
.rail .fac.add { color: var(--faint); }
.brandrow.switcher { width: 100%; text-align: left; border-radius: 12px; padding: 8px 10px; margin-bottom: 14px; border-bottom: 0; background: var(--hover); }
.brandrow.switcher:hover { background: var(--active); }
.brandrow.switcher .brandmark { font-size: 12px; font-weight: 600; color: #fff; }
.brandrow.switcher.dim b { color: var(--muted); }
.fac-menu { padding: 6px; }
.fac-menu a, .fac-menu button { align-items: center; }
.fac-menu b { display: block; font-weight: 500; color: var(--ink); }
.fac-menu small { display: block; font-size: 12px; color: var(--muted); }
.fac-menu span:nth-child(2) { flex: 1; text-align: left; }
.fac-menu .sq { width: 30px; height: 30px; border-radius: 9px; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.fac-menu .cur { background: var(--hover); }
.fac-menu [data-add] { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; color: var(--brand); }
.fac-menu [data-add] b { color: var(--brand); }

.mrf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.mrf-card {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.mrf-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--fc, var(--line)); }
.mrf-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--line-2); }
.mrf-card-main { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 16px; width: 100%; text-align: left; color: inherit; font: inherit; }
.mrf-remove { align-self: flex-start; margin-top: 2px; }
.mrf-top { display: flex; align-items: center; gap: 12px; }
.mrf-top .sq { width: 40px; height: 40px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.mrf-top .t { flex: 1; min-width: 0; }
.mrf-top b { display: block; font-weight: 500; font-size: 17px; letter-spacing: -.01em; }
.mrf-top small { display: block; color: var(--muted); font-size: 13px; }
.mrf-mid { display: flex; gap: 18px; align-items: center; }
.mrf-mid > div:first-child { text-align: center; font-size: 12px; color: var(--muted); }
.mrf-nums { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.mrf-nums small { display: block; font-size: 12px; color: var(--muted); }
.mrf-nums b { font-weight: 500; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mrf-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.mrf-foot .go { display: inline-flex; gap: 4px; align-items: center; color: var(--ink); font-weight: 500; }
.mrf-card.add { align-items: center; justify-content: center; text-align: center; border-style: dashed; color: var(--muted); min-height: 220px; gap: 6px; }
.mrf-card.add .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--hover); display: grid; place-items: center; color: var(--ink); margin-bottom: 6px; }
.mrf-card.add b { color: var(--ink); font-weight: 500; }
.mrf-card.add small { max-width: 240px; font-size: 13px; }
.rtable.cmp th { position: static; cursor: default; }
.rtable.cmp tbody tr { cursor: pointer; }
.rtable.cmp tfoot td { position: static; }
.rtable.cmp .sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 10px; }

/* ── Part 7b: field staff Daily Entry (phone-first) ────────────── */
:lang(or) body, .fa:lang(or) { line-height: 1.55; }
.fa { min-height: 100vh; background: var(--page); max-width: 640px; margin: 0 auto; padding-bottom: 120px; }
.fa-hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; line-height: 1.45; }
.fa-cam { position: relative; border-radius: 16px; overflow: hidden; background: #111; aspect-ratio: 3/4; max-height: 360px; }
.fa-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fa-cam-frame { pointer-events: none; position: absolute; inset: 18% 14%; border: 2px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.fa-cam-btns { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.fa-cam-btns .btn { flex: 1; min-width: 140px; justify-content: center; }
.input.upper { text-transform: uppercase; letter-spacing: .04em; font-family: var(--mono, ui-monospace, monospace); }
.fa-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.fa-head .brandmark { width: 32px; height: 32px; flex-shrink: 0; }
.fa-head .t { flex: 1; min-width: 0; }
.fa-head b { display: block; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.fa-head small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fa-lang { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 500; background: #fff; }
.fa-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.fa-tabs button { font-size: 13px; padding: 0 6px; }
.fa-tabs button { height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--muted); }
.fa-tabs button.on { background: var(--ink); color: #fff; }
.fa-tabs .n { background: var(--amber); color: #fff; border-radius: 99px; font-size: 12px; padding: 0 7px; min-width: 20px; }
.fa-sec { padding: 16px 14px 4px; }
.fa-label { display: block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.fa-dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fa-dates > * { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; text-align: center; padding: 6px; }
.fa-dates > * svg { color: var(--muted); }
.fa-dates b { font-size: 15px; font-weight: 600; }
.fa-dates small { font-size: 12px; color: var(--muted); }
.fa-dates .on { border-color: var(--brand); background: var(--brand-l); box-shadow: 0 0 0 2px var(--brand) inset; }
.fa-dates .on b { color: var(--brand); }
.fa-dates input[type=date] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.fa-empty { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1.5px dashed var(--line-2); border-radius: 14px; color: var(--muted); background: #fff; font-size: 15px; }
.fa-line { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 8px; transition: border-color .15s; }
.fa-line:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.fa-line.bad { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-l); }
.fa-line .nm { flex: 1; min-width: 0; }
.fa-line .nm b { display: block; font-weight: 500; font-size: 16px; line-height: 1.25; }
.fa-line .nm small { display: block; font-size: 12px; color: var(--muted); }
.fa-line .kg { display: flex; align-items: baseline; gap: 4px; background: var(--hover); border-radius: 10px; padding: 0 10px; }
.fa-line .kg input { width: 92px; height: 48px; border: 0; background: none; outline: 0; text-align: right; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fa-line .kg em { font-style: normal; color: var(--muted); font-size: 14px; }
.fa-line .rm { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--faint); flex-shrink: 0; }
.fa-line .rm:hover { background: var(--red-l); color: var(--red); }
.fa-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--faint); margin-bottom: 10px; }
.fa-search input { flex: 1; border: 0; outline: 0; font-size: 16px; background: none; color: var(--ink); }
.fa-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.fa-cats::-webkit-scrollbar { display: none; }
.fa-cats button { flex-shrink: 0; height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; font-size: 15px; }
.fa-cats button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fa-mat { position: relative; display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 10px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; text-align: left; transition: border-color .12s, transform .08s; }
.fa-mat:active { transform: scale(.98); }
.fa-mat .tile { width: 46px; height: 46px; border-radius: 12px; }
.fa-mat b { display: block; font-weight: 500; font-size: 15px; line-height: 1.25; }
.fa-mat small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.2; }
.fa-mat.added { border-color: var(--green); background: #f6fbf8; }
.fa-mat .tick { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.fa textarea.input { font-size: 16px; }
.fa-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 640px; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -18px rgba(0,0,0,.25); }
.fa-bar .sum { flex: 1; }
.fa-bar .sum small { display: block; color: var(--muted); font-size: 13px; }
.fa-bar .sum b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fa-bar .sum em { font-style: normal; font-size: 14px; color: var(--muted); font-weight: 400; }
.fa-save { height: 54px; padding: 0 26px; font-size: 17px; border-radius: 14px; justify-content: center; background: var(--green); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.fa-save:hover { background: #17843b; }
.fa-save:disabled { opacity: .45; }
.fa-err { color: var(--red); font-size: 14px; padding: 8px 14px; min-height: 20px; }
.fa-done { text-align: center; padding: 56px 24px; }
.fa-done .big-tick { width: 88px; height: 88px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; box-shadow: 0 0 0 10px var(--green-l); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.fa-done h2 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.fa-done p { margin-top: 6px; }
.fa-done-total { margin: 18px auto 6px; font-size: 18px; color: var(--ink-2); }
.fa-done-total b { font-size: 40px; font-weight: 600; letter-spacing: -.03em; color: var(--ink); }
.fa-done-btns { display: grid; gap: 10px; max-width: 320px; margin: 26px auto 0; }
.fa-done-btns .btn { height: 52px; justify-content: center; font-size: 16px; }
.ic-soft { width: 64px; height: 64px; border-radius: 18px; background: var(--hover); display: grid; place-items: center; margin: 0 auto 16px; color: var(--ink-2); }
.fa-list { padding: 14px; display: grid; gap: 10px; }
.fa-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.fa-card.returned { border-color: #f5c2c3; }
.fa-card.withdrawn { opacity: .6; }
.fa-card .top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.fa-card .top b { display: block; font-size: 16px; font-weight: 600; }
.fa-card .top small { font-size: 12px; color: var(--muted); }
.fa-card ul { list-style: none; border-top: 1px solid var(--line); }
.fa-card li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.fa-card li b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fa-card li s { color: var(--faint); font-weight: 400; margin-left: 4px; }
.fa-card .tot { display: flex; justify-content: space-between; padding: 10px 0 2px; font-size: 16px; }
.fa-card .tot b { font-weight: 600; }
.fa-note { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--ink-2); background: var(--hover); border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.fa-note svg { margin-top: 3px; flex-shrink: 0; }
.fa-note.bad { background: var(--red-l); color: #9b1c1f; }
.fa-card .btn.sm { margin-top: 10px; }
@media (min-width: 600px) { .fa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fa { border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: #fbfbfa; } }
.nav .count.amber { background: var(--amber); color: #fff; }
.entry-row { grid-template-columns: minmax(260px, 1.5fr) minmax(200px, 1.2fr) minmax(120px, .7fr) 130px; }
.entry-row.withdrawn, .entry-row.returned { opacity: .7; }
.rv-lines { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rv-line { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rv-line .nm { flex: 1; min-width: 0; }
.rv-line .nm b { display: block; font-weight: 500; }
.rv-line .nm small { display: block; font-size: 12px; color: var(--muted); }
.rv-line .unit { width: 150px; }
.rv-line .input { height: 40px; text-align: right; padding-right: 36px; font-weight: 500; }
.rv-line .input.changed { border-color: var(--amber); background: var(--amber-l); }
.rv-line s { font-weight: 400; font-size: 13px; margin-left: 6px; }
.rv-total { display: flex; justify-content: space-between; padding: 12px 14px; background: var(--band); font-weight: 500; }
.rv-total b { font-size: 18px; font-variant-numeric: tabular-nums; }
.demo-u small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1180px) { .entry-row { grid-template-columns: minmax(220px, 1.5fr) minmax(110px, .7fr) 120px; } .entry-row .c.mats-c { display: none; } }
@media (max-width: 900px) { .entry-row { grid-template-columns: 1fr auto; } .entry-row .c:nth-child(3) { display: none; } .entry-row .c.nb { border-left: 0; } }

/* ── Part 8a: EPR & compliance ─────────────────────────────────── */
.report-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.buy-row { grid-template-columns: minmax(240px, 1.5fr) minmax(80px, .5fr) minmax(100px, .7fr) minmax(120px, .8fr) minmax(110px, .7fr) minmax(130px, .8fr) minmax(100px, .6fr) 24px; }
.epr-tag { color: var(--brand); font-weight: 500; }
.badge { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 7px; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600; }
.warn-card { border-color: #f6d8a8; background: #fffbf3; }
.epr-cats { display: grid; gap: 4px; }
.epr-cat { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.epr-cat:last-child { border-bottom: 0; }
.epr-cat .badge { min-width: 38px; height: 28px; font-size: 13px; }
.epr-cat .t { flex: 1; min-width: 0; }
.epr-cat b { display: block; font-weight: 500; font-size: 14px; }
.epr-cat small { color: var(--muted); font-size: 12px; }
.epr-cat .r { font-weight: 500; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.q-row .q { width: 28px; font-weight: 500; color: var(--muted); font-size: 13px; }
.q-row .q-bar { display: flex; height: 18px; border-radius: 5px; overflow: hidden; gap: 2px; min-width: 4px; }
.q-row .q-bar span { height: 100%; }
.q-row .num { margin-left: auto; font-size: 13px; font-weight: 500; }
.mat-epr { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 32px 0; }
.mat-epr .me { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; background: #fff; }
.mat-epr .me b { font-weight: 500; }
.mat-epr .tile.sm { width: 30px; height: 30px; border-radius: 8px; }
.doc-row { grid-template-columns: minmax(240px, 1.4fr) minmax(150px, .9fr) minmax(170px, 1fr) 130px 24px; }
.file-field .ff-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--band); color: var(--muted); }
.file-field .ff-name { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-field.bad .ff-box { border-color: var(--red); }
.file-field.bad .ff-name { color: var(--red); }
.epr-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--red-l); color: #8f1c1e; font-size: 14px; }
.epr-warn svg { flex-shrink: 0; margin-top: 2px; }
.epr-warn b { font-weight: 600; }
@media (max-width: 1180px) {
  .report-tabs { grid-template-columns: repeat(6, minmax(150px, 1fr)); }
  .buy-row { grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .8fr) minmax(130px, .8fr) 24px; }
  .buy-row .c.due-c { display: none; }
  .doc-row { grid-template-columns: minmax(220px, 1.4fr) minmax(130px, .8fr) 120px 24px; }
  .doc-row .c:nth-child(3) { display: none; }
}
@media (max-width: 900px) {
  .buy-row .c.epr-c { grid-column: 1 / -1; border-left: 0; padding: 0 0 0 64px; }
  .buy-row .c.epr-c .lbl { display: none; }
  .doc-row { grid-template-columns: 1fr auto; }
  .doc-row .c:nth-child(2) { display: none; }
  .doc-row .c.nb { border-left: 0; }
  .mat-epr { padding: 16px 16px 0; }
}

/* ── Part 8b: bidder verification (head office) ────────────────── */
.bid-row { grid-template-columns: minmax(260px, 1.5fr) minmax(120px, .8fr) minmax(170px, 1fr) minmax(110px, .7fr) 150px 24px; }
.rv-docs { display: grid; gap: 8px; }
.rv-doc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.rv-doc .top { display: flex; align-items: center; gap: 10px; }
.rv-doc .top .t { flex: 1; min-width: 0; }
.rv-doc .top b { display: block; font-weight: 500; }
.rv-doc .top small { display: block; color: var(--muted); font-size: 12px; }
.rv-doc-act { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.rv-doc-act .seg button { height: 32px; font-size: 13px; }
.rv-doc-act .seg button[data-st="approved"].on { background: var(--green); border-color: var(--green); }
.rv-doc-act .seg button[data-st="rejected"].on { background: var(--red); border-color: var(--red); }
.rv-doc-act .input { height: 36px; font-size: 13px; flex: 1; }
@media (max-width: 1180px) { .bid-row { grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 1fr) 130px 24px; } .bid-row .c:nth-child(2), .bid-row .c:nth-child(4) { display: none; } }
@media (max-width: 900px) { .bid-row { grid-template-columns: 1fr auto; } .bid-row .c:nth-child(3) { display: none; } .bid-row .c.nb { border-left: 0; } .rv-doc-act { flex-wrap: wrap; } }
.nav a.on .count.amber { background: var(--amber); color: #fff; }
.kv .v svg { display: inline-block; vertical-align: -2px; }

/* ── Part 8c: lots (MRF side) ──────────────────────────────────── */
.lot-row { grid-template-columns: minmax(260px, 1.5fr) minmax(150px, .9fr) minmax(120px, .8fr) minmax(130px, .8fr) 170px 24px; }
.val.hot { color: var(--red); font-weight: 500; }
.lot-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.lot-hero img, .lot-hero .lot-art { width: 140px; height: 104px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.lot-art { display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, #f4f4f2); }
.lot-art .tile { background: none; box-shadow: none; width: auto; height: auto; }
.lot-art .tile svg { width: 56px; height: 56px; }
.lot-hero .big { font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.lot-hero .big small { font-size: 15px; color: var(--muted); }
.lot-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.lot-ph, .lot-add { width: 96px; height: 76px; border-radius: 12px; overflow: hidden; position: relative; }
.lot-ph img { width: 100%; height: 100%; object-fit: cover; }
.lot-ph.up { opacity: .6; }
.lot-ph span { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; text-align: center; padding: 2px; }
.lot-add { border: 1.5px dashed var(--line-2); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: 12px; cursor: pointer; background: var(--band); }
.lot-add:hover { border-color: var(--ink-2); color: var(--ink); }
.lot-preview { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--brand-l); color: #1a3ea8; font-size: 14px; }
.lot-preview:empty { display: none; }
.lot-preview svg { flex-shrink: 0; margin-top: 2px; }
.terms [hidden] { display: none !important; }
@media (max-width: 1180px) { .lot-row { grid-template-columns: minmax(220px, 1.5fr) minmax(130px, .8fr) minmax(120px, .8fr) 150px 24px; } .lot-row .c:nth-child(3) { display: none; } }
@media (max-width: 900px) { .lot-row { grid-template-columns: 1fr auto; } .lot-row .c:nth-child(2), .lot-row .c:nth-child(4) { display: none; } .lot-row .c.nb { border-left: 0; } .lot-hero { flex-direction: column; align-items: flex-start; } }
.dep-row { grid-template-columns: minmax(260px, 1.5fr) minmax(120px, .7fr) minmax(170px, 1fr) 260px; }
.dep-act { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.mk-status { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.mk-status.ok { background: var(--green-l); color: #146c34; }
.mk-status.info { background: var(--brand-l); color: #1a3ea8; }
@media (max-width: 900px) { .dep-row { grid-template-columns: 1fr; row-gap: 8px; } .dep-row .c { border-left: 0; padding: 0; } .dep-act { justify-content: flex-start; } }
.ord-row { grid-template-columns: minmax(250px, 1.4fr) minmax(150px, .9fr) minmax(170px, 1fr) minmax(150px, .9fr) 170px 24px; }
.weigh-box { border: 1.5px solid var(--brand); border-radius: 14px; padding: 16px; background: #fbfcff; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.doc-btn { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-align: left; font-size: 13px; }
.doc-btn:hover { border-color: var(--ink-2); }
.doc-btn span { font-weight: 500; } .doc-btn small { color: var(--muted); font-size: 11px; }
.mk-log { list-style: none; }
.mk-log li { padding: 8px 0 8px 16px; border-left: 2px solid var(--line); position: relative; }
.mk-log li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.mk-log li:first-child::before { background: var(--brand); }
.mk-log b { display: block; font-weight: 500; font-size: 14px; } .mk-log small { color: var(--muted); font-size: 12px; } .mk-log p { font-size: 13px; color: var(--ink-2); }
@media (max-width: 1180px) { .ord-row { grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 1fr) 150px 24px; } .ord-row .c:nth-child(2), .ord-row .c:nth-child(4) { display: none; } }
@media (max-width: 900px) { .ord-row { grid-template-columns: 1fr auto; } .ord-row .c:nth-child(3) { display: none; } .ord-row .c.nb { border-left: 0; } .doc-grid { grid-template-columns: 1fr; } }
.login-home { margin-left: auto; font-size: 13px; font-weight: 400; color: rgba(255,255,255,.8); }
.login-home:hover { color: #fff; }
.login-mobile-brand .login-home { color: var(--muted); }
