:root {
  --ink: #303030;
  --ink-strong: #1f1f1f;
  --muted: #616161;
  --muted-2: #8a8f98;
  --line: #dcdfe4;
  --line-strong: #aeb4bc;
  --paper: #f1f2f4;
  --paper-soft: #f6f6f7;
  --white: #ffffff;
  --primary: #303030;
  --primary-hover: #1a1a1a;
  --accent: #0f766e;
  --accent-hover: #0b5f59;
  --accent-soft: #e8f5f2;
  --accent-line: #8ac8bd;
  --charge: #b7791f;
  --charge-hover: #8a5a16;
  --charge-soft: #fff7e6;
  --blue: #005bd3;
  --amber: #8a6116;
  --red: #b42318;
  --green: #0c6b3d;
  --blue-soft: #eef5ff;
  --green-soft: #eef8f2;
  --amber-soft: #fff7e6;
  --red-soft: #fff2f1;
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.08), 0 1px 1px rgba(26, 26, 26, 0.04);
  --shadow-strong: 0 10px 28px rgba(26, 26, 26, 0.1);
  --focus: 0 0 0 2px #ffffff, 0 0 0 4px rgba(0, 91, 211, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.nav-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

button:hover,
.nav-button:hover {
  background: #f7f7f7;
  border-color: #9097a2;
}

button:focus-visible,
.nav-button:focus-visible,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: var(--focus);
  outline: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media print {
  body {
    background: #ffffff;
    font-size: 11px;
  }

  .app-shell {
    max-width: none;
    padding: 0;
  }

  .top-actions,
  .page-nav,
  .auth-bar,
  .button-row,
  .feedback,
  .search-row,
  .no-print,
  form,
  button,
  .nav-button {
    display: none !important;
  }

  .mode-zone,
  .detail-panel {
    border: 0;
    box-shadow: none;
    padding: 0 0 14px;
    page-break-inside: avoid;
  }

  table {
    font-size: 10px;
  }
}

a {
  color: var(--blue);
}

.primary,
.nav-button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.primary:hover,
.nav-button.primary:hover {
  background: var(--primary-hover);
}

.danger {
  background: #fff4f4;
  border-color: #e3a1a1;
  color: var(--red);
}

.link-button {
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0 2px;
  box-shadow: none;
  font-weight: 800;
  text-decoration: underline;
}

.link-button:hover {
  background: transparent;
  color: #0048a8;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px 24px 32px;
}

.operator-shell {
  max-width: 1440px;
}

.topbar {
  position: sticky;
  z-index: 12;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -20px -24px 16px;
  padding: 14px 24px 12px;
  border-bottom: 1px solid rgba(174, 180, 188, 0.55);
  background: rgba(241, 242, 244, 0.94);
  backdrop-filter: blur(10px);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-nav .nav-button {
  min-height: 32px;
  padding: 0 10px;
}

.page-nav .nav-button.is-current,
.page-nav .nav-button[aria-current="page"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.auth-bar {
  position: relative;
  order: -1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.android-device-settings-btn {
  min-height: 34px;
  padding: 0 10px;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu summary::after {
  content: "Menu";
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.account-avatar {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-size: 11px;
}

.account-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: min(260px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-menu-panel button {
  width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--ink-strong);
  font-size: 24px;
  font-weight: 750;
  line-height: 1.2;
}

h2 {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.session-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.band,
.scan-panel,
.side-panel,
.mode-zone,
.login-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls-band,
.mode-zone {
  padding: 16px;
  margin-bottom: 16px;
}

.mode-zone:focus-within {
  border-color: #c5cad2;
}

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

.operator-control-grid,
.packing-control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operator-scanner-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.operator-scan-input-row {
  grid-template-columns: minmax(0, 1fr) 132px 104px;
}

.transfer-scan-input-row {
  grid-template-columns: minmax(0, 1fr) 132px 90px;
  margin-top: 0;
}

.pos-scan-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
}

.operator-page #scanInput {
  min-height: 62px;
  font-size: 24px;
}

.transfer-item-search #itemSearchInput,
#itemSearchInput {
  min-height: 44px;
}

#scanInput,
#itemSearchInput,
#inventorySearchInput,
#searchInput,
#boxLookupInput {
  border-color: #8d96a3;
  background: #ffffff;
}

#scanInput:focus,
#itemSearchInput:focus,
#inventorySearchInput:focus,
#searchInput:focus,
#boxLookupInput:focus {
  background: #fbfdff;
}

.packing-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 0 12px;
  padding: 12px 0;
}

.compact-fulfilment,
.operator-metrics {
  margin-top: 10px;
}

.selected-parcel {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 91, 211, 0.12);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--paper-soft);
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  padding: 22px;
}

.login-panel h1 {
  margin-top: 2px;
  font-size: 24px;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.remember-row input {
  width: 18px;
  min-height: 18px;
}

.remember-row span {
  margin: 0;
}

.admin-user-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) 120px;
  align-items: end;
}

.password-user-form {
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(180px, 1fr)) 140px;
  align-items: end;
}

.settings-form {
  grid-template-columns: minmax(180px, 0.9fr) minmax(120px, 0.5fr) minmax(240px, 1fr) 140px;
  align-items: end;
}

.settings-notes {
  min-width: 0;
}

.inventory-form {
  grid-template-columns: minmax(140px, 0.6fr) minmax(240px, 1fr) minmax(160px, 0.8fr) minmax(160px, 0.7fr);
  align-items: end;
}

.stock-form {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) minmax(120px, 0.4fr) 120px;
  align-items: end;
}

.transfer-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
}

.transfer-note {
  grid-column: span 2;
}

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

.selected-item-stock {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 10px;
}

.bulk-transfer-input {
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.compact-head {
  margin-bottom: 8px;
}

.import-form {
  grid-template-columns: minmax(260px, 1fr) 150px;
  align-items: end;
}

.pos-settings-location-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.45fr) minmax(280px, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

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

.settings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfc;
  padding: 12px;
}

.event-shop-pos-cue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  border: 1px solid #b8c7db;
  border-radius: 8px;
  background: #f4f8fc;
  padding: 10px 12px;
}

.event-shop-pos-cue div {
  min-width: 0;
}

.event-shop-pos-cue span,
.event-shop-pos-cue strong {
  display: block;
}

.event-shop-pos-cue span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-shop-pos-cue strong {
  color: var(--ink-strong);
  font-size: 13px;
  line-height: 1.35;
}

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

.pos-access-user {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  padding: 9px 10px;
}

.pos-access-user input {
  width: 16px;
  min-height: 16px;
}

.pos-access-user span {
  margin: 0;
}

.pos-access-user strong,
.pos-access-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-access-user small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-edit-row input {
  min-width: 120px;
}

.fulfilment-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}

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

.dashboard-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  min-height: 104px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 14px 14px 13px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.dashboard-card:hover {
  border-color: var(--line-strong);
  background: #fafafa;
  box-shadow: var(--shadow-strong);
  transform: translateY(-1px);
}

.dashboard-card::after {
  content: ">";
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8fa;
  color: var(--muted);
  font-weight: 900;
}

.dashboard-card span {
  grid-column: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.dashboard-card strong {
  grid-column: 1;
  color: var(--ink-strong);
  font-size: 15px;
  line-height: 1.3;
}

label span,
.scan-label {
  display: block;
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-line {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 18px;
}

.checkbox-line input {
  width: auto;
  min-height: 0;
}

.checkbox-line span {
  margin: 0;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--white);
  color: #000000;
  padding: 7px 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #747b85;
}

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

select {
  padding-right: 30px;
}

.button-row,
.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.no-top-margin {
  margin-top: 0;
}

.search-row input {
  flex: 1 1 260px;
}

.pagination-bar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pagination-bar label {
  width: 110px;
}

.pagination-bar button {
  min-width: 104px;
}

.pagination-bar span {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 11px 4px;
}

.scanner-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  gap: 10px;
  margin-bottom: 14px;
}

.scanner-layout > .mode-zone:last-child {
  display: flex;
  flex-direction: column;
}

.pos-shortcut-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 8px;
}

.pos-shortcut-head label {
  width: min(220px, 45%);
}

.pos-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.pos-shortcut-tile {
  min-height: 80px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  position: relative;
  gap: 3px;
  padding: 7px;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
  transition: transform 90ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.pos-shortcut-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 4px solid var(--accent);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}

.pos-shortcut-tile:hover,
.pos-shortcut-tile:focus-visible {
  border-color: var(--accent);
  background: #f6fbfa;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.12);
}

.pos-shortcut-tile:hover::before,
.pos-shortcut-tile:focus-visible::before {
  opacity: 1;
}

.pos-shortcut-tile:active {
  transform: scale(0.985);
}

.pos-shortcut-tile strong,
.pos-shortcut-tile span,
.pos-shortcut-tile small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-shortcut-tile strong {
  color: #172321;
  font-size: 11px;
  line-height: 1.25;
}

.pos-shortcut-tile span,
.pos-shortcut-tile small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.pos-shortcut-pager {
  align-items: center;
  margin-bottom: 12px;
}

.pos-search-results {
  margin-top: 8px;
}

.pos-search-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pos-search-list button {
  min-height: 48px;
  display: grid;
  justify-items: start;
  gap: 2px;
  text-align: left;
}

.pos-search-list span,
.pos-search-list small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}

.pos-shop-picker {
  max-width: 680px;
  width: min(680px, 100%);
  margin: 0 auto 16px;
}

.pos-shop-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.pos-shop-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  padding: 7px 8px;
  box-shadow: var(--shadow);
}

.pos-shop-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.pos-shop-code {
  min-width: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f8fa;
  color: var(--muted);
  padding: 2px 5px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.pos-shop-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-complete-wrap {
  margin-top: auto;
  padding-top: 14px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) clamp(116px, 18%, 136px);
  align-items: stretch;
  gap: 10px;
}

.pos-complete-wrap .metrics {
  margin: 0;
  min-width: 0;
  align-items: stretch;
  grid-template-columns: 1fr;
}

.pos-complete-wrap .metric-row,
.pos-complete-wrap #completeSaleBtn {
  height: 68px;
  min-height: 68px;
  max-height: 68px;
}

.pos-complete-wrap .metric-row {
  min-width: 0;
  display: grid;
  align-content: center;
  overflow: hidden;
}

.pos-complete-wrap .metric-row span,
.pos-complete-wrap .metric-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-complete-wrap .metric-row strong {
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1.1;
}

.pos-complete-wrap #completeSaleBtn {
  align-self: stretch;
  padding: 0 14px;
}

.pos-screen {
  background: #eef1f4;
}

.pos-screen .app-shell {
  background: #eef1f4;
}

.pos-screen .topbar {
  border-bottom-color: rgba(15, 118, 110, 0.18);
}

.pos-screen .topbar h1 {
  color: #172321;
}

.pos-screen .mode-zone {
  border-color: #d4e0df;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 10px 24px rgba(15, 118, 110, 0.05);
}

.pos-screen #posCheckout.scanner-layout:not(.hidden) > .mode-zone:first-child {
  border-top: 3px solid var(--accent-line);
}

.pos-screen #posCheckout.scanner-layout:not(.hidden) > .mode-zone:last-child {
  border-top: 3px solid #d7a94f;
}

.pos-screen .section-head .eyebrow,
.pos-screen .pos-shortcut-head .eyebrow {
  color: var(--accent);
}

.pos-payment-options {
  margin-top: 12px;
  grid-template-columns: 1fr;
}

.pos-context-pill {
  order: 4;
  max-width: min(38px, 6vw);
  min-height: 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f8fa;
  padding: 0 4px;
  color: var(--muted);
  line-height: 1;
  opacity: 0.76;
}

.pos-context-pill strong {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-checkout-meta {
  align-items: center;
}

.readonly-field {
  min-height: 56px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.readonly-field span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.readonly-field strong {
  color: var(--ink-strong);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.pos-payment-methods {
  min-width: 0;
  padding: 0;
  border: 0;
}

.pos-payment-methods legend {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.payment-radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payment-radio-option {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.payment-radio-option input {
  width: 16px;
  height: 16px;
  accent-color: #2f2f2f;
}

.payment-radio-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

#offlineStatus {
  border-left: 5px solid #6b7280;
}

#offlineStatus.success {
  border-left-color: #00865a;
}

#offlineStatus.warning {
  border-left-color: #b7791f;
}

#offlineStatus.error {
  border-left-color: #c81e1e;
}

.pos-offline-panel {
  width: min(520px, 100%);
  margin: 5px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--ink);
  overflow: hidden;
}

.pos-offline-panel summary {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 6px 9px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.pos-offline-list {
  display: grid;
  gap: 6px;
  max-height: 156px;
  overflow: auto;
  padding: 0 8px 8px;
}

.pos-offline-sale {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
}

.pos-offline-sale strong {
  color: var(--ink-strong);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.pos-offline-sale span,
.pos-offline-sale small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pos-offline-sale.error {
  border-color: #efc2c2;
  background: #fff8f8;
}

.pos-offline-sale.syncing {
  border-color: #b7c8e8;
  background: #f6f9ff;
}

.pos-offline-actions {
  padding: 0 8px 8px;
}

.pos-offline-actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

.pos-offline-actions {
  flex-wrap: wrap;
}

.pos-cart-table {
  margin-top: 12px;
  margin-bottom: 12px;
  overflow-x: visible;
  border-color: #d4e0df;
}

.pos-cart-table table,
.pos-cart-compact {
  min-width: 0;
  table-layout: fixed;
}

.pos-cart-compact th,
.pos-cart-compact td {
  padding: 7px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pos-cart-compact th:nth-child(1),
.pos-cart-compact td:nth-child(1) {
  width: 58px;
}

.pos-cart-compact th:nth-child(3),
.pos-cart-compact td:nth-child(3) {
  width: 108px;
}

.pos-cart-compact th:nth-child(4),
.pos-cart-compact td:nth-child(4) {
  width: 88px;
}

.pos-cart-compact th:nth-child(5),
.pos-cart-compact td:nth-child(5) {
  width: 42px;
}

.pos-cart-qty {
  width: 42px;
  min-height: 30px;
  padding: 5px 6px;
  text-align: center;
}

.pos-cart-qty-stepper {
  display: grid;
  grid-template-columns: 28px 42px 28px;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.pos-cart-qty-stepper button {
  width: 28px;
  min-height: 30px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.pos-cart-remove {
  min-width: 30px;
  width: 30px;
  padding: 0;
}

.pos-complete-sale {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.pos-screen {
  height: 100dvh;
  overflow: hidden;
}

.pos-screen .app-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 6px 10px 8px;
  overflow: hidden;
}

.pos-screen .topbar {
  position: relative;
  flex: 0 0 auto;
  min-height: 34px;
  margin: 0 0 6px;
  padding: 0 0 5px;
  background: transparent;
  backdrop-filter: none;
}

.pos-screen .topbar h1 {
  font-size: 16px;
}

.pos-screen .topbar .eyebrow {
  display: none;
}

.pos-screen .android-device-settings-btn {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.pos-screen .pos-context-pill {
  max-width: min(32px, 5vw);
  min-height: 12px;
  padding: 0 2px;
}

.pos-screen .pos-context-pill strong {
  font-size: 6px;
}

.pos-screen .section-head .eyebrow {
  font-size: 9px;
}

.pos-screen .section-head {
  min-height: 0;
  margin-bottom: 6px;
}

.pos-screen .section-head h2 {
  font-size: 13px;
  line-height: 1.15;
}

.pos-screen .pos-checkout-head {
  align-items: start;
}

.pos-screen .pos-checkout-meta {
  flex-wrap: nowrap;
  gap: 6px;
}

.pos-screen .mode-zone {
  padding: 8px;
}

.pos-screen #posCheckout.scanner-layout:not(.hidden) {
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 3fr) minmax(310px, 2fr);
  gap: 10px;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.pos-screen #posCheckout.scanner-layout:not(.hidden) > .mode-zone {
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.pos-screen #posCheckout.scanner-layout:not(.hidden) > .mode-zone:first-child,
.pos-screen #posCheckout.scanner-layout:not(.hidden) > .mode-zone:last-child {
  display: flex;
  flex-direction: column;
}

.pos-screen .section-head,
.pos-screen .control-grid,
.pos-screen .button-row,
.pos-screen .pos-shortcut-head,
.pos-screen .pagination-bar,
.pos-screen .pos-payment-options,
.pos-screen .pos-complete-wrap {
  flex: 0 0 auto;
}

.pos-screen #posFeedback,
.pos-screen .feedback {
  flex: 0 0 auto;
}

.pos-screen #posFeedback {
  width: fit-content;
  max-width: min(520px, 100%);
  min-height: 0;
  margin: 4px 0 0;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.2;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
}

.pos-screen #offlineStatus {
  width: fit-content;
  max-width: min(520px, 100%);
  min-height: 0;
  margin: 4px 0 0;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.15;
}

.pos-screen .pos-offline-panel {
  flex: 0 0 auto;
  max-width: min(440px, 100%);
}

.pos-screen .pos-offline-panel summary {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 10px;
}

.pos-screen .pos-offline-list {
  max-height: 96px;
}

.pos-screen .control-grid {
  gap: 6px;
}

.pos-screen .readonly-field {
  min-height: 38px;
  padding: 5px 8px;
}

.pos-screen .readonly-field span,
.pos-screen label span {
  font-size: 11px;
}

.pos-screen .readonly-field strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.pos-screen input,
.pos-screen select,
.pos-screen button {
  min-height: 32px;
}

.pos-screen .pos-shortcut-head {
  margin-top: 5px;
  margin-bottom: 5px;
}

.pos-screen .pos-shortcut-head h2 {
  font-size: 13px;
}

.pos-screen .pos-shortcut-head label {
  width: min(160px, 38%);
}

.pos-screen .pos-shortcut-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
  gap: 6px;
  grid-auto-rows: minmax(70px, auto);
  padding-right: 2px;
}

.pos-screen .pos-shortcut-tile {
  min-height: 70px;
  padding: 7px;
}

.pos-screen .pos-shortcut-tile strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.pos-screen .pos-shortcut-pager {
  margin-top: 6px;
  margin-bottom: 0;
}

.pos-screen #cartSummary {
  flex: 0 0 auto;
}

.pos-screen .pos-cart-table {
  flex: 1 1 auto;
  max-height: none;
  min-height: 88px;
  overflow: auto;
}

.pos-screen .pos-payment-options {
  margin-top: 8px;
}

.pos-screen #lastReceiptWrap {
  order: 8;
  flex: 0 1 auto;
  max-height: 28%;
  min-height: 0;
  overflow: auto;
}

.pos-screen #lastReceiptWrap:empty {
  display: none;
}

.pos-screen .pos-complete-wrap {
  order: 10;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: auto;
  padding-top: 8px;
  background: var(--white);
}

.pos-screen .pos-complete-sale {
  border-color: var(--charge);
  background: var(--charge);
  color: var(--white);
  font-size: 16px;
  box-shadow: 0 10px 22px rgba(183, 121, 31, 0.24);
}

.pos-screen .pos-complete-sale:hover {
  border-color: var(--charge-hover);
  background: var(--charge-hover);
}

.pos-screen .pos-complete-wrap .metric-row {
  border-color: #e7d5b3;
  background: var(--charge-soft);
}

.pos-screen .pos-complete-wrap .metric-row span {
  color: #6f4d18;
}

.pos-screen .pos-complete-wrap .metric-row strong {
  color: #1f1f1f;
}

.payment-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  padding: 16px;
}

.payment-dialog::backdrop {
  background: rgba(0, 0, 0, 0.46);
}

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

.payment-dialog-summary .metric-row {
  border-color: #d4e0df;
  background: var(--accent-soft);
}

.terminal-approval-panel {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px 10px;
}

.terminal-amount-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.terminal-amount-line span {
  color: var(--muted);
  font-weight: 700;
}

.terminal-amount-line strong {
  font-size: 15px;
}

.terminal-approval-check {
  margin: 0;
  padding-top: 0;
}

.terminal-approval-panel small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.logo-preview-wrap {
  display: grid;
  gap: 6px;
  align-content: end;
}

.logo-preview-wrap > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receipt-logo-preview {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receipt-logo-preview img {
  max-width: 180px;
  max-height: 56px;
  object-fit: contain;
}

.browser-printer-status {
  display: grid;
  gap: 6px;
  align-content: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
}

.browser-printer-status > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.browser-printer-status strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.printer-scope-note {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
}

.printer-scope-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.printer-scope-note strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.android-printer-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.android-printer-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.android-printer-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.android-printer-panel strong {
  color: var(--ink-strong);
  font-size: 13px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.android-printer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.android-device-settings-dialog form {
  gap: 12px;
}

.android-device-settings-status {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.android-device-settings-status span,
.android-device-settings-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.android-device-settings-status strong {
  color: var(--ink-strong);
  font-size: 13px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.android-device-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.receipt-action-row {
  margin-bottom: 10px;
}

.receipt-print-status {
  margin: 0 0 10px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.25;
}

.receipt-audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.receipt-audit-meta span {
  min-height: 32px;
  display: inline-grid;
  align-content: center;
  gap: 2px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8fa;
}

.receipt-audit-meta small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.receipt-audit-meta strong {
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.scan-panel,
.side-panel {
  padding: 14px;
}

.scanner-status,
.panel-header,
.section-head,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scanner-status {
  margin-bottom: 12px;
}

.scanner-status p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.scanner-status strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.camera-wrap {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111111;
  aspect-ratio: 16 / 9;
}

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

.hidden {
  display: none !important;
}

.scan-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 90px;
  gap: 8px;
}

#scanInput {
  min-height: 54px;
  font-size: 20px;
  font-weight: 750;
}

.quantity-line {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.box-scan-line {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1fr) minmax(180px, 1fr) 92px;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}

.checkbox-label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label input {
  width: auto;
}

.box-photo-preview {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa center / cover no-repeat;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
}

.floorplan-preview {
  min-height: 150px;
  background-size: contain;
}

.feedback {
  margin: 12px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.neutral {
  background: #f6f6f7;
  border-color: var(--line);
  color: var(--muted);
}

.success {
  background: #eff8f3;
  border-color: #b7dec8;
  color: var(--green);
}

.error {
  background: #fff4f4;
  border-color: #efc2c2;
  color: var(--red);
}

.warning {
  background: #fff8e8;
  border-color: #ead59b;
  color: var(--amber);
}

.last-scan {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.operator-last-scan {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding: 0 0 12px;
}

.empty-state {
  color: var(--muted);
  padding: 14px 0;
}

.scan-result,
.parcel,
.metric-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.scan-result strong,
.parcel strong {
  display: block;
}

.scan-result small,
.parcel small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.recent-list {
  display: grid;
  gap: 0;
  margin-top: 10px;
  max-height: 420px;
  overflow: auto;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.recent-box-photo {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 6px;
}

.box-info-photo {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
}

.item-photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
}

.item-photo-card {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.item-photo-thumb {
  width: 116px;
  height: 116px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  display: block;
}

.photo-thumb-button {
  display: inline-block;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.photo-thumb-button:hover .box-info-photo,
.box-photo-preview[role="button"]:hover,
.box-result-photo:hover img {
  border-color: var(--blue);
}

.box-finder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.box-finder label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.box-finder label span {
  font-size: 12px;
}

.box-result-photo {
  width: min(360px, 100%);
  display: grid;
  gap: 6px;
  justify-items: start;
  align-items: start;
  min-height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin-bottom: 10px;
  color: var(--blue);
}

.box-result-photo img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
}

.floorplan-detail {
  margin-top: 12px;
}

.floorplan-photo {
  width: min(680px, 100%);
}

.floorplan-photo img {
  max-height: 360px;
  background: #fafafa;
}

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

.finder-box-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 10px;
}

.finder-box-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.finder-box-head strong,
.finder-box-head small {
  display: block;
}

.finder-box-head small {
  color: var(--muted);
  margin-top: 2px;
}

.rack-detail-media {
  display: grid;
  gap: 10px;
}

.rack-inline-photo {
  width: 120px;
  min-height: 72px;
  margin-top: 6px;
}

.photo-dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 14px;
}

.full-photo {
  display: block;
  width: 100%;
  max-height: calc(100vh - 126px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
}

.muted-text {
  color: var(--muted);
}

.compact-head {
  margin-bottom: 8px;
}

.inline-check {
  display: inline-flex;
  width: auto;
  min-height: auto;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-check input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  padding: 0;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.inline-control input {
  min-width: 0;
}

.inline-control button {
  white-space: nowrap;
}

.po-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.label-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.label-preview {
  width: min(100%, 420px);
  min-height: 150px;
  border: 1px dashed #aab3be;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.box-label {
  width: 86mm;
  min-height: 48mm;
  color: #111;
  background: #fff;
  display: grid;
  grid-template-columns: 32mm minmax(0, 1fr);
  gap: 4mm;
  align-items: start;
  font-family: Arial, Helvetica, sans-serif;
}

.box-label-qr {
  width: 32mm;
  height: 32mm;
}

.box-label-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.box-label-title {
  font-size: 13pt;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.box-label-code {
  margin-top: 2mm;
  font-size: 8pt;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.box-label-contents {
  grid-column: 1 / -1;
  margin: 2mm 0 0;
  padding: 0;
  list-style: none;
  font-size: 7.5pt;
  line-height: 1.25;
}

.box-label-contents li {
  display: grid;
  grid-template-columns: 16mm minmax(0, 1fr) 11mm;
  gap: 2mm;
}

.box-label-empty {
  grid-column: 1 / -1;
  color: #555;
  font-size: 8pt;
}

.print-only {
  display: none;
}

.receipt-print-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.thermal-receipt {
  width: 80mm;
  max-width: 100%;
  background: #fff;
  color: #000;
  border: 1px solid var(--line);
  padding: 4mm;
  font-family: "Courier New", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10pt;
  line-height: 1.25;
}

.thermal-receipt.receipt-58 {
  width: 58mm;
  font-size: 7.5pt;
  line-height: 1.18;
  padding: 2mm;
}

.receipt-center {
  text-align: center;
}

.receipt-logo {
  display: block;
  max-width: 42mm;
  max-height: 16mm;
  margin: 0 auto 2mm;
  object-fit: contain;
  filter: grayscale(1) contrast(3);
}

.receipt-58 .receipt-logo {
  max-width: 28mm;
  max-height: 11mm;
  margin-bottom: 1.5mm;
}

.receipt-note {
  margin-top: 2mm;
  white-space: pre-wrap;
}

.receipt-rule {
  border-top: 1px dashed #000;
  margin: 2.5mm 0;
}

.receipt-58 .receipt-rule {
  margin: 1.5mm 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 3mm;
}

.receipt-58 .receipt-row {
  gap: 1mm;
}

.receipt-row span,
.receipt-row strong,
.receipt-item div {
  overflow-wrap: anywhere;
}

.receipt-row span:first-child {
  flex: 1 1 auto;
}

.receipt-row span:last-child,
.receipt-row strong:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.receipt-currency {
  margin-bottom: 1mm;
  text-align: right;
  font-size: 0.9em;
}

.receipt-item {
  margin-bottom: 2mm;
}

.receipt-58 .receipt-item {
  margin-bottom: 1.25mm;
}

.receipt-total {
  font-size: 1.15em;
  font-weight: 900;
}

@media print {
  body.printing-label > *:not(.print-only) {
    display: none !important;
  }

  body.printing-label .print-only {
    display: block;
    width: 100%;
  }

  @page {
    size: A5 portrait;
    margin: 6mm;
  }

  body.printing-label {
    background: #fff;
    margin: 0;
    padding: 0;
  }

  body.printing-label .box-label {
    box-sizing: border-box;
    width: 136mm;
    min-height: 198mm;
    padding: 8mm;
    grid-template-columns: 52mm minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 7mm;
    align-content: start;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  body.printing-label .box-label-qr {
    width: 52mm;
    height: 52mm;
  }

  body.printing-label .box-label-title {
    font-size: 24pt;
    line-height: 1.05;
  }

  body.printing-label .box-label-code {
    margin-top: 4mm;
    font-size: 13pt;
  }

  body.printing-label .box-label-contents {
    margin-top: 7mm;
    font-size: 8.5pt;
    font-weight: 900;
    line-height: 1.2;
  }

  body.printing-label .box-label-contents li {
    grid-template-columns: 24mm minmax(0, 1fr) 12mm;
    gap: 2.5mm;
    padding: 1mm 0;
    border-bottom: 0.2mm solid #ddd;
    align-items: start;
    overflow-wrap: anywhere;
  }

  body.printing-label .box-label-contents strong,
  body.printing-label .box-label-contents span {
    font-weight: 900;
    overflow-wrap: anywhere;
    min-width: 0;
  }

  body.printing-label .box-label-empty {
    margin-top: 7mm;
    font-size: 12pt;
  }
}

@media print {
  body.printing-receipt > *:not(.print-only) {
    display: none !important;
  }

  body.printing-receipt .print-only {
    display: block;
  }

  body.printing-receipt {
    background: #fff;
    margin: 0;
    padding: 0;
  }

  body.printing-receipt .thermal-receipt {
    border: 0;
    width: 80mm;
    max-width: 80mm;
    padding: 2mm;
    font-size: 9pt;
  }

  body.printing-receipt .thermal-receipt.receipt-58 {
    width: 58mm;
    max-width: 58mm;
    padding: 1.25mm;
    font-size: 7pt;
    line-height: 1.18;
  }
}

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

.recent-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.recent-actions button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.delta {
  align-self: center;
  min-width: 36px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ebf3ff;
  color: var(--blue);
  text-align: center;
  font-weight: 750;
}

.mode-zone {
  margin-bottom: 14px;
}

.section-head {
  margin-bottom: 12px;
}

.fulfilment-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

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

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric-row strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.parcel-list {
  display: grid;
  gap: 10px;
}

.parcel-header,
.parcel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.item-chips,
.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f6f7;
  color: var(--ink);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 650;
}

.chip.warn {
  background: #fff8e8;
  border-color: #ead59b;
  color: var(--amber);
}

.chip.good {
  background: #eff8f3;
  border-color: #b7dec8;
  color: var(--green);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: var(--white);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #fafafa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfcfd;
}

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

dialog {
  width: min(760px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 56px rgba(26, 26, 26, 0.18);
}

.wide-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.wide-dialog > .dialog-head,
.wide-dialog > .metrics,
.wide-dialog > .detail-section {
  margin: 14px;
}

.detail-section {
  display: grid;
  gap: 10px;
}

dialog::backdrop {
  background: rgba(26, 26, 26, 0.42);
}

dialog form {
  padding: 14px;
}

.full-span {
  grid-column: 1 / -1;
}

@media (max-width: 860px) {
  body {
    font-size: 13px;
  }

  .app-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 12px;
  }

  main,
  .mode-zone,
  .control-grid,
  .transfer-form,
  .selected-item-stock,
  label {
    min-width: 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    margin: -12px -12px 12px;
    padding: 12px;
  }

  .top-actions {
    width: 100%;
    justify-content: stretch;
  }

  .page-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .page-nav .nav-button {
    flex: 0 0 auto;
  }

  .top-actions > * {
    flex: 1 1 auto;
  }

  .auth-bar {
    flex: 0 0 auto;
  }

  .account-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .session-pill {
    white-space: normal;
  }

  .control-grid,
  .fulfilment-grid,
  .operator-control-grid,
  .packing-control-grid,
  .admin-user-form,
  .password-user-form,
  .settings-form,
  .pos-settings-location-row,
  .pos-access-grid,
  .inventory-form,
  .stock-form,
  .transfer-form,
  .import-form,
  .scanner-layout,
  .metrics,
  .page-grid {
    grid-template-columns: 1fr;
  }

  .scan-input-row,
  .operator-scan-input-row,
  .transfer-scan-input-row,
  .pos-scan-input-row,
  .box-finder {
    grid-template-columns: 1fr;
  }

  .payment-radio-group {
    grid-template-columns: 1fr;
  }

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

  .box-scan-line {
    grid-template-columns: 1fr;
  }

  .transfer-note {
    grid-column: auto;
  }

  .full-span {
    grid-column: auto;
  }

  .mode-zone {
    padding: 12px;
  }

  .pos-shortcut-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-shortcut-head label {
    width: 100%;
  }

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

  .pos-search-list {
    grid-template-columns: 1fr;
  }

  .pos-shop-list {
    grid-template-columns: 1fr;
  }

  .pos-shop-card {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-shop-card-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pos-screen {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  .pos-screen .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .pos-screen .scanner-layout,
  .pos-screen .scanner-layout > .mode-zone {
    overflow: visible;
  }

  .pos-screen .pos-shortcut-grid,
  .pos-screen .pos-cart-table,
  .pos-screen #lastReceiptWrap {
    max-height: none;
    overflow: visible;
  }

  .selected-item-stock {
    padding: 8px;
  }

  .compact-mobile-table table {
    min-width: 0;
  }

  .compact-mobile-table th,
  .compact-mobile-table td {
    padding: 7px 8px;
    white-space: nowrap;
  }

  select,
  input,
  textarea,
  button {
    min-width: 0;
  }

  .button-row button,
  .search-row button,
  .button-row .nav-button,
  .search-row .nav-button {
    flex: 1 1 130px;
  }
}
