:root {
  --blue: #1f5fa8;
  --blue-dark: #10233f;
  --navy: #10243d;
  --navy-soft: #173150;
  --accent: #e8f1fb;
  --silver: #d7dee8;
  --silver-soft: #f4f7fb;
  --white: #ffffff;
  --text: #162033;
  --muted: #667085;
  --border: #dfe5ee;
  --success: #178345;
  --warning: #b7791f;
  --error: #c2352b;
  --shadow: 0 18px 42px rgba(16, 35, 63, 0.08);
  --radius: 12px;
}

/* Finance Centre Stage 1 */
.finance-subnav { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.finance-subnav a { padding: 0.55rem 0.8rem; border: 1px solid var(--border); border-radius: 0.6rem; background: #fff; color: var(--text); font-weight: 700; text-decoration: none; }
.finance-subnav a:hover { border-color: var(--blue); color: var(--blue); }
.finance-hero { display: flex; justify-content: space-between; align-items: center; }
.finance-summary-grid { margin: 1rem 0; }
.finance-two-column { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.finance-stack { display: grid; gap: 0.65rem; }
.finance-list-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: 0.65rem; }
.finance-list-row span { color: var(--muted); text-align: right; }
.finance-form, .finance-import-form, .finance-period-form, .finance-reconcile-form { display: grid; gap: 0.85rem; }
.finance-import-form { grid-template-columns: 1fr 1fr 2fr auto; align-items: end; }
.finance-manual-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.finance-manual-grid button { align-self: end; }
.finance-filter-bar { display: grid; grid-template-columns: minmax(15rem, 1fr) auto auto auto; gap: 0.65rem; margin-bottom: 1rem; }
.finance-create-panel { margin-bottom: 1rem; }
.finance-create-panel summary, .finance-format-help summary { cursor: pointer; font-weight: 800; }
.finance-error-row pre { white-space: pre-wrap; color: #9b1c1c; margin: 0; }
.finance-drop-zone { min-height: 5rem; display: flex; align-items: center; justify-content: center; gap: 0.65rem; padding: 0.75rem; border: 2px dashed var(--border); border-radius: 0.65rem; background: var(--silver-soft); }
.finance-drop-zone.dragging { border-color: var(--blue); background: var(--accent); }
.finance-drop-zone small { color: var(--muted); }
.finance-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.finance-detail-grid div { padding: 0.75rem; border-radius: 0.65rem; background: var(--silver-soft); }
.finance-detail-grid span { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.finance-values { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; }
.finance-values dt { color: var(--muted); }
.finance-values dd { margin: 0; font-weight: 700; }
.finance-warning-card { border-left: 4px solid #d97706; }
.finance-checklist { display: grid; gap: 0.65rem; padding-left: 1.2rem; }
.finance-confidence { display: inline-flex; align-items: center; border-radius: 999px; padding: .3rem .65rem; font-weight: 700; font-size: .82rem; }
.finance-confidence-green { background: #dcfce7; color: #166534; }
.finance-confidence-amber { background: #fef3c7; color: #92400e; }
.finance-confidence-red { background: #fee2e2; color: #991b1b; }
.finance-confidence-manual { background: #dbeafe; color: #1d4ed8; }
.finance-vat-heading, .finance-action-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.finance-vat-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.finance-vat-box { display: flex; flex-direction: column; gap: .35rem; color: inherit; text-decoration: none; }
.finance-vat-box strong { font-size: 1.55rem; }
.finance-vat-box small { color: var(--muted); }
.finance-vat-box:hover { border-color: var(--blue); }
.finance-exception { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); gap: 1rem; border-left: 5px solid #d97706; }
.finance-exception-red, .finance-danger-card { border-left: 5px solid #b91c1c; }
.finance-exception-form { align-self: start; }
.finance-difference { color: #b91c1c; font-weight: 700; }
table td small { display: block; color: var(--muted); }

@media (max-width: 900px) {
  .finance-two-column, .finance-detail-grid { grid-template-columns: 1fr; }
  .finance-import-form, .finance-manual-grid, .finance-filter-bar, .finance-exception { grid-template-columns: 1fr; }
}

.barcode-label-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 1fr);
  gap: 18px;
}

.barcode-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.barcode-label-controls form {
  display: grid;
  gap: 16px;
}

.barcode-lookup-message {
  display: flex;
  gap: 12px;
  min-height: 48px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 9px;
  background: #f2f6fb;
  color: var(--muted);
}

.barcode-lookup-message strong {
  color: var(--ink);
  font-size: 18px;
}

.barcode-description-editor,
.barcode-quantity-warning {
  padding: 14px;
  border-radius: 9px;
}

.barcode-description-editor {
  border: 1px solid #d9e3ef;
  background: #f8fbff;
}

.barcode-quantity-warning {
  border: 1px solid #f0b449;
  background: #fff7e6;
  color: #704500;
}

.barcode-preview-stage {
  display: grid;
  min-height: 230px;
  place-items: center;
  padding: 24px;
  overflow: auto;
  border-radius: 12px;
  background: #e9eef5;
}

.barcode-physical-label {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: var(--label-width, 47mm);
  height: var(--label-height, 30mm);
  padding: 1.6mm 2mm 1.2mm;
  overflow: hidden;
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
}

.barcode-preview-stage .barcode-physical-label {
  border: 1px solid #c6ced8;
  box-shadow: 0 8px 24px rgb(21 42 70 / 18%);
}

.barcode-physical-label.is-empty {
  opacity: 0.45;
}

.barcode-label-description {
  overflow: hidden;
  font-size: 9pt;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barcode-label-sku {
  padding-top: 0.6mm;
  font-size: 8pt;
  font-weight: 700;
  text-align: center;
}

.barcode-label-bars {
  min-height: 0;
  padding-top: 0.7mm;
}

.ean13-barcode {
  display: block;
  width: 100%;
  height: 100%;
}

.barcode-label-number {
  padding-top: 0.4mm;
  font-size: 8pt;
  letter-spacing: 0.7mm;
  text-align: center;
}

.barcode-preview-note {
  margin-bottom: 0;
  text-align: center;
}

.barcode-print-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #eef4fb;
  font-family: Arial, Helvetica, sans-serif;
}

.barcode-print-sheet {
  display: block;
}

@media (max-width: 900px) {
  .barcode-label-workspace,
  .barcode-entry-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f9fc;
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
}

.wholesale-portal-body {
  background: #f4f7f5;
  color: #193328;
}

.portal-header {
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 82px;
  padding: 14px max(24px, calc((100vw - 1240px) / 2));
  background: #fff;
  border-bottom: 1px solid #dce6df;
}

.portal-brand {
  display: inline-flex;
  flex-direction: column;
  color: #183c2d;
  text-decoration: none;
  line-height: 1;
}

.portal-brand strong { font-size: 23px; letter-spacing: .08em; }
.portal-brand span { margin-top: 5px; color: #7a3528; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.portal-header nav { display: flex; flex: 1; flex-wrap: wrap; gap: 7px; }
.portal-header nav a { padding: 10px 12px; color: #29493b; text-decoration: none; border-radius: 7px; font-weight: 700; }
.portal-header nav a:hover { background: #edf4ef; }
.portal-header form { margin: 0; }
.portal-signout { background: transparent; border: 1px solid #bdccc2; color: #29493b; }
.portal-main { width: min(1240px, calc(100% - 40px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 34px 0 60px; }
.portal-footer { padding: 25px; color: #63766d; text-align: center; }
.portal-preview-banner { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 9px 20px; background: #fff1c9; color: #704b00; font-weight: 800; }
.portal-preview-banner form { margin: 0; }
.portal-preview-banner button { min-height: 34px; padding: 6px 12px; }
.portal-sandbox-banner { padding: 8px 20px; background: #dbeafe; color: #123b70; text-align: center; font-weight: 800; border-bottom: 1px solid #93c5fd; }
.portal-sandbox-confirmation { border-left: 5px solid #2563eb; }

.portal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding: 38px;
  background: linear-gradient(135deg, #e2efe6, #fff);
  border: 1px solid #d5e4da;
  border-radius: 16px;
}

.portal-hero h1, .portal-page-heading h1, .portal-narrow-card h1 { color: #173b2c; font-size: clamp(28px, 4vw, 42px); }
.portal-hero p:last-child { margin-bottom: 0; color: #587065; font-size: 18px; }
.portal-content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
.portal-card, .portal-narrow-card {
  padding: 28px;
  background: #fff;
  border: 1px solid #dce6df;
  border-radius: 14px;
  box-shadow: 0 15px 36px rgba(29, 61, 47, .06);
}
.portal-narrow-card { max-width: 600px; margin: 40px auto; }
.portal-advertising { display: grid; align-content: start; gap: 16px; }
.portal-advertising section { min-height: 135px; padding: 22px; background: #fff; border: 1px solid #dce6df; border-radius: 13px; }
.portal-advertising span { display: block; margin-bottom: 14px; color: #7a3528; font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.portal-page-heading { margin-bottom: 24px; }
.portal-page-heading p:last-child { color: #63766d; }
.portal-table-search { max-width: 430px; margin-bottom: 22px; }
.portal-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.portal-address-card { grid-column: 1 / -1; }
.portal-address-card address { margin: 18px 0; padding: 17px; background: #f4f7f5; border-radius: 8px; font-style: normal; line-height: 1.6; }
.portal-address-card details { margin-top: 20px; }
.portal-address-card summary { cursor: pointer; color: #1f5fa8; font-weight: 800; }
.portal-saved-address { display: flex; align-items: start; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e3ebe5; }
.portal-saved-address address { flex: 1; }
.portal-saved-address form { margin-top: 18px; }
.portal-reorder-lines { display: grid; gap: 10px; margin-top: 14px; }
.portal-reorder-lines form { display: grid; grid-template-columns: minmax(220px, 1fr) 110px auto; align-items: end; gap: 12px; }
.portal-order-view-control { width: 100%; padding: 12px 14px; cursor: pointer; border-radius: 7px; background: #f2f7f3; color: #1f5fa8; font-weight: 800; }
.portal-order-view-control:hover { background: #e7f0e9; }
.portal-quantity-input { appearance: textfield; -moz-appearance: textfield; }
.portal-quantity-input::-webkit-inner-spin-button, .portal-quantity-input::-webkit-outer-spin-button { appearance: none; margin: 0; }

.portal-login-page { display: grid; min-height: 100vh; place-items: center; padding: 30px; }
.portal-login-card { width: min(440px, 100%); padding: 38px; background: #fff; border: 1px solid #dce6df; border-radius: 16px; box-shadow: 0 24px 60px rgba(29, 61, 47, .14); }
.portal-activation-card { width: min(820px, 100%); padding: 38px; background: #fff; border: 1px solid #dce6df; border-radius: 16px; box-shadow: 0 24px 60px rgba(29, 61, 47, .14); }
.portal-login-brand { margin-bottom: 32px; }
.portal-login-card h1, .portal-activation-card h1 { color: #173b2c; }
.portal-login-card > p { color: #63766d; }
.portal-terms-acceptance { margin: 20px 0; padding: 20px; border: 1px solid #dce6df; border-radius: 10px; background: #f7faf8; }
.portal-terms-acceptance pre { max-height: 420px; overflow: auto; white-space: pre-wrap; font: inherit; line-height: 1.55; }
.portal-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-admin-actions form { margin: 0; }

.portal-order-fields { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-bottom: 25px; }
.portal-product-entry { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 110px 90px; align-items: end; gap: 12px; padding: 20px; background: #f2f7f3; border-radius: 10px; }
.portal-product-results { position: absolute; z-index: 10; top: 83px; left: 20px; width: calc(100% - 242px); max-height: 320px; overflow: auto; background: #fff; border: 1px solid #ccd9d0; border-radius: 8px; box-shadow: 0 16px 35px rgba(20, 45, 34, .16); }
.portal-product-results button { display: block; width: 100%; border: 0; border-bottom: 1px solid #edf1ee; border-radius: 0; background: #fff; color: #193328; text-align: left; }
.portal-product-results button:hover { background: #edf4ef; }
.portal-order-lines { margin-top: 28px; }
.portal-order-line { display: grid; grid-template-columns: minmax(190px, 1fr) 100px 100px auto; align-items: start; gap: 14px; padding: 17px 0; border-bottom: 1px solid #e3ebe5; }
.portal-order-line small { display: block; margin-top: 5px; color: #63766d; }
.portal-line-price { padding-top: 31px; }
.portal-order-line [data-stock] { grid-column: 2 / -1; }
.portal-stock-warning, .portal-carriage-warning { margin: 0; padding: 11px 13px; border-radius: 7px; background: #fff0ef; color: #b62c25; font-weight: 800; }
.portal-order-total { margin: 26px 0; margin-left: auto; width: min(430px, 100%); padding: 20px; background: #f4f7f5; border-radius: 10px; }
.portal-order-total > div { display: flex; justify-content: space-between; padding: 6px 0; }
.portal-order-total .portal-total-line { margin-top: 7px; padding-top: 13px; border-top: 1px solid #cddad1; font-size: 20px; }
.portal-carriage-warning { margin-top: 14px; }

@media (max-width: 850px) {
  .portal-header { align-items: flex-start; flex-wrap: wrap; }
  .portal-header nav { order: 3; flex-basis: 100%; }
  .portal-content-grid, .portal-account-grid { grid-template-columns: 1fr; }
  .portal-address-card { grid-column: auto; }
  .portal-advertising { grid-template-columns: repeat(3, 1fr); }
  .portal-order-fields { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .portal-main { width: min(100% - 24px, 1240px); padding-top: 20px; }
  .portal-header { padding: 14px; }
  .portal-header nav a { padding: 8px; font-size: 13px; }
  .portal-hero { align-items: flex-start; flex-direction: column; padding: 24px; }
  .portal-advertising { grid-template-columns: 1fr; }
  .portal-product-entry { grid-template-columns: 1fr 100px; }
  .portal-product-entry > button { grid-column: 1 / -1; }
  .portal-product-results { top: 83px; width: calc(100% - 40px); }
  .portal-order-line { grid-template-columns: 1fr 85px; }
  .portal-line-price { padding-top: 0; }
  .portal-order-line [data-stock] { grid-column: 1 / -1; }
  .portal-saved-address, .portal-reorder-lines form { grid-template-columns: 1fr; flex-direction: column; }
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 40px;
}

.auth-panel {
  width: 100%;
  max-width: 440px;
  margin: 9vh auto 0;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(21, 56, 88, 0.12);
}

.brand p,
.topbar p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--blue-dark);
  font-size: 28px;
  line-height: 1.15;
}

.title-back-link {
  color: inherit;
  text-decoration: none;
}

.title-back-link:hover {
  color: var(--blue);
  text-decoration: none;
}

h2 {
  color: var(--blue-dark);
  font-size: 19px;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 16px;
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: var(--silver-soft);
  color: var(--blue-dark);
  border: 1px solid var(--border);
}

.messages {
  max-width: 720px;
  margin: 0 auto 18px;
}

.message {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--blue-dark);
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.view-mode-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: -12px 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.view-mode-toggle {
  display: inline-flex;
  gap: 0;
  padding: 3px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.view-mode-toggle button {
  min-height: 34px;
  padding: 7px 12px;
  background: transparent;
  color: var(--blue-dark);
  border: 0;
}

.view-mode-toggle button.active {
  background: var(--blue);
  color: var(--white);
}

.view-detailed-only {
  display: none;
}

th.view-detailed-only,
td.view-detailed-only {
  display: none;
}

.is-detailed-view .view-detailed-only {
  display: block;
}

.is-detailed-view th.view-detailed-only,
.is-detailed-view td.view-detailed-only {
  display: table-cell;
}

.is-detailed-view .view-detailed-only.table-wrap {
  display: block;
}

.is-detailed-view .view-detailed-only.grid {
  display: grid;
}

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

.panel {
  min-height: 150px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.panel.action {
  border-top: 5px solid var(--blue);
}

.staff-shell {
  max-width: 980px;
}

.staff-topbar {
  align-items: flex-start;
}

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

.staff-tile {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  border-radius: 8px;
  background: #586b7c;
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 18px 38px rgba(21, 56, 88, 0.14);
}

.staff-tile span {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}

.staff-tile small {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  opacity: 0.9;
}

.tile-inventory {
  background: #1f4f82;
}

.tile-amazon-inventory {
  background: #1f4f82;
}

.tile-factory {
  background: #2f6673;
}

.tile-factory-stock {
  background: #2f6673;
}

.tile-replenishment {
  background: #276c6f;
}

.tile-fba-replenishment {
  background: #276c6f;
}

.tile-claims {
  background: #6b5876;
}

.tile-tasks {
  background: #7a8492;
}

.tile-soon {
  background: #7a8492;
}

.panel p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.inline-form {
  margin-top: 18px;
}

a {
  color: var(--blue);
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

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

.summary-list.inventory-totals {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

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

.summary-list div {
  padding: 14px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.summary-list dt {
  color: var(--muted);
  font-size: 13px;
}

.summary-list dd {
  margin: 6px 0 0;
  color: var(--blue-dark);
  font-size: 24px;
  font-weight: 700;
}

.summary-list dd.compact-value {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.table-wrap {
  margin-top: 18px;
  max-height: 70vh;
  overflow-x: auto;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.product-seed-lookup,
.product-seed-generator {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  max-width: 760px;
}

.product-seed-lookup label,
.product-seed-generator fieldset {
  grid-column: 1 / -1;
}

.product-seed-generator {
  margin-top: 20px;
}

.product-seed-generator fieldset {
  margin: 0;
}

.product-type-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.product-type-result small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.product-seed-grid-wrap {
  max-height: none;
}

.product-seed-grid {
  min-width: 1200px;
}

.product-seed-grid th:first-child {
  width: 48px;
}

.product-seed-grid td {
  padding: 6px;
}

.product-seed-grid input {
  min-width: 145px;
  width: 100%;
}

.product-seed-export-actions {
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--silver-soft);
  color: var(--blue-dark);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  color: var(--muted);
}

th.sort-desc::after {
  content: "↓";
}

th.sort-asc::after {
  content: "↑";
}

td {
  color: var(--text);
  font-size: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.settings-panel {
  margin-top: 18px;
}

.settings-form {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
}

.settings-form label {
  max-width: 220px;
}

.task-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.task-centre-shell {
  max-width: 1180px;
}

.compact-topbar {
  margin-bottom: 18px;
}

.task-panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.history-panel {
  margin-top: 18px;
}

.history-summary {
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
}

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

.history-panel[open] .history-summary {
  margin-bottom: 14px;
}

.history-search-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.history-actions {
  margin-top: 14px;
}

.task-list {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.task-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
}

.task-row strong {
  color: var(--blue-dark);
}

.task-row small {
  color: var(--muted);
  font-weight: 400;
}

.task-priority.priority-urgent {
  color: #b42318;
  font-weight: 800;
}

.boxes-heading,
.boxes-global-form,
.boxes-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.boxes-global-form,
.boxes-actions {
  flex-wrap: wrap;
}

.boxes-switch {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 14px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.boxes-switch.is-on { background: var(--blue); }
.boxes-switch.is-off { background: #6f7b8a; }
.boxes-switch input { margin-right: 8px; }

.boxes-run-times {
  margin-top: 16px;
}

.boxes-product-name,
.boxes-table td small {
  display: block;
  margin: 4px 0;
}

.boxes-stars {
  color: #d88900;
  white-space: nowrap;
}

.boxes-product-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.boxes-url-field {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .boxes-heading { align-items: flex-start; flex-direction: column; }
  .boxes-product-form { grid-template-columns: 1fr; }
  .boxes-url-field { grid-column: auto; }
}

.task-overdue {
  border-color: #f0b8b4;
  background: #fff7f6;
}

.reminder-form {
  padding: 14px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.reminder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.input-suffix span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.reminder-toggle {
  margin-bottom: 2px;
}

.reminder-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.reminder-row.inactive {
  opacity: 0.68;
}

.reminder-row strong,
.reminder-row small {
  display: block;
}

.reminder-row small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}

.task-details {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-status {
  font-weight: 700;
  white-space: nowrap;
}

.status-new {
  color: #1f4f82;
}

.status-opened {
  color: #8a5a00;
}

.status-completed {
  color: #147a3f;
}

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

.status-pill {
  font-weight: 700;
  white-space: nowrap;
}

.status-required {
  color: #b42318;
}

.status-monitor {
  color: #8a5a00;
}

.status-healthy {
  color: #147a3f;
}

.status-excess {
  color: #b42318;
}

.table-tools {
  margin-top: 18px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.table-tools label {
  max-width: 360px;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-form button,
.filter-form .button-link {
  min-height: 44px;
}

.secondary-link {
  background: var(--silver);
  color: var(--blue-dark);
  text-align: center;
}

.ledger-table-wrap table {
  min-width: 1320px;
}

.diagnostic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
}

.diagnostic-tags span {
  padding: 6px 9px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--blue-dark);
  font-size: 13px;
}

.diagnostic-table-wrap {
  margin-top: 10px;
}

.diagnostic-table-wrap table {
  min-width: 680px;
}

.diagnostic-note {
  margin: 12px 0 16px;
  padding: 12px;
  background: #eef6ff;
  border: 1px solid #b9d9f4;
  border-radius: 6px;
  color: var(--blue-dark);
}

.section-heading {
  margin-top: 22px;
}

.returns-reasons {
  margin-top: 18px;
  overflow-x: auto;
}

.secondary-panel {
  margin-top: 18px;
  background: #f8fafc;
}

.secondary-panel h2,
.secondary-column {
  color: var(--muted);
}

.secondary-panel .summary-list dd {
  font-size: 19px;
}

.claims-table-wrap table {
  min-width: 1120px;
}

.claim-actions {
  min-width: 360px;
}

.claim-actions form {
  margin: 0 0 10px;
}

.claim-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.claim-note-form {
  display: grid;
  gap: 8px;
}

.claim-text {
  margin-top: 10px;
  color: var(--blue-dark);
}

.claim-text textarea {
  margin-top: 8px;
  font-size: 13px;
}

.claim-notes {
  padding: 10px;
  background: var(--silver-soft);
  border-radius: 6px;
  white-space: pre-wrap;
}

.detail-grid {
  margin-top: 18px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.claim-status-actions {
  margin-top: 18px;
}

.claim-copy-panel {
  margin-top: 18px;
}

.claim-copy-panel textarea {
  margin-top: 14px;
  min-height: 420px;
  font-size: 14px;
  line-height: 1.45;
}

.event-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.event-list li {
  padding: 12px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.event-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.attachment-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.attachment-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.attachment-list span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

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

.compact-table th {
  position: static;
}

.totals-panel {
  margin-top: 18px;
}

.unknown-sku {
  color: #b42318;
  font-weight: 700;
}

.unknown-sku-row {
  background: #fff3f2;
}

.factory-rules-shell {
  max-width: 1240px;
}

.factory-rules-shell .panel {
  margin-bottom: 18px;
}

.factory-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.factory-form.rules-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.checkbox-label input {
  width: 18px;
  min-height: 18px;
}

.checkbox-label span {
  color: var(--blue-dark);
}

.task-routing-table-wrap {
  max-height: none;
}

.task-routing-table {
  min-width: 980px;
}

.task-routing-table select,
.task-routing-table input {
  min-width: 150px;
}

.task-cover-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto;
  gap: 14px;
  align-items: end;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .task-cover-form {
    grid-template-columns: 1fr;
  }
}

.factory-category-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.factory-category-list dd {
  font-size: 18px;
}

.factory-table-wrap table,
.factory-table {
  min-width: 860px;
}

.factory-stock-shell {
  max-width: 1180px;
}

.factory-stock-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.factory-stock-table-wrap table,
.factory-stock-table {
  min-width: 820px;
}

.factory-stock-table input {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 14px;
}

.factory-stock-table input[name="sku"] {
  min-width: 120px;
}

.factory-stock-table input[type="number"] {
  max-width: 110px;
}

.factory-stock-value {
  display: inline-block;
  min-width: 54px;
  font-weight: 700;
}

.factory-stock-edit-input {
  max-width: 110px;
}

.factory-costings-shell {
  display: grid;
  gap: 1rem;
}

.factory-costings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.factory-costings-tabs a {
  padding: 0.65rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  background: #fff;
  color: #334155;
  font-weight: 700;
  text-decoration: none;
}

.factory-costings-tabs a.active {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

.factory-costings-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.factory-costings-intro h2,
.costing-form-section h2,
.costing-input-section h2,
.costing-results h2 {
  margin-top: 0;
}

.costing-source-badge {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  font-size: 0.82rem;
  font-weight: 700;
}

.costing-input-table input,
.factory-costing-weights input {
  min-width: 8rem;
  width: 100%;
}

.costing-calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.costing-form-section {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.costing-form-section label,
.costing-add-weight form label {
  display: grid;
  gap: 0.3rem;
  color: #475569;
  font-weight: 700;
}

.costing-form-section input,
.costing-form-section select,
.costing-add-weight input {
  width: 100%;
}

.costing-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.costing-result-grid > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 0.6rem;
  background: #f8fafc;
}

.costing-result-grid span,
.factory-costing-weights small {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
}

.costing-result-grid strong {
  font-size: 1.1rem;
}

.costing-result-grid .costing-total {
  background: #ecfdf5;
  color: #166534;
}

.costing-add-weight summary {
  cursor: pointer;
  font-weight: 800;
}

.costing-add-weight form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.costing-add-weight button {
  align-self: end;
}

.factory-costing-weights td:first-child {
  min-width: 15rem;
}

.factory-costing-weights td:first-child input + input {
  margin-top: 0.35rem;
}

.weight-unverified {
  color: #b45309;
  font-weight: 700;
}

.weight-grams-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.weight-grams-entry input {
  width: 8rem;
}

.weight-collection-table td:first-child {
  width: 8rem;
}

.weight-collection-complete {
  border-color: #86efac;
  background: #f0fdf4;
}

@media (max-width: 900px) {
  .costing-calculator-grid,
  .costing-add-weight form,
  .costing-result-grid {
    grid-template-columns: 1fr;
  }

  .factory-costings-intro {
    align-items: flex-start;
    flex-direction: column;
  }
}

.factory-planning-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 170px auto;
  gap: 14px;
  align-items: end;
}

.factory-planning-panel {
  display: grid;
  grid-template-columns: 150px 170px auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
  padding: 16px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.factory-planning-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.planning-month-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
}

.planning-month-summary span {
  color: var(--muted);
}

.planning-month-summary strong {
  color: var(--text);
}

.factory-planning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.generate-plan-form {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.positive-overstock {
  color: #b91c1c;
  font-weight: 700;
}

.factory-system-info {
  margin-top: 18px;
}

.production-plan-shell {
  max-width: 980px;
}

.production-plan-actions {
  margin-top: 18px;
}

.plan-warning {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #f3c56b;
  border-radius: 8px;
  background: #fff7e6;
  color: #7a4a00;
}

.plan-warning span {
  color: #8a5a12;
}

.factory-warning-panel {
  margin-top: 18px;
}

@media print {
  .app-sidebar,
  .app-header,
  .topbar nav,
  .view-toggle,
  .production-plan-actions,
  .site-footer {
    display: none !important;
  }
}

.site-footer {
  margin-top: auto;
  padding-top: 32px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 760px) {
  .page {
    padding: 22px;
  }

  .topbar,
  .grid,
  .staff-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .summary-list,
  .summary-list.wide,
  .summary-list.inventory-totals,
  .summary-list.secondary-summary,
  .factory-category-list,
  .factory-form,
  .factory-planning-panel,
  .factory-planning-tools,
  .nav-actions,
  .settings-form,
  .task-row,
  .reminder-grid,
  .reminder-row,
  .history-search-form,
  .attachment-list li {
    display: grid;
    grid-template-columns: 1fr;
  }

  .attachment-list span {
    white-space: normal;
  }
}

/* Dashboard V1 Activation */
.dashboard-v1 {
  padding-bottom: 12px;
}

.dashboard-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin: 2px 0 26px;
}

.dashboard-kicker {
  margin: 0 0 7px;
  color: #2d63b9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.dashboard-welcome h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(30px, 3.6vw, 46px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.dashboard-welcome > div > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.dashboard-local-time {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
  min-width: 220px;
  padding: 14px 17px;
  border: 1px solid #dfe6f0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  box-shadow: 0 12px 30px rgba(16, 35, 63, 0.05);
  text-align: right;
}

.dashboard-local-time strong {
  color: var(--blue-dark);
  font-size: 21px;
}

.dashboard-v1-grid {
  align-items: stretch;
  gap: 18px;
}

.dashboard-v1 .dashboard-card {
  min-height: 236px;
  gap: 18px;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(16, 35, 63, 0.075);
}

.dashboard-v1 .dashboard-card:hover {
  transform: none;
}

.dashboard-v1 .dashboard-action-card:hover,
.dashboard-v1 .dashboard-module-card:hover,
.dashboard-v1 .dashboard-explore-card:hover {
  border-color: #cbd8ea;
  box-shadow: 0 18px 42px rgba(16, 35, 63, 0.1);
}

.dashboard-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-card-label {
  color: #718096;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-card-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: #edf3fc;
  color: #245fae;
  font-size: 14px;
  font-weight: 800;
}

.dashboard-task-card .dashboard-card-mark {
  background: #245fae;
  color: #fff;
}

.dashboard-v1 .dashboard-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.015em;
}

.dashboard-v1 .dashboard-card p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.dashboard-count {
  color: #245fae !important;
  font-size: 38px;
  font-weight: 800;
  line-height: 1 !important;
}

.dashboard-primary-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  margin-top: auto;
  color: #1554a0;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-v1 .dashboard-primary-link::after {
  content: "\2192";
  transition: transform 150ms ease;
}

.dashboard-v1 .dashboard-primary-link:hover::after {
  transform: translateX(3px);
}

.dashboard-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.dashboard-card-links a {
  padding: 7px 10px;
  border-radius: 8px;
  background: #f1f5fb;
  color: #254d7f;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.dashboard-card-links a:hover {
  background: #245fae;
  color: #fff;
}

.dashboard-neutral-note {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-v1 .dashboard-photo-card {
  min-height: 236px;
  padding: 0;
  border: 0;
  margin: 0;
  background: #294966;
}

.dashboard-photo-card::after {
  background: linear-gradient(180deg, rgba(16, 35, 63, 0.02) 25%, rgba(12, 28, 48, 0.76) 100%);
}

.dashboard-photo-card figcaption {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  padding: 24px;
}

.dashboard-photo-card figcaption span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-photo-card figcaption strong {
  color: #fff;
  font-size: 20px;
}

.dashboard-photo-secondary img {
  object-position: center 52%;
}

.dashboard-all-modules {
  margin-top: auto;
}

.dashboard-all-modules summary {
  color: #1554a0;
  cursor: pointer;
  font-weight: 800;
}

.dashboard-all-module-groups {
  display: grid;
  gap: 14px;
  max-height: 320px;
  padding: 16px 4px 2px 0;
  overflow-y: auto;
}

.dashboard-all-module-groups h3 {
  margin: 0 0 7px;
  color: var(--blue-dark);
  font-size: 13px;
}

.dashboard-all-module-groups section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.dashboard-all-module-groups a {
  color: #315f96;
  font-size: 12px;
  text-decoration: none;
}

.dashboard-all-module-groups a:hover {
  text-decoration: underline;
}

@media (max-width: 1120px) {
  .dashboard-welcome {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .dashboard-welcome {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }

  .dashboard-local-time {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .dashboard-v1 .dashboard-card,
  .dashboard-v1 .dashboard-photo-card {
    min-height: 210px;
  }
}
.estate-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.estate-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.checkbox-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.checkbox-panel legend {
  padding: 0 6px;
  color: var(--blue-dark);
  font-weight: 700;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

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

.estate-actions {
  min-width: 420px;
}

.estate-actions form {
  margin: 0 0 8px;
}

.estate-edit-panel {
  margin-bottom: 10px;
}

.estate-edit-panel summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 700;
}

.estate-inline-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: var(--silver-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.estate-page-form {
  min-width: 280px;
}

.estate-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.compact-checkbox-panel {
  padding: 10px;
  background: #fff;
}

.compact-checkbox-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  max-height: 220px;
  overflow: auto;
}

.compact-checkbox-grid label {
  padding: 6px 8px;
  font-size: 0.92rem;
}

.reset-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
}

.wages-shell {
  max-width: 980px;
}

.wages-deadline {
  border-top-color: #b02a37;
}

.wages-deadline h2 {
  color: #8f1f2b;
  font-size: 24px;
}

.wages-form,
.wage-employee-list {
  display: grid;
  gap: 14px;
}

.wage-employee-row {
  min-height: 0;
}

.wage-employee-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.wage-normal-toggle {
  display: flex;
  min-width: 150px;
}

.wage-exception-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wage-exception-details:not([hidden]) {
  display: grid;
}

.wage-notes {
  grid-column: 1 / -1;
}

.wage-oven-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--silver-soft);
}

.wage-oven-section h3 {
  margin: 0 8px 0 0;
  color: var(--blue-dark);
}

.wage-submit-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.wage-admin-panel,
.wage-review-card {
  margin-top: 18px;
}

.wage-admin-add,
.wage-inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.wage-review-list {
  margin: 16px 0 0;
  padding-left: 22px;
  line-height: 1.8;
}

.oven-shell {
  max-width: 1080px;
}

.oven-feedback {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.oven-live-summary,
.oven-summary {
  grid-column: 1 / -1;
}

.oven-status {
  min-width: 110px;
  padding: 12px 16px;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.oven-green {
  background: #19764a;
}

.oven-amber {
  background: #a86600;
}

.oven-red {
  background: #a8242f;
}

.oven-warning-list {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 22px;
  color: #8f1f2b;
  font-weight: 700;
  line-height: 1.6;
}

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

.oven-submit-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.oven-admin-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

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

@media (max-width: 760px) {
  .reset-form,
  .wage-admin-add,
  .wage-inline-form,
  .oven-form-grid,
  .oven-settings-form,
  .oven-admin-tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wage-exception-details:not([hidden]) {
    grid-template-columns: 1fr;
  }

  .wage-employee-header {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* TOP presentation refresh */
.app-frame {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% 0%, rgba(31, 95, 168, 0.08), transparent 30rem),
    #f7f9fc;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 20px;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--navy), #0b1b30);
  color: #fff;
}

.sidebar-brand {
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

.brand-mark strong {
  display: block;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark small,
.sidebar-user small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 500;
}

.brand-orbit {
  position: relative;
  width: 42px;
  height: 42px;
  border: 8px solid #2d6fd2;
  border-radius: 50%;
}

.brand-orbit::before,
.brand-orbit::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.brand-orbit::before {
  width: 28px;
  height: 28px;
  right: -14px;
  bottom: -9px;
  border: 7px solid rgba(255, 255, 255, 0.7);
}

.brand-orbit::after {
  width: 9px;
  height: 9px;
  right: -4px;
  top: -7px;
  background: #d8dee8;
  box-shadow: 17px 17px 0 #2d6fd2;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav-link,
.side-nav-group summary,
.side-nav-children a {
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

.side-nav-link,
.side-nav-group summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.side-nav-group summary::-webkit-details-marker {
  display: none;
}

.side-nav-link.active,
.side-nav-group summary:hover,
.side-nav-link:hover {
  background: #2d63b9;
  color: #fff;
}

.side-nav-link.muted {
  color: rgba(255, 255, 255, 0.44);
  cursor: default;
}

.side-nav-link.muted:hover {
  background: transparent;
}

.nav-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
}

.chevron {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.side-nav-children {
  display: grid;
  gap: 3px;
  padding: 2px 0 8px 14px;
}

.side-nav-children a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 600;
}

.task-nav-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.task-nav-badge,
.task-nav-new {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  background: #f59e0b;
  color: #10233f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.task-nav-badge {
  justify-content: center;
  min-width: 24px;
  padding: 3px 7px;
}

.task-nav-badge.amazon-alert-badge {
  background: #c62828;
  color: #fff;
}

.route-assignees {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.route-primary-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
}

.route-primary-assignee select,
.route-secondary-assignee select {
  width: 100%;
}

.route-add-assignee {
  flex: 0 0 30px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.task-nav-new {
  padding: 3px 8px;
  white-space: nowrap;
}

.side-nav-children a:hover,
.side-nav-children a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.sidebar-user strong {
  display: block;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-company-switcher {
  display: grid;
  gap: 7px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.sidebar-company-switcher select {
  width: 100%;
}

.sidebar-logout {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.app-main {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
  padding: 28px 34px 26px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.app-header-title h1,
.dashboard-hero h1 {
  color: var(--blue-dark);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.app-header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-search {
  position: relative;
  display: block;
  width: min(340px, 32vw);
}

.top-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.top-search input {
  min-height: 48px;
  border-color: #e1e7f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 35, 63, 0.06);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid #e1e7f0;
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(16, 35, 63, 0.05);
}

.date-time {
  display: grid;
  gap: 2px;
  min-width: 158px;
  color: var(--muted);
  font-size: 13px;
}

.date-time strong {
  color: var(--blue-dark);
  font-size: 15px;
}

.user-avatar {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: #e8eef8;
  color: var(--blue-dark);
  font-weight: 800;
}

.user-avatar.small {
  width: 40px;
  height: 40px;
  background: #2d63b9;
  color: #fff;
  font-size: 13px;
}

.app-main > .shell > .topbar {
  display: none;
}

.shell {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
}

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

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.home-brand {
  display: grid;
  grid-template-columns: 72px minmax(0, auto);
  gap: 16px;
  align-items: center;
  padding-right: 18px;
}

.home-brand .brand-orbit {
  width: 66px;
  height: 66px;
  border-width: 12px;
}

.home-brand .brand-orbit::before {
  width: 42px;
  height: 42px;
  right: -20px;
  bottom: -14px;
  border-width: 10px;
}

.home-brand .brand-orbit::after {
  right: -5px;
  top: -8px;
  box-shadow: 26px 26px 0 #2d6fd2;
}

.home-brand strong {
  display: block;
  color: var(--blue-dark);
  font-size: 58px;
  line-height: 0.9;
}

.home-brand small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-hero p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 18px;
}

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

.dashboard-card,
.panel,
.table-tools,
.table-wrap,
.auth-panel {
  border: 1px solid rgba(223, 229, 238, 0.9);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-card:hover,
.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(16, 35, 63, 0.11);
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h2,
.dashboard-card h2 {
  color: var(--blue-dark);
  font-size: 18px;
}

.card-heading p,
.dashboard-card p,
.metric-note {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.metric-icon {
  display: inline-grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: var(--blue);
  font-weight: 800;
}

.metric-icon.success {
  background: #e8f6ec;
  color: var(--success);
}

.metric-value {
  display: block;
  color: var(--blue);
  font-size: 40px;
  line-height: 1;
}

.success-text,
.metric-note.success {
  color: var(--success);
}

.metric-note.warning {
  color: var(--error);
}

.dashboard-card > a {
  margin-top: auto;
  color: #0b4da2;
  text-decoration: none;
}

.dashboard-card > a::after {
  content: " ->";
}

.image-card {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  justify-content: flex-end;
  color: #fff;
}

.image-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 30%, rgba(16, 35, 63, 0.62));
}

.image-card div {
  position: relative;
  z-index: 1;
}

.image-card h2,
.image-card p {
  color: #fff;
}

.quiet-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 2px 0 0;
  list-style: none;
}

.quiet-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
}

.quiet-list small {
  color: var(--muted);
  white-space: nowrap;
}

.panel {
  padding: 24px;
}

.panel.action {
  border-top: 0;
  box-shadow: inset 0 4px 0 var(--blue), var(--shadow);
}

.summary-list div,
.task-row,
.event-list li,
.attachment-list li,
.diagnostic-tags span,
.checkbox-grid label,
.wage-oven-section,
.estate-inline-form {
  border-color: #e4eaf2;
  border-radius: 10px;
  background: #f7f9fc;
}

button,
.button-link {
  border-radius: 9px;
  background: var(--blue);
  box-shadow: 0 10px 20px rgba(31, 95, 168, 0.14);
}

button.secondary,
.secondary-link {
  background: #eef3f8;
  color: var(--blue-dark);
  box-shadow: none;
}

input,
select,
textarea {
  border-color: #dfe5ee;
  border-radius: 9px;
  background: #fff;
}

.messages {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto 18px;
}

.message {
  border-color: #c7dcf4;
  border-radius: 10px;
  background: #f0f7ff;
}

.site-footer {
  width: 100%;
  max-width: 1360px;
  margin: auto auto 0;
  padding-top: 38px;
  text-align: left;
}

.auth-page {
  background:
    radial-gradient(circle at 26% 18%, rgba(31, 95, 168, 0.1), transparent 24rem),
    #f7f9fc;
}

.auth-panel {
  border: 0;
  border-radius: 16px;
}

.section-heading,
.wholesale-lines-heading,
.wholesale-line,
.wholesale-submit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workflow-toggle-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 2px;
}

.workflow-toggle {
  position: relative;
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.workflow-toggle-label {
  min-width: 0;
}

.workflow-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.workflow-toggle-state {
  display: inline-grid;
  min-width: 52px;
  min-height: 30px;
  place-items: center;
  border-radius: 7px;
  background: #7b8797;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.workflow-toggle input:checked + .workflow-toggle-state {
  background: #2563c7;
}

.workflow-toggle input:not(:checked) + .workflow-toggle-state .toggle-on,
.workflow-toggle input:checked + .workflow-toggle-state .toggle-off {
  display: none;
}

.workflow-toggle input:focus-visible + .workflow-toggle-state {
  outline: 3px solid rgba(37, 99, 199, 0.28);
  outline-offset: 2px;
}

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

.knowledge-base-form textarea {
  width: 100%;
  min-height: 520px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.section-heading h2,
.wholesale-lines-heading h3 {
  margin-bottom: 4px;
}

.status-pill {
  display: inline-flex;
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.success {
  background: #e8f6ee;
  color: #237447;
}

.status-pill.warning {
  background: #fff5da;
  color: #8a6111;
}

.status-pill.error {
  background: #fdeaea;
  color: #a03939;
}

.wholesale-order-form {
  display: grid;
  gap: 26px;
  margin-top: 24px;
}

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

.wholesale-order-grid label,
.wholesale-line label {
  display: grid;
  gap: 7px;
}

.wholesale-lines {
  display: grid;
  gap: 12px;
}

.wholesale-line {
  align-items: end;
  padding: 16px;
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  background: #f7f9fc;
}

.wholesale-line > label:first-child {
  flex: 1 1 auto;
}

.wholesale-line .quantity-field {
  flex: 0 0 120px;
}

.line-rate {
  display: grid;
  gap: 7px;
  min-width: 90px;
  padding-bottom: 8px;
}

.line-rate span,
.order-error {
  color: var(--muted);
  font-size: 12px;
}

.order-error {
  display: block;
  max-width: 280px;
  margin-top: 5px;
  white-space: normal;
}

.remove-line {
  margin-bottom: 1px;
}

.wholesale-submit-actions {
  justify-content: flex-start;
}

.brand h1 {
  color: var(--blue-dark);
}

.searchable-picker {
  position: relative;
}

.searchable-picker > input {
  width: 100%;
}

.picker-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #ccd7e6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 36, 61, 0.16);
}

.picker-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--navy);
  text-align: left;
}

.picker-option:hover,
.picker-option.active {
  background: #eaf2ff;
  color: var(--blue-dark);
}

.picker-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
}

.discount-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.compact-button {
  min-width: max-content;
  padding-inline: 13px;
}

.field-message {
  min-height: 18px;
}

.product-entry-panel,
.order-lines-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #e1e8f1;
  border-radius: 14px;
  background: #fbfcfe;
}

.product-entry-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 110px 100px auto;
  gap: 12px;
  align-items: end;
}

.product-entry-row label {
  display: grid;
  gap: 7px;
}

.product-entry-row .line-rate {
  padding-bottom: 8px;
}

.product-entry-row > button {
  margin-bottom: 1px;
}

.order-lines-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.order-lines-title h3 {
  margin-bottom: 4px;
}

.delivery-placeholder {
  display: grid;
  min-width: 245px;
  gap: 2px;
  padding: 11px 14px;
  border: 1px dashed #b8c7da;
  border-radius: 10px;
  background: #f5f8fc;
}

.delivery-placeholder span,
.delivery-placeholder small,
.order-line-product small {
  color: var(--muted);
  font-size: 12px;
}

.empty-order-lines {
  margin: 0;
  padding: 18px;
  border: 1px dashed #ccd7e6;
  border-radius: 10px;
  text-align: center;
}

.wholesale-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 90px auto;
}

.order-line-product {
  display: grid;
  align-self: center;
  gap: 3px;
}

.order-line-product strong {
  color: var(--navy);
  font-size: 16px;
}

.stock-warning {
  display: grid;
  width: 360px;
  max-width: min(360px, 80vw);
  gap: 10px;
  margin-top: 5px;
  padding: 11px;
  border: 1px solid #d9534f;
  border-radius: 9px;
  background: #fff0f0;
  color: #a12622;
  font-size: 13px;
  line-height: 1.4;
}

.stock-warning[hidden] {
  display: none;
}

.stock-warning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.stock-warning-actions button {
  padding: 7px 9px;
  font-size: 12px;
}

.pick-job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.pick-job-card,
.pick-job-actions,
.pick-job-completion,
.stale-job-actions {
  display: flex;
  gap: 14px;
}

.pick-job-card {
  align-items: stretch;
  flex-direction: column;
}

.pick-job-card-heading,
.pick-job-actions,
.pick-job-completion,
.stale-job-actions {
  align-items: center;
  justify-content: space-between;
}

.pick-job-code {
  color: var(--navy);
  font-size: 34px;
  letter-spacing: 0.08em;
}

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

.inline-warning {
  padding: 12px;
  border: 1px solid #efc1c1;
  border-radius: 10px;
  background: #fff3f3;
  color: #8b2d2d;
}

.pick-job-actions form,
.stale-job-actions form {
  margin: 0;
}

.pick-job-completion form,
.stale-job-actions form:first-of-type {
  display: flex;
  align-items: end;
  gap: 10px;
}

.pick-job-completion label,
.stale-job-actions label {
  display: grid;
  gap: 7px;
}

.danger-button {
  background: #a03939;
}

.pick-sheet {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px;
  background: #fff;
  color: #111;
}

.pick-sheet header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 3px solid #111;
}

.pick-sheet header p {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}

.pick-sheet h1 {
  margin: 0 0 18px;
  color: #111;
  font-size: 62px;
  letter-spacing: 0.12em;
}

.pick-sheet-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 42px;
  margin: 30px 0;
  font-size: 21px;
}

.pick-sheet-details div {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 16px;
  align-items: end;
}

.pick-sheet-details .pick-sheet-customer {
  grid-column: 1 / -1;
  grid-template-columns: 130px minmax(0, 1fr);
  font-size: 29px;
}

.pick-sheet-details .pick-sheet-packing-aim {
  grid-column: 1 / -1;
  grid-template-columns: 210px minmax(0, 1fr);
  font-size: 24px;
}

.pick-sheet-details dt {
  font-weight: 800;
  white-space: nowrap;
}

.pick-sheet-details dd {
  margin: 0;
}

.write-in {
  min-height: 34px;
  border-bottom: 2px solid #111;
}

.pick-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 25px;
}

.pick-sheet th,
.pick-sheet td {
  padding: 18px 14px;
  border: 2px solid #333;
  text-align: left;
}

.pick-sheet th {
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pick-sheet td:nth-child(2) {
  width: 130px;
  font-size: 32px;
  font-weight: 800;
}

.pick-sheet td small {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.25;
}

.tick-column {
  width: 80px;
  text-align: center !important;
}

.print-checkbox {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #111;
}

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

.wholesale-add-product-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.wholesale-add-product-form label {
  display: grid;
  gap: 7px;
}

.wholesale-add-product-form small {
  color: var(--muted);
  line-height: 1.3;
}

.wholesale-add-product-form button {
  white-space: nowrap;
}

.pricing-family-form,
.pricing-bulk-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.pricing-family-form label,
.pricing-bulk-form label,
.pricing-search {
  display: grid;
  gap: 7px;
}

.pricing-family-form button,
.pricing-bulk-form button {
  width: max-content;
}

.pricing-search {
  min-width: 280px;
}

.inline-price-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-price-form input {
  width: 110px;
}

.draft-price {
  display: block;
  color: #9a5d00;
  font-weight: 800;
}

.published-price {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.customer-hidden-product {
  background: #fff7f7;
}

.customer-visibility-form {
  margin: 0;
}

.customer-hidden-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 174px;
  padding: 7px 9px;
  border: 2px solid #d84a4a;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
}

.customer-hidden-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #c72d2d;
}

.customer-hidden-control.is-hidden {
  background: #ffe8e8;
  border-color: #b91f1f;
  color: #9f1818;
  font-weight: 800;
}

.pricing-preview-panel,
.publish-prices-panel {
  display: grid;
  gap: 18px;
}

.publish-prices-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.publish-prices-panel details {
  grid-column: 1 / -1;
}

.draft-publication-list {
  display: grid;
  gap: 7px;
  max-height: 320px;
  margin: 14px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.draft-publication-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f8fc;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html,
  body {
    width: 100%;
    min-width: 0;
  }

  .app-sidebar,
  .app-header,
  .site-footer,
  .no-print {
    display: none !important;
  }

  .app-frame,
  .app-main,
  .app-content {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .pick-sheet {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .pick-sheet-details {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6mm 10mm;
  }

  .pick-sheet-details div,
  .pick-sheet-details .pick-sheet-customer,
  .pick-sheet-details .pick-sheet-packing-aim {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4mm;
    min-width: 0;
  }

  .pick-sheet table {
    table-layout: fixed;
  }

  .pick-sheet td:first-child {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 1120px) {
  .app-frame {
    grid-template-columns: 240px minmax(0, 1fr);
  }

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

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-search {
    width: min(460px, 88vw);
  }
}

@media (max-width: 760px) {
  .app-frame {
    display: block;
  }

  .app-sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .app-main {
    padding: 22px;
  }

  .app-header-tools,
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .top-search,
  .date-time {
    width: 100%;
  }

  .icon-button,
  .user-avatar {
    display: none;
  }

  .dashboard-card {
    min-height: 180px;
  }

  .dashboard-hero,
  .home-brand {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-brand strong {
    font-size: 46px;
  }

  .brand-mark strong {
    font-size: 30px;
  }

  .section-heading,
  .wholesale-lines-heading,
  .wholesale-line,
  .wholesale-submit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .wholesale-order-grid {
    grid-template-columns: 1fr;
  }

  .wholesale-line .quantity-field {
    flex-basis: auto;
  }

  .product-entry-row,
  .wholesale-line {
    grid-template-columns: 1fr;
  }

  .order-lines-title {
    align-items: stretch;
    flex-direction: column;
  }

  .delivery-placeholder {
    min-width: 0;
  }

  .pick-job-actions,
  .pick-job-completion,
  .stale-job-actions,
  .pick-job-completion form,
  .stale-job-actions form:first-of-type {
    align-items: stretch;
    flex-direction: column;
  }

  .pick-sheet-details {
    grid-template-columns: 1fr;
  }

  .pricing-workflow-grid,
  .pricing-family-form,
  .pricing-bulk-form,
  .wholesale-add-product-form,
  .publish-prices-panel {
    grid-template-columns: 1fr;
  }

  .pricing-search {
    min-width: 0;
    width: 100%;
  }

  .inline-price-form {
    align-items: stretch;
    flex-direction: column;
  }
}
.tracking-number {
  display: inline-block;
  margin: 0 0.35rem 0.25rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.table-search-form {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.table-search-form label {
  flex: 1 1 22rem;
}

.message-import-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 1rem;
}

.message-list-table table {
  min-width: 760px;
}

.message-trays {
  display: flex;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.message-trays a {
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.message-trays a:hover,
.message-trays a:focus-visible {
  background: var(--silver-soft);
  color: var(--text);
}

.message-trays a.active {
  background: var(--blue, #1667b1);
  color: #fff;
}

.voicemail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.75rem 0;
}

.voicemail-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.voicemail-toolbar-actions form {
  margin: 0;
}

.voicemail-delete-selected {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

.voicemail-updated {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.voicemail-list {
  border-top: 1px solid var(--border);
}

.voicemail-row {
  display: grid;
  grid-template-columns: 1.1rem 1rem minmax(9rem, 0.9fr) minmax(12rem, 1.6fr) 3.5rem auto auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.15rem;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.voicemail-row.new .voicemail-caller {
  color: #b42318;
  font-weight: 800;
}

.voicemail-row.heard .voicemail-caller,
.voicemail-row.heard time,
.voicemail-row.heard .voicemail-duration {
  color: #737b84;
  font-weight: 400;
}

.voicemail-select {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.voicemail-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voicemail-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #808890;
}

.voicemail-state.new .voicemail-dot {
  background: #c62828;
}

.voicemail-state.multiple .voicemail-dot {
  background: #e67e22;
}

.voicemail-mailbox-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid #b86a18;
  border-radius: 0.25rem;
  background: #fff4e8;
  color: #8a4d0f;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
}

.voicemail-group-labels {
  display: inline-flex;
  gap: 0.25rem;
}

.voicemail-time-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  white-space: nowrap;
}

.voicemail-caller {
  overflow: hidden;
  justify-self: center;
  width: 100%;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voicemail-caller-group {
  border-bottom: 1px solid var(--border);
}

.voicemail-group-summary {
  display: grid;
  grid-template-columns: 1rem auto minmax(11rem, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  min-height: 3.15rem;
  padding: 0.45rem 0.6rem 0.45rem 1.75rem;
  cursor: pointer;
  list-style-position: outside;
}

.voicemail-group-summary:hover,
.voicemail-group-summary:focus-visible {
  background: #fff7ed;
}

.voicemail-group-summary .voicemail-caller {
  color: #c66300;
  font-weight: 800;
}

.voicemail-caller-group.heard .voicemail-group-summary .voicemail-caller {
  color: #737b84;
  font-weight: 400;
}

.voicemail-expand-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.voicemail-group-recordings {
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.voicemail-group-row {
  grid-template-columns: 1.1rem 1rem minmax(11rem, 1fr) 3.5rem auto auto;
  padding-left: 1.75rem;
}

.voicemail-caller-group .voicemail-group-row.new time,
.voicemail-caller-group .voicemail-group-row.new .voicemail-duration {
  color: #c66300;
  font-weight: 800;
}

.voicemail-duration {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.voicemail-play,
.voicemail-delete {
  min-width: 4.25rem;
  padding: 0.42rem 0.65rem;
}

.voicemail-audio {
  display: none;
}

.voicemail-single-delete-form {
  display: none;
}

.queue-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 34rem;
  margin: 0.9rem 0 1rem auto;
}

.queue-search-form label {
  flex: 1 1 auto;
}

.queue-search-form input {
  width: 100%;
}

.queue-search-form button {
  padding: 0.55rem 0.8rem;
}

.conversation-list {
  border-top: 1px solid var(--border);
}

.conversation-row {
  display: grid;
  grid-template-columns: minmax(10rem, 0.35fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.8rem 0.35rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.conversation-row:hover,
.conversation-row:focus-visible {
  background: var(--silver-soft);
}

.conversation-row.read {
  color: var(--muted);
}

.conversation-row.read .conversation-sender {
  font-weight: 500;
}

.conversation-sender {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-queue {
  margin: 0;
  padding: 1.25rem 0.35rem;
  color: var(--muted);
}

.calm-completed {
  margin-top: 1.5rem;
}

.calm-completed .conversation-list {
  margin-top: 0.75rem;
}

.original-message-panel,
.technical-message-panel {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.original-message-panel summary,
.technical-message-panel summary {
  cursor: pointer;
  font-weight: 750;
}

.technical-message-panel {
  color: var(--muted);
}

.queue-count {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--orange, #f28c28);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.queue-count.subtle {
  min-height: auto;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  background: var(--silver, #d8dce1);
  color: var(--text);
}

.completed-today {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.completed-today summary {
  cursor: pointer;
  font-weight: 800;
}

.completed-today .table-wrap {
  margin-top: 1rem;
}

.message-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.message-details div {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--silver-soft);
}

.message-details dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.message-details dd {
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
}

.message-amazon-details,
.message-body,
.message-attachments {
  margin-top: 1.5rem;
}

.message-body pre {
  max-height: 60vh;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--silver-soft);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.section-heading.compact {
  align-items: center;
}

.ai-draft-panel {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--silver-soft);
}

.customer-context-panel {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.customer-context-panel > summary {
  cursor: pointer;
  padding: 1rem 1.1rem;
  font-weight: 700;
}

#customer-context-content {
  padding: 0 1.1rem 1.1rem;
}

.customer-context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.customer-context-grid > section,
.customer-timeline {
  border-top: 1px solid var(--border);
  padding-top: .8rem;
}

.compact-context div {
  grid-template-columns: minmax(80px, .7fr) 1.3fr;
}

.context-list {
  margin: .5rem 0 0;
  padding-left: 1.2rem;
}

.context-list li + li { margin-top: .55rem; }
.timeline-list time { display: block; color: var(--muted); font-size: .85rem; }

.ai-output-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  margin-top: 1rem;
}

.ai-output-grid article {
  min-width: 0;
}

.ai-output {
  min-height: 8rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-output.reply {
  min-height: 12rem;
}

.message-reply-form textarea {
  width: 100%;
  min-height: 12rem;
  resize: vertical;
}

.message-reply-form button { margin-top: .75rem; }
.message-draft-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}
.manual-reply-panel { margin: 1rem 0; }
.manual-reply-panel > summary { display: inline-flex; cursor: pointer; list-style: none; }
.manual-reply-panel > summary::-webkit-details-marker { display: none; }
.manual-reply-panel[open] > summary { margin-bottom: 1rem; }
.manual-reply-panel .message-reply-form { max-width: 52rem; }
.manual-reply-panel label { display: block; }
.sent-reply-history + .sent-reply-history { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.sent-reply-history pre { white-space: pre-wrap; font: inherit; overflow-wrap: anywhere; }

.ai-generated-note {
  margin: 0.75rem 0 0;
}

.complete-work-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.complete-work-form p {
  margin: 0.25rem 0 0;
}

.error-text {
  color: var(--danger, #b42318);
}

.wholesale-customer-edit-page .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 760px) {
  .wholesale-customer-edit-page .form-grid {
    grid-template-columns: 1fr;
  }

  .message-details {
    grid-template-columns: 1fr;
  }

  .ai-output-grid {
    grid-template-columns: 1fr;
  }

  .complete-work-form {
    align-items: stretch;
    flex-direction: column;
  }

  .message-trays {
    overflow-x: auto;
  }

  .voicemail-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .voicemail-row {
    grid-template-columns: 1rem 1rem minmax(7.5rem, 1fr) 3.25rem auto auto;
  }

  .voicemail-caller {
    grid-column: 3 / -1;
    grid-row: 2;
  }

  .voicemail-group-summary {
    grid-template-columns: 1rem auto minmax(8rem, 1fr);
  }

  .voicemail-expand-label {
    display: none;
  }

  .voicemail-group-row {
    padding-left: 0.75rem;
  }

  .conversation-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .queue-search-form {
    margin-left: 0;
  }
}

@media print {
  html.barcode-label-print-document,
  html.barcode-label-print-document .barcode-label-print-page {
    width: var(--label-width, 47mm) !important;
    height: var(--label-height, 30mm) !important;
    min-width: var(--label-width, 47mm) !important;
    min-height: var(--label-height, 30mm) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
    background: #fff !important;
  }

  .barcode-label-print-page .barcode-print-sheet {
    width: var(--label-width, 47mm);
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
  }

  .barcode-label-print-page .barcode-physical-label {
    position: relative;
    display: block;
    width: var(--label-width, 47mm);
    height: var(--label-height, 30mm);
    margin: 0;
    padding: 0;
    overflow: hidden;
    break-after: page;
    page-break-after: always;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .barcode-label-print-page .barcode-label-description,
  .barcode-label-print-page .barcode-label-sku,
  .barcode-label-print-page .barcode-label-bars,
  .barcode-label-print-page .barcode-label-number {
    position: absolute;
    left: 2mm;
    width: 43mm;
    margin: 0;
    padding: 0;
  }

  .barcode-label-print-page .barcode-label-description {
    top: 1.6mm;
    height: 3.5mm;
  }

  .barcode-label-print-page .barcode-label-sku {
    top: 5.5mm;
    height: 3mm;
  }

  .barcode-label-print-page .barcode-label-bars {
    top: 9mm;
    height: 15.5mm;
  }

  .barcode-label-print-page .barcode-label-number {
    bottom: 1.2mm;
    height: 3mm;
  }

  .barcode-label-print-page .barcode-physical-label:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
.finance-vat-method-card{display:flex;align-items:end;justify-content:space-between;gap:24px}
.finance-vat-method-card>div{max-width:620px}
.finance-vat-method-form{display:flex;align-items:end;gap:12px;flex-wrap:wrap}
.finance-vat-method-form>label{display:grid;gap:6px;font-weight:700}
.finance-method-switch{display:flex;border:1px solid #cbd7e6;border-radius:9px;overflow:hidden;background:#eef3f8}
.finance-method-switch label{cursor:pointer;margin:0}
.finance-method-switch input{position:absolute;opacity:0;pointer-events:none}
.finance-method-switch span{display:block;padding:11px 14px;color:#536273;font-weight:700}
.finance-method-switch input:checked+span{background:#1769b0;color:#fff}
@media(max-width:800px){.finance-vat-method-card{display:block}.finance-vat-method-form{margin-top:18px}}
