:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f6;
  color: #101726;
  --ink: #101726;
  --muted: #607086;
  --line: #d8e0ea;
  --panel: #ffffff;
  --soft: #f6f8fb;
  --blue: #1261d8;
  --blue-dark: #0b4db2;
  --green: #16864a;
  --red: #c7352c;
  --shadow: 0 18px 46px rgba(18, 32, 54, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef2f6;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(242, 245, 248, 0.96)),
    linear-gradient(135deg, #dbe7f4 0%, #f7f9fb 50%, #e7f0ec 100%);
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--ink);
  font-size: 2.15rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.lede {
  max-width: 560px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.shell {
  width: min(100% - 28px, 1180px);
  margin: 0 auto;
  padding: 18px 0 34px;
}

.entry-shell {
  width: min(100% - 28px, 1440px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #1b2a40;
  font-size: 0.98rem;
  font-weight: 900;
}

.brand-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #173052 0%, #101f36 100%);
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0;
  box-shadow: 0 10px 22px rgba(18, 33, 58, 0.18);
}

.eyebrow {
  width: fit-content;
  margin: 0 0 10px;
  padding: 6px 10px;
  border: 1px solid #c9d7e7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #3f5877;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 14px 28px rgba(18, 97, 216, 0.25);
}

.button.primary:hover,
.button.primary:focus {
  background: var(--blue-dark);
  outline: none;
}

.button.secondary {
  border: 1px solid #cbd7e6;
  background: rgba(255, 255, 255, 0.86);
  color: #26384f;
}

.button.secondary:hover,
.button.secondary:focus {
  border-color: #91a8c2;
  outline: none;
}

.button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  align-items: center;
  padding: 18px;
}

.auth-panel {
  display: grid;
  gap: 24px;
  width: min(100%, 430px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin-bottom: 10px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label,
.scan-result label {
  color: #2b3e56;
  font-size: 0.88rem;
  font-weight: 900;
}

.auth-form input {
  min-height: 52px;
  width: 100%;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.auth-form input:focus,
.scan-result textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18, 97, 216, 0.13);
}

.auth-form .button {
  width: 100%;
  margin-top: 8px;
}

.form-error {
  border: 1px solid #f1b2ad;
  border-radius: 8px;
  padding: 12px;
  background: #fff3f2;
  color: #9a251e;
  font-weight: 800;
  line-height: 1.4;
}

.form-success {
  border: 1px solid #a9ddbc;
  border-radius: 8px;
  padding: 12px;
  background: #f4fbf7;
  color: #17643c;
  font-weight: 900;
  line-height: 1.4;
}

.portal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 24px;
}

.portal-header h1 {
  margin-bottom: 10px;
}

.portal-header .actions {
  justify-content: flex-end;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.menu-grid-single {
  grid-template-columns: minmax(0, 520px);
}

.menu-button {
  display: grid;
  min-height: 156px;
  align-content: space-between;
  gap: 20px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.menu-button:hover,
.menu-button:focus {
  border-color: var(--blue);
  box-shadow: 0 20px 50px rgba(18, 97, 216, 0.16);
  outline: none;
  transform: translateY(-2px);
}

.menu-button-primary {
  border-color: #b8cef0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.menu-kicker {
  display: inline-flex;
  width: fit-content;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 12px;
  background: #eef5ff;
  color: var(--blue);
  font-weight: 900;
}

.menu-button strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.menu-button small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.verified-list {
  display: grid;
  gap: 12px;
}

.verified-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.verified-card-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.verified-card h2 {
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.verified-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.verified-meta div {
  min-width: 0;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  padding: 9px;
  background: #fafbfc;
}

.verified-meta dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.verified-meta dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.verified-time {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.verified-actions {
  display: grid;
  min-width: 190px;
}

.entry-panel {
  display: grid;
  gap: 14px;
  width: min(100%, 680px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.entry-panel-wide {
  width: min(100%, 1440px);
}

.entry-form {
  display: grid;
  gap: 11px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.form-grid > div {
  display: grid;
  gap: 8px;
}

.entry-form label {
  color: #2b3e56;
  font-size: 0.86rem;
  font-weight: 900;
}

.entry-form input,
.entry-form select {
  min-height: 52px;
  width: 100%;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.entry-form input:focus,
.entry-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18, 97, 216, 0.13);
}

.combo {
  position: relative;
}

.combo-search {
  padding-right: 34px !important;
}

.combo::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #607086;
  border-bottom: 2px solid #607086;
  transform: rotate(45deg);
  pointer-events: none;
}

.combo-list {
  position: fixed;
  z-index: 1000;
  display: none;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(18, 32, 54, 0.16);
}

.combo.is-open .combo-list {
  display: grid;
}

.combo-list button {
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.combo-list button:hover,
.combo-list button:focus {
  background: #eef5ff;
  outline: none;
}

.combo-list button:last-child {
  border-bottom: 0;
}

.readonly-field {
  display: grid;
  gap: 5px;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}

.readonly-field span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.readonly-field strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.delivery-entry {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.delivery-table {
  position: relative;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: 100%;
  overflow: visible;
  padding-bottom: 4px;
}

.delivery-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.55fr) minmax(130px, 0.72fr) minmax(150px, 0.82fr) minmax(130px, 0.72fr) minmax(78px, 0.45fr) repeat(3, minmax(86px, 0.48fr)) minmax(80px, 0.42fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.delivery-head {
  padding: 8px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #eef4fb;
  color: #334c6b;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.delivery-row:not(.delivery-head) {
  position: relative;
  z-index: 21;
  padding: 8px;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  background: #fbfdff;
}

.delivery-row select,
.delivery-row input {
  min-height: 44px;
  width: 100%;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  padding: 0 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
}

.delivery-row .combo {
  min-width: 0;
}

.delivery-row .combo-search {
  padding-right: 32px !important;
}

.delivery-row .combo::after {
  top: 18px;
}

.delivery-row .combo-list {
  z-index: 80;
}

.delivery-row .display-field {
  background: #f4f7fb;
  color: #334c6b;
}

.row-remove {
  min-height: 42px;
  border: 1px solid #e0b6b2;
  border-radius: 8px;
  background: #fff7f6;
  color: #9a251e;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.add-row-button {
  justify-self: start;
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.professional-table {
  border-color: #cdd9e8;
}

.sales-order-table-wrap {
  border-color: #c6d5e7;
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #e3e9f1;
  padding: 14px 13px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  border-bottom: 1px solid #cbd9ea;
  background: #eef4fb;
  color: #334c6b;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.data-table td {
  background: #fff;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.sales-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.data-table tbody tr:hover td {
  background: #f6faff;
}

.data-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

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

.status-chip,
.table-action {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.status-chip {
  border: 1px solid #b8cdf2;
  background: #f2f7ff;
  color: #255aa2;
}

.table-action {
  border: 1px solid #cbd7e6;
  background: #fff;
  color: var(--blue);
}

.sales-table .table-action {
  min-height: 40px;
  border-color: #1261d8;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(18, 97, 216, 0.18);
  white-space: nowrap;
}

.sales-table .delivery-entry-action {
  border-color: #15803d;
  background: #16864a;
}

.table-action:hover,
.table-action:focus {
  border-color: var(--blue);
  background: #eef5ff;
  outline: none;
}

.sales-table .table-action:hover,
.sales-table .table-action:focus {
  background: var(--blue-dark);
  color: #fff;
}

.sales-table .delivery-entry-action:hover,
.sales-table .delivery-entry-action:focus {
  background: #126c3d;
}

.qty-cell {
  display: inline-flex;
  min-width: 58px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd9ea;
  border-radius: 8px;
  background: #f5f8fc;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.report-summary,
.report-totals {
  display: grid;
  gap: 10px;
}

.report-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-totals {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0;
}

.report-summary article,
.report-totals article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(18, 32, 54, 0.08);
}

.report-summary span,
.report-totals span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-summary strong,
.report-totals strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.report-totals strong {
  font-size: 1.45rem;
}

.report-summary small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
}

.report-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.report-section h2 {
  color: var(--ink);
  font-size: 1.2rem;
}

.report-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 14px;
  border: 1px solid #c6d5e7;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.report-hero-panel h2 {
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.report-hero-panel p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.45;
}

.report-hero-panel dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.report-hero-panel dl div {
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  padding: 11px;
  background: #fafbfc;
}

.report-hero-panel dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-hero-panel dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.report-hero-panel dd span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.progress-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.progress-card {
  display: grid;
  gap: 5px;
  border: 1px solid #d5e1ee;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(18, 32, 54, 0.08);
}

.progress-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.progress-card strong {
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 950;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(18, 32, 54, 0.08);
}

.timeline-item > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.timeline-item strong {
  color: var(--ink);
  font-weight: 950;
}

.timeline-item span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.timeline-item dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.timeline-item dl div {
  min-width: 0;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  padding: 9px;
  background: #fafbfc;
}

.timeline-item dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-item dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.scan-panel,
.connection-card,
.details-grid div,
.feature-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.scan-panel {
  padding: 14px;
}

.scanner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.scanner-main {
  display: grid;
  gap: 10px;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  grid-column: 1 / -1;
}

.workflow-pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  padding: 0 10px;
  background: #fbfcfe;
  color: #617288;
  font-size: 0.82rem;
  font-weight: 900;
}

.workflow-pill.is-active {
  border-color: #9ab8ed;
  background: #eef5ff;
  color: var(--blue);
}

.workflow-pill.is-done {
  border-color: #a9ddbc;
  background: #f1fbf5;
  color: #17633a;
}

.scanner-camera {
  position: relative;
  overflow: hidden;
  border: 1px solid #24364e;
  border-radius: 8px;
  background: linear-gradient(180deg, #111d30 0%, #0b1422 100%);
  aspect-ratio: 1 / 1;
  min-height: 280px;
}

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

.scanner-camera img {
  max-width: 100%;
}

.scanner-camera > div {
  border: 0 !important;
}

.scanner-camera button,
.scanner-camera select {
  border-radius: 8px;
  font: inherit;
}

.scanner-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  grid-column: 1 / -1;
  order: 3;
}

.scan-result {
  display: grid;
  gap: 10px;
}

.scan-result textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.scan-status {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.scan-status[data-tone="success"] {
  border-color: #a9ddbc;
  background: #f1fbf5;
  color: #17633a;
}

.scan-status[data-tone="error"] {
  border-color: #f1b2ad;
  background: #fff3f2;
  color: #9a251e;
}

.scan-status[data-tone="info"] {
  border-color: #b8cdf2;
  background: #f2f7ff;
  color: #255aa2;
}

.scan-details {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #ffffff;
}

.scan-alert {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 23, 38, 0.46);
  backdrop-filter: blur(4px);
}

.scan-alert[hidden] {
  display: none;
}

.scan-alert-card {
  display: grid;
  justify-items: center;
  gap: 11px;
  width: min(100%, 390px);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(16, 23, 38, 0.26);
  text-align: center;
}

.scan-alert-icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border: 3px solid #f1b2ad;
  border-radius: 50%;
  color: var(--red);
  font-size: 2rem;
  font-weight: 900;
}

.scan-alert[data-tone="success"] .scan-alert-icon {
  border-color: #a9ddbc;
  color: var(--green);
}

.scan-alert h2 {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.2;
}

.scan-alert p {
  color: var(--muted);
  line-height: 1.5;
}

.scan-alert-details {
  display: grid;
  gap: 8px;
  width: 100%;
  margin: 4px 0;
}

.scan-alert-details div {
  display: grid;
  grid-template-columns: 0.76fr 1.24fr;
  gap: 10px;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fafbfc;
  text-align: left;
}

.scan-alert-details dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scan-alert-details dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.scan-alert .actions {
  width: 100%;
}

.scan-alert .button {
  flex: 1 1 0;
}

.scan-details[hidden] {
  display: none;
}

.scan-details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scan-details h2 {
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.2;
}

.result-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  padding: 0 10px;
  background: #f7f9fc;
  color: #33445b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-badge[data-tone="passed"],
.result-badge[data-tone="active"] {
  border-color: #a9ddbc;
  background: #f1fbf5;
  color: #17633a;
}

.result-badge[data-tone="hold"] {
  border-color: #ead28d;
  background: #fff9e8;
  color: #785c12;
}

.result-badge[data-tone="rejected"],
.result-badge[data-tone="inactive"],
.result-badge[data-tone="not-found"] {
  border-color: #f1b2ad;
  background: #fff3f2;
  color: #9a251e;
}

.label-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.label-grid div {
  min-width: 0;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  padding: 11px;
  background: #fafbfc;
}

.label-grid .label-grid-wide {
  grid-column: 1 / -1;
}

.label-grid dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.label-grid dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.status-panel {
  display: grid;
  gap: 16px;
  max-width: 760px;
  padding: 34px 0;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 18px;
}

.connection-card.is-success {
  border-color: #a9ddbc;
  background: #f6fdf8;
}

.connection-card.is-error {
  border-color: #f1b2ad;
  background: #fff7f6;
}

.status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(199, 53, 44, 0.12);
}

.connection-card.is-success .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(22, 134, 74, 0.14);
}

.status-label {
  color: var(--ink);
  font-weight: 900;
}

.status-copy {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-word;
}

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

.details-grid div {
  padding: 14px;
  box-shadow: none;
}

.details-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.details-grid dd {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.hero,
.features,
.portal-grid {
  display: grid;
  gap: 14px;
}

.feature-card {
  padding: 20px;
}

.quantity-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  align-items: start;
}

.quantity-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.plate-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.action-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.quantity-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plate-hero {
  display: grid;
  gap: 5px;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  padding: 14px;
  background: #f4f8fd;
}

.plate-hero span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.plate-hero strong {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.plate-hero small {
  color: #3f5877;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.label-grid.compact {
  grid-template-columns: 1fr;
}

.section-title {
  display: grid;
  gap: 4px;
}

.section-title h2,
.complete-state h2,
.empty-state h2 {
  color: var(--ink);
  font-size: 1.45rem;
  letter-spacing: 0;
}

.quantity-form {
  display: grid;
  gap: 12px;
}

.quantity-form label {
  color: #2b3e56;
  font-size: 0.88rem;
  font-weight: 900;
}

.search-input,
.quantity-input {
  min-height: 54px;
  width: 100%;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.quantity-entry {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
}

.quantity-entry .quantity-input {
  min-height: 64px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 950;
}

.qty-stepper {
  min-height: 58px;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.45rem;
  font-weight: 950;
  cursor: pointer;
}

.qty-stepper:active {
  transform: translateY(1px);
}

.search-input:focus,
.quantity-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18, 97, 216, 0.13);
}

.order-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.order-card {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid #d7e1ec;
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfe;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.order-card::after {
  content: "Tap to select";
  justify-self: start;
  border: 1px solid #cbd7e6;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  color: #3f5877;
  font-size: 0.72rem;
  font-weight: 900;
}

.order-card:hover,
.order-card:focus,
.order-card.is-selected {
  border-color: var(--blue);
  background: #f3f7ff;
  outline: none;
}

.order-card.is-selected::after {
  content: "Selected";
  border-color: #9ab8ed;
  background: #eaf3ff;
  color: var(--blue);
}

.order-card strong {
  font-size: 1rem;
  font-weight: 900;
}

.order-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

.order-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.order-summary div {
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}

.order-summary dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.order-summary dd {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.summary-input {
  min-height: 38px;
  width: 100%;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

.summary-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18, 97, 216, 0.13);
  outline: none;
}

.helper-text,
.complete-state p,
.empty-state p {
  color: var(--muted);
  line-height: 1.45;
}

.complete-state,
.empty-state {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.complete-icon {
  display: inline-flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border: 2px solid #a9ddbc;
  border-radius: 50%;
  background: #f4fbf7;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 900;
}

.sticky-submit {
  display: grid;
}

@media (max-width: 780px) {
  body {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(238, 242, 246, 0.95)),
      linear-gradient(145deg, #dce8f6 0%, #f8fafc 54%, #e8f0ec 100%);
  }

  h1 {
    font-size: 1.9rem;
  }

  .shell {
    width: min(100% - 18px, 980px);
    padding: 10px 0 92px;
  }

  .entry-shell {
    width: min(100% - 18px, 980px);
  }

  .auth-shell {
    align-items: start;
    padding-top: 18px;
  }

  .auth-panel {
    padding: 20px;
  }

  .portal-header {
    display: grid;
    gap: 12px;
    padding-top: 6px;
  }

  .portal-header h1 {
    font-size: 1.55rem;
  }

  .brand-lockup {
    margin-bottom: 10px;
  }

  .portal-header .actions,
  .portal-header .button {
    width: 100%;
  }

  .menu-grid,
  .scanner,
  .label-grid,
  .details-grid,
  .quantity-layout,
  .order-summary,
  .verified-card,
  .verified-meta,
  .report-summary,
  .report-totals,
  .timeline-item dl,
  .report-hero-panel,
  .progress-panel {
    grid-template-columns: 1fr;
  }

  .menu-button {
    min-height: 144px;
    padding: 18px;
  }

  .menu-button strong {
    font-size: 1.35rem;
  }

  .verified-actions {
    min-width: 0;
  }

  .verified-actions .button {
    width: 100%;
  }

  .entry-panel {
    padding: 14px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .entry-form input,
  .entry-form select {
    min-height: 56px;
  }

  .delivery-head {
    display: none;
  }

  .delivery-row {
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 0;
  }

  .delivery-row:not(.delivery-head) {
    padding: 10px;
  }

  .row-remove,
  .add-row-button {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(18, 32, 54, 0.09);
    overflow: hidden;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 0.78fr 1.22fr;
    gap: 10px;
    border-bottom: 1px solid #e3e9f1;
    padding: 11px;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .table-action {
    width: 100%;
  }

  .timeline-item > div {
    display: grid;
  }

  .scan-panel {
    padding: 8px;
  }

  .scanner {
    gap: 12px;
  }

  .scanner-camera {
    min-height: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
  }

  .scanner-controls {
    position: fixed;
    right: 9px;
    bottom: 10px;
    left: 9px;
    z-index: 5;
    margin-top: 2px;
    padding: 8px;
    border: 1px solid rgba(203, 215, 230, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 34px rgba(18, 32, 54, 0.16);
  }

  .scanner-controls .button {
    min-height: 58px;
    padding: 0 12px;
  }

  .workflow-strip {
    gap: 6px;
  }

  .workflow-pill {
    min-height: 34px;
    padding: 0 7px;
    font-size: 0.74rem;
  }

  .scan-result {
    gap: 8px;
  }

  .scan-result label,
  .scan-result textarea {
    display: none;
  }

  .scan-status {
    font-size: 0.9rem;
  }

  .scan-result textarea {
    min-height: 128px;
  }

  .quantity-panel {
    box-shadow: 0 12px 28px rgba(18, 32, 54, 0.09);
  }

  .action-panel {
    padding: 14px;
  }

  .plate-panel {
    gap: 10px;
    padding: 10px;
  }

  .quantity-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }

  .label-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .label-grid.compact div {
    padding: 10px;
  }

  .section-title h2 {
    font-size: 1.28rem;
  }

  .order-list {
    max-height: none;
  }

  .order-card {
    padding: 14px;
  }

  .quantity-entry {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .quantity-form .button {
    min-height: 58px;
  }

  .sticky-submit {
    position: fixed;
    right: 9px;
    bottom: 10px;
    left: 9px;
    z-index: 6;
    border: 1px solid rgba(203, 215, 230, 0.9);
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 34px rgba(18, 32, 54, 0.16);
  }
}

@media (max-width: 380px) {
  .shell {
    width: min(100% - 16px, 980px);
  }

  .auth-shell {
    padding: 12px;
  }

  .button {
    min-height: 50px;
    padding: 0 12px;
  }

  .scanner-controls {
    grid-template-columns: 1fr;
  }
}
