/* ==================================================================
   Panchayati Gaushala Rishikesh — Operations & Coupon Ledger
   Administrative Design System
   Clean, calm, practical internal office application.
   ================================================================== */

:root {
  /* Surfaces & Backgrounds: Warm, archival paper tone reflecting Gita Press / Gaushala heritage */
  --bg: #f8f6f0;
  --bg-subtle: #fbf9f5;
  --card: #ffffff;
  --card-head: #faf7f2;
  --card-alt: #fdfcf9;

  /* Borders & Dividers */
  --rule: #e5dfd3;
  --rule-soft: #f2eee6;
  --rule-dark: #d5ccbe;

  /* Inks & Text */
  --ink: #161c24;
  /* Deep warm charcoal */
  --ink-soft: #384252;
  /* Medium dark */
  --ink-mute: #687282;
  /* Muted metadata */
  --ink-faint: #98a2b0;
  /* Placeholders */

  /* Administrative Brand: Vedic Midnight Slate */
  --slate: #182230;
  /* Deep midnight slate */
  --slate-hi: #253346;
  /* Slate hover */
  --slate-dark: #0f1722;
  /* Deepest slate */
  --slate-light: #f2eee6;
  /* Warm light slate */

  /* Operational Semantic Tokens */
  --accept: #15803d;
  /* Forest / Vrindavan Green (Redeemed) */
  --accept-bg: #f0fdf4;
  --accept-border: #bbf7d0;

  --amber: #b45309;
  /* Saffron / Kesari (Sold / Pending) */
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;

  --reject: #8b1a1a;
  /* Traditional Gerua / Sindoor Red (Void / Alert) */
  --reject-bg: #fef2f2;
  --reject-border: #fecaca;

  --info: #1d4ed8;
  /* Allocations / Stock */
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  /* Gaumata Cultural & Traditional Accents */
  --gaumata-red: #8b1a1a;
  --gaumata-gold: #c9a227;
  --gaumata-gold-hi: #e8d08a;
  --saffron: #c25e00;
  --saffron-soft: #fff7ed;
  --saffron-border: #fed7aa;

  /* Typography */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "Nirmala UI", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;

  /* Navigation & Layout */
  --nav: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ------------------------------------------------------------- Reset & Base */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

body {
  padding-bottom: calc(var(--nav) + var(--safe-b));
}

a {
  color: var(--info);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hide {
  display: none !important;
}

/* ------------------------------------------------------------- Mobile Header */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--slate);
  color: #ffffff;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--gaumata-gold);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

header .who {
  min-width: 0;
  justify-self: start;
  max-width: 100%;
}

header .who b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

header .who span {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 500;
}

header .who-btn {
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px 6px 4px 0;
  text-align: left;
  border-radius: 6px;
  max-width: 100%;
  transition: background 0.15s ease;
}

header .who-btn:hover,
header .who-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

header .who-btn .who-hint {
  display: none;
}

header .header-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  max-width: min(48vw, 200px);
  text-align: center;
}

header .shri-hari {
  margin: 0;
  font-family: var(--serif);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  color: var(--gaumata-gold-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

header .header-jai {
  font-family: var(--serif);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #f1c5c2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  justify-self: end;
}

header .header-gaumata .gaumata-img {
  width: 36px;
  height: 36px;
}

/* ------------------------------------------------------------- Gaumata Mark */

.gaumata-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.gaumata-mark .gaumata-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  line-height: 1.2;
  gap: 2px;
}

.gaumata-mark .gaumata-text .hi {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--gaumata-gold-hi);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gaumata-mark .gaumata-text .en {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #e2e8f0;
  white-space: nowrap;
}

.gaumata-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  display: block;
  flex-shrink: 0;
  border: 1.5px solid var(--gaumata-gold);
  background: #1a1208;
}

/* ------------------------------------------------------------- Network Pill */

.net {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.net::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.net.on {
  color: #15803d;
  background: #dcfce7;
  border-color: #86efac;
}

.net.on::before {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.net.off {
  color: #b45309;
  background: #fef3c7;
  border-color: #fde68a;
}

.net.off::before {
  background: #d97706;
}

.net .q {
  font-family: var(--mono);
}

/* ------------------------------------------------------------- Main Views */

main {
  padding: 16px 16px 28px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.full-page-view {
  width: 100%;
}

.view {
  display: none;
}

.view.on {
  display: block;
}

/* ------------------------------------------------------------- Typography */

h1 {
  font-family: var(--sans);
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.lede {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 16px;
  line-height: 1.5;
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  font-weight: 700;
}

/* ------------------------------------------------------------- Cards */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.card h2 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.card h3 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
}

/* ------------------------------------------------------------- Scanner */

.cam {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cam video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cam .off {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
}

.cam .frame {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 38%;
  height: 24%;
  border: 2px solid #ffffff;
  border-radius: 6px;
  box-shadow: 0 0 0 2000px rgba(15, 23, 42, 0.45);
}

.cam .frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

/* ------------------------------------------------------------- Scanner Verdict */
/* Vital operational component for milk counter: read at arm's length */

.verdict {
  margin-top: 14px;
  border: 2px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  padding: 20px 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.verdict .code {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -1px;
}

.verdict .cno {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 5px;
}

.verdict .title {
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  margin: 8px 0 6px;
  letter-spacing: -0.02em;
}

.verdict .msg {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.verdict .idle {
  color: var(--ink-mute);
  font-size: 15px;
  text-align: center;
}

.verdict.ok {
  background: var(--accept-bg);
  border-color: var(--accept);
}

.verdict.ok .title,
.verdict.ok .code {
  color: var(--accept);
}

.verdict.bad {
  background: var(--reject-bg);
  border-color: var(--reject);
}

.verdict.bad .title,
.verdict.bad .code {
  color: var(--reject);
}

.verdict.warn {
  background: var(--amber-bg);
  border-color: var(--amber);
}

.verdict.warn .title,
.verdict.warn .code {
  color: var(--amber);
}

.verdict .prior {
  margin-top: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border-left: 4px solid currentColor;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.verdict .prior.red {
  border-left-color: var(--reject);
}

.verdict .prior.green {
  border-left-color: var(--accept);
}

.verdict .prior b {
  font-family: var(--mono);
  color: var(--ink);
}

.verdict .prior .who {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 4px;
}

.verdict .prior .verify {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.verdict .prior .verify .linkbtn {
  margin-left: 6px;
  font-size: 12.5px;
}

.verdict .pending {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
}

.verdict .pending.red {
  color: var(--reject);
}

@keyframes pop {
  from {
    transform: scale(0.98);
    opacity: 0.7;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.verdict.hit {
  animation: pop 0.15s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .verdict.hit {
    animation: none;
  }
}

/* ------------------------------------------------------------- Counter Tally */

.tally {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  min-width: 0;
}

.tally>div {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--slate);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tally .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tally .val {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-top: 4px;
  color: var(--ink);
}

.tally>div.g {
  border-left-color: var(--accept);
}

/* ------------------------------------------------------------- Inputs & Form Controls */

label.f {
  display: block;
  margin-bottom: 14px;
}

label.f>span {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 5px;
}

input,
select,
textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--rule-dark);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  padding-right: 30px;
}

input[type=number],
input.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

textarea {
  min-height: 64px;
  resize: vertical;
}

input.input-error,
select.input-error,
textarea.input-error {
  border-color: var(--reject, #e53935) !important;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.18) !important;
}

.err-msg {
  display: block;
  color: var(--reject, #e53935);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16);
}

label.f.cb {
  display: flex;
  align-items: center;
  gap: 8px;
}

label.f.cb input {
  width: auto;
  margin: 0;
}

label.f.cb>span {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--slate);
  background: var(--slate);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--slate-hi);
  border-color: var(--slate-hi);
}

.btn:active {
  background: var(--slate-dark);
  transform: translateY(1px);
}

.btn.primary {
  background: var(--slate);
  border-color: var(--slate);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--slate-hi);
}

.btn.wide {
  width: 100%;
}

.btn.big {
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
}

.btn.ghost {
  background: #ffffff;
  color: var(--ink-soft);
  border: 1px solid var(--rule-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn.ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--ink-mute);
  color: var(--ink);
}

.btn.ghost:active {
  background: var(--rule-soft);
}

.btn.danger {
  background: var(--reject);
  border-color: var(--reject);
  color: #ffffff;
}

.btn.danger:hover {
  background: #991b1b;
  border-color: #991b1b;
}

.btn.sm {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
  line-height: 1.25;
}

.btn.undo {
  background: var(--reject-bg);
  color: var(--reject);
  border-color: var(--reject-border);
  box-shadow: none;
}

.btn.undo:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.btn.undo:active {
  background: #fecaca;
}

.inline-act {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btnrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------- Lists */

.list {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  transition: background 0.1s ease;
}

.item:last-child {
  border-bottom: 0;
}

.item .l {
  min-width: 0;
}

.item .l b {
  display: block;
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
}

.item .l small {
  color: var(--ink-mute);
  font-size: 12px;
}

.item .r {
  text-align: right;
  white-space: nowrap;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}

.item.tap {
  cursor: pointer;
}

.item.tap:hover {
  background: var(--bg-subtle);
}

.item.tap:active {
  background: var(--rule-soft);
}

/* ------------------------------------------------------------- Badges & Tags */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid transparent;
  line-height: 1.3;
  white-space: nowrap;
}

/* Semantic Badges */
.tag.UNUSED,
.tag.unused,
.tag.ok,
.tag.accept,
.tag.active,
.tag.FREE {
  color: var(--accept);
  border-color: var(--accept-border);
  background: var(--accept-bg);
}

.tag.ALLOCATED,
.tag.ALLOCATED_TO_BRANCH,
.tag.IN_HO_STOCK,
.tag.IN_BRANCH_STOCK,
.tag.blue {
  color: var(--info);
  border-color: var(--info-border);
  background: var(--info-bg);
}

.tag.SOLD,
.tag.SOLD_TO_BUYER {
  color: #0369a1;
  border-color: #bae6fd;
  background: #f0f9ff;
}

.tag.REDEEMED,
.tag.redeemed,
.tag.USED,
.tag.used,
.tag.FINISHED,
.tag.finished,
.tag.amber,
.tag.saffron {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

.tag.PRINTED {
  color: var(--ink-soft);
  border-color: var(--rule);
  background: var(--rule-soft);
}

.tag.DUPLICATE,
.tag.UNKNOWN,
.tag.NOT_SOLD,
.tag.VOID,
.tag.CANCELLED,
.tag.cancelled,
.tag.RESELL_ATTEMPT,
.tag.WRONG_BRANCH,
.tag.OFFLINE_CONFLICT,
.tag.reject,
.tag.high,
.tag.warn {
  color: var(--reject);
  border-color: var(--reject-border);
  background: var(--reject-bg);
}

.tag.QUEUED {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

.badge-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.badge-num.blue,
.badge-num.allocated {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

.badge-num.green,
.badge-num.used,
.badge-num.redeemed {
  background: var(--accept-bg);
  color: var(--accept);
  border: 1px solid var(--accept-border);
}

.badge-num.saffron,
.badge-num.amber,
.badge-num.stock,
.badge-num.remaining,
.badge-num.teal {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.badge-num.code,
.badge-num.slate {
  background: var(--rule-soft);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}

/* ------------------------------------------------------------- Empty & Hints */

.empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 13.5px;
}

.hint {
  font-size: 12.5px;
  color: var(--ink-mute);
  margin-top: 6px;
  line-height: 1.45;
}

/* ------------------------------------------------------------- Mobile Bottom Nav */

nav.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: #ffffff;
  border-top: 1px solid var(--rule);
  padding-bottom: var(--safe-b);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.tabs .tab {
  flex: 1;
  border: 0;
  background: none;
  padding: 8px 2px 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  transition: color 0.15s ease;
}

.tabs .tab .ic {
  font-size: 19px;
  line-height: 1;
}

.tabs .tab.on {
  color: var(--saffron);
  font-weight: 600;
}

.tabs .tab.on::after {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2.5px;
  background: #d97706;
  border-radius: 0 0 2px 2px;
}

.tabs .tab .badge {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 6px;
  background: var(--reject);
  color: #ffffff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  font-family: var(--mono);
}

/* ------------------------------------------------------------- Toast */

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav) + var(--safe-b) + 14px);
  background: var(--slate-dark);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 50;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toast.ok {
  background: var(--accept);
}

.toast.bad {
  background: var(--reject);
}

/* ------------------------------------------------------------- Login View */

.login {
  max-width: 400px;
  margin: 40px auto 0;
  padding: 32px 28px;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-top: 3.5px solid var(--gaumata-gold);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.login-shri {
  text-align: center;
  color: var(--amber) !important;
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login-gaumata {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 20px;
}

.login-gaumata .gaumata-img {
  width: 96px;
  height: 96px;
  border: 2.5px solid var(--gaumata-gold);
  box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.4), 0 0 0 6px rgba(201, 162, 39, 0.2), 0 8px 24px rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

.login-gaumata .gaumata-text {
  align-items: center;
  text-align: center;
  gap: 2px;
}

.login-gaumata .gaumata-text .hi {
  font-family: var(--serif);
  color: var(--saffron);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-gaumata .gaumata-text .en {
  color: var(--ink-mute);
  font-size: 11px;
}

.login .mark {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.gn-main,
.gn-place {
  display: block;
}

.gn-place {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-top: 2px;
}

.login .mark .gn-place {
  font-size: 13px;
  margin-top: 3px;
}

.login .sub {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  font-weight: 600;
  margin: 0 0 20px;
}

.login .f {
  text-align: left;
  margin-bottom: 14px;
}

.login #signin {
  margin-top: 6px;
  padding: 10px 16px;
  background: var(--saffron);
  border-color: #9a4800;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(194, 94, 0, 0.2);
}

.login #signin:hover {
  background: var(--amber);
  border-color: #78350f;
}

.login .hint {
  margin-top: 18px;
  line-height: 1.5;
  font-size: 12px;
}

.branding-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
}

/* ------------------------------------------------------------- Desktop Layout (>= 900px) */

.rail {
  display: none;
}

.body {
  min-width: 0;
  flex: 1;
}

@media (min-width: 900px) {
  #app {
    display: flex;
    min-height: 100vh;
  }

  body {
    padding-bottom: 0;
    background: var(--bg);
  }

  .rail {
    display: flex;
    flex-direction: column;
    width: 248px;
    flex: 0 0 248px;
    background: var(--slate);
    color: #e2e8f0;
    padding: 14px 0;
    border-right: 1px solid #0f1722;
    border-top: 3.5px solid var(--gaumata-gold);
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.08);
  }

  .rail .brand {
    padding: 4px 14px 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .rail .brand::before {
    content: "|| श्रीहरि: ||";
    display: block;
    text-align: center;
    font-family: var(--serif);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gaumata-gold-hi);
    margin-bottom: 10px;
    opacity: 0.95;
  }

  .rail .rail-gaumata {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 0 8px;
    padding: 0;
    gap: 8px;
    width: 100%;
  }

  .rail .rail-gaumata .gaumata-img {
    order: 1;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2.5px solid var(--gaumata-gold);
    box-shadow: 0 0 0 2.5px rgba(139, 26, 26, 0.45), 0 0 0 5px rgba(201, 162, 39, 0.25), 0 8px 20px rgba(0, 0, 0, 0.35);
    background: #1a1208;
    margin: 2px auto;
    transition: transform 0.2s ease;
  }

  .rail .rail-gaumata .gaumata-img:hover {
    transform: scale(1.03);
  }

  .rail .rail-gaumata .gaumata-text {
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
  }

  .rail .rail-gaumata .gaumata-text .hi {
    font-family: var(--serif);
    color: var(--gaumata-gold-hi);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.25;
  }

  .rail .rail-gaumata .gaumata-text .en {
    color: #cbd5e1;
    font-size: 9.5px;
    letter-spacing: 0.05em;
    font-weight: 500;
  }

  .rail .brand .mark {
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-align: center;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .rail .brand .gn-main {
    display: block;
    font-family: var(--serif);
    font-size: 16.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.01em;
  }

  .rail .brand .gn-place {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--gaumata-gold-hi);
    margin-top: 3px;
    letter-spacing: 0.03em;
  }

  .login .mark .gn-place {
    color: var(--ink-mute);
    font-size: 12.5px;
    margin-top: 3px;
  }

  .rail .brand .sub {
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-top: 5px;
    font-weight: 600;
  }

  .rail nav {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
    background: none;
    border: 0;
    overflow-y: auto;
  }

  .rail nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    transition: all 0.15s ease;
  }

  .rail nav a .ic {
    font-size: 15px;
    width: 18px;
    text-align: center;
    opacity: 0.8;
  }

  .rail nav a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
  }

  .rail nav a.on {
    background: rgba(217, 119, 6, 0.16);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 3.5px 0 0 #d97706;
  }

  .rail nav a.on .ic {
    color: var(--gaumata-gold-hi);
    opacity: 1;
  }

  .railbadge {
    margin-left: auto;
    background: var(--reject);
    color: #ffffff;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 6px;
    font-family: var(--mono);
  }

  .rail .railfoot {
    margin-top: auto;
    padding: 0 14px 12px;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: none;
  }

  .rail .railfoot .surabhyai-namah {
    width: 100%;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--gaumata-gold-hi);
    font-family: var(--serif);
    letter-spacing: 0.08em;
    margin: 0 0 4px;
    padding: 10px 0 0;
    border: none;
    opacity: 1;
    line-height: 1.3;
  }

  .rail .railfoot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .rail .rail-who.who-btn {
    cursor: pointer;
    border: 0;
    background: transparent;
    color: #ffffff;
    padding: 2px 4px;
    text-align: left;
    font: inherit;
    border-radius: 6px;
    flex: 1;
    min-width: 0;
  }

  .rail .rail-who.who-btn:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .rail .rail-who b {
    display: block;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rail .rail-who .who-hint {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.04em;
  }

  header {
    display: none;
  }

  nav.tabs {
    display: none;
  }

  main {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 24px 32px 60px;
    box-sizing: border-box;
  }

  #v-sell,
  #v-scan,
  #v-settings {
    max-width: 860px;
    width: 100%;
  }

  #v-myday {
    max-width: 580px;
    width: 100%;
  }

  #v-myday .myday-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 14px;
    max-width: 580px;
  }

  #v-myday .myday-bar {
    max-width: 580px;
    display: flex;
    gap: 10px;
  }

  #v-myday #mdList,
  #v-myday .list {
    max-width: 580px;
  }

  .wrap2 {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  .stats {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .row3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 899px) {
  .wrap2 {
    display: block;
  }

  .wrap2>div+div {
    margin-top: 14px;
  }

  .row3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .row3 label.f:last-child {
    grid-column: 1 / -1;
  }
}

/* ------------------------------------------------------------- Page Headers & Stats */

.pagehead {
  margin-bottom: 16px;
}

.pagehead h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--slate);
}

.stat .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat .val {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-top: 4px;
  line-height: 1.2;
  color: var(--ink);
}

.stat .note {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 4px;
  line-height: 1.35;
}

.stat .note:empty {
  display: none;
  margin: 0;
}

/* Stat color variants */
.stat.green::before,
.stat.used::before,
.stat.redeemed::before {
  background: var(--accept);
}

.stat.green .val {
  color: var(--accept);
}

.stat.amber::before,
.stat.saffron::before,
.stat.teal::before {
  background: var(--amber);
}

.stat.amber .val {
  color: var(--amber);
}

.stat.red::before,
.stat.maroon::before {
  background: var(--reject);
}

.stat.red .val {
  color: var(--reject);
}

.stat.slate::before {
  background: var(--slate);
}

.stats-compact .stat {
  padding: 10px 14px;
}

.stats-compact .stat .val {
  margin-top: 2px;
}

/* ------------------------------------------------------------- My Round Bar */

.myday-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 14px;
  min-width: 0;
}

.myday-bar input[type=date] {
  flex: 1;
  min-width: 0;
  width: auto;
}

.myday-bar .btn {
  flex-shrink: 0;
  padding: 8px 16px;
  align-self: stretch;
}

/* ------------------------------------------------------------- Tables */

.tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  background: var(--card-head);
  position: sticky;
  top: 0;
  z-index: 5;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
  color: var(--ink);
}

tr:last-child td {
  border-bottom: 0;
}

td.num,
th.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 500;
}

tbody tr {
  transition: background 0.1s ease;
}

tbody tr:hover td {
  background: var(--bg-subtle);
}

/* ── Serial row numbering ─────────────────────────────────────────────── */
/* Applied globally; use class "no-serial" on a <table> to opt out        */
table:not(.no-serial) tbody {
  counter-reset: serial-row;
}
table:not(.no-serial) tbody tr {
  counter-increment: serial-row;
}
/* Invisible first-child spacer on the header row — keeps columns aligned */
table:not(.no-serial) thead th:first-child::before {
  content: '#';
  display: inline-block;
  min-width: 22px;
  margin-right: 6px;
  font-size: 10px;
  color: var(--ink-faint);
  font-weight: 600;
  letter-spacing: 0.04em;
}
table:not(.no-serial) tbody tr td:first-child::before {
  content: counter(serial-row);
  display: inline-block;
  min-width: 22px;
  margin-right: 6px;
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 500;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover td {
  background: var(--rule-soft) !important;
}

tr.void td {
  color: var(--ink-faint);
}

tr.void td:first-child {
  text-decoration: line-through;
}

td.empty {
  text-align: center;
  color: var(--ink-mute);
  padding: 24px 14px;
  font-style: normal;
}

table.stock td {
  padding: 10px 12px;
}

table.stock td.num {
  font-size: 14.5px;
  font-weight: 600;
}

table.stock tr.total td {
  border-top: 2px solid var(--rule);
  border-bottom: 0;
  font-weight: 700;
  background: var(--bg-subtle);
}

table.stock td .sub {
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 400;
}

table.kv {
  margin-top: 10px;
}

table.kv td.klabel {
  color: var(--ink-mute);
  width: 160px;
  white-space: nowrap;
  font-weight: 500;
}

.bigcode {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1;
}

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--info);
  text-decoration: underline;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
}

.linkbtn:hover {
  color: var(--slate-dark);
}

.linkbtn.danger-link {
  color: var(--reject);
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 16px 0;
}

/* ------------------------------------------------------------- Modal Dialogs */

dialog {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 22px 24px;
  background: #ffffff;
  color: var(--ink);
  width: min(500px, 92vw);
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

dialog#ask h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
}

dialog#ask .f {
  margin-bottom: 14px;
}

dialog#ask .f span {
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Safari Fallback Dialog */
dialog.fallback {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  width: min(500px, 92vw);
  max-width: 500px;
  max-height: 88vh;
  overflow-y: auto;
}

body.dialog-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 99;
}

body.dialog-open {
  overflow: hidden;
}

/* ------------------------------------------------------------- Filter Bar & Chips */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.filter-count {
  font-size: 12.5px;
  color: var(--ink-mute);
  font-weight: 500;
}

.filter-panel {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg-subtle);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.filter-panel .f {
  margin: 0;
}

.filter-panel .filt-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--rule);
  color: var(--ink);
}

.filter-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-mute);
}

.filter-chip button:hover {
  color: var(--reject);
}

.ac-wrap {
  position: relative;
}

.ac-list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: 100%;
  max-height: 200px;
  overflow: auto;
  margin: 2px 0 0;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ac-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.ac-list button:hover,
.ac-list button.active {
  background: var(--bg-subtle);
}

/* ------------------------------------------------------------- Progress Bar & Analytics */

.bar,
.progbar {
  height: 6px;
  background: var(--rule-soft);
  border-radius: 9999px;
  overflow: hidden;
}

.bar-fill,
.progbar>div {
  height: 100%;
  width: 0;
  background: var(--slate);
  transition: width 0.2s ease-out;
}

.bar-fill.done {
  background: var(--accept);
}

.bar-fill.bad {
  background: var(--reject);
}

.analytics-card {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.stacked-chart-bar {
  display: flex;
  height: 14px;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--rule-soft);
  margin: 12px 0 8px;
}

.stacked-segment {
  height: 100%;
  transition: width 0.3s ease-out;
}

.stacked-segment.redeemed {
  background: var(--accept);
}

.stacked-segment.remaining {
  background: var(--amber);
}

.stacked-segment.other {
  background: var(--ink-mute);
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-top: 6px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.redeemed {
  background: var(--accept);
}

.legend-dot.remaining {
  background: var(--amber);
}

.branch-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.branch-chart-item {
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
}

.branch-chart-item .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.branch-chart-item .bname {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}

/* ------------------------------------------------------------- Section Headings */

h2.sectionhead {
  font-family: var(--sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400e;
  font-weight: 700;
  margin: 20px 0 10px;
  padding: 2px 0 6px 10px;
  border-left: 3px solid #d97706;
  border-bottom: 1px solid var(--rule);
}

h2.sectionhead:first-of-type {
  margin-top: 4px;
}

h2.sectionhead span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  font-weight: normal;
}

/* ------------------------------------------------------------- Status Alerts & Verification */

.verdict-line,
.gapok,
.gapbad,
.pdfok,
.pdfbad,
.pdfwarn {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  border-left: 4px solid currentColor;
}

.gapok,
.pdfok,
.verdict-line.good {
  background: var(--accept-bg);
  border-left-color: var(--accept);
  color: var(--accept);
}

.gapbad,
.pdfbad,
.verdict-line.bad {
  background: var(--reject-bg);
  border-left-color: var(--reject);
  color: var(--reject);
}

.gapbad b,
.verdict-line.bad b {
  color: var(--reject);
}

.pdfwarn {
  background: var(--amber-bg);
  border-left-color: var(--amber);
  color: var(--amber);
}

/* Diagnostics fold */
details.diag>summary {
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  color: var(--ink-soft);
}

details.diag>summary::-webkit-details-marker {
  display: none;
}

details.diag>summary::before {
  content: "▸ ";
  color: var(--ink-mute);
}

details.diag[open]>summary::before {
  content: "▾ ";
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--rule-soft);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--ink);
}

/* Specific Tables */
#batchTable td:first-child,
#staffTable td:first-child {
  min-width: 150px;
}

#batchTable td:first-child b {
  overflow-wrap: normal;
  word-break: keep-all;
}

#batchTable,
#staffTable,
#sdTable,
#rTable {
  min-width: 640px;
}

#scanBuyerCard {
  border-left: 3px solid var(--slate);
  background: #ffffff;
}

/* ------------------------------------------------------------- Print */

@media print {

  .rail,
  .tabs,
  header,
  .noprint,
  .btnrow {
    display: none !important;
  }

  body,
  main {
    background: #ffffff;
    padding: 0;
    max-width: none;
  }

  #app {
    display: block;
  }

  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
  }

  .view:not(.on) {
    display: none !important;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}