    :root {
      --bg: #f4f6f8;
      --card: #ffffff;
      --text: #17202a;
      --muted: #6b7280;
      --line: #d7dde5;
      --dark: #111827;
      --green: #d9f7df;
      --green-strong: #21a35b;
      --yellow: #fff5cc;
      --red: #ffe0e0;
      --blue: #dcecff;
      --shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: Arial, Helvetica, sans-serif;
      background: var(--bg);
      color: var(--text);
    }

    .app-header {
      background: var(--dark);
      color: white;
      padding: 12px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      position: sticky;
      top: 0;
      z-index: 20;
      box-shadow: var(--shadow);
    }

    .brand {
      font-size: 20px;
      font-weight: 800;
      letter-spacing: 0.3px;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .uk-clock {
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0;
      background: rgba(255,255,255,0.12);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 999px;
      padding: 5px 9px;
      color: #f9fafb;
    }

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

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

    select, input {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 9px 10px;
      background: white;
      min-height: 38px;
    }

    .pin-input {
      width: 120px;
    }

    button {
      border: 0;
      border-radius: 8px;
      padding: 9px 13px;
      min-height: 38px;
      font-weight: 700;
      cursor: pointer;
      background: #e5e7eb;
      color: #111827;
      white-space: nowrap;
    }

    button:hover { filter: brightness(0.96); }
    button:disabled { opacity: 0.5; cursor: not-allowed; }

    .btn-primary { background: #2563eb; color: white; }
    .btn-ok { background: #16a34a; color: white; }
    .btn-problem { background: #dc2626; color: white; }
    .btn-undo { background: #f59e0b; color: white; }
    .btn-small { padding: 6px 9px; min-height: 32px; font-size: 13px; }

    .user-pill {
      background: rgba(255,255,255,0.12);
      padding: 7px 10px;
      border-radius: 999px;
      color: white;
      font-size: 14px;
    }

    .wrap {
      padding: 12px;
      max-width: 1600px;
      margin: 0 auto;
      display: none;
    }

    .wrap.unlocked {
      display: block;
    }

    .login-notice {
      max-width: 760px;
      margin: 32px auto;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 22px;
      box-shadow: var(--shadow);
      text-align: center;
    }

    .login-notice.hidden {
      display: none;
    }

    .login-notice h1 {
      margin: 0 0 8px;
      font-size: 24px;
    }

    .login-notice p {
      margin: 6px 0;
      color: var(--muted);
    }

    .tabs {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      padding: 8px 0 12px;
      background: var(--bg);
    }

    .tab {
      background: white;
      border: 1px solid var(--line);
      color: var(--text);
    }

    .tab.active {
      background: var(--dark);
      color: white;
      border-color: var(--dark);
    }

    .toolbar {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px;
      margin-bottom: 12px;
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      box-shadow: var(--shadow);
    }

    .toolbar input {
      min-width: 260px;
      flex: 1;
    }

    .status-line {
      color: var(--muted);
      font-size: 14px;
      margin-left: auto;
    }

    .table-card {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      overflow-x: auto;
      box-shadow: var(--shadow);
    }

    table {
      width: 100%;
      min-width: 900px;
      border-collapse: collapse;
      table-layout: fixed;
    }

    thead {
      background: #e8edf3;
    }

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

    th {
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: #374151;
    }

    .col-order { width: 18%; }
    .col-sku { width: 34%; }
    .col-qty { width: 7%; }
    .col-priority { width: 13%; }
    .col-status { width: 12%; }
    .col-actions { width: 16%; }

    tbody tr.group-row.combined {
      background: var(--green);
      border-left: 0;
    }

    tbody tr.group-row.urgent {
      background: #fff2f2;
    }

    tbody tr.group-row.packed-pending {
      opacity: 0.72;
      text-decoration: line-through;
      background: #eef2f7;
    }

    .extra-row td {
      background: #fafafa;
      color: #374151;
      font-size: 14px;
      padding-top: 6px;
      padding-bottom: 6px;
    }

    .extra-line {
      padding-left: 24px;
      color: #1f2937;
    }

    .clickable {
      color: #0f5cc0;
      font-weight: 800;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .badge {
      display: inline-block;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
      background: #e5e7eb;
      color: #111827;
    }

    .badge.urgent, .badge.express { background: #fee2e2; color: #991b1b; }
    .badge.priority { background: #fef3c7; color: #92400e; }
    .badge.standard { background: #e5e7eb; color: #374151; }
    .badge.problem { background: #fee2e2; color: #991b1b; }
    .badge.packed { background: #dcfce7; color: #166534; }

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

    .actions .btn-ok,
    .actions .btn-problem {
      min-width: 54px;
    }

    .order-main {
      display: inline-block;
      margin-bottom: 6px;
    }

    .deadline-small {
      display: block;
      margin-top: 5px;
      color: #374151;
      font-size: 12px;
    }

    .department-small {
      display: block;
      margin-top: 5px;
      color: #374151;
      font-size: 12px;
    }

    .empty {
      padding: 24px;
      text-align: center;
      color: var(--muted);
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.48);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 50;
      padding: 16px;
    }

    .modal-backdrop.open { display: flex; }

    .modal {
      background: white;
      width: min(760px, 100%);
      max-height: 90vh;
      overflow: auto;
      border-radius: 14px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.22);
      padding: 16px;
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      border-bottom: 1px solid var(--line);
      padding-bottom: 10px;
      margin-bottom: 12px;
    }

    .modal h2 {
      margin: 0;
      font-size: 22px;
    }

    .modal-section {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 10px;
      margin: 10px 0;
      background: #fbfdff;
    }

    .modal-section h3 {
      margin: 0 0 8px;
      font-size: 16px;
    }

    textarea {
      width: 100%;
      min-height: 90px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 9px 10px;
      resize: vertical;
    }

    .toast {
      position: fixed;
      right: 16px;
      bottom: 16px;
      background: #111827;
      color: white;
      border-radius: 10px;
      padding: 12px 14px;
      box-shadow: var(--shadow);
      display: none;
      z-index: 70;
      max-width: 440px;
    }

    .toast.show { display: block; }

    @media (max-width: 900px) {
      .app-header { align-items: flex-start; flex-direction: column; }
      .login-box { justify-content: flex-start; width: 100%; }
      .tabs { top: auto; }
      th, td { padding: 8px 6px; font-size: 14px; }
      .col-order { width: 19%; }
      .col-sku { width: 33%; }
      .col-qty { width: 7%; }
      .col-priority { width: 12%; }
      .col-status { width: 12%; }
      .col-actions { width: 17%; }
      .actions { flex-direction: column; }
      .actions button { width: 100%; }
    }
    .badge.priority-next { background: #fee2e2; color: #991b1b; }
    .badge.priority-111 { background: #ffedd5; color: #9a3412; }
    .badge.priority-11 { background: #fef3c7; color: #92400e; }
    .badge.priority-1 { background: #fef9c3; color: #854d0e; }
    .badge.priority-a, .badge.priority-asap { background: #dbeafe; color: #1e40af; }
    .badge.priority-int, .badge.priority-normal { background: #e5e7eb; color: #374151; }

/* V6 manager/product details */
.modal {
  max-width: 1180px;
}

.detail-table {
  min-width: 760px;
  table-layout: auto;
}

.detail-table th,
.detail-table td {
  font-size: 13px;
}

.manager-box {
  border-left: 5px solid #2563eb;
  background: #f8fbff;
}

.manager-box label {
  display: block;
  margin: 10px 0 4px;
  font-weight: 700;
}

.manager-box input,
.manager-box select,
.manager-box textarea {
  width: 100%;
}

.manager-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}

.manager-row input,
.manager-row select {
  width: auto;
  min-width: 240px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.sku-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.product-photo {
  max-width: 100%;
  max-height: 360px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
}

.sku-manager-list {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 8px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

@media (max-width: 900px) {
  .sku-layout {
    grid-template-columns: 1fr;
  }
}


    .confirm-box {
      border: 2px solid #16a34a;
      background: #f0fdf4;
    }

    .restore-box {
      border: 2px solid #f59e0b;
    }

    .sku-list-summary {
      margin: 8px 0;
      color: var(--muted);
      font-weight: 700;
    }

    .sku-manager-list {
      overflow-x: auto;
      max-height: 55vh;
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 8px;
      background: white;
    }

    .sku-table {
      min-width: 900px;
    }

    .sku-table th,
    .sku-table td {
      font-size: 13px;
    }


/* V10 manager tools */
.danger-box {
  border: 2px solid #dc2626;
  border-radius: 10px;
  background: #fff1f2;
}

.inner-danger {
  padding: 10px;
  margin-top: 10px;
}

.employee-add-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  margin-bottom: 12px;
}

.employee-grid {
  display: grid;
  grid-template-columns: 1fr 140px 160px 120px;
  gap: 8px;
  align-items: center;
}

.dept-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0;
}

.dept-check {
  font-weight: 600 !important;
  margin: 0 !important;
  white-space: nowrap;
}

.employee-table-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.employee-table {
  min-width: 980px;
}

.employee-table input,
.employee-table select {
  min-width: 110px;
}

.inactive-row {
  opacity: 0.55;
  background: #f3f4f6;
}

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


/* V11 readability and manager full-screen improvements */
.modal-backdrop {
  align-items: stretch;
  justify-content: center;
  padding: 14px;
}

.modal {
  width: calc(100vw - 28px);
  max-width: 1500px;
  max-height: calc(100vh - 28px);
  border-radius: 12px;
}

#modalTitle {
  font-size: 24px;
}

.table-card {
  border: 2px solid #c7d0dc;
}

th, td {
  border-bottom: 2px solid #cbd5e1;
}

tbody tr.group-row td {
  border-top: 3px solid #9ca3af;
  border-bottom: 2px solid #cbd5e1;
}

.extra-row td {
  border-bottom: 1px solid #d7dde5;
}

.clickable {
  color: #111827;
  text-decoration: none;
}

.clickable:hover {
  text-decoration: underline;
}


.qty-cell {
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
}

th.col-qty {
  text-align: center;
}

.qty-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #fff3bf !important;
  color: #7c2d12;
  font-weight: 900;
  font-size: 16px;
  text-align: center;
  border: 0 !important;
}

.plain-priority,
.plain-status {
  display: inline-block;
  color: #111827;
  font-weight: 800;
  padding: 0;
  background: transparent;
}


.order-edit-grid,
.employee-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.order-edit-grid label,
.employee-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
}

.order-edit-grid input,
.order-edit-grid select,
.employee-form-grid input,
.employee-form-grid select {
  width: 100%;
  min-width: 0;
}

.order-item-editor {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.edit-items-table {
  min-width: 1100px;
}

.edit-items-table input {
  width: 100%;
  min-width: 0;
}

.employee-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px;
}

.employee-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: white;
}

.employee-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.employee-depts {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.active-check {
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
}

.active-check input,
.dept-check input {
  width: 20px;
  height: 20px;
  min-height: 20px;
}

.employee-table-wrap,
.employee-table {
  display: none;
}

.manager-box label {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .order-edit-grid,
  .employee-form-grid,
  .employee-cards {
    grid-template-columns: 1fr;
  }
  .modal-backdrop {
    padding: 4px;
  }
  .modal {
    width: calc(100vw - 8px);
    max-height: calc(100vh - 8px);
  }
}


.quick-add-sku-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  background: #f8fafc;
}

.quick-add-sku-box h4 {
  margin: 0 0 8px 0;
}

.quick-add-sku-box input,
.quick-add-sku-box select {
  min-width: 180px;
}


.clickdrop-file-row {
  align-items: flex-start;
  border-left: 5px solid #999;
}
.clickdrop-file-row.not-uploaded {
  border-left-color: #c77700;
}
.clickdrop-file-row.uploaded {
  border-left-color: #267a3e;
  opacity: 0.86;
}
.clickdrop-file-row .sku-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}


.sku-extra-info {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
}

.sku-extra-info:hover {
  text-decoration: underline;
}

.additional-info-box {
  border-left: 4px solid #f59e0b;
}

.additional-info-line {
  font-size: 13px;
  font-weight: 400;
  color: #374151;
  white-space: pre-wrap;
}

    .evri-table th:first-child,
    .evri-table td:first-child {
      width: 42px;
      text-align: center;
    }

    .evri-order-row.problem {
      background: var(--red);
    }

    .evri-sku-grid {
      margin-top: 8px;
    }

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

    .checkbox-label input {
      min-height: auto;
    }

.evri-manual-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.evri-manual-help {
  margin: 6px 0 10px 0;
}

.evri-manual-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.evri-manual-table {
  min-width: 1100px;
  margin: 0;
}

.evri-manual-table input,
.evri-manual-table select {
  width: 100%;
  min-width: 80px;
  padding: 7px 8px;
}

.evri-manual-table .evri-order-number {
  min-width: 170px;
}

.evri-manual-table .evri-item-name {
  min-width: 140px;
}

.evri-manual-table .evri-value,
.evri-manual-table .evri-weight,
.evri-manual-table .evri-length,
.evri-manual-table .evri-width,
.evri-manual-table .evri-height {
  min-width: 70px;
}

.evri-order-cell {
  min-width: 210px;
}

.evri-order-number.evri-order-ok {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  background: #f0fdf4;
}

.evri-order-number.evri-order-bad {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
  background: #fef2f2;
}

.evri-order-number.evri-order-pending {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.evri-order-status {
  min-height: 14px;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.15;
  color: var(--muted);
  white-space: nowrap;
}

.evri-order-status-ok {
  color: #15803d;
}

.evri-order-status-bad {
  color: #b91c1c;
}

.evri-order-status-pending {
  color: #92400e;
}

.evri-manual-row.evri-duplicate-row td {
  background: #fff7ed;
}

.evri-manual-row.evri-duplicate-row .evri-order-number {
  border-color: #f97316 !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18) !important;
  background: #fff7ed !important;
}

.evri-duplicate-status {
  min-height: 14px;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.15;
  color: #c2410c;
  white-space: nowrap;
}


.evri-manual-table .evri-notify {
  min-width: 76px;
  text-transform: uppercase;
}


.order-multiline { line-height: 1.25; display: inline-block; }
.sku-extra-info {
  display: inline-block;
  margin-top: 6px;
  padding: 7px 11px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid #f59e0b;
  background: #fff7ed;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.sku-extra-info:hover { filter: brightness(0.97); }
.additional-info-manager-box textarea { min-height: 120px; width: 100%; }

.manager-menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
  max-width: 720px;
}
.manager-menu-tile {
  min-height: 56px;
  width: 100%;
  white-space: normal;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}
.manager-menu-tile:hover { background: #f8fafc; }
.manager-section-hidden { display: none !important; }
.manager-back-row { margin: 0 0 12px; }
#mergeOrderNumbers { width: 100%; min-height: 120px; }

.problem-notes-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.problem-notes-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.problem-note-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  background: #fff7ed;
}
.problem-note-card p { margin: 6px 0 10px; }
#generalProblemNoteText { width: 100%; min-height: 130px; }


/* V37 UI fixes */
.tabs,
.toolbar {
  position: static !important;
  top: auto !important;
}
.manager-menu-grid {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  grid-template-columns: none !important;
  max-width: 760px;
}
.manager-menu-tile {
  display: block !important;
  width: 100% !important;
}


/* V38 UI and usability fixes */
.welcome-brand {
  color: #000;
  font-size: 48px !important;
  line-height: 1.05;
  margin-bottom: 4px !important;
  letter-spacing: 0.02em;
}
.welcome-subtitle {
  color: #111827 !important;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px !important;
}
.uk-clock {
  min-width: 210px;
  text-align: center;
}
.sku-extra-info-row {
  display: block;
  margin-top: 8px;
}
tbody tr.group-row.combined + tr.extra-row td,
tbody tr.extra-row.combined-child td {
  background: #eefbf1 !important;
  border-left: 0 !important;
}
tbody tr.group-row.combined + tr.extra-row .extra-line,
tbody tr.extra-row.combined-child .extra-line {
  color: #14532d;
}
.problem-note-card .btn-small {
  margin-right: 6px;
  margin-top: 4px;
}
#editGeneralProblemNoteText {
  width: 100%;
  min-height: 130px;
}


/* V39 small UI cleanup */
tbody tr.group-row.combined,
tbody tr.group-row.combined td,
tbody tr.extra-row.combined-child td {
  border-left: 0 !important;
}
.badge.priority-normal,
.badge.standard {
  background: transparent !important;
  color: #111827 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.actions {
  gap: 14px !important;
}
.actions .btn-ok,
.actions .btn-problem {
  min-width: 54px;
}

/* Shipping Hub / Click & Drop API */
.shipping-settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 8px 0 10px;
}
.shipping-settings-grid input[type="password"] {
  width: 100%;
  margin-top: 5px;
}
.shipping-auto-check {
  align-self: center;
  white-space: nowrap;
}
.shipping-actions-row {
  gap: 14px;
  align-items: center;
}
.shipping-summary-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.shipping-summary-cards div {
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  padding: 10px;
  background: #f8fbff;
}
.shipping-summary-cards b,
.shipping-summary-cards span {
  display: block;
}
.shipping-summary-cards span {
  font-size: 22px;
  margin-top: 4px;
}
.shipping-table td {
  vertical-align: top;
}
.cd-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  background: #edf2f7;
}
.cd-status-sent,
.cd-status-waiting-tracking {
  background: #fff3bf;
}
.cd-status-tracking-found {
  background: #d3f9d8;
}
.cd-status-error {
  background: #ffd6d6;
}
.pre-line {
  white-space: pre-line;
}
.problem-text {
  color: #b42318;
  font-size: 12px;
}
@media (max-width: 900px) {
  .shipping-settings-grid,
  .shipping-summary-cards {
    grid-template-columns: 1fr;
  }
  .shipping-auto-check {
    white-space: normal;
  }
}

.auto-import-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 180px;
}
.auto-import-inline label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.auto-import-inline input[type="number"] {
  width: 72px;
  padding: 4px 6px;
}
.auto-import-inline .btn-small {
  width: fit-content;
}

.raw-json-box {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
}

.manager-hint {
  grid-column: 1 / -1;
  background: #fff7df;
  border: 1px solid #f3d27a;
  border-radius: 10px;
  padding: 10px 12px;
  color: #5d4500;
}

.version-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
}


/* V68 packing-list readability updates */
.badge.priority-next,
.badge.priority-111,
.badge.priority-11,
.badge.priority-1,
.badge.priority-a,
.badge.priority-asap,
.badge.priority-int {
  font-size: 15px !important;
  font-weight: 950 !important;
  padding: 3px 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}
.badge.priority-next { color: #991b1b !important; }
.badge.priority-111 { color: #9a3412 !important; }
.badge.priority-11 { color: #92400e !important; }
.badge.priority-1 { color: #854d0e !important; }
.badge.priority-a, .badge.priority-asap { color: #1e40af !important; }
.badge.priority-int { color: #374151 !important; }
.plain-priority {
  color: #a1a1aa !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: .01em;
}
.plain-status {
  color: #b6bbc4 !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: .02em;
}
.qty-alert {
  min-width: 34px !important;
  min-height: 30px !important;
  padding: 3px 9px !important;
  border-radius: 10px !important;
  background: #ffedd5 !important;
  color: #9a3412 !important;
  font-size: 21px !important;
  font-weight: 950 !important;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, .22) !important;
}
tbody tr.extra-row td,
tbody tr.extra-row.combined-child td {
  font-size: 16px !important;
}
tbody tr.extra-row .clickable {
  font-size: inherit !important;
  font-weight: 800 !important;
}

/* V69 Amazon FBM merge review */
.merge-review-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}
.merge-review-card {
  border: 1px solid #d5dbe6;
  border-radius: 12px;
  padding: 12px;
  background: #fbfcff;
}
.merge-review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}
.mini-table th,
.mini-table td {
  border-bottom: 1px solid #e6e9f0;
  padding: 6px 7px;
  text-align: left;
  vertical-align: top;
}
.mini-table th {
  color: #5b6472;
  font-weight: 700;
  background: #f3f5f9;
}

/* V70 priority/status visibility + shipping date filter */
.packing-date-filter {
  min-width: 190px;
}

.col-qty,
.col-priority,
.col-status,
.col-actions,
td.qty-cell,
tbody td:nth-child(4),
tbody td:nth-child(5),
tbody td:nth-child(6) {
  text-align: center !important;
  vertical-align: middle !important;
}

tbody td:nth-child(4) .deadline-small,
tbody td:nth-child(4) .ship-date-small,
tbody td:nth-child(5) .department-small {
  text-align: center !important;
}

.plain-priority,
.plain-status {
  color: #aeb4bf !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: .02em !important;
  text-transform: uppercase;
  line-height: 1.2;
}

.badge.priority-next {
  color: #ff0000 !important;
  font-size: 17px !important;
  font-weight: 950 !important;
  text-shadow: 0 0 0 #ff0000;
}

.badge.priority-111,
.badge.priority-11,
.badge.priority-1 {
  color: #111827 !important;
  background: #fff200 !important;
  border: 2px solid #facc15 !important;
  border-radius: 8px !important;
  padding: 2px 8px !important;
  font-size: 16px !important;
  font-weight: 950 !important;
  line-height: 1.2;
}

.badge.priority-a,
.badge.priority-asap {
  color: #1e40af !important;
  background: transparent !important;
  border: 0 !important;
}

.badge.priority-int {
  color: #16a34a !important;
  background: #dcfce7 !important;
  border: 1px solid #86efac !important;
  border-radius: 8px !important;
  padding: 2px 8px !important;
}

.qty-alert {
  min-width: 44px !important;
  min-height: 36px !important;
  padding: 4px 12px !important;
  border-radius: 12px !important;
  background: #fff200 !important;
  color: #b91c1c !important;
  font-size: 24px !important;
  font-weight: 950 !important;
  border: 3px solid #f97316 !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .18) !important;
}

.deadline-small,
.ship-date-small,
.department-small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #1f2937;
}

.ship-date-small {
  color: #64748b;
  font-size: 11px;
}


/* V71 small UI corrections */
.qty-alert {
  min-width: 22px !important;
  min-height: 22px !important;
  padding: 1px 6px !important;
  border-radius: 5px !important;
  background: #fff3bf !important;
  color: #7c2d12 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  border: 0 !important;
  box-shadow: none !important;
}

#searchInput::-webkit-calendar-picker-indicator {
  display: none !important;
}

/* V72 dispatch-date filter and QTY readability */
td.qty-cell {
  font-size: 18px !important;
  font-weight: 900 !important;
}
.qty-alert {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 2px !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #dc2626 !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  border: 0 !important;
  box-shadow: none !important;
}
.packing-date-filter {
  min-width: 200px;
}


/* V73 QTY circle + ship-by date filter cleanup */
td.qty-cell {
  font-size: 19px !important;
  font-weight: 900 !important;
}
.qty-alert {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 24px !important;
  min-height: 24px !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #b91c1c !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  border: 2px solid #dc2626 !important;
  box-shadow: none !important;
  line-height: 1 !important;
}

/* V74 QTY final: red outline circle, no fill */
td.qty-cell {
  font-size: 19px !important;
  font-weight: 900 !important;
}
.qty-alert {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 27px !important;
  height: 27px !important;
  min-width: 27px !important;
  min-height: 27px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #b91c1c !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  border: 2px solid #dc2626 !important;
  box-shadow: none !important;
  line-height: 1 !important;
}

/* V77-V80 Manager-only Click & Drop error repair / Amazon Exceptions */
.cd-errors-panel {
  border: 2px solid #fecaca;
  background: #fff7f7;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.cd-error-table th,
.cd-error-table td {
  border-bottom-color: #fecaca;
}
.cd-mini-status {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 5px auto 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.cd-mini-not-sent {
  color: #94a3b8;
  background: #f1f5f9;
}
.cd-mini-sent {
  color: #854d0e;
  background: #fef3c7;
}
.cd-mini-tracking {
  color: #166534;
  background: #dcfce7;
}
.cd-mini-error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}
.cd-mini-review {
  color: #5b21b6;
  background: #ede9fe;
}
.shipping-summary-cards {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

/* V82 fixes: QTY values like 10 must not stack; use an oval red outline with no fill. */
td.qty-cell {
  white-space: nowrap !important;
  text-align: center !important;
}
.qty-alert {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 7px !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #b91c1c !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  border: 2px solid #dc2626 !important;
  box-shadow: none !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums !important;
}

/* V82: make the on-demand C&D queue obvious above the error repair panel. */
.cd-not-sent-panel {
  border: 2px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.cd-not-sent-table th,
.cd-not-sent-table td {
  border-bottom-color: #bfdbfe;
}

/* V84 Manager Click & Drop shipping/tracking visibility */
.cd-tracking-small {
  display: block;
  margin: 3px auto 0;
  max-width: 150px;
  font-size: 11px;
  font-weight: 800;
  color: #166534;
  line-height: 1.2;
  word-break: break-word;
}
.cd-shipping-info-box {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.cd-shipping-info-table {
  min-width: 0;
  width: 100%;
}
.cd-shipping-info-table th {
  width: 210px;
  text-align: left;
  background: #dcfce7;
}
.cd-shipping-info-table td {
  word-break: break-word;
}


/* Label Console / Print Sheet */
.label-main { display: none; }
.label-main.unlocked { display: block; }
.label-console-card h1 { margin-bottom: 6px; }
.label-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.label-shortcuts span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  font-size: 12px;
}
.label-console-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.label-console-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.label-console-table { min-width: 1320px; margin: 0; }
.label-console-table input,
.label-console-table select {
  width: 100%;
  padding: 7px 8px;
  min-width: 64px;
}
.label-console-table .label-order-input { min-width: 170px; font-weight: 800; }
.label-search-cell { min-width: 210px; }
.label-match-cell { min-width: 260px; font-size: 12px; line-height: 1.25; }
.label-row-status-cell { min-width: 170px; font-size: 12px; line-height: 1.25; }
.label-actions-cell { min-width: 180px; white-space: nowrap; }
.label-match-status {
  min-height: 14px;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.1;
}
.label-console-row.label-row-selected td { outline: 2px solid rgba(37, 99, 235, 0.35); outline-offset: -2px; }
.label-console-row.label-row-ok td { background: #ecfdf5; }
.label-console-row.label-row-ambiguous td { background: #fff7ed; }
.label-console-row.label-row-bad td { background: #fef2f2; }
.label-console-row.label-row-processing td { background: #eff6ff; }
.label-console-row.label-row-done td { background: #f0fdf4; opacity: 0.94; }
.label-console-row.label-row-ok .label-order-input {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,.16);
}
.label-console-row.label-row-ambiguous .label-order-input {
  border-color: #f97316 !important;
  box-shadow: 0 0 0 3px rgba(249,115,22,.18);
}
.label-console-row.label-row-bad .label-order-input {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.16);
}
.label-small-ok {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
}
.label-small-bad {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 800;
}
.label-match-picker {
  display: grid;
  gap: 8px;
}
.label-match-choice {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
}
.label-console-jobs {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.label-job-row {
  display: grid;
  grid-template-columns: 100px 160px 180px 130px 130px 90px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-left: 4px solid #22c55e;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  font-size: 12px;
}
.label-job-row.error { border-left-color: #ef4444; }
@media (max-width: 900px) {
  .label-job-row { grid-template-columns: 1fr; }
}

/* V86 Label Console carrier-specific controls */
.label-console-table { min-width: 1460px; }
.label-notify-cell { min-width: 110px; font-size: 12px; white-space: nowrap; }
.label-auto-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-weight: 700;
}
.label-disabled-input,
.label-console-table input:disabled,
.label-console-table select:disabled {
  background: #e5e7eb !important;
  color: #64748b !important;
  cursor: not-allowed;
}


/* V87: C&D Review needed control panel */
.cd-review-panel {
  border: 2px solid #ddd6fe;
  background: #f5f3ff;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.cd-review-table th,
.cd-review-table td {
  border-bottom-color: #ddd6fe;
}
.cd-review-actions {
  min-width: 220px;
}
.cd-review-actions button {
  margin: 2px;
}
.shipping-summary-click {
  cursor: pointer;
  outline: 2px solid #ddd6fe;
}
.shipping-summary-click:hover {
  background: #f5f3ff;
}

/* V89: make packed rows visibly crossed out, including order numbers and combined child rows. */
tbody tr.group-row.packed-pending td,
tbody tr.extra-row.packed-pending td {
  text-decoration: line-through !important;
  opacity: 0.72;
  background: #eef2f7 !important;
}
.invoice-actions-row {
  margin-top: 10px;
}

.invoice-email-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #f8fbff;
}
.invoice-email-box h4 {
  margin: 0 0 8px 0;
}
.invoice-email-row {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.invoice-email-row input {
  min-width: 280px;
  max-width: 420px;
}
.invoice-email-box textarea {
  width: 100%;
  min-height: 70px;
  margin-top: 8px;
}

/* V97: packed rows must cross out clickable order numbers too, not only SKU text. */
tbody tr.group-row.packed-pending .clickable,
tbody tr.group-row.packed-pending .order-main,
tbody tr.extra-row.packed-pending .clickable,
tbody tr.extra-row.packed-pending .extra-line,
tbody tr.group-row.status-packed .clickable,
tbody tr.group-row.status-packed .order-main,
tbody tr.extra-row.status-packed .clickable,
tbody tr.extra-row.status-packed .extra-line {
  text-decoration: line-through !important;
}

.employee-role-checks {
  border: 1px solid #d7dde5;
  border-radius: 12px;
  padding: 8px;
  background: #f8fafc;
  margin-bottom: 10px;
}
.employee-card h5,
.employee-add-box h5 {
  margin: 8px 0 4px;
}
.role-check {
  font-weight: 800;
}

.employee-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

/* V99 Rope Finder */
.rope-finder-card h1 {
  margin-top: 0;
}

.rope-finder-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(120px, 0.8fr)) auto;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.rope-finder-toolbar input,
.rope-finder-toolbar select {
  width: 100%;
}

.rope-finder-wrap {
  overflow-x: auto;
}

.rope-finder-table th,
.rope-finder-table td {
  white-space: nowrap;
}

.rope-finder-table td:first-child {
  font-size: 18px;
}

@media (max-width: 1000px) {
  .rope-finder-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .rope-finder-toolbar {
    grid-template-columns: 1fr;
  }
}

/* V100 Rope Finder editing */
.rope-finder-toolbar {
  grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(120px, 0.8fr)) auto auto;
}

.rope-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.rope-row-actions button {
  padding: 6px 9px;
  font-size: 12px;
}

.rope-edit-box label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 800;
}

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

.rope-edit-box textarea {
  min-height: 90px;
}

@media (max-width: 700px) {
  .rope-edit-grid {
    grid-template-columns: 1fr;
  }
}

/* V101 Full backup manager */
.backup-settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(360px, 2fr);
  gap: 10px;
  align-items: end;
  margin: 10px 0;
}

.backup-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 800;
}

.backup-settings-grid label.dept-check {
  flex-direction: row;
  align-items: center;
  padding-bottom: 8px;
}

.backup-settings-actions,
.backup-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.backup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin: 8px 0;
  background: #fff;
}

.backup-row.error {
  border-color: #fecaca;
  background: #fff7f7;
}

.backup-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* V101 Rope colour chips and sorting */
.rope-finder-toolbar {
  grid-template-columns: minmax(240px, 1.4fr) repeat(5, minmax(120px, 0.8fr)) auto auto;
}

.rope-colour-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: color-mix(in srgb, var(--rope-colour) 18%, white);
  color: #111827;
  font-weight: 800;
}

.rope-colour-dot {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--rope-colour);
  border: 1px solid rgba(0,0,0,0.25);
  flex: 0 0 auto;
}

.rope-colour-chip.light .rope-colour-dot {
  border-color: rgba(0,0,0,0.45);
}

.rope-comment-cell {
  white-space: normal !important;
  min-width: 220px;
  max-width: 420px;
}

@media (max-width: 1000px) {
  .backup-settings-grid {
    grid-template-columns: 1fr 1fr;
  }
  .backup-settings-actions {
    grid-column: 1 / -1;
  }
  .rope-finder-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .backup-settings-grid,
  .rope-finder-toolbar {
    grid-template-columns: 1fr;
  }
  .backup-row {
    flex-direction: column;
  }
}

/* V102 Stock Control */
.stock-summary-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
}
.safe-badge {
  display: inline-block;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
}
.stock-filters input[type="text"],
.stock-filters input[type="search"],
.stock-filters input:not([type]),
.stock-filters select {
  min-width: 180px;
}
.stock-table-wrap {
  overflow: auto;
  max-height: 420px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.stock-table th,
.stock-table td,
.stock-component-table th,
.stock-component-table td {
  white-space: nowrap;
  vertical-align: top;
}
.stock-table td:nth-child(2),
.stock-component-table td:nth-child(2) {
  white-space: normal;
  min-width: 260px;
}
.stock-low-row {
  background: #fff7ed;
}
.stock-item-details {
  margin-top: 14px;
}
.stock-detail-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}
.stock-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.stock-detail-card textarea {
  min-height: 70px;
  width: 100%;
}
@media (max-width: 900px) {
  .stock-detail-head {
    display: block;
  }
}

/* V103 separate Stock Control module */
.safe-panel {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
}
.stock-control-card h1 {
  margin-top: 0;
}

/* V104 Rope Finder tablet readability and stable rows */
.rope-finder-table {
  border-collapse: separate;
  border-spacing: 0;
}
.rope-finder-table th,
.rope-finder-table td {
  font-size: 16px;
  line-height: 1.35;
  vertical-align: middle !important;
  padding-top: 10px;
  padding-bottom: 10px;
}
.rope-finder-table th {
  font-size: 13px;
  letter-spacing: .06em;
  font-weight: 900;
}
.rope-finder-table td:first-child {
  font-size: 20px;
  font-weight: 900;
}
.rope-colour-chip {
  min-height: 28px;
  font-size: 15px;
}
.rope-row-actions button {
  min-height: 34px;
  font-size: 13px;
  font-weight: 800;
}
.rope-comment-cell {
  min-width: 260px;
}

/* V104 Stock item editor */
.stock-sku-button {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-weight: 900;
  padding: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
}
.stock-photo-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
}
.stock-detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 16px;
  align-items: start;
}
.stock-photo-panel {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  background: #f9fafb;
}
.stock-photo-large,
.stock-photo-placeholder {
  width: 100%;
  min-height: 190px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  color: #6b7280;
  font-weight: 800;
}
.stock-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.stock-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 800;
}
.stock-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.stock-stats-grid > div {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}
.stock-stats-grid b {
  display: block;
  font-size: 24px;
  line-height: 1;
}
.stock-stats-grid span {
  display: block;
  margin-top: 5px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
@media (max-width: 900px) {
  .stock-detail-layout,
  .stock-edit-grid,
  .stock-stats-grid {
    grid-template-columns: 1fr;
  }
}


/* V105 Stock Control modal editor and tablet readability */
.stock-csv-panel {
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
}
.stock-table-readable th,
.stock-table-readable td {
  font-size: 15px;
  line-height: 1.35;
  vertical-align: middle;
}
.stock-click-row {
  cursor: pointer;
}
.stock-click-row:hover {
  background: #f3f4f6;
}
.stock-sku-button,
.stock-sku-strong {
  color: #111827 !important;
  font-size: 17px;
  font-weight: 950;
  text-decoration: none;
}
.stock-sku-button:hover,
.stock-sku-strong:hover {
  text-decoration: underline;
}
.stock-sku-title {
  color: #111827;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: .01em;
}
.stock-detail-modal {
  border: 0;
  padding: 0;
}
.stock-effective-note {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
}
.stock-analysis-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}
.stock-analysis-bar h4 {
  margin: 0 10px 0 0;
}
.stock-analysis-bar input {
  width: 90px;
  margin: 0 6px;
}
#modalContent {
  max-height: calc(100vh - 145px);
  overflow: auto;
  padding-right: 4px;
}
@media (max-width: 900px) {
  .stock-table-readable th,
  .stock-table-readable td {
    font-size: 16px;
  }
  .stock-sku-button,
  .stock-sku-strong {
    font-size: 18px;
  }
  .stock-csv-panel .manager-row,
  .stock-analysis-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

/* V106 Stock filtering, Sales Analysis and shared SKU stock view */
.stock-column-filters {
  display: grid;
  grid-template-columns: repeat(9, minmax(110px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.stock-column-filters input,
.stock-column-filters select {
  width: 100%;
  min-height: 38px;
  font-size: 14px;
}
.stock-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 10px;
  font-weight: 800;
}
.sales-analysis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.sales-analysis-toolbar input[type="number"] {
  width: 90px;
  margin: 0 6px;
}
.sku-stock-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  border-radius: 12px;
}
.sku-stock-box h3,
.sku-stock-box h4 {
  margin: 4px 0 8px;
}
.sku-stock-box-inner {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0;
}
.sku-stock-components th,
.sku-stock-components td {
  font-size: 13px;
  padding: 6px 8px;
}
@media (max-width: 1100px) {
  .stock-column-filters {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}
@media (max-width: 700px) {
  .stock-column-filters {
    grid-template-columns: 1fr;
  }
  .stock-pagination {
    flex-direction: column;
    align-items: stretch;
  }
}


/* V107 Stock table first, taller grids and Sales Analysis improvements */
.stock-top-table-area {
  margin-top: 12px;
  margin-bottom: 16px;
}
.stock-table-wrap-tall {
  max-height: 880px;
}
.stock-table-readable th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e5edf7;
}
.stock-table-readable td:nth-child(2) {
  min-width: 360px;
}
.stock-table-readable th,
.stock-table-readable td {
  padding: 10px 12px;
}
.sales-analysis-top-tables {
  margin-top: 12px;
}
.sales-sort-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 6px 0;
}
.sales-sort-row select {
  min-height: 36px;
  font-weight: 700;
}
.sales-negative-cell {
  color: #b91c1c;
  background: #fee2e2;
}
.sales-table-wrap {
  max-height: 760px;
}
@media (max-width: 900px) {
  .stock-table-wrap-tall,
  .sales-table-wrap {
    max-height: 75vh;
  }
  .stock-table-readable td:nth-child(2) {
    min-width: 240px;
  }
}


/* V108 cleaner header, wider stock tables and safe marketplace console */
.stock-main {
  max-width: none;
  width: calc(100vw - 24px);
}
.stock-control-card {
  width: 100%;
}
.stock-table-wrap-tall {
  max-height: calc(100vh - 210px);
  overflow: auto;
}
.stock-table {
  min-width: 1450px;
  table-layout: auto !important;
}
.stock-table-readable th,
.stock-table-readable td {
  white-space: nowrap;
}
.stock-table-readable td:nth-child(2) {
  white-space: normal;
  min-width: 460px;
}
.stock-table-readable td:nth-child(1) {
  min-width: 260px;
}
.marketplace-test-box h4 {
  margin: 8px 0;
}
.marketplace-test-box ul {
  margin-top: 6px;
}
@media (max-width: 900px) {
  .stock-main {
    width: calc(100vw - 10px);
    padding-left: 5px;
    padding-right: 5px;
  }
  .stock-table {
    min-width: 1250px;
  }
  .stock-table-wrap-tall {
    max-height: 78vh;
  }
}


.marketplace-test-controls select {
  min-width: 280px;
}
.marketplace-test-safety-row {
  align-items: center;
}
.disabled-check {
  opacity: 0.85;
  font-weight: 700;
}
.marketplace-live-result {
  border: 1px solid #d0d7de;
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  background: #f8fafc;
}
.marketplace-live-result.ok {
  border-color: #22c55e;
}
.marketplace-live-result.bad {
  border-color: #ef4444;
}
.marketplace-live-result.warn {
  border-color: #f59e0b;
  background: #fffbeb;
}
.marketplace-live-pre {
  max-height: 260px;
  overflow: auto;
  margin-top: 8px;
  white-space: pre-wrap;
}

.ebay-map-scroll {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #fff;
}
.ebay-match-scroll {
  max-height: 320px;
  overflow: auto;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #fff;
}
.ebay-map-table {
  min-width: 1250px;
  table-layout: auto;
}
.ebay-map-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}
.ebay-map-table td:nth-child(2),
.ebay-map-table td:nth-child(3) {
  color: #111827;
  font-weight: 700;
}
.warn-text {
  color: #b91c1c;
  font-weight: 700;
}


/* V114 compact header and grouped manager menu */
.app-header {
  padding: 6px 10px !important;
  gap: 8px !important;
  min-height: 46px;
}
.header-time-box {
  gap: 6px !important;
  flex: 0 0 auto;
}
.app-header .version-pill {
  font-size: 10px;
  padding: 2px 5px;
  opacity: 0.75;
}
.app-header .uk-clock {
  min-width: 82px !important;
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  padding: 3px 7px !important;
  font-size: 11px !important;
  line-height: 1.05;
  border-radius: 7px !important;
}
.login-box {
  gap: 5px !important;
  flex: 1 1 auto;
}
.app-header button,
.app-header select,
.app-header input {
  min-height: 30px !important;
  padding: 5px 8px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
}
.app-header .pin-input {
  width: 86px !important;
}
.app-header .user-pill {
  padding: 5px 8px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  font-weight: 800;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.manager-menu-groups {
  max-width: 980px !important;
  gap: 12px !important;
}
.manager-menu-intro {
  margin: 0 0 10px;
}
.manager-menu-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
}
.manager-menu-group h4 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}
.manager-menu-group-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}
.manager-menu-group .manager-menu-tile {
  min-height: 44px !important;
  padding: 10px 12px !important;
  box-shadow: none !important;
}
@media (max-width: 900px) {
  .app-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .login-box {
    width: auto !important;
    justify-content: flex-end !important;
  }
  .manager-menu-group-buttons {
    grid-template-columns: 1fr;
  }
}

/* V115 header and Manager navigation corrections */
.app-header {
  padding: 7px 10px !important;
  min-height: 42px !important;
}
.header-time-box {
  min-width: 128px;
}
.app-header .uk-clock {
  min-width: 122px !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  border-radius: 7px !important;
  font-weight: 800 !important;
}
.app-header .version-pill {
  display: none !important;
}
.app-header .user-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc !important;
  color: #111827 !important;
  border: 1px solid #cbd5e1;
  text-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
}
.app-header button,
.app-header select,
.app-header input {
  min-height: 31px !important;
  padding: 5px 8px !important;
  font-size: 12px !important;
}
.manager-jump-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.manager-jump-label {
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}
.manager-jump-bar select {
  flex: 1 1 auto;
  min-width: 260px;
}
.manager-section-hidden {
  display: block !important;
}
.manager-back-row,
.manager-menu-grid,
.manager-menu-intro,
.manager-menu-groups {
  display: none !important;
}
@media (max-width: 900px) {
  .app-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .header-time-box {
    min-width: 118px;
  }
  .app-header .uk-clock {
    min-width: 116px !important;
    font-size: 11px !important;
  }
  .login-box {
    width: auto !important;
    justify-content: flex-end !important;
  }
  .manager-jump-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .manager-jump-bar select {
    min-width: 0;
    width: 100%;
  }
}

/* V116 Manager header + grouped manager menu correction */
.manager-menu-grid.manager-menu-groups {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
  max-width: 980px !important;
}
.manager-menu-intro {
  display: block !important;
}
.modal-section.manager-section-hidden,
.danger-box.manager-section-hidden {
  display: none !important;
}
.manager-back-row {
  margin: 0 0 12px;
}
.manager-jump-bar {
  display: none !important;
}
.app-header.manager-test-mode {
  min-height: 42px !important;
}
.app-header.manager-test-mode .login-box {
  justify-content: flex-end !important;
}

/* V117 manager header/version and stock update preview improvements */
.manager-version-bar {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #111827;
  font-size: 13px;
}
.app-header .manager-module-select {
  min-width: 150px !important;
  max-width: 190px !important;
  font-weight: 800;
  background: #eef2ff !important;
  color: #111827 !important;
}
.app-header .app-version-pill,
.app-header .version-pill.app-version-pill {
  display: none !important;
  align-items: center;
  justify-content: center;
  background: #fef3c7 !important;
  color: #78350f !important;
  border: 1px solid #fbbf24 !important;
  padding: 5px 8px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}
.app-header.manager-test-mode .app-version-pill,
.app-header.manager-test-mode .version-pill.app-version-pill {
  display: inline-flex !important;
}
.app-header.manager-test-mode .login-box {
  gap: 5px !important;
}
.stock-row-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.stock-flag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.stock-flag.bad {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.stock-flag.warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.marketplace-live-result details summary,
.ebay-match-scroll details summary {
  cursor: pointer;
  font-weight: 800;
  color: #1d4ed8;
}
@media (max-width: 1200px) {
  .app-header.manager-test-mode .manager-module-select {
    max-width: 150px !important;
  }
  .app-header.manager-test-mode .user-pill {
    max-width: 110px !important;
  }
}

/* V118 manager header cleanup + one SKU live quantity update */
.app-header .app-version-left-pill {
  display: none;
  align-items: center;
  justify-content: center;
  background: #fef3c7 !important;
  color: #78350f !important;
  border: 1px solid #fbbf24 !important;
  padding: 5px 8px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  margin-right: 7px;
}
.app-header.manager-test-mode .app-version-left-pill {
  display: inline-flex !important;
}
.header-time-box {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}
.one-sku-live-update {
  margin: 12px 0;
  border-color: #fb923c !important;
  background: #fff7ed !important;
}
.one-sku-live-update h4 {
  margin-top: 0;
}
.one-sku-live-update input,
.one-sku-live-update select {
  min-height: 34px;
}
.one-sku-live-update .btn-danger {
  font-weight: 900;
}
.app-header.manager-test-mode .app-version-pill,
.app-header.manager-test-mode .version-pill.app-version-pill {
  display: none !important;
}

/* V119 header polish + SKU sync flags */
.app-header .app-version-left-pill {
  background: transparent !important;
  border: 0 !important;
  color: #ffffff !important;
  padding: 0 6px 0 0 !important;
  margin-right: 4px !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  opacity: 1 !important;
}
.app-header .uk-clock {
  background: transparent !important;
  border: 0 !important;
  color: #ffffff !important;
  padding: 0 !important;
  min-width: 0 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  letter-spacing: 0.01em !important;
  line-height: 1 !important;
  text-shadow: none !important;
}
.app-header .user-pill {
  background: transparent !important;
  border: 0 !important;
  color: #ffffff !important;
  padding: 0 2px !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
.app-header.manager-test-mode .login-box {
  gap: 6px !important;
}
.safe-badge.sync-on,
.stock-table .safe-badge.sync-on {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #86efac !important;
}
.stock-sync-check {
  margin: 8px 0 2px !important;
  font-weight: 900;
}


/* V123 Stock Control longer table and eBay item number visibility */
.stock-table-wrap-tall {
  height: min(2200px, calc(300vh - 630px));
  max-height: min(2200px, calc(300vh - 630px));
}
.stock-table {
  min-width: 1680px;
}
.stock-ebay-cell {
  font-weight: 800;
  color: #111827;
  min-width: 150px;
}
.stock-column-filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
@media (max-width: 900px) {
  .stock-table-wrap-tall {
    height: 85vh;
    max-height: 85vh;
  }
  .stock-table {
    min-width: 1450px;
  }
}

/* V126 sync failure visibility and richer missing-SKU report */
.stock-sync-failed-row {
  background: #fef2f2 !important;
  outline: 2px solid #fecaca;
  outline-offset: -2px;
}
.stock-sync-status-small {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.25;
  max-width: 210px;
  white-space: normal;
  color: #4b5563;
  font-weight: 800;
}
.stock-sync-status-small.failed {
  color: #991b1b;
}
.stock-sync-status-small.pending {
  color: #92400e;
}
.stock-sync-status-small.ok {
  color: #166534;
}
.stock-missing-table {
  min-width: 1850px;
}
.stock-missing-table td:nth-child(6) {
  white-space: normal;
  min-width: 280px;
}

/* V130: multi ship-date filter, compact INFO preview, problem/refund row hints */
.shipping-date-multi {
  position: relative;
  min-width: 200px;
  max-width: 260px;
}
.shipping-date-button {
  width: 100%;
  min-height: 38px;
  text-align: left;
  background: #ffffff;
  color: #111827;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 8px 34px 8px 12px;
  font-weight: 700;
  position: relative;
}
.shipping-date-button::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 8px;
  color: #475569;
}
.shipping-date-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 4px);
  left: 0;
  min-width: 230px;
  max-height: 310px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
  padding: 8px;
}
.shipping-date-panel-title {
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  margin: 2px 4px 6px;
}
.shipping-date-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.shipping-date-option:hover {
  background: #eef4ff;
}
.shipping-date-all-option {
  border-bottom: 1px solid #e5eaf0;
  margin-bottom: 4px;
  color: #0f172a;
}
.shipping-date-option input {
  width: 16px;
  height: 16px;
}
.shipping-date-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #e5eaf0;
  padding-top: 8px;
  margin-top: 6px;
}
.shipping-date-empty {
  padding: 8px 6px;
}
.sku-extra-info {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #fff7ed;
  padding: 3px 8px;
  text-decoration: none !important;
}
.sku-extra-info-label {
  color: #c2410c;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
}
.sku-extra-info-preview {
  display: inline-block;
  max-width: 300px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.sku-problem-preview {
  margin-top: 5px;
  max-width: 420px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge.cancelled {
  background: #e5e7eb !important;
  color: #4b5563 !important;
  border: 1px solid #cbd5e1 !important;
}
tbody tr.status-refunded td {
  color: #6b7280 !important;
  background: #f3f4f6 !important;
}
tbody tr.status-refunded .clickable,
tbody tr.status-refunded .order-main,
tbody tr.status-refunded .extra-line {
  color: #6b7280 !important;
  text-decoration: line-through !important;
}
.cancelled-info {
  border-left: 4px solid #9ca3af;
  background: #f3f4f6;
  color: #4b5563;
  padding: 8px 10px;
  border-radius: 8px;
}
.refund-cancel-box {
  border-left: 4px solid #9ca3af;
}


/* V131 Tracking module */
.tracking-card h1 { margin-bottom: 6px; }
.tracking-toolbar { gap: 10px; flex-wrap: wrap; }
.tracking-toolbar select,
.tracking-toolbar input { min-height: 38px; }
.tracking-toolbar input { min-width: 260px; flex: 1; }
.tracking-table-wrap { overflow-x: auto; }
.tracking-table { width: 100%; border-collapse: collapse; min-width: 1120px; }
.tracking-table th,
.tracking-table td { border-bottom: 1px solid #d7e0ea; padding: 9px 8px; text-align: left; vertical-align: top; }
.tracking-table th { background: #e7edf4; color: #102033; font-size: 13px; }
.tracking-number { font-weight: 800; color: #0f172a; }
.tracking-no { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-weight: 800; font-size: 12px; }
.tiny-text { font-size: 12px; line-height: 1.35; }
.tracking-message { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracking-actions { min-width: 190px; }
.tracking-actions button { margin: 2px 0; }
.tracking-dispatch-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-weight: 800; font-size: 12px; background: #e5e7eb; color: #374151; }
.tracking-dispatch-sent { background: #dcfce7; color: #166534; }
.tracking-dispatch-pending { background: #fef9c3; color: #854d0e; }
.tracking-dispatch-failed { background: #fee2e2; color: #991b1b; }
.tracking-dispatch-blocked { background: #ffedd5; color: #9a3412; }
.tracking-dispatch-local_only { background: #e0f2fe; color: #075985; }
.btn-warning { background: #f59e0b; color: #111827; border: none; border-radius: 8px; padding: 9px 12px; font-weight: 800; cursor: pointer; }
.btn-warning:hover { filter: brightness(0.96); }

/* V139 Amazon feed resend/re-confirm */
.tracking-actions .btn-secondary { display: block; margin-top: 4px; }
.tracking-dispatch-amazon_feed_pending { background: #ede9fe; color: #5b21b6; }
.tracking-dispatch-amazon_feed_done { background: #ccfbf1; color: #115e59; }
.btn-secondary {
  background: #e5e7eb;
  color: #111827;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}
.btn-secondary:hover { filter: brightness(0.96); }


/* V140 Tracking not-packed rows and late tracking timing */
.tracking-timing { display:inline-block; padding:4px 7px; border-radius:999px; font-size:11px; font-weight:800; white-space:nowrap; }
.tracking-timing-on_time { background:#dcfce7; color:#166534; }
.tracking-timing-late_tracking { background:#fef9c3; color:#854d0e; }
.tracking-timing-too_late_tracking { background:#fee2e2; color:#991b1b; }
.tracking-timing-unknown { background:#e5e7eb; color:#374151; }
.tracking-pack-status { display:inline-block; padding:4px 7px; border-radius:999px; font-size:11px; font-weight:800; background:#e5e7eb; color:#374151; }
.tracking-pack-not-packed { background:#ffedd5; color:#9a3412; }
.tracking-pack-packed { background:#dbeafe; color:#1d4ed8; }
.tracking-pack-done { background:#dcfce7; color:#166534; }
.tracking-table th:nth-child(8), .tracking-table td:nth-child(8) { min-width: 130px; }

/* V142 Auto Tracking Evri import panel */
.auto-evri-import-panel { margin-top: 10px; gap: 10px; align-items: center; flex-wrap: wrap; }


/* V147 Manager-menu Auto Tracking, Stock Control full-width table layout and tracking audit visibility */
.stock-controls-top {
  margin: 12px 0 14px;
}
.stock-toolbar {
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.stock-toolbar select,
.stock-toolbar input {
  min-height: 38px;
}
.stock-toolbar input {
  min-width: 300px;
  flex: 1;
}
.stock-action-row {
  gap: 8px;
  flex-wrap: wrap;
}
.stock-action-row input[type="file"] {
  max-width: 360px;
}
.stock-top-table-area {
  margin-top: 14px;
}
.stock-items-list {
  margin-top: 8px;
}
.stock-table-wrap-tall {
  height: calc(100vh - 245px);
  min-height: 560px;
  max-height: none;
  overflow: auto;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
}
.stock-table {
  width: 100%;
  min-width: 1680px;
  border-collapse: collapse;
}
.stock-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e7edf4;
}
.stock-table th,
.stock-table td {
  border-bottom: 1px solid #d7e0ea;
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}
.stock-column-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
@media (max-width: 900px) {
  .stock-table-wrap-tall {
    height: 75vh;
    min-height: 420px;
  }
  .stock-toolbar input {
    min-width: 100%;
  }
}

/* V146: Packing list priority is separate from Tracking timing. */


/* V147 Stock Control responsiveness, manual order helpers and Auto Tracking audit */
.stock-loading-soft {
  opacity: .72;
  cursor: progress;
}
.stock-table-wrap-tall {
  height: calc(100vh - 160px) !important;
  min-height: 720px;
  max-height: none !important;
}
.manual-sku-search-box {
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  margin: 10px 0;
}
.manual-sku-search-box input {
  min-width: 320px;
}
.manual-sku-search-table {
  margin-top: 8px;
}
.manual-address-grid {
  margin-top: 4px;
}
.auto-action-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
}
.auto-log-details {
  margin-top: 5px;
}
.auto-log-details summary {
  cursor: pointer;
  font-weight: 800;
  color: #1d4ed8;
}
.auto-log-table td:last-child {
  min-width: 360px;
}
@media (max-width: 900px) {
  .stock-table-wrap-tall {
    height: 82vh !important;
    min-height: 520px;
  }
  .manual-sku-search-box input {
    min-width: 100%;
  }
}

/* V148 Stock Control search split, persistent Missing SKU Audit and full-height table */
.stock-control-card {
  min-height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
}
.stock-controls-top {
  flex: 0 0 auto;
}
.stock-collapsible-panel {
  margin: 8px 0;
  padding: 8px 10px;
}
.stock-collapsible-panel summary {
  cursor: pointer;
  font-weight: 900;
}
.stock-top-table-area {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.stock-items-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.stock-table-wrap-tall {
  flex: 1 1 auto;
  height: auto !important;
  min-height: calc(100vh - 310px) !important;
  max-height: none !important;
}
.stock-toolbar input#stockSkuSearchInput {
  min-width: 360px;
  flex: 1.2;
}
.stock-toolbar input#stockGlobalSearchInput {
  min-width: 340px;
  flex: 1;
}
.stock-audit-heading {
  margin: 8px 0;
}
.stock-audit-table {
  min-width: 1700px;
}
.stock-missing-table .btn-danger,
.stock-audit-table .btn-danger {
  background: #ef4444;
  color: #fff;
}
@media (max-width: 900px) {
  .stock-toolbar input#stockSkuSearchInput,
  .stock-toolbar input#stockGlobalSearchInput {
    min-width: 100%;
  }
  .stock-table-wrap-tall {
    min-height: 75vh !important;
  }
}

/* V149 manual multi-line order entry */
.manual-items-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin: 8px 0 12px;
}
.manual-items-table {
  min-width: 980px;
  margin: 0;
}
.manual-items-table input {
  width: 100%;
  box-sizing: border-box;
}
.manual-items-table .manual-line-main {
  width: auto;
  transform: scale(1.2);
}
.manual-items-table .manual-line-qty {
  max-width: 90px;
}


/* V155 Stock Control full-page table and manual SKU search restore */
#stockMain.wrap.unlocked {
  display: flex;
  flex-direction: column;
  max-width: none;
  width: 100%;
  min-height: calc(100vh - 50px);
  padding: 8px 10px;
}
#stockMain .stock-control-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 62px);
}
#stockMain .stock-top-table-area {
  flex: 1 1 auto;
  min-height: 0;
}
#stockMain .stock-items-list {
  flex: 1 1 auto;
  min-height: 0;
}
#stockMain .stock-table-wrap-tall {
  height: calc(100vh - 210px) !important;
  min-height: calc(100vh - 210px) !important;
  max-height: none !important;
  overflow: auto;
}
#stockMain .stock-collapsible-panel[open] ~ .stock-top-table-area .stock-table-wrap-tall,
#stockMain .stock-controls-top:has(.stock-collapsible-panel[open]) + .stock-top-table-area .stock-table-wrap-tall {
  height: calc(100vh - 360px) !important;
  min-height: 480px !important;
}
.manual-sku-search-table td {
  vertical-align: middle;
}

/* V156 Stock Control uses normal page scrolling like Tracking, not a small internal vertical box. */
#stockMain.wrap.unlocked {
  max-width: none !important;
  width: 100vw !important;
  min-height: calc(100vh - 38px) !important;
  padding: 6px 8px !important;
}
#stockMain .stock-control-card {
  min-height: auto !important;
  display: block !important;
}
#stockMain .stock-top-table-area,
#stockMain .stock-items-list {
  display: block !important;
  min-height: 0 !important;
}
#stockMain .stock-table-wrap-tall {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
}
#stockMain .stock-table {
  min-width: 1680px;
}
#stockMain .stock-pagination {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: rgba(248, 250, 252, .96);
  backdrop-filter: blur(3px);
}
.order-priority-quick-panel {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 12px;
  padding: 10px;
  margin-top: 10px;
}
.order-priority-quick-panel .manager-row {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.order-priority-quick-panel select,
.order-priority-quick-panel input {
  min-height: 36px;
}


/* V157 Stock Control: remove accidental internal vertical scrollbar.
   The page should scroll vertically, while only the wide table scrolls horizontally. */
#stockMain .stock-control-card {
  overflow: visible !important;
}
#stockMain .stock-table-wrap,
#stockMain .stock-table-wrap-tall {
  max-height: none !important;
  height: auto !important;
  min-height: 0 !important;
  overflow-x: auto !important;
  overflow-y: clip !important;
}
#stockMain .stock-table-wrap-tall table {
  margin-bottom: 0 !important;
}
#stockMain .stock-pagination {
  position: static !important;
}

/* V158: Stock Control should scroll with the page, like Tracking.
   Remove the extra inner vertical scrollbar and make the table fit the viewport. */
#stockMain.wrap.unlocked,
#stockMain,
#stockMain .stock-control-card,
#stockMain .stock-top-table-area,
#stockMain .stock-items-list {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}
#stockMain .stock-table-wrap,
#stockMain .stock-table-wrap-tall {
  display: block !important;
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
}
#stockMain .stock-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important;
}
#stockMain .stock-table-readable th,
#stockMain .stock-table-readable td {
  white-space: normal !important;
}
#stockMain .stock-table-readable td:nth-child(1) {
  min-width: 170px !important;
}
#stockMain .stock-table-readable td:nth-child(2) {
  min-width: 260px !important;
}
#stockMain .stock-ebay-cell {
  min-width: 130px !important;
  max-width: 220px;
  overflow-wrap: anywhere;
}
#stockMain .stock-pagination {
  position: static !important;
}

/* V160 Statistics module polish and duplicate-control cleanup */
.statistic-main {
  max-width: none;
  width: calc(100vw - 24px);
}
.statistic-card {
  overflow: visible;
}
.statistic-toolbar input[type="number"] {
  width: 90px;
  margin: 0 6px;
}
.statistic-toolbar input[type="time"] {
  width: 120px;
  margin: 0 6px;
}
.statistic-toolbar #statisticSearchInput {
  min-width: 320px;
}
.statistic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.statistic-summary-box {
  margin-top: 12px;
}
.statistic-table-wrap {
  max-height: none;
  overflow: visible;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
}
.statistic-table-wrap-tall {
  max-height: none;
}
.statistic-table th {
  position: sticky;
  top: 0;
  background: #e5edf7;
  z-index: 2;
}
.statistic-table th,
.statistic-table td {
  white-space: nowrap;
}
@media (max-width: 1000px) {
  .statistic-grid {
    grid-template-columns: 1fr;
  }
  .statistic-toolbar #statisticSearchInput {
    min-width: 220px;
  }
}


/* V163 Done history paging */
.done-history-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.done-history-controls select,
.done-history-controls input[type="date"] {
  min-height: 38px;
}
.done-history-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* V163 Click & Drop duplicate-send guard */

/* V170 marketplace account layout cleanup */
.marketplace-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
  align-items: start;
}
.marketplace-account-card {
  border: 1px solid var(--border, #d5dfec);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.marketplace-account-card.is-inactive {
  opacity: 0.75;
}
.mp-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8eef6;
}
.mp-card-title {
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.mp-card-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px 0;
}
.mp-card-section {
  min-width: 0;
  overflow-wrap: anywhere;
}
.mp-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid #e8eef6;
  padding-top: 10px;
}
.mp-status-line {
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  max-height: 3.8em;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.auto-import-inline.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 6px 0;
}
.auto-import-inline.compact label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 12px;
}
.auto-import-inline.compact input[type="number"] {
  width: 68px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.status-ok {
  background: #dcfce7;
  color: #166534;
}
.status-muted {
  background: #e5e7eb;
  color: #475569;
}

/* V179: B&Q / Mirakl cannot be dispatched without a tracking number. */
.tracking-disabled-action,
.tracking-disabled-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(1);
}
/* V180: make disabled B&Q no-tracking action visibly pale grey, not orange. */
#trackingBulkNoTrackingBtn.tracking-disabled-action,
#trackingBulkNoTrackingBtn.tracking-disabled-action:disabled,
.tracking-disabled-action,
.tracking-disabled-action:disabled {
  background: #e5e7eb !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  filter: grayscale(1);
}

/* V184: Monthly Sales / HMRC dashboard and archive UI. */
.hmrc-dashboard-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
}
.hmrc-dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.hmrc-year-tools input {
  min-width: 130px;
}
.hmrc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.hmrc-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}
.hmrc-chart-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  overflow-x: auto;
}
.hmrc-chart-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.hmrc-svg-chart {
  width: 100%;
  min-width: 680px;
  height: 310px;
}
.hmrc-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
}
.hmrc-axis-line {
  stroke: #64748b;
  stroke-width: 1.5;
}
.hmrc-axis-text {
  fill: #475569;
  font-size: 12px;
}
.hmrc-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
}
.hmrc-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hmrc-chart-legend i {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 999px;
}
.hmrc-marketplace-table {
  width: 100%;
  margin-top: 12px;
}

/* V203 Operations / Stability Pack */
.system-health-main,
.tracking-main,
.hmrc-main {
  max-width: 1800px;
}
.system-health-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.system-health-grid section {
  min-width: 0;
}
.system-health-kpis .hmrc-kpi-card b {
  font-size: 1.35rem;
}
.health-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(0,0,0,0.12);
}
.health-green {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.health-amber {
  background: #fef3c7;
  color: #92400e;
  border-color: #fbbf24;
}
.health-red {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.health-muted {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}
.tracking-audit-help {
  margin: 10px 0;
}
.tracking-audit-modal .safe-panel {
  margin-top: 12px;
}
.tracking-audit-table th {
  width: 260px;
  text-align: left;
  white-space: nowrap;
  background: #f8fafc;
}
.tracking-audit-table td {
  word-break: break-word;
}
.backup-command-box pre {
  background: #111827;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 10px;
  overflow: auto;
  white-space: pre-wrap;
}
@media (max-width: 900px) {
  .system-health-grid {
    grid-template-columns: 1fr;
  }
}

/* V215 security transition: Maintenance controls and security self-test layout. */
.system-health-card .checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.system-health-card .checkbox-line input[type="checkbox"] {
  width: 22px;
  height: 22px;
}
