:root {
  --navy-950: #0b2239;
  --navy-900: #123553;
  --navy-800: #163f64;
  --blue-600: #1769e0;
  --blue-500: #2f7cf0;
  --blue-100: #e8f1ff;
  --ink: #172b3a;
  --muted: #667785;
  --line: #dce4ea;
  --surface: #ffffff;
  --canvas: #f3f6f9;
  --green: #0b8f63;
  --green-bg: #e9f8f2;
  --amber: #b66a09;
  --amber-bg: #fff5de;
  --red: #c93f4d;
  --red-bg: #fff0f1;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(12, 42, 67, .08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; color: var(--navy-950); font-size: clamp(1.7rem, 3vw, 2.45rem); line-height: 1.1; letter-spacing: -.04em; }
h2 { margin-bottom: 6px; color: var(--navy-950); font-size: 1.12rem; letter-spacing: -.015em; }
p { color: var(--muted); line-height: 1.55; }
small { color: var(--muted); }

.app-shell { padding-left: 256px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 256px; flex-direction: column; padding: 22px 16px; color: #d6e3ee; background: linear-gradient(180deg, var(--navy-950), #102f4a); }
.brand { display: inline-flex; align-items: center; gap: 12px; margin: 0 4px 28px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: white; background: linear-gradient(135deg, #48a5ff, #1462d0); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 800; box-shadow: 0 10px 22px rgba(20, 98, 208, .3); }
.brand strong, .brand small { display: block; }
.brand strong { color: white; font-size: 1.06rem; letter-spacing: .01em; }
.brand small { margin-top: 1px; color: #90aac0; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: 10px; color: #b9ccdc; font-size: .92rem; font-weight: 600; }
.nav-link:hover, .nav-link:focus-visible { color: white; background: rgba(255, 255, 255, .09); outline: none; }
.nav-link span { width: 22px; color: #76b3ef; font-size: 1.1rem; text-align: center; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 15px 10px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar-footer strong, .sidebar-footer small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer strong { color: white; font-size: .85rem; }
.sidebar-footer small { margin-top: 3px; color: #8ba5ba; font-size: .72rem; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: #2f7cf0; font-weight: 800; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 70px; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
.topbar-title strong, .topbar-title small { display: block; }
.topbar-title strong { color: var(--navy-900); font-size: .92rem; }
.topbar-title small { margin-top: 3px; font-size: .72rem; }
.main-content { width: min(1500px, 100%); margin: 0 auto; padding: 30px 34px 56px; }
.mobile-only { display: none !important; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading p { margin-bottom: 0; }
.heading-actions, .action-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.compact-heading { margin-bottom: 18px; }
.eyebrow { margin-bottom: 7px !important; color: var(--blue-600) !important; font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.lead { max-width: 620px; color: #43586b; font-size: 1.05rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-heading p { margin-bottom: 0; font-size: .88rem; }
.card-heading > div:first-child { min-width: 0; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: .85rem; font-weight: 750; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(47, 124, 240, .22); outline-offset: 2px; }
.button-primary { color: white; background: var(--blue-600); box-shadow: 0 8px 18px rgba(23, 105, 224, .2); }
.button-primary:hover { background: #0c5cca; }
.button-secondary { color: var(--navy-900); border-color: #bcd1e5; background: #eef5fb; }
.button-ghost { color: var(--navy-900); border-color: var(--line); background: white; }
.button-danger { color: white; background: var(--red); }
.button-small { min-height: 34px; padding: 7px 11px; font-size: .78rem; }
.button-block { width: 100%; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy-900); background: white; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric { position: relative; min-height: 128px; padding: 19px; overflow: hidden; box-shadow: none; }
.metric::after { position: absolute; top: -22px; right: -18px; width: 74px; height: 74px; border-radius: 50%; background: var(--blue-100); content: ""; }
.metric > span, .metric > strong, .metric > small { position: relative; z-index: 1; display: block; }
.metric > span { color: #597084; font-size: .8rem; font-weight: 700; }
.metric > strong { margin: 10px 0 5px; color: var(--navy-950); font-size: 2rem; line-height: 1; }
.metric > small { font-size: .72rem; }
.metric-warning::after { background: var(--amber-bg); }
.metric-success::after { background: var(--green-bg); }
.metric-danger::after { background: var(--red-bg); }

.table-card { padding: 22px; }
.responsive-table { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
th { padding: 11px 12px; color: #6b7f90; background: #f5f8fa; font-size: .68rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid #e8edf1; color: #263b4c; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }
.cell-note { display: block; max-width: 300px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 34px !important; color: var(--muted); text-align: center; }
.progress { width: 110px; height: 6px; margin: 2px 0 5px; overflow: hidden; border-radius: 99px; background: #e6edf2; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f7cf0, #49a5ff); }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; color: #31506a; background: #edf2f6; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.badge-large { padding: 8px 12px; font-size: .74rem; }
.badge-approved, .badge-exported, .badge-misa_processed, .badge-match { color: #087552; background: var(--green-bg); }
.badge-pending_approval, .badge-reconciling, .badge-surplus, .badge-shortage, .badge-need_manager { color: #99600d; background: var(--amber-bg); }
.badge-round1, .badge-round2, .badge-parsed { color: #145cb5; background: var(--blue-100); }
.badge-cancelled, .badge-uncounted { color: #a03540; background: var(--red-bg); }
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green) !important; }
.muted { color: var(--muted); }

label { display: grid; gap: 7px; color: #3d5366; font-size: .78rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cad6df; border-radius: 9px; color: var(--ink); background: white; outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(47, 124, 240, .12); }
.required { margin-left: 3px; color: var(--red); }
.stack-form { display: grid; gap: 15px; }
.two-column-form { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 18px; align-items: start; }
.form-card { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.step-number { display: inline-grid; width: 32px; height: 32px; float: left; place-items: center; margin-right: 10px; border-radius: 9px; color: white; background: var(--navy-900); font-size: .68rem; font-weight: 900; }
.upload-zone { min-height: 220px; place-items: center; align-content: center; margin-bottom: 18px; padding: 28px; border: 2px dashed #a9c3db; border-radius: 14px; color: var(--navy-900); background: #f7fbff; text-align: center; cursor: pointer; }
.upload-zone:hover { border-color: var(--blue-500); background: #f1f7ff; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone strong, .upload-zone small { display: block; }
.upload-zone small { max-width: 310px; font-weight: 500; line-height: 1.5; }
.upload-icon { display: grid; width: 50px; height: 50px; place-items: center; margin-bottom: 6px; border-radius: 14px; color: var(--blue-600); background: var(--blue-100); font-size: 1.55rem; }
.check-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 25px; color: #526a7c; font-size: .82rem; line-height: 1.4; }
.check-list li::before { position: absolute; left: 0; display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-bg); content: "✓"; font-size: .66rem; font-weight: 900; }
.check-list.compact { margin-bottom: 20px; }

.workflow { margin-bottom: 18px; padding: 22px; box-shadow: none; }
.workflow-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.workflow-step { display: flex; align-items: center; gap: 9px; min-height: 64px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafb; }
.workflow-step > span { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #6d7e8b; background: #e5ebef; font-size: .72rem; font-weight: 900; }
.workflow-step strong, .workflow-step small { display: block; }
.workflow-step strong { color: #334c60; font-size: .76rem; }
.workflow-step small { margin-top: 3px; font-size: .66rem; }
.workflow-step.is-done { border-color: #bee6d6; background: #f1faf6; }
.workflow-step.is-done > span { color: white; background: var(--green); }
.blocker-box { margin-top: 16px; padding: 13px 16px; border: 1px solid #f0d3a3; border-radius: 10px; color: #7a4b08; background: var(--amber-bg); font-size: .8rem; }
.blocker-box ul { margin: 7px 0 0; padding-left: 20px; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f4; }
.detail-list dt { color: var(--muted); font-size: .75rem; }
.detail-list dd { margin: 0; color: #294258; font-size: .8rem; font-weight: 650; }
.checksum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Consolas, monospace; }
.inline-form { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; margin-bottom: 15px; }
.download-list { display: grid; gap: 8px; margin-top: 15px; }
.download-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.download-list strong, .download-list small { display: block; }
.download-list strong { max-width: 420px; overflow: hidden; color: var(--navy-900); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.download-list small { margin-top: 3px; font-size: .67rem; }
.download-list b { color: var(--blue-600); font-size: 1.1rem; }
.empty-note { margin-bottom: 0; font-size: .82rem; }

.count-shell { max-width: 1100px; margin: 0 auto; }
.scanner-card { margin-bottom: 16px; padding: 20px; border-color: #c5d9ea; background: linear-gradient(135deg, white, #f3f8fd); box-shadow: none; }
.scanner-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.scanner-hero strong, .scanner-hero small { display: block; }
.scanner-hero strong { color: var(--navy-900); }
.scanner-hero small { margin: 4px 0 0 17px; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(11, 143, 99, .12); }
.barcode-search { display: grid; grid-template-columns: 90px 1fr auto; align-items: end; gap: 10px; }
.barcode-search label { align-self: center; }
.barcode-search input { min-height: 54px; border-width: 2px; font-size: 1.18rem; font-weight: 800; letter-spacing: .04em; }
.barcode-search .button { min-height: 54px; }
.scanner-message { margin: 10px 0 0 100px; font-size: .76rem; }
.camera-preview { width: 100%; max-height: 360px; margin-bottom: 16px; border-radius: 12px; object-fit: cover; background: black; }
.comparison-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 18px 20px; border-color: #bfe2d4; background: #f2fbf7; box-shadow: none; }
.comparison-card h2 { margin-bottom: 0; font-size: .92rem; }
.comparison-card dl { display: grid; min-width: 430px; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.comparison-card dl > div { padding: 9px 12px; border-radius: 9px; background: white; }
.comparison-card dt { color: var(--muted); font-size: .66rem; }
.comparison-card dd { margin: 4px 0 0; color: var(--navy-950); font-size: 1rem; font-weight: 900; }
.unknown-card { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 18px; border-color: #f0c4c8; background: var(--red-bg); }
.unknown-card > span { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: var(--red); font-weight: 900; }
.unknown-card h2, .unknown-card p { margin-bottom: 3px; }
.unknown-card form { margin-left: auto; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.product-card { padding: 20px; box-shadow: none; }
.product-head { display: flex; justify-content: space-between; gap: 12px; }
.product-head h2 { margin: 7px 0 4px; font-size: 1rem; line-height: 1.35; }
.product-head p { margin: 0; font-size: .76rem; }
.sku { color: var(--blue-600); font-family: Consolas, monospace; font-size: .74rem; font-weight: 900; }
.lot-box { display: flex; gap: 18px; margin: 15px 0; padding: 10px 12px; border-radius: 9px; color: #596f81; background: #f2f5f7; font-size: .75rem; }
.lot-box strong { color: var(--navy-900); }
.count-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quantity-field input { min-height: 60px; color: var(--navy-950); font-size: 1.35rem; font-weight: 900; }
.segmented { display: grid; grid-column: span 2; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 10px; background: #edf2f6; }
.segmented label { display: block; cursor: pointer; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented span { display: block; padding: 9px; border-radius: 7px; color: #5b7081; text-align: center; }
.segmented input:checked + span { color: var(--navy-900); background: white; box-shadow: 0 3px 8px rgba(20, 55, 82, .1); }
.count-form .button-block { grid-column: span 2; }
.recent-card { padding: 20px; box-shadow: none; }

.filter-tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.filter-tabs a { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: #607486; background: white; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.filter-tabs a.active { color: white; border-color: var(--blue-600); background: var(--blue-600); }
.wide-table-card { padding: 0; overflow: hidden; }
.wide-table-card table { min-width: 1180px; }
.cause-details summary { color: var(--blue-600); cursor: pointer; font-weight: 700; }
.mini-form { display: grid; min-width: 270px; gap: 6px; margin-top: 8px; }
.mini-form input, .mini-form select { min-height: 35px; padding: 7px 9px; font-size: .75rem; }
.branch-create { margin-bottom: 18px; }
.branch-form { grid-template-columns: minmax(160px, .45fr) minmax(260px, 1fr); }
.branch-form .button { justify-self: start; }
.branch-edit-form { display: grid; min-width: 420px; grid-template-columns: minmax(150px, .7fr) minmax(210px, 1fr) auto; gap: 8px; }
.branch-edit-form input { min-height: 36px; padding: 7px 9px; font-size: .78rem; }
.branch-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.branch-actions form { margin: 0; }

.flash { margin-bottom: 18px; padding: 13px 16px; border-radius: 11px; font-size: .84rem; line-height: 1.45; }
.flash-success { color: #086c4d; border: 1px solid #bce2d3; background: var(--green-bg); }
.flash-warning { color: #81530b; border: 1px solid #ecd39e; background: var(--amber-bg); }
.flash-danger { color: #9c303b; border: 1px solid #efc5c9; background: var(--red-bg); }

.guest-shell { background: linear-gradient(135deg, #0c2943 0 49%, #f1f5f8 49%); }
.login-page { display: grid; min-height: 100vh; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 8vw; padding: 7vw; }
.login-panel { max-width: 630px; }
.login-panel .brand { margin-left: 0; }
.login-panel h1 { max-width: 630px; color: white; font-size: clamp(2.3rem, 5vw, 4.6rem); }
.login-panel .lead { color: #b8ccdc; }
.trust-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.trust-list span { padding: 7px 10px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 999px; color: #d8e5ef; background: rgba(255, 255, 255, .06); font-size: .7rem; }
.login-card { width: min(440px, 100%); justify-self: end; padding: 36px; }
.login-card h2 { font-size: 1.6rem; }
.login-card .text-link { display: block; margin-top: 18px; color: var(--blue-600); font-size: .76rem; text-align: center; }

.diagnostic-page { max-width: 920px; margin: 0 auto; padding: 36px 20px; }
.diagnostic-score { display: grid; width: 92px; height: 92px; place-items: center; border-radius: 50%; font-size: 1rem; font-weight: 900; }
.diagnostic-score.pass { color: #087552; background: var(--green-bg); box-shadow: inset 0 0 0 7px rgba(11, 143, 99, .13); }
.diagnostic-score.fail { color: #a03540; background: var(--red-bg); box-shadow: inset 0 0 0 7px rgba(201, 63, 77, .12); }
.diagnostic-list { padding: 10px 20px; }
.diagnostic-list article { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #e7edf1; }
.diagnostic-list article:last-child { border-bottom: 0; }
.diagnostic-list strong, .diagnostic-list small { display: block; }
.diagnostic-list small { margin-top: 3px; }
.diagnostic-list b { font-size: .7rem; }
.check-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; font-weight: 900; }
.check-icon.pass { color: var(--green); background: var(--green-bg); }
.check-icon.fail { color: var(--red); background: var(--red-bg); }
.diagnostic-note { margin-top: 16px; font-size: .8rem; text-align: center; }
.error-page { max-width: 760px; margin: 7vh auto; padding: 34px; text-align: center; }
.error-page .action-strip { justify-content: center; }
.error-symbol { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 16px; border-radius: 50%; color: white; background: var(--red); font-size: 1.5rem; font-weight: 900; }
pre { max-width: 600px; overflow: auto; padding: 10px; border-radius: 8px; color: #dbeafe; background: #112b43; font-size: .7rem; white-space: pre-wrap; }

@media (max-width: 1180px) {
  .metric-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { padding-left: 0; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-only { display: inline-grid !important; }
  .topbar { padding: 0 18px; }
  .topbar-title { margin-right: auto; margin-left: 10px; }
  .main-content { padding: 22px 18px 50px; }
  .metric-grid, .metric-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column-form, .content-grid { grid-template-columns: 1fr; }
  .workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: 1fr; }
  .guest-shell { background: linear-gradient(180deg, #0c2943 0 38%, #f1f5f8 38%); }
  .login-page { grid-template-columns: 1fr; gap: 28px; padding: 40px 20px; }
  .login-panel h1 { font-size: 2.5rem; }
  .login-card { justify-self: center; }
}

@media (max-width: 620px) {
  h1 { font-size: 1.7rem; }
  .topbar-title small { display: none; }
  .topbar form .button { padding: 7px 9px; }
  .page-heading { flex-direction: column; gap: 14px; }
  .page-heading .button { width: 100%; }
  .heading-actions { width: 100%; }
  .heading-actions .button { width: auto; }
  .metric-grid, .metric-grid-5 { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric { min-height: 105px; padding: 15px; }
  .metric > strong { font-size: 1.65rem; }
  .metric > small { display: none; }
  .table-card { padding: 14px; }
  .form-grid, .form-grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .workflow-steps { grid-template-columns: 1fr; }
  .workflow-step { min-height: 54px; }
  .barcode-search { grid-template-columns: 1fr; }
  .barcode-search label { align-self: auto; }
  .scanner-message { margin-left: 0; }
  .scanner-hero { align-items: flex-start; }
  .scanner-hero .button { padding: 8px 10px; }
  .count-form { grid-template-columns: 1fr; }
  .segmented, .count-form .button-block { grid-column: span 1; }
  .unknown-card { align-items: flex-start; flex-wrap: wrap; }
  .comparison-card { align-items: stretch; flex-direction: column; }
  .comparison-card dl { min-width: 0; grid-template-columns: repeat(2, 1fr); }
  .unknown-card form { width: 100%; margin-left: 0; }
  .inline-form { grid-template-columns: 1fr; }
  .branch-form, .branch-edit-form { min-width: 0; grid-template-columns: 1fr; }
  .detail-list > div { grid-template-columns: 1fr; gap: 3px; }
  .login-card { padding: 24px; }
  .login-panel .brand { margin-bottom: 20px; }
  .login-panel h1 { font-size: 2.1rem; }
}

@media print {
  .sidebar, .topbar, .button, .filter-tabs { display: none !important; }
  .app-shell { padding: 0; }
  .main-content { max-width: none; padding: 0; }
  .card { box-shadow: none; }
}

.count-feedback{margin-top:14px;padding:12px 14px;border-radius:12px;font-weight:700}
.count-feedback.is-pending{background:#eef5ff;color:#1857a4}
.count-feedback.is-success{background:#e9f9f1;color:#08754a}
.count-feedback.is-error{background:#fff0f1;color:#b42336}
[data-quick-undo]{margin-top:10px}
.running-total{display:grid;grid-template-columns:1fr auto;align-items:center;gap:2px 12px;padding:12px 14px;margin:14px 0;border-radius:12px;background:#f2f7fc}
.running-total strong{font-size:1.4rem;color:#0d3558}
.running-total small{grid-column:1/-1;color:#6b7e90}
.product-actions{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap;margin-top:12px}
.quality-details{flex:1;min-width:220px}
.quality-details>summary{list-style:none;cursor:pointer}
.quality-details>summary::-webkit-details-marker{display:none}
.quality-form{display:grid;gap:12px;margin-top:12px;padding:16px;border:1px solid #dce8f3;border-radius:14px;background:#f8fbfe}
.assignment-grid{display:grid;gap:16px}
.chip-list{display:flex;flex-wrap:wrap;gap:8px}
.chip{border:1px solid #c9d9e8;border-radius:999px;background:#f3f8fc;color:#153b5d;padding:8px 12px;cursor:pointer}
.compact-actions{margin-top:8px}
.is-voided{opacity:.55;text-decoration:line-through}
.user-table input,.user-table select{min-width:150px}

@media (max-width: 620px) {
  .count-shell .page-heading{align-items:flex-start}
  .scanner-card,.product-card,.recent-card{border-radius:16px}
  .barcode-search label{display:none}
  .barcode-search input{font-size:20px;min-height:56px}
  .barcode-search .button,.count-form .button{min-height:54px;font-size:16px}
  .quantity-field input{font-size:24px;min-height:58px}
  .product-grid{grid-template-columns:1fr}
  .quality-details{width:100%}
  .quality-details>summary{width:100%;text-align:center}
}
