* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e3e6ea;
  --border-strong: #d5d9df;
  --text: #17191c;
  --muted: #6f7680;
  --soft: #f8f9fb;
  --soft-2: #f1f3f6;
  --accent: #111827;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --warning: #8a4b08;
  --warning-bg: #fff8e8;
  --success: #176b3a;
  --success-bg: #edf9f1;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.05);
}

body {
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;

  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.page {
  width: calc(100% - 40px);
  max-width: none;
  margin: 0 20px;
  padding: 20px 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.6px;
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: visible;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.master-po-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
}
.panel-title {
  font-size: 17px;
  font-weight: 700;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.panel-body {
  padding: 20px;
}

textarea {
  width: 100%;
  min-height: 145px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  outline: none;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  line-height: 1.5;
}

textarea:focus,
input:focus,
select:focus {
  border-color: #8d96a3;
  outline: none;
  box-shadow: 0 0 0 3px rgba(17,24,39,.05);
}

.btn {
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  padding: 8px 13px;
  font-weight: 600;
}

.btn:hover {
  background: var(--soft);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #252b36;
}

.btn-danger {
  color: var(--danger);
  border-color: #efc5c0;
  background: #fff;
}

.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

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

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

.status.working {
  color: var(--warning);
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--danger);
  white-space: pre-wrap;
}

.stats {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.4px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.field input,
.field select {
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  padding: 7px 10px;
  min-width: 130px;
}

.field.search input {
  min-width: 250px;
}

.filter-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-tab {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 650;
}

.filter-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.supplier-sheet .table-wrap {
  overflow: visible;
  max-width: none;
}
.master-po-table-wrap {
  overflow: visible;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 1220px;
}

th {
  position: sticky;
  top: 98px;
  z-index: 2;
  background: #f7f8fa;
  color: #505762;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .45px;
  font-weight: 750;
}
.master-po-table-wrap th {
  position: sticky;
  top: 75px;
  z-index: 25;
  background: #f7f8fa;
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: #fafbfc;
}

.sku {
  font-weight: 750;
}

.common-name {
  max-width: 390px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supplier {
  font-weight: 700;
}

.qty-input {
  width: 92px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 5px 8px;
  font-weight: 650;
  background: #fff;
}

.money-main {
  font-weight: 750;
}

.money-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}

.pill-tier {
  background: var(--warning-bg);
  color: var(--warning);
  cursor: pointer;
  border: 1px solid #f1d6a7;
}

.pill-ok {
  color: var(--success);
  background: var(--success-bg);
}

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

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

.supplier-section {
  margin-top: 18px;
}

.supplier-grid {
  display: grid;
  gap: 12px;
  align-items: start;
}

.supplier-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  min-width: 0;
  width: 100%;
  overflow: visible;
}

.supplier-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  position: sticky;
top: 0;
z-index: 20;
background: #fff;
  min-width: 0;
}

.supplier-name {
  font-size: 16px;
  font-weight: 800;
}

.supplier-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.supplier-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
flex-shrink: 0;
}

.supplier-sheet {
  border-top: 1px solid transparent;
  padding: 0 14px;
  background: #fbfcfd;
  max-width: 100%;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 180ms ease-out,
    opacity 120ms ease-out,
    transform 180ms ease-out,
    padding 180ms ease-out,
    border-color 180ms ease-out;
}

.supplier-sheet.open {
  border-top-color: var(--border);
  padding: 14px;
  /* Large suppliers can exceed 5,000px (e.g. 300+ lines). Never clip rows. */
  max-height: none;
  opacity: 1;
  transform: translateY(0);
}

.supplier-sheet table {
  min-width: 900px;
}

.supplier-sheet thead {
  position: sticky;
  top: 58px;
  z-index: 18;
}

.supplier-sheet thead th {
  position: static;
  background: #f7f8fa;
}

.tier-detail {
  margin-top: 7px;
  color: var(--warning);
  font-size: 11px;
  font-weight: 650;
}

.supplier-summary-bar {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
background: #fff;
padding: 10px 0;
}

.supplier-summary-bar strong {
  color: var(--text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 28, .42);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

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

.modal {
  width: min(460px, 100%);
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow:
    0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}

.modal-body {
  padding: 22px;
}

.modal-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-text {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.modal-actions {
  border-top: 1px solid var(--border);
  padding: 13px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #111827;
  color: #fff;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  box-shadow:
    0 12px 30px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s ease;
  z-index: 150;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .page {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
  }

  .stats {
    grid-template-columns:
      repeat(2, minmax(140px, 1fr));
  }
}

@media print {
  body {
    background: white;
  }

  .no-print {
    display: none !important;
  }
}
.costing-grid-table {
  width: 100%;
  table-layout: fixed;
}

.costing-grid-table th,
.costing-grid-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.costing-grid-table th:nth-child(1),
.costing-grid-table td:nth-child(1) {
  width: 130px;
}

.costing-grid-table th:nth-child(2),
.costing-grid-table td:nth-child(2) {
  width: 320px;
}

.costing-grid-table th:nth-child(3),
.costing-grid-table td:nth-child(3) {
  width: 140px;
}

.costing-grid-table th:nth-child(4),
.costing-grid-table td:nth-child(4) {
  width: 220px;
}

.costing-grid-table th:nth-child(5),
.costing-grid-table td:nth-child(5) {
  width: 90px;
}

.costing-grid-table th:nth-child(6),
.costing-grid-table td:nth-child(6) {
  width: 90px;
}

.costing-grid-table th:nth-child(7),
.costing-grid-table td:nth-child(7) {
  width: 90px;
}
.costing-grid-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.costing-search-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  flex: 1;
}

.costing-search-field label {
  font-size: 12px;
  font-weight: 700;
  color: #5f6672;
}

.costing-search-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
}

.costing-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  background: white;
  border: 1px solid #d8dce3;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.costing-search-suggestion {
  padding: 9px 10px;
  cursor: pointer;
  border-bottom: 1px solid #eef0f3;
}

.costing-search-suggestion:last-child {
  border-bottom: 0;
}

.costing-search-suggestion:hover {
  background: #f5f6f8;
}

.costing-search-suggestion-main {
  font-weight: 700;
}

.costing-search-suggestion-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #6f7680;
}
/* Costing Manager search-first empty state */

#costing-results-area {
  min-height: 360px;
}

.costing-empty-state {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #d9dde5;
  border-radius: 12px;
  margin-top: 16px;
  padding: 32px;
  box-sizing: border-box;
}

.costing-empty-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.costing-empty-text {
  font-size: 14px;
  color: #6f7680;
  max-width: 480px;
  line-height: 1.5;
}
.costing-active-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  height: 38px;
  padding: 0 4px;
  font-size: 14px;
}

#costing-refresh-btn {
  height: 38px;
  padding: 0 14px;
}

@media (max-width: 1100px) {
  .costing-grid-toolbar {
    align-items: stretch;
  }

  .costing-active-toggle,
  #costing-refresh-btn {
    height: 38px;
  }
}
.costing-summary-table th:nth-child(1),
.costing-summary-table td:nth-child(1) {
  width: 14%;
}

.costing-summary-table th:nth-child(2),
.costing-summary-table td:nth-child(2) {
  width: 34%;
}

.costing-summary-table th:nth-child(3),
.costing-summary-table td:nth-child(3) {
  width: 18%;
}

.costing-summary-table th:nth-child(4),
.costing-summary-table td:nth-child(4) {
  width: 18%;
}

.costing-summary-table th:nth-child(5),
.costing-summary-table td:nth-child(5) {
  width: 16%;
}
/* Costing Manager compact table layout */

.costing-summary-table {
  width: 100%;
  table-layout: fixed;
}

.costing-summary-table th:nth-child(1),
.costing-summary-table td:nth-child(1) {
  width: 34px;
  padding-left: 10px;
  padding-right: 2px;
  text-align: center;
}

.costing-summary-table th:nth-child(2),
.costing-summary-table td:nth-child(2) {
  width: 150px;
  padding-left: 4px;
}

.costing-summary-table th:nth-child(3),
.costing-summary-table td:nth-child(3) {
  width: auto;
}

.costing-summary-table th:nth-child(4),
.costing-summary-table td:nth-child(4) {
  width: 170px;
}

.costing-summary-table th:nth-child(5),
.costing-summary-table td:nth-child(5) {
  width: 140px;
}

.costing-summary-table th:nth-child(6),
.costing-summary-table td:nth-child(6) {
  width: 120px;
  white-space: nowrap;
}

.costing-summary-table td:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Costing Manager product-name delayed preview */

.costing-product-name {
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}

.costing-name-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 460px;
  padding: 12px 14px;

  background: #fff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);

  font-size: 13px;
  line-height: 1.45;
  white-space: normal;

  user-select: text;
  cursor: text;
}
/* Costing Manager batch supplier picker */

.costing-batch-supplier-panel {
  margin: 8px 0 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.costing-batch-panel-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.costing-batch-supplier-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.costing-batch-supplier-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;

  background: #fff;
  border: 1px solid #d5d9df;
  border-radius: 6px;

  font-size: 13px;
  cursor: pointer;
}

.costing-batch-supplier-option:hover {
  background: #f5f7fa;
  border-color: #aeb6c2;
}

.costing-batch-coverage {
  font-size: 12px;
  color: #68707c;
  white-space: nowrap;
}
/* Costing Manager batch editor */

.costing-batch-price-editor {
  margin: 8px 0 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.costing-batch-editor-summary {
  margin-bottom: 10px;
  font-size: 12px;
  color: #68707c;
}

.costing-batch-editor-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.costing-batch-editor-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.costing-batch-editor-fields input,
.costing-batch-editor-fields select {
  min-width: 120px;
  padding: 6px 8px;
}

.costing-batch-missing-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e8ec;
}

.costing-batch-missing-note {
  margin-bottom: 8px;
  font-size: 12px;
  color: #68707c;
}

.costing-batch-missing-row {
  display: grid;
  grid-template-columns: 160px minmax(180px, 320px);
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.costing-batch-missing-row input {
  padding: 6px 8px;
}
/* Compact batch costing toolbar */

.costing-batch-compact-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
}

.costing-batch-toolbar-group label,
.costing-batch-inline-editor label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.costing-batch-toolbar-group select {
  min-width: 210px;
  padding: 6px 8px;
}

.costing-batch-inline-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.costing-batch-inline-editor input,
.costing-batch-inline-editor select {
  min-width: 95px;
  padding: 6px 8px;
}

.costing-batch-remove-btn {
  margin-left: 4px;
}

.costing-batch-missing-inline {
  flex-basis: 100%;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e5e8ec;
}
/* Costing Manager - selected batch action */
.costing-batch-bar button.costing-batch-action-active {
  background: #1f2937;
  color: #ffffff;
  border-color: #1f2937;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(31, 41, 55, 0.15);
}
/* =========================================
   COSTING MANAGER - SEARCHABLE SUPPLIER
========================================= */

.costing-supplier-picker-label {
  position: relative;
}

.costing-supplier-picker {
  position: relative;
  min-width: 230px;
}

.costing-supplier-input-wrap {
  display: flex;
  align-items: stretch;
}

.costing-supplier-input-wrap input {
  width: 100%;
  min-width: 0;
  border-radius: 6px 0 0 6px;
}

.costing-supplier-dropdown-toggle {
  width: 38px;
  padding: 0;
  border-left: 0;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
}

.costing-supplier-suggestions {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 1000;

  max-height: 280px;
  overflow-y: auto;

  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  padding: 5px;
}

.costing-supplier-suggestion,
.costing-supplier-add-new {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 5px;
}

.costing-supplier-suggestion:hover {
  background: #f3f4f6;
}

.costing-supplier-add-new {
  font-weight: 700;
}

.costing-supplier-add-new:hover {
  background: #f3f4f6;
}

.costing-supplier-suggestion-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

.costing-supplier-no-results {
  padding: 10px;
  color: #6b7280;
  font-size: 13px;
}
/* =========================================
   COSTING MANAGER - ADD NEW SUPPLIER
========================================= */

.costing-add-new-supplier-form {
  position: absolute;
  z-index: 1100;
  margin-top: 6px;
  width: 320px;
  padding: 14px;

  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
}

.costing-add-new-supplier-form label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

.costing-add-new-supplier-form input[type="text"],
.costing-add-new-supplier-form input[type="number"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
}

.costing-add-supplier-title {
  font-weight: 700;
  font-size: 15px;
}

.costing-add-supplier-checkbox {
  display: flex !important;
  align-items: center;
  gap: 6px;
}

.costing-add-supplier-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
/* =========================================
   COSTING MANAGER - INLINE CONFIRM
========================================= */

.costing-inline-confirm {
  position: fixed;
  z-index: 2000;
  width: 290px;
  box-sizing: border-box;
  padding: 14px;

  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.costing-inline-confirm-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.costing-inline-confirm-detail {
  font-size: 13px;
  line-height: 1.4;
}

.costing-inline-confirm-note {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

.costing-inline-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
}

.costing-remove-quote-btn {
  margin-left: 6px;
}
/* =========================================
   COSTING MANAGER - COMPACT COLUMN SPACING
========================================= */

/* Main summary table */
.costing-summary-table th:nth-child(1),
.costing-summary-table td:nth-child(1) {
  width: 34px;
}

.costing-summary-table th:nth-child(2),
.costing-summary-table td:nth-child(2) {
  width: 150px;
}

.costing-summary-table th:nth-child(4),
.costing-summary-table td:nth-child(4) {
  width: 170px;
}

.costing-summary-table th:nth-child(5),
.costing-summary-table td:nth-child(5) {
  width: 110px;
}

.costing-summary-table th:nth-child(6),
.costing-summary-table td:nth-child(6) {
  width: 120px;
}

/* Expanded supplier quote table */
.costing-quote-detail-row .costing-grid-table {
  table-layout: fixed;
  width: 100%;
}
.costing-quote-detail-row .costing-grid-table th {
  position: static;
  top: auto;
  z-index: auto;
}

.costing-quote-detail-row .costing-grid-table th:nth-child(1),
.costing-quote-detail-row .costing-grid-table td:nth-child(1) {
  width: 16%;
}

.costing-quote-detail-row .costing-grid-table th:nth-child(2),
.costing-quote-detail-row .costing-grid-table td:nth-child(2) {
  width: 38%;
}

.costing-quote-detail-row .costing-grid-table th:nth-child(3),
.costing-quote-detail-row .costing-grid-table td:nth-child(3) {
  width: 12%;
}

.costing-quote-detail-row .costing-grid-table th:nth-child(4),
.costing-quote-detail-row .costing-grid-table td:nth-child(4) {
  width: 10%;
}

.costing-quote-detail-row .costing-grid-table th:nth-child(5),
.costing-quote-detail-row .costing-grid-table td:nth-child(5) {
  width: 10%;
}

.costing-quote-detail-row .costing-grid-table th:nth-child(6),
.costing-quote-detail-row .costing-grid-table td:nth-child(6) {
  width: 14%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.costing-remove-quote-btn {
  margin-left: 6px;
  white-space: nowrap;
}
/* Costing Manager - clickable master rows */
.costing-summary-clickable {
  cursor: pointer;
}

.costing-summary-clickable:hover {
  background: #f8fafc;
}

.costing-summary-clickable.costing-summary-open {
  background: #f8fafc;
}
.costing-undo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 3000;

  display: flex;
  align-items: center;
  gap: 18px;

  padding: 11px 14px;
  border-radius: 8px;
  background: #1f2937;
  color: white;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 13px;
}

.costing-undo-toast-button {
  border: 0;
  background: transparent;
  color: white;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}

.costing-undo-toast-button:disabled {
  opacity: 0.6;
  cursor: default;
}
.costing-permanent-undo {
  margin: 10px 0 12px;
  padding: 8px 12px;

  border: 1px solid #d1d5db;
  border-radius: 7px;

  background: white;
  color: #111827;

  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.costing-permanent-undo:hover {
  background: #f9fafb;
}

.costing-permanent-undo:disabled {
  opacity: 0.55;
  cursor: default;
}
.master-po-row,
.supplier-po-row {
  cursor: pointer;
}
.supplier-sheet tbody {
  user-select: none;
  -webkit-user-select: none;
}

.supplier-sheet .qty-input {
  user-select: text;
  -webkit-user-select: text;
}
.master-po-row.selected > td:not(:nth-child(1)):not(:nth-child(2)),
.supplier-po-row.selected > td:not(:nth-child(1)):not(:nth-child(2)) {
  background: rgba(59, 130, 246, 0.14);
}
.master-selectable-cell {
  cursor: cell;
}

.master-selectable-cell.selected-cell,
.supplier-selectable-cell.selected-cell {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}
.drag-col,
.drag-handle-cell {
  width: 22px;
  text-align: center;
}

.drag-handle {
  cursor: grab;
  user-select: none;
  font-size: 18px;
  line-height: 1;
  opacity: 0.65;
}

.drag-handle:active {
  cursor: grabbing;
}
#costing-batch-grid {
  width: 100%;
}

.costing-batch-grid-row {
  display: grid;
  grid-template-columns:
  minmax(100px, 0.6fr)
  minmax(600px, 4.5fr)
  minmax(250px, 1.7fr)
  minmax(55px, 0.3fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.costing-batch-grid-header {
  font-weight: 700;
  margin-bottom: 8px;
}

.costing-batch-grid-header > div {
  min-width: 0;
}

.costing-batch-cell {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.costing-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.costing-status-badge.is-active {
  background: #dcfce7;
  color: #166534;
}

.costing-status-badge.is-dead {
  background: #fee2e2;
  color: #991b1b;
}
.master-po-panel {
  background: #f3f7ff;
}
.recon-status-col,
.recon-status-cell {
  width: 52px;
  text-align: center;
}

.recon-icon.reconciled {
  color: #16a34a;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}
.supplier-card-header.reconciled-complete {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
[hidden] {
  display: none !important;
}
.master-po-panel {
  background: #dbeafe !important;
}
.app-tabs {
  display: flex;
  align-items: center;
  width: 100%;
}
.po-save-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.po-save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.po-save-status.saving .po-save-dot {
  background: #f59e0b;
}

.po-save-status.error .po-save-dot {
  background: #ef4444;
}

.po-save-status.saving .po-save-text {
  color: #b45309;
}

.po-save-status.error .po-save-text {
  color: #dc2626;
}
.supplier-po-sent.is-sent {
  background: #ff5a1f;
  color: #ffffff;
  border-color: #ff5a1f;
  font-weight: 700;
  border-radius: 999px;
}
.incoming-table {
  display: table;
}

.incoming-table thead {
  display: table-header-group;
}

.incoming-table tbody {
  display: table-row-group;
}
.incoming-table th {
  position: static;
  top: auto;
}


/* Master PO reconciliation status */
.master-recon-status-col,
.master-recon-status-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}
.master-recon-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}


.supplier-header-toggle {
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 8px;
}

.supplier-header-toggle:hover {
  background: rgba(15, 23, 42, 0.035);
}

.supplier-header-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
}


.master-po-header-toggle {
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 8px;
}

.master-po-header-toggle:hover {
  background: rgba(15, 23, 42, 0.035);
}

.master-po-header-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
}

.multi-select {
  position: relative;
  min-width: 180px;
}

.multi-select-button {
  width: 100%;
  min-height: 38px;
  padding: 8px 30px 8px 10px;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  color: inherit;
  background: #fff;
  border: 1px solid #d7dce3;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.multi-select-button::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
}

.multi-select-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  width: 240px;
  max-height: 310px;
  overflow: hidden;
  padding: 8px;
  background: #fff;
  border: 1px solid #d7dce3;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
}

.multi-select-search {
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  margin: 0 0 6px;
  padding: 6px 9px;
  font: inherit;
  font-size: 13px;
  border: 1px solid #d7dce3;
  border-radius: 7px;
  outline: none;
}

.multi-select-search:focus {
  border-color: #9aa6b2;
}

.multi-select-options {
  max-height: 250px;
  overflow-y: auto;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  color: inherit;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.multi-select-option:hover {
  background: rgba(15, 23, 42, .045);
}

.multi-select-option input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  box-sizing: border-box !important;
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
  max-height: 14px !important;
  flex: 0 0 14px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #aab2bc;
  border-radius: 3px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.multi-select-option input[type="checkbox"]::before {
  content: "✓";
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: #2563eb;
  transform: scale(0);
}

.multi-select-option input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* Suppliers Incoming */
.incoming-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 6px 0 18px;
}
.incoming-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.incoming-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  box-shadow: 0 5px 18px rgba(0,0,0,.035);
}
.incoming-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}
.incoming-stat strong {
  font-size: 24px;
  letter-spacing: -.4px;
}
.incoming-dashboard-panel {
  overflow: visible;
}
.incoming-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.incoming-view-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--soft-2);
  border-radius: 8px;
}
.incoming-view-tab {
  border: 0;
  background: transparent;
  padding: 7px 11px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.incoming-view-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.incoming-search {
  width: 260px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.incoming-orders {
  padding: 8px;
}
.incoming-order-card {
  border: 1px solid transparent;
  border-bottom-color: var(--border);
  background: #fff;
  overflow: visible;
}
.incoming-order-card:last-child {
  border-bottom-color: transparent;
}
.incoming-order-card.is-escalated {
  border-left: 3px solid #b42318;
}
.incoming-order-summary {
  width: 100%;
  border: 0;
  background: #fff;
  position: sticky;
  top: 8px;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(180px, .9fr) minmax(130px, .65fr) 110px 95px 22px;
  align-items: center;
  gap: 18px;
  padding: 15px 14px;
  text-align: left;
}
.incoming-order-summary:hover {
  background: #fafbfc;
}
.incoming-order-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}
.incoming-order-title > span:not(.incoming-escalation-badge) {
  color: var(--muted);
}
.incoming-order-meta,
.incoming-progress-copy span,
.incoming-last-received span,
.incoming-workspace-note,
.incoming-receive-actions > span {
  color: var(--muted);
  font-size: 11px;
}
.incoming-order-meta {
  margin-top: 4px;
}
.incoming-order-commercials {
  display: flex;
  gap: 10px;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #3f4650;
}
.incoming-order-commercials span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--muted);
}
.incoming-fx-equivalents {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.incoming-order-value {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}
.incoming-order-value small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}
.incoming-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.incoming-progress {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  background: #eceff2;
  border-radius: 999px;
}
.incoming-progress span {
  display: block;
  height: 100%;
  background: #2563eb;
  border-radius: inherit;
}
.incoming-last-received {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.incoming-last-received strong {
  font-size: 12px;
  font-weight: 600;
}
.incoming-summary-print {
  justify-self: center;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text);
  background: #f5f6f7;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.incoming-summary-print:hover {
  background: #eceef1;
}
.incoming-summary-print:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.incoming-status,
.incoming-escalation-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.incoming-status {
  padding: 5px 8px;
}
.incoming-status-awaiting {
  color: #5f6670;
  background: #f0f2f4;
}
.incoming-status-partial {
  color: #8a4b08;
  background: #fff3d6;
}
.incoming-status-complete {
  color: #176b3a;
  background: #eaf7ef;
}
.incoming-escalation-badge {
  color: #b42318;
  background: #fff0ee;
  padding: 3px 7px;
}
.incoming-chevron {
  color: var(--muted);
  font-size: 15px;
  text-align: right;
}
.incoming-workspace {
  margin: 0 12px 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
}
.incoming-workspace-head,
.incoming-receive-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.incoming-section-label {
  font-size: 13px;
  font-weight: 700;
}
.incoming-table-wrap {
  overflow-x: auto;
  margin: 13px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.incoming-table {
  width: 100%;
  border-collapse: collapse;
  display: table;
}
.incoming-table th,
.incoming-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-align: left;
}
.incoming-table th {
  color: var(--muted);
  font-size: 11px;
  background: #fafbfc;
}
.incoming-order-card .incoming-workspace > .incoming-table-wrap {
  overflow: visible;
}
.incoming-order-card .incoming-workspace > .incoming-table-wrap > .incoming-table > thead th {
  position: sticky;
  top: 82px;
  z-index: 39;
  background: #fafbfc;
  box-shadow: 0 1px 0 var(--border);
}
.incoming-table tr:last-child td {
  border-bottom: 0;
}
.incoming-receive-input {
  width: 100px;
  height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
}
.incoming-done {
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}
.incoming-escalate.is-escalated {
  color: var(--danger);
  border-color: #efc5c0;
  background: var(--danger-bg);
}
.incoming-history {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.incoming-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.incoming-history-row > div {
  display: flex;
  gap: 9px;
  align-items: baseline;
}
.incoming-history-row span,
.incoming-empty-history {
  color: var(--muted);
  font-size: 11px;
}
.incoming-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  min-height: 170px;
  color: var(--muted);
  font-size: 13px;
}
.incoming-empty strong {
  color: var(--text);
}
@media (max-width: 1200px) {
  .incoming-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 900px) {
  .incoming-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .incoming-order-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .incoming-last-received {
    display: none;
  }
  .incoming-summary-print {
    justify-self: start;
  }
}

.incoming-history-batch {
  border-bottom: 1px solid var(--border);
}
.incoming-history-batch > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 7px 2px;
  cursor: pointer;
  font-size: 12px;
}
.incoming-history-batch > summary::-webkit-details-marker {
  display: none;
}
.incoming-history-batch > summary > div:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}
.incoming-history-batch > summary span {
  color: var(--muted);
}
.incoming-history-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.incoming-history-chevron {
  transition: transform .15s ease;
}
.incoming-history-batch[open] .incoming-history-chevron {
  transform: rotate(180deg);
}
.incoming-history-detail {
  padding: 0 0 12px;
}
.incoming-history-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.incoming-history-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}
.incoming-history-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}
.incoming-audit-badge {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef3ff;
  color: #315da8 !important;
  font-size: 10px;
  font-weight: 700;
}
.incoming-audit-badge.voided {
  background: #fff0ee;
  color: var(--danger) !important;
}
.incoming-history-batch.is-voided > summary {
  opacity: .6;
}

.incoming-history-edit-input {
  width: 92px;
  height: 30px;
  padding: 4px 7px;
  border: 1px solid #9aa6b2;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}
.incoming-edit-audit {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #f5f7fa;
  font-size: 11px;
}
.incoming-edit-audit > strong {
  display: block;
  margin-bottom: 6px;
}
.incoming-edit-audit > div {
  display: flex;
  gap: 14px;
  padding: 4px 0;
  color: var(--muted);
}
.incoming-edit-audit > div span:first-child {
  min-width: 155px;
}

/* Keep incoming tables inside the viewport */
.incoming-table {
  table-layout: fixed;
}
.incoming-table th:nth-child(1),
.incoming-table td:nth-child(1) {
  width: 120px;
}
.incoming-table th:nth-child(2),
.incoming-table td:nth-child(2) {
  width: 38%;
  max-width: 420px;
}
.incoming-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.incoming-table th:nth-child(n+3),
.incoming-table td:nth-child(n+3) {
  width: 110px;
}
.incoming-history-table th:nth-child(2),
.incoming-history-table td:nth-child(2) {
  width: 36%;
  max-width: 380px;
}

.incoming-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
#incomingUndo:disabled {
  opacity: .45;
  cursor: default;
}

.incoming-order-actions,.incoming-order-editbar,.incoming-edit-order-savebar,.incoming-bulk-add-actions{display:flex;align-items:center;gap:8px}
.incoming-order-editbar{margin:10px 0;padding:10px 12px;border:1px solid #e5e7eb;border-radius:8px;justify-content:space-between}
.incoming-bulk-add-panel{margin:10px 0;padding:14px;border:1px solid #dbe2ea;border-radius:10px;display:grid;gap:8px;background:#fafafa}
.incoming-bulk-add-panel span{font-size:12px;color:#64748b}
.incoming-bulk-add-input{width:100%;min-height:110px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;resize:vertical}
.incoming-bulk-add-actions,.incoming-edit-order-savebar{justify-content:flex-end}
.incoming-edit-order-savebar{margin:10px 0}
.incoming-order-qty-input{width:90px}
.incoming-edit-remove-cell{width:84px}

/* Suppliers Incoming V2 — transmit-back action */
.incoming-transmit-back {
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.incoming-transmit-back:hover {
  background: var(--soft-2);
  transform: translateY(-1px);
}
.incoming-receive-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.incoming-confirm-popover{position:fixed;z-index:10000;width:360px;padding:18px;background:var(--panel);border:1px solid var(--border);border-radius:16px;box-shadow:0 18px 50px rgba(0,0,0,.16);animation:incomingPop .14s ease-out}
.incoming-confirm-popover:after{content:"";position:absolute;bottom:-7px;left:50%;width:12px;height:12px;background:var(--panel);border-right:1px solid var(--border);border-bottom:1px solid var(--border);transform:translateX(-50%) rotate(45deg)}
.incoming-confirm-eyebrow{font-size:10px;font-weight:800;letter-spacing:.12em;color:var(--muted);margin-bottom:7px}
.incoming-confirm-title{font-size:17px;font-weight:750;letter-spacing:-.02em;color:var(--text)}
.incoming-confirm-ref{margin-top:4px;font-size:12px;color:var(--muted)}.incoming-confirm-ref span{padding:0 3px}
.incoming-confirm-copy{margin-top:14px;padding:11px 12px;background:var(--soft);border-radius:10px;font-size:12px;line-height:1.55}.incoming-confirm-copy div+div{margin-top:3px}
.incoming-confirm-note{margin-top:10px;font-size:11px;line-height:1.45;color:var(--muted)}
.incoming-confirm-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:15px}
@keyframes incomingPop{from{opacity:0;transform:translateY(4px) scale(.985)}to{opacity:1;transform:none}}
@media(max-width:520px){.incoming-confirm-popover{width:calc(100vw - 32px)}}


/* Defective Items intentionally reuses the PO Generator classes for a carbon-copy layout. */
#defective-items-page .defective-create-body{padding-top:0}
#defective-items-page .defective-supplier-badge{display:inline-flex;align-items:center;padding:3px 7px;border-radius:999px;background:#fff0ee;color:#b42318;font-size:10px;font-weight:800;margin-left:6px}


/* ==========================================================
   ENZALADA — REFINED SYSTEM UI
   Visual-only layer. No workflow, controls, IDs, or behavior changed.
   ========================================================== */

:root{
  --bg:#f5f5f7;
  --panel:rgba(255,255,255,.92);
  --border:rgba(0,0,0,.085);
  --border-strong:rgba(0,0,0,.14);
  --text:#1d1d1f;
  --muted:#6e6e73;
  --soft:#f5f5f7;
  --soft-2:#ececf0;
  --accent:#1d1d1f;
  --accent-blue:#0071e3;
  --danger:#c9342f;
  --danger-bg:#fff1f0;
  --warning:#9a5b00;
  --warning-bg:#fff7e6;
  --success:#16803b;
  --success-bg:#edf8f0;
  --radius:18px;
  --shadow:0 1px 2px rgba(0,0,0,.03),0 10px 34px rgba(0,0,0,.045);
}

html{
  background:#f5f5f7;
}

body{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Helvetica Neue",Helvetica,Arial,sans-serif;
  background:
    radial-gradient(circle at 22% -10%,rgba(255,255,255,.95),rgba(255,255,255,0) 34%),
    #f5f5f7;
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.page{
  width:calc(100% - 48px);
  margin:0 24px;
  padding:18px 0 36px;
}

/* Top application switcher */
.app-tabs{
  position:sticky;
  top:10px;
  z-index:80;
  width:max-content;
  max-width:100%;
  min-height:46px;
  padding:5px;
  gap:3px;
  margin:0 0 28px;
  border:1px solid rgba(0,0,0,.07);
  border-radius:15px;
  background:rgba(248,248,250,.78);
  box-shadow:0 8px 28px rgba(0,0,0,.07);
  backdrop-filter:saturate(180%) blur(22px);
  -webkit-backdrop-filter:saturate(180%) blur(22px);
}

.app-tab{
  min-height:34px;
  padding:7px 13px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:#55555a;
  font-size:13px;
  font-weight:590;
  letter-spacing:-.01em;
  transition:background .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}

.app-tab:hover{
  background:rgba(255,255,255,.64);
  color:#1d1d1f;
}

.app-tab:active{ transform:scale(.98); }

.app-tab.active{
  background:#fff;
  color:#1d1d1f;
  box-shadow:0 1px 2px rgba(0,0,0,.08),0 3px 10px rgba(0,0,0,.06);
}

.po-save-status{
  min-height:34px;
  margin-left:8px;
  padding:0 10px;
  border-left:1px solid rgba(0,0,0,.07);
  color:#727277;
  font-size:12px;
  font-weight:560;
}

.po-save-dot{width:7px;height:7px;background:#30b85a;box-shadow:0 0 0 3px rgba(48,184,90,.09)}

/* Typography */
h1,
.incoming-page-head h1{
  font-size:32px;
  line-height:1.08;
  font-weight:720;
  letter-spacing:-.035em;
}

.subtitle{
  margin-top:7px;
  color:#77777c;
  font-size:14px;
  letter-spacing:-.01em;
}

.panel-title{
  font-size:17px;
  font-weight:680;
  letter-spacing:-.018em;
}

.panel-subtitle{
  color:#77777c;
  font-size:12.5px;
  line-height:1.45;
}

/* Surfaces */
.panel,
.incoming-dashboard-panel{
  border:1px solid rgba(0,0,0,.07);
  border-radius:18px;
  background:rgba(255,255,255,.94);
  box-shadow:var(--shadow);
}

.panel-header{
  padding:17px 19px;
  border-bottom:1px solid rgba(0,0,0,.065);
  background:rgba(255,255,255,.82);
}

.panel-body{padding:18px}

.master-po-panel{
  background:rgba(255,255,255,.94) !important;
  overflow:clip;
}

.master-po-header{
  top:0;
  background:rgba(255,255,255,.9);
  backdrop-filter:saturate(160%) blur(18px);
  -webkit-backdrop-filter:saturate(160%) blur(18px);
}

.master-po-panel > .panel-body,
#defective-items-page .master-po-panel > .panel-body{
  background:linear-gradient(180deg,#f8f9fb 0%,#f3f4f7 100%);
}

/* Stats */
.stats,
.incoming-summary{
  gap:12px;
  margin-bottom:18px;
}

.stat,
.incoming-stat{
  position:relative;
  overflow:hidden;
  padding:17px 18px;
  border:1px solid rgba(0,0,0,.065);
  border-radius:16px;
  background:rgba(255,255,255,.88);
  box-shadow:0 1px 1px rgba(0,0,0,.02),0 7px 24px rgba(0,0,0,.035);
}

.stat::before,
.incoming-stat::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(135deg,rgba(255,255,255,.55),rgba(255,255,255,0) 55%);
}

.stat-label,
.incoming-stat span{
  color:#77777c;
  font-size:11.5px;
  font-weight:580;
  letter-spacing:-.005em;
}

.stat-value,
.incoming-stat strong{
  font-size:25px;
  line-height:1.1;
  font-weight:700;
  letter-spacing:-.04em;
}

/* Controls */
button,
input,
select,
textarea{
  transition:border-color .14s ease,box-shadow .14s ease,background .14s ease,transform .08s ease;
}

.btn,
.costing-mode-btn,
.incoming-view-tab{
  border:1px solid rgba(0,0,0,.1);
  border-radius:10px;
  background:rgba(255,255,255,.9);
  color:#1d1d1f;
  font-weight:590;
  box-shadow:0 1px 1px rgba(0,0,0,.02);
}

.btn:hover,
.costing-mode-btn:hover{
  background:#fff;
  border-color:rgba(0,0,0,.16);
}

.btn:active,
.costing-mode-btn:active{
  transform:scale(.985);
}

.btn-primary{
  background:#1d1d1f;
  color:#fff;
  border-color:#1d1d1f;
  box-shadow:0 2px 6px rgba(0,0,0,.12);
}

.btn-primary:hover{background:#000;border-color:#000}

.btn-danger{
  color:#c9342f;
  border-color:rgba(201,52,47,.2);
  background:rgba(255,255,255,.92);
}

.btn-danger:hover{background:#fff1f0}

.field label{
  color:#7a7a80;
  font-size:10.5px;
  font-weight:650;
  letter-spacing:.055em;
}

.field input,
.field select,
.qty-input,
.incoming-search,
.incoming-receive-input,
.incoming-order-qty-input,
.multi-select-button,
.costing-search-field input,
.costing-batch-cell,
.costing-supplier-input-wrap input,
textarea{
  border:1px solid rgba(0,0,0,.12);
  border-radius:10px;
  background:rgba(255,255,255,.94);
  color:#1d1d1f;
  box-shadow:inset 0 1px 1px rgba(0,0,0,.015);
}

.field input:hover,
.field select:hover,
.qty-input:hover,
.incoming-search:hover,
.multi-select-button:hover{
  border-color:rgba(0,0,0,.18);
}

textarea:focus,
input:focus,
select:focus,
.multi-select-button:focus-visible{
  border-color:rgba(0,113,227,.55);
  outline:none;
  box-shadow:0 0 0 3px rgba(0,113,227,.12);
}

.filter-tabs{
  gap:5px;
  padding:4px;
  width:max-content;
  margin-bottom:16px;
  border-radius:11px;
  background:#e9eaed;
}

.filter-tab{
  border:0;
  border-radius:8px;
  padding:7px 12px;
  background:transparent;
  color:#6c6c71;
  font-weight:600;
}

.filter-tab.active{
  background:#fff;
  color:#1d1d1f;
  box-shadow:0 1px 2px rgba(0,0,0,.08),0 2px 7px rgba(0,0,0,.045);
}

/* Tables */
.table-wrap,
.incoming-table-wrap,
.incoming-history-table{
  border:1px solid rgba(0,0,0,.07);
  border-radius:13px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.02);
}

table{
  background:#fff;
}

th,
.master-po-table-wrap th,
.supplier-sheet thead th,
.incoming-table th{
  background:#f7f7f9;
  color:#6e6e73;
  font-size:10.5px;
  font-weight:680;
  letter-spacing:.055em;
  border-bottom:1px solid rgba(0,0,0,.07);
}

th,td{
  padding:11px 12px;
  border-bottom:1px solid rgba(0,0,0,.06);
}

tbody tr{
  transition:background .12s ease;
}

tbody tr:hover{
  background:#f8f8fa;
}

.master-po-row.selected,
.supplier-po-row.selected{
  background:#edf5ff !important;
}

.selected-cell{
  background:#e8f2ff !important;
  box-shadow:inset 0 0 0 1px rgba(0,113,227,.32);
}

.sku{font-weight:680;letter-spacing:-.01em}
.money-main{font-weight:650}

/* Pills / statuses */
.pill,
.costing-status-badge,
.incoming-status,
.incoming-escalation-badge{
  border-radius:999px;
  font-weight:650;
  letter-spacing:-.005em;
}

.pill-ok,
.incoming-status-complete,
.costing-status-badge.is-active{
  color:#19783a;
  background:#edf7f0;
}

.pill-tier,
.incoming-status-partial{
  color:#8b5700;
  background:#fff6df;
  border-color:rgba(139,87,0,.16);
}

.incoming-status-awaiting{
  color:#67676c;
  background:#efeff1;
}

/* Supplier cards */
.supplier-grid{gap:10px}

.supplier-card{
  border:1px solid rgba(0,0,0,.07);
  border-radius:15px;
  background:rgba(255,255,255,.94);
  box-shadow:0 1px 2px rgba(0,0,0,.02),0 8px 24px rgba(0,0,0,.025);
}

.supplier-card-header{
  padding:13px 15px;
  border-radius:15px;
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(15px);
  -webkit-backdrop-filter:blur(15px);
}

.supplier-card-header.reconciled-complete{
  background:linear-gradient(90deg,#f1faf4,#fff 44%);
  border-color:rgba(22,128,59,.14);
}

.supplier-name{
  font-size:15px;
  font-weight:700;
  letter-spacing:-.018em;
}

.supplier-meta{
  color:#77777c;
  font-size:11.5px;
}

.supplier-sheet{
  background:#f8f8fa;
}

.supplier-summary-bar{
  border-radius:10px;
  background:transparent;
}

/* Dropdowns / popovers */
.multi-select-menu,
.costing-search-suggestions,
.costing-supplier-suggestions,
.incoming-confirm-popover{
  border:1px solid rgba(0,0,0,.09);
  border-radius:13px;
  background:rgba(255,255,255,.94);
  box-shadow:0 14px 44px rgba(0,0,0,.14);
  backdrop-filter:saturate(180%) blur(22px);
  -webkit-backdrop-filter:saturate(180%) blur(22px);
}

.multi-select-option{border-radius:8px}
.multi-select-option:hover,
.costing-search-suggestion:hover{background:#f1f2f4}

/* Modals */
.modal-backdrop{
  background:rgba(0,0,0,.22);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
}

.modal{
  border:1px solid rgba(0,0,0,.08);
  border-radius:20px;
  background:rgba(255,255,255,.97);
  box-shadow:0 24px 90px rgba(0,0,0,.2);
}

.modal-title{
  font-size:20px;
  font-weight:700;
  letter-spacing:-.025em;
}

.modal-actions{
  background:#f8f8fa;
  border-top-color:rgba(0,0,0,.06);
}

/* Suppliers Incoming */
.incoming-page-head{margin-top:2px}
.incoming-toolbar{
  border-bottom:1px solid rgba(0,0,0,.06);
  background:rgba(255,255,255,.78);
}

.incoming-view-tabs{
  gap:3px;
  padding:4px;
  border-radius:10px;
  background:#ececef;
}

.incoming-view-tab{
  border:0;
  color:#707075;
  background:transparent;
}

.incoming-view-tab.active{
  color:#1d1d1f;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.08),0 2px 6px rgba(0,0,0,.04);
}

.incoming-orders{padding:9px}

.incoming-order-card{
  margin-bottom:7px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.065);
  border-radius:13px;
  background:#fff;
}

.incoming-order-card:last-child{border-bottom-color:rgba(0,0,0,.065)}

.incoming-order-summary{
  background:#fff;
  padding:15px 16px;
}

.incoming-order-summary:hover{background:#f8f8fa}

.incoming-progress{height:4px;background:#ececf0}
.incoming-progress span{background:#0071e3}

.incoming-workspace{
  border:1px solid rgba(0,0,0,.065);
  border-radius:13px;
  background:#f8f8fa;
}

/* Costing Manager */
.costing-manager-toolbar{
  gap:4px;
  width:max-content;
  padding:4px;
  border-radius:11px;
  background:#ececef;
}

.costing-mode-btn{
  min-height:32px;
  border:0;
  background:transparent;
  box-shadow:none;
  color:#6e6e73;
}

.costing-mode-btn.active,
.costing-batch-action-active{
  background:#fff !important;
  color:#1d1d1f !important;
  border-color:transparent !important;
  box-shadow:0 1px 2px rgba(0,0,0,.08),0 2px 6px rgba(0,0,0,.04) !important;
}

.costing-empty-state{
  border:1px solid rgba(0,0,0,.07);
  border-radius:16px;
  background:linear-gradient(180deg,#fbfbfc,#f7f7f9);
}

.costing-batch-supplier-panel,
.costing-batch-price-editor,
.costing-batch-compact-toolbar{
  border:1px solid rgba(0,0,0,.07);
  border-radius:13px;
  background:#f8f8fa;
  box-shadow:none;
}

/* Defective Items */
.defective-supplier-badge{
  background:#fff1f0 !important;
  color:#b63831 !important;
  border:1px solid rgba(182,56,49,.12);
}

/* Product Data + generic utility panels */
#product-data-page .panel,
#supplier-manager-page .panel,
#costing-manager-page .panel{
  border-radius:18px;
}

#product-data-page textarea{
  background:#f8f8fa;
}

/* Toast */
.toast{
  right:24px;
  bottom:24px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  background:rgba(28,28,30,.9);
  box-shadow:0 16px 50px rgba(0,0,0,.24);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}

/* Refined hover/focus behavior */
.supplier-header-toggle:hover,
.master-po-header-toggle:hover{
  background:rgba(0,0,0,.025);
}

.supplier-header-toggle:focus-visible,
.master-po-header-toggle:focus-visible{
  outline:3px solid rgba(0,113,227,.18);
  outline-offset:1px;
}

/* Scrollbars */
*{
  scrollbar-width:thin;
  scrollbar-color:#c8c8cc transparent;
}

*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{
  border:3px solid transparent;
  border-radius:999px;
  background:#c8c8cc;
  background-clip:padding-box;
}
*::-webkit-scrollbar-thumb:hover{background:#aaaab0;background-clip:padding-box}

/* Responsive polish */
@media (max-width:1000px){
  .page{width:calc(100% - 28px);margin:0 14px}
  .app-tabs{width:100%;overflow-x:auto;justify-content:flex-start}
  .po-save-status{margin-left:auto}
  h1,.incoming-page-head h1{font-size:28px}
}

@media (prefers-reduced-motion:no-preference){
  .panel,
  .stat,
  .incoming-stat,
  .supplier-card{
    transition:box-shadow .18s ease,border-color .18s ease,transform .18s ease;
  }
  .stat:hover,
  .incoming-stat:hover{
    transform:translateY(-1px);
    box-shadow:0 2px 4px rgba(0,0,0,.03),0 12px 30px rgba(0,0,0,.05);
  }
}


/* ==========================================================
   APPLE-FIRST-PARTY PASS
   Stronger visual direction: quieter, flatter, more spacious.
   ========================================================== */

:root{
  --bg:#f7f7f9;
  --panel:#ffffff;
  --border:rgba(0,0,0,.055);
  --border-strong:rgba(0,0,0,.10);
  --text:#1d1d1f;
  --muted:#86868b;
  --soft:#f5f5f7;
  --soft-2:#ececef;
  --accent:#1d1d1f;
  --shadow:none;
}

body{
  background:#f7f7f9;
}

.page{
  width:calc(100% - 64px);
  margin:0 32px;
  padding:22px 0 44px;
}

.app-tabs{
  top:12px;
  min-height:44px;
  padding:4px;
  border:0;
  border-radius:14px;
  background:rgba(236,236,239,.82);
  box-shadow:0 6px 22px rgba(0,0,0,.055);
}

.app-tab{
  min-height:34px;
  padding:7px 14px;
  border-radius:10px;
  color:#6e6e73;
  font-size:12.5px;
  font-weight:600;
}

.app-tab.active{
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.10),0 1px 8px rgba(0,0,0,.045);
}

.po-save-status{
  color:#8e8e93;
  border-left-color:rgba(0,0,0,.06);
}

.topbar{
  margin:10px 0 30px;
}

h1,
.incoming-page-head h1{
  font-size:36px;
  font-weight:700;
  letter-spacing:-.045em;
}

.subtitle{
  font-size:14px;
  color:#86868b;
}

.panel,
.incoming-dashboard-panel{
  border:0;
  border-radius:20px;
  box-shadow:0 1px 2px rgba(0,0,0,.025),0 8px 30px rgba(0,0,0,.035);
  overflow:hidden;
}

.panel-header{
  padding:20px 22px 18px;
  border-bottom:1px solid rgba(0,0,0,.045);
}

.panel-title{
  font-size:18px;
  font-weight:650;
}

.panel-subtitle{
  font-size:12.5px;
  color:#8a8a8f;
}

.panel-body{
  padding:20px 22px 22px;
}

.stats,
.incoming-summary{
  gap:14px;
}

.stat,
.incoming-stat{
  min-height:104px;
  padding:20px;
  border:0;
  border-radius:18px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.025),0 6px 22px rgba(0,0,0,.025);
}

.stat-label,
.incoming-stat span{
  color:#8e8e93;
  font-size:11px;
  font-weight:600;
}

.stat-value,
.incoming-stat strong{
  font-size:29px;
  font-weight:680;
  letter-spacing:-.045em;
}

.master-po-panel > .panel-body,
#defective-items-page .master-po-panel > .panel-body{
  background:#f2f2f5;
}

.master-po-header{
  background:rgba(255,255,255,.93);
}

.toolbar{
  gap:12px;
  margin-bottom:18px;
}

.field label{
  color:#8e8e93;
  font-size:10px;
  font-weight:650;
}

.field input,
.field select,
.qty-input,
.incoming-search,
.incoming-receive-input,
.incoming-order-qty-input,
.multi-select-button,
.costing-search-field input,
.costing-supplier-input-wrap input{
  border:0;
  background:#fff;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08),0 1px 1px rgba(0,0,0,.02);
}

.field input,
.field select,
.multi-select-button{
  min-height:40px;
  border-radius:11px;
}

textarea{
  border:0;
  border-radius:14px;
  background:#fff;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);
}

textarea:focus,
input:focus,
select:focus,
.multi-select-button:focus-visible{
  box-shadow:
    inset 0 0 0 1px rgba(0,113,227,.38),
    0 0 0 4px rgba(0,113,227,.10);
}

.btn{
  min-height:36px;
  border:0;
  border-radius:10px;
  background:#f1f1f3;
  box-shadow:none;
  color:#1d1d1f;
}

.btn:hover{
  background:#e9e9ec;
}

.btn-primary{
  background:#1d1d1f;
  color:#fff;
}

.btn-primary:hover{
  background:#000;
}

.btn-danger{
  background:#fff1f0;
  color:#c9342f;
}

.filter-tabs,
.incoming-view-tabs,
.costing-manager-toolbar{
  padding:4px;
  border-radius:12px;
  background:#e8e8eb;
}

.filter-tab,
.incoming-view-tab,
.costing-mode-btn{
  padding:8px 13px;
  border-radius:9px;
}

.filter-tab.active,
.incoming-view-tab.active,
.costing-mode-btn.active{
  background:#fff !important;
  box-shadow:0 1px 2px rgba(0,0,0,.09),0 2px 7px rgba(0,0,0,.04) !important;
}

.master-po-summary-bar,
.supplier-summary-bar{
  color:#7c7c80;
  font-size:12px;
}

.table-wrap,
.incoming-table-wrap{
  border:0;
  border-radius:14px;
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.05);
}

table{
  background:#fff;
}

th,
.master-po-table-wrap th,
.supplier-sheet thead th,
.incoming-table th{
  background:#f7f7f8;
  color:#8a8a8f;
  border-bottom:1px solid rgba(0,0,0,.045);
  font-size:10px;
  font-weight:650;
  letter-spacing:.05em;
}

th,td{
  padding:12px 13px;
  border-bottom:1px solid rgba(0,0,0,.045);
}

tbody tr:hover{
  background:#fafafa;
}

.qty-input{
  height:34px;
  border-radius:9px;
}

.pill{
  padding:5px 9px;
}

.supplier-grid{
  gap:12px;
}

.supplier-card{
  border:0;
  border-radius:17px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.025),0 7px 24px rgba(0,0,0,.03);
}

.supplier-card-header{
  padding:15px 17px;
  background:#fff;
}

.supplier-sheet{
  background:#f6f6f8;
}

.supplier-card-header.reconciled-complete{
  background:#f5fbf6;
}

.incoming-order-card{
  border:0;
  border-radius:15px;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.05);
}

.incoming-order-summary{
  padding:16px 17px;
}

.incoming-workspace{
  border:0;
  border-radius:15px;
  background:#f4f4f6;
}

.multi-select-menu,
.costing-search-suggestions,
.costing-supplier-suggestions,
.incoming-confirm-popover{
  border:0;
  border-radius:15px;
  box-shadow:0 20px 60px rgba(0,0,0,.16),0 2px 10px rgba(0,0,0,.06);
}

.modal{
  border:0;
  border-radius:22px;
  box-shadow:0 30px 100px rgba(0,0,0,.22);
}

.modal-body{
  padding:26px 26px 22px;
}

.modal-title{
  font-size:21px;
}

.modal-actions{
  padding:14px 18px;
  background:#f6f6f8;
}

.costing-empty-state{
  border:0;
  background:#f4f4f6;
}

.costing-batch-supplier-panel,
.costing-batch-price-editor,
.costing-batch-compact-toolbar{
  border:0;
  background:#f4f4f6;
}

/* Make page chrome feel less SaaS-card-heavy */
#po-generator-page > .panel-header,
#defective-items-page > .panel-header{
  padding-left:0;
  padding-right:0;
  background:transparent;
  border-bottom:0;
}

#po-generator-page > .panel-header + .panel-body,
#defective-items-page > .panel-header + .panel-body{
  padding-left:0;
  padding-right:0;
}

@media (max-width:1000px){
  .page{
    width:calc(100% - 28px);
    margin:0 14px;
  }
  h1,
  .incoming-page-head h1{
    font-size:30px;
  }
}


/* Keep working headers visible beneath the floating app switcher */
:root{
  --app-switcher-sticky-offset: 68px;
  --supplier-header-height: 58px;
}

.master-po-header{
  position:sticky;
  top:var(--app-switcher-sticky-offset);
  z-index:55;
  background:rgba(255,255,255,.94);
  backdrop-filter:saturate(180%) blur(20px);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  box-shadow:0 1px 0 rgba(0,0,0,.05),0 8px 18px rgba(0,0,0,.025);
}

.supplier-card-header{
  position:sticky;
  top:var(--app-switcher-sticky-offset);
  z-index:50;
  background:rgba(255,255,255,.94);
  backdrop-filter:saturate(180%) blur(20px);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  box-shadow:0 1px 0 rgba(0,0,0,.045);
}

.supplier-sheet thead{
  position:sticky;
  top:calc(var(--app-switcher-sticky-offset) + var(--supplier-header-height));
  z-index:45;
}

.master-po-table-wrap th{
  top:calc(var(--app-switcher-sticky-offset) + 70px);
}

@media (max-width:1000px){
  :root{
    --app-switcher-sticky-offset: 64px;
  }
}


/* Sticky header fix: sticky cannot follow the viewport through clipped ancestors. */
.master-po-panel,
.supplier-section > .panel,
.supplier-card{
  overflow:visible !important;
}

.master-po-panel > .panel-body,
.supplier-card .supplier-sheet{
  overflow:visible;
}

.master-po-header{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:64px !important;
  z-index:70 !important;
}

.supplier-card-header{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:64px !important;
  z-index:65 !important;
}

.master-po-table-wrap th{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:132px !important;
  z-index:60 !important;
}

.supplier-sheet thead{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:122px !important;
  z-index:60 !important;
}

.supplier-sheet thead th{
  position:static !important;
}

@media (max-width:1000px){
  .master-po-header,
  .supplier-card-header{top:60px !important;}
  .master-po-table-wrap th{top:128px !important;}
  .supplier-sheet thead{top:118px !important;}
}


/* Stack floating navigation + working header as one clean dock */
:root{
  --floating-tabs-top: 12px;
  --floating-tabs-height: 44px;
  --working-header-top: 56px;
  --working-header-height: 82px;
}

.app-tabs{
  top:var(--floating-tabs-top) !important;
  z-index:90 !important;
  margin-bottom:28px;
}

.master-po-header,
.supplier-card-header{
  top:var(--working-header-top) !important;
  z-index:80 !important;
  margin:0 !important;
  border-radius:0 !important;
  box-shadow:
    0 1px 0 rgba(0,0,0,.05),
    0 10px 24px rgba(0,0,0,.035) !important;
}

/* No visual hole between the two sticky layers */
.master-po-header::before,
.supplier-card-header::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-10px;
  height:10px;
  background:rgba(255,255,255,.94);
  pointer-events:none;
}

.master-po-header{
  padding-left:22px !important;
  padding-right:22px !important;
}

.supplier-card-header{
  padding-left:17px !important;
  padding-right:17px !important;
}

/* Keep table headers aligned directly under their sticky working headers */
.master-po-table-wrap th{
  top:calc(var(--working-header-top) + var(--working-header-height)) !important;
}

.supplier-sheet thead{
  top:calc(var(--working-header-top) + 58px) !important;
}

/* Make the sticky layers visually continuous */
.master-po-header,
.supplier-card-header,
.master-po-table-wrap th,
.supplier-sheet thead th{
  background:rgba(255,255,255,.97) !important;
  backdrop-filter:saturate(180%) blur(20px);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
}

@media (max-width:1000px){
  :root{
    --working-header-top:54px;
  }
}


/* Opaque top dock backdrop — prevents content showing above/behind floating tabs */
body::before{
  content:"";
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:72px;
  z-index:76;
  background:#f7f7f9;
  pointer-events:none;
}

/* Keep floating layers above the dock backdrop */
.app-tabs{z-index:100 !important;}
.master-po-header,
.supplier-card-header{z-index:90 !important;}
.master-po-table-wrap th,
.supplier-sheet thead{z-index:85 !important;}

@media (max-width:1000px){
  body::before{height:68px;}
}


/* Prevent collapsed supplier sheets from creating invisible scroll height.
   Open sheets stay overflow-visible so sticky table headers still work. */
.supplier-card .supplier-sheet:not(.open){
  overflow:hidden !important;
}

.supplier-card .supplier-sheet.open{
  overflow:visible !important;
}

.supplier-section,
.supplier-grid,
.supplier-section > .panel{
  min-height:0 !important;
}

.page{
  padding-bottom:24px !important;
}


/* Master table header alignment fix: sit directly below the floating Master PO bar */
:root{
  --master-work-header-height:58px;
}

.master-po-table-wrap th{
  top:calc(var(--working-header-top) + var(--master-work-header-height)) !important;
}

@media (max-width:1000px){
  .master-po-table-wrap th{
    top:calc(var(--working-header-top) + var(--master-work-header-height)) !important;
  }
}


/* Master PO column header: stick the entire THEAD, not individual TH cells.
   This prevents the header row from visually dropping between data rows. */
.master-po-table-wrap thead{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:calc(var(--working-header-top) + var(--master-work-header-height)) !important;
  z-index:88 !important;
  background:#f7f7f8 !important;
}

.master-po-table-wrap thead th{
  position:static !important;
  top:auto !important;
  z-index:auto !important;
  background:#f7f7f8 !important;
}

.master-po-table-wrap tbody{
  position:relative;
  z-index:1;
}


/* Match Supplier Orders behavior: Master PO working bar + column header dock together */
:root{
  --tabs-dock-top:12px;
  --tabs-dock-height:44px;
  --master-bar-top:56px;
  --master-bar-height:74px;
  --master-columns-top:130px;
}

/* Keep Master PO bar fixed below floating tabs */
.master-po-header{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:var(--master-bar-top) !important;
  z-index:92 !important;
  min-height:var(--master-bar-height);
  background:rgba(255,255,255,.985) !important;
}

/* Column labels must dock immediately below the Master PO bar */
.master-po-table-wrap thead{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:var(--master-columns-top) !important;
  z-index:91 !important;
  display:table-header-group;
  background:#f7f7f8 !important;
}

/* Safari/Chrome table sticky is more reliable on TH than THEAD.
   Keep both levels aligned to the exact same dock offset. */
.master-po-table-wrap thead th{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:var(--master-columns-top) !important;
  z-index:91 !important;
  background:#f7f7f8 !important;
}

/* Remove any old offset rules fighting the master header */
.master-po-table-wrap th{
  top:var(--master-columns-top) !important;
}

/* Keep rows below the floating column strip */
.master-po-table-wrap tbody{
  position:relative;
  z-index:1;
}

/* Hide underlying row content behind the two floating work bars */
.master-po-header::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:1px;
  background:rgba(0,0,0,.05);
}

@media (max-width:1000px){
  :root{
    --master-bar-top:54px;
    --master-columns-top:128px;
  }
}


/* Master PO header reliability fix:
   keep the real table header in normal flow; a JS-synced clone floats only after it scrolls under Master PO. */
.master-po-table-wrap thead,
.master-po-table-wrap thead th,
.master-po-table-wrap th{
  position:static !important;
  top:auto !important;
  z-index:auto !important;
}

#masterPoFloatingColumns{
  position:fixed;
  z-index:91;
  display:none;
  overflow:hidden;
  pointer-events:none;
  background:#f7f7f8;
  box-shadow:0 1px 0 rgba(0,0,0,.06),0 8px 18px rgba(0,0,0,.025);
}

#masterPoFloatingColumns.is-visible{
  display:block;
}

#masterPoFloatingColumns table{
  width:100% !important;
  min-width:0 !important;
  margin:0;
  table-layout:fixed;
  border-collapse:collapse;
  background:#f7f7f8;
}

#masterPoFloatingColumns thead,
#masterPoFloatingColumns th{
  position:static !important;
  top:auto !important;
  background:#f7f7f8 !important;
}

#masterPoFloatingColumns th{
  box-sizing:border-box;
  padding:12px 13px;
  color:#8a8a8f;
  border-bottom:1px solid rgba(0,0,0,.045);
  font-size:10px;
  font-weight:650;
  letter-spacing:.05em;
  text-transform:uppercase;
  white-space:nowrap;
}

/* Product Master — dense spreadsheet workflow with Apple-like chrome */
.product-master-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:18px 0 16px}
.product-master-head h1{font-size:34px;letter-spacing:-1.2px}
.product-master-actions{display:flex;gap:8px}
.product-master-summary{display:grid;grid-template-columns:repeat(6,minmax(130px,1fr));gap:10px;margin-bottom:14px}
.product-progress-card{appearance:none;text-align:left;border:1px solid rgba(0,0,0,.055);background:rgba(255,255,255,.92);border-radius:16px;padding:15px 16px;box-shadow:0 8px 28px rgba(0,0,0,.035);color:var(--text)}
.product-progress-card:hover{transform:translateY(-1px);box-shadow:0 10px 32px rgba(0,0,0,.055)}
.product-progress-card span,.product-progress-card small{display:block;color:#8a8a8f;font-size:11px}
.product-progress-card strong{display:block;font-size:24px;letter-spacing:-.6px;margin:4px 0 2px}
.product-master-panel{overflow:visible}
.product-master-toolbar{padding:14px 16px 10px;background:rgba(255,255,255,.96);border-radius:16px 16px 0 0}
.product-master-tabs{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:12px}
.product-master-tab{border:0;border-radius:9px;padding:8px 11px;background:#f1f1f3;color:#666;font-size:12px;font-weight:650}
.product-master-tab.active{background:#1d1d1f;color:#fff}
.product-master-filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap}
.product-toggle{height:38px;display:flex;align-items:center;gap:8px;padding:0 12px;border-radius:10px;background:#f4f4f6;font-size:12px;font-weight:650;color:#555}
.product-sheet-help{padding:8px 16px;color:#8a8a8f;font-size:11px;border-top:1px solid rgba(0,0,0,.04)}
.product-master-table-wrap{border-radius:0 0 16px 16px;max-height:calc(100vh - 250px);overflow:auto}
.product-master-table{min-width:1500px;table-layout:auto}
.product-master-table thead th{position:sticky!important;top:0!important;z-index:4!important;background:#f6f6f8!important}
.product-master-table td{padding:5px 8px;height:42px}
.product-master-table th{padding:9px 8px}
.product-master-table .common-name{max-width:330px}
.product-sheet-input{height:30px;width:100%;min-width:82px;border:1px solid transparent;border-radius:6px;background:transparent;padding:4px 6px}
.product-sheet-input:hover{border-color:#d9d9de;background:#fff}
.product-sheet-input:focus{border-color:#8aa9ff;background:#fff;box-shadow:0 0 0 2px rgba(0,122,255,.12)}
.product-sheet-input[data-field="relation_group"]{min-width:130px}
.product-sheet-input[data-field="image_url"]{min-width:220px}
.product-relation-cell{display:flex;align-items:center;gap:5px}
.product-siblings{border:0;background:#e8f1ff;color:#1769aa;border-radius:999px;padding:4px 7px;font-size:10px;font-weight:750}
.product-cbm{font-variant-numeric:tabular-nums;color:#555}
.product-no-supplier{background:#fff1f0;color:#b42318}
.product-complete{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:50%;background:#eaf8ef;color:#14833b;font-weight:800}
.product-incomplete{font-size:10px;font-weight:700;color:#9a6700;background:#fff7db;border-radius:999px;padding:5px 7px}
.product-copy-sku{cursor:pointer}
.product-copy-sku.copied{background:#eaf8ef}
.product-bulk-modal{width:min(760px,calc(100vw - 32px));max-width:760px}
.product-bulk-preview{font-size:11px;color:#8a8a8f;margin-top:8px}
#productBulkModal:not(.open){display:none}
#productBulkModal.open{display:flex}
@media(max-width:1200px){.product-master-summary{grid-template-columns:repeat(3,1fr)}}

.product-master-notice{font-size:12px;font-weight:600;opacity:0;transition:opacity .18s ease;white-space:nowrap}.product-master-notice.show{opacity:.72}

.product-relation-cell{display:flex;align-items:center;gap:4px}.product-relation-cell .product-sheet-input{min-width:0;flex:1}.product-siblings{flex:0 0 auto;margin-left:0}.product-siblings-modal{max-width:440px}.product-siblings-list{display:flex;flex-direction:column;gap:6px;margin-top:12px;max-height:320px;overflow:auto}.product-sibling-item{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border:1px solid rgba(0,0,0,.07);border-radius:10px;background:rgba(0,0,0,.025);font-weight:600}.product-sibling-item.current{background:rgba(0,0,0,.06)}.product-sibling-item small{font-size:11px;font-weight:500;opacity:.55}

.costing-load-variations{margin-left:7px;padding:2px 7px;border:0;border-radius:999px;background:rgba(0,113,227,.08);color:#1672b8;font-size:10px;font-weight:650;cursor:pointer;vertical-align:1px}.costing-load-variations:hover{background:rgba(0,113,227,.14)}.costing-load-variations:disabled{opacity:.5;cursor:default}

@media (max-width: 900px) {
  .incoming-order-card .incoming-workspace > .incoming-table-wrap {
    overflow-x: auto;
  }
}


/* PR24: final incoming sticky overrides — keep after Apple pass */
#suppliers-incoming-page .incoming-dashboard-panel,
#suppliers-incoming-page .incoming-orders,
#suppliers-incoming-page .incoming-order-card {
  overflow: visible !important;
}
#suppliers-incoming-page .incoming-order-summary {
  position: sticky !important;
  top: 8px !important;
  z-index: 60 !important;
  background: #fff !important;
}
#suppliers-incoming-page .incoming-order-card .incoming-workspace > .incoming-table-wrap {
  overflow: visible !important;
}
#suppliers-incoming-page .incoming-order-card .incoming-workspace > .incoming-table-wrap > .incoming-table > thead th {
  position: sticky !important;
  top: 82px !important;
  z-index: 59 !important;
  background: #fafbfc !important;
}


/* PR24: stacked sticky supplier + receiving column headers */
#suppliers-incoming-page {
  --incoming-supplier-sticky-height: 80px;
}
#suppliers-incoming-page .incoming-order-summary {
  position: sticky !important;
  top: 0 !important;
  z-index: 70 !important;
  min-height: var(--incoming-supplier-sticky-height);
  background: #fff !important;
}
#suppliers-incoming-page .incoming-order-card .incoming-workspace > .incoming-table-wrap > .incoming-table > thead {
  position: sticky !important;
  top: var(--incoming-supplier-sticky-height) !important;
  z-index: 69 !important;
}
#suppliers-incoming-page .incoming-order-card .incoming-workspace > .incoming-table-wrap > .incoming-table > thead th {
  position: static !important;
  background: #fafbfc !important;
  box-shadow: 0 1px 0 var(--border);
}


/* PR24: only the receiving workspace header + column labels float */
#suppliers-incoming-page .incoming-order-summary {
  position: static !important;
  min-height: 0 !important;
}
#suppliers-incoming-page .incoming-workspace {
  overflow: visible !important;
}
#suppliers-incoming-page .incoming-workspace-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 72 !important;
  margin: -16px -16px 0;
  padding: 16px 16px 10px;
  background: #f8f8fa !important;
}
#suppliers-incoming-page .incoming-order-card .incoming-workspace > .incoming-table-wrap > .incoming-table > thead {
  position: sticky !important;
  top: 58px !important;
  z-index: 71 !important;
}

.incoming-defective-badge{
  display:inline-flex;
  align-items:center;
  margin-left:7px;
  padding:2px 6px;
  border-radius:999px;
  background:#fff4e5;
  color:#9a5b00;
  font-size:9px;
  font-weight:700;
  line-height:1.2;
  vertical-align:1px;
  white-space:nowrap;
}

/* Existing incoming migration */
.incoming-migration-modal{width:min(920px,94vw);max-width:920px}
.incoming-migration-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:18px 0}
.incoming-migration-fields label,.incoming-migration-paste-label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:700;color:#555}
.incoming-migration-fields input{width:100%}
#incomingMigrationPaste{min-height:150px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;resize:vertical}
.incoming-migration-preview{margin-top:14px;max-height:300px;overflow:auto}
.incoming-migration-preview table{width:100%;min-width:560px}
.incoming-migration-invalid td{background:#fff1f2;color:#b42318}
#incomingMigrationError:empty{display:none}
@media(max-width:700px){.incoming-migration-fields{grid-template-columns:1fr}}

.incoming-migration-supplier-wrap{position:relative}
.incoming-migration-supplier-suggestions{position:absolute;left:0;right:0;top:calc(100% + 5px);z-index:120;background:#fff;border:1px solid rgba(0,0,0,.09);border-radius:12px;box-shadow:0 14px 40px rgba(0,0,0,.14);padding:5px;max-height:260px;overflow:auto}
.incoming-migration-supplier-option{display:block;width:100%;border:0;background:transparent;text-align:left;padding:9px 10px;border-radius:8px;font:inherit;color:inherit;cursor:pointer}
.incoming-migration-supplier-option:hover,.incoming-migration-supplier-option:focus{background:#f1f2f4;outline:none}


/* Warehouse Inventory */
#inventory-page{max-width:1440px;margin:0 auto;padding-bottom:56px}
.inventory-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:4px 0 22px}
.inventory-head h1{margin:0 0 5px;font-size:30px;letter-spacing:-.035em}
.inventory-location-switch{display:flex;gap:4px;padding:4px;background:#f1f2f4;border-radius:12px}
.inventory-location-switch button{border:0;background:transparent;padding:8px 13px;border-radius:9px;font:inherit;font-size:12px;font-weight:650;color:#777;cursor:pointer}
.inventory-location-switch button.active{background:#fff;color:#111;box-shadow:0 1px 4px rgba(0,0,0,.09)}
.inventory-location-switch button:disabled{opacity:.42;cursor:default}
.inventory-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 24px;background:linear-gradient(145deg,#fbfbfc,#f3f4f6);border:1px solid rgba(0,0,0,.06);border-radius:20px;margin-bottom:12px}
.inventory-eyebrow{font-size:12px;font-weight:750;color:#777;margin-bottom:6px}
.inventory-asof{font-size:21px;font-weight:750;letter-spacing:-.025em;color:#171717}
.inventory-match-note{font-size:11px;color:#777;margin-top:5px}
.inventory-file-note{display:flex;flex-direction:column;align-items:flex-end;max-width:320px}
.inventory-file-note span{font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:#999;font-weight:700}
.inventory-file-note strong{font-size:12px;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.inventory-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:12px}
.inventory-stat{padding:18px 20px;background:#fff;border:1px solid rgba(0,0,0,.065);border-radius:16px;box-shadow:0 4px 16px rgba(0,0,0,.025)}
.inventory-stat span{display:block;font-size:11px;color:#888;font-weight:650;margin-bottom:7px}
.inventory-stat strong{font-size:25px;letter-spacing:-.035em}
.inventory-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr);gap:12px;margin-bottom:12px}
.inventory-card{background:#fff;border:1px solid rgba(0,0,0,.065);border-radius:18px;padding:20px;box-shadow:0 5px 20px rgba(0,0,0,.025)}
.inventory-card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.inventory-card-head h2{font-size:15px;letter-spacing:-.015em;margin:0 0 4px}
.inventory-card-head p{font-size:11px;color:#888;margin:0}
.inventory-drop-zone{min-height:205px;border:1.5px dashed #cfd2d7;border-radius:16px;background:#fafafb;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:25px;transition:.18s ease;cursor:pointer}
.inventory-drop-zone.is-dragging{border-color:#0071e3;background:#f2f8ff;transform:scale(.997)}
.inventory-drop-icon{width:38px;height:38px;border-radius:12px;background:#ededf0;display:grid;place-items:center;font-size:20px;margin-bottom:12px}
.inventory-drop-zone strong{font-size:14px}
.inventory-drop-zone span{font-size:11px;color:#888;margin:5px 0 14px}
.inventory-upload-status{font-size:11px;color:#777;margin-top:10px;min-height:16px}
.inventory-upload-status.success{color:#19733a}.inventory-upload-status.error{color:#b42318}.inventory-upload-status.working{color:#5c5c66}
.inventory-upload-preview{border-top:1px solid rgba(0,0,0,.06);margin-top:14px;padding-top:16px}
.inventory-preview-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}
.inventory-preview-summary>div{padding:10px 11px;background:#f7f7f8;border-radius:11px}
.inventory-preview-summary strong,.inventory-preview-summary span{display:block}.inventory-preview-summary strong{font-size:16px}.inventory-preview-summary span{font-size:9px;color:#888;margin-top:2px}.inventory-preview-summary .warn strong{color:#b26a00}
.inventory-preview-table{max-height:280px}.inventory-preview-table table,.inventory-current-table table{width:100%}
.inventory-preview-table th,.inventory-preview-table td,.inventory-current-table th,.inventory-current-table td{padding:9px 10px;font-size:11px}
.inventory-preview-table th,.inventory-current-table th{font-size:9px;text-transform:uppercase;letter-spacing:.05em;color:#888}
.inventory-qty{text-align:right;font-variant-numeric:tabular-nums;font-weight:700}
.inventory-unmatched td{background:#fff9ee}
.inventory-preview-more,.inventory-table-foot{font-size:10px;color:#888;margin-top:9px}
.inventory-preview-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.inventory-update-list{display:flex;flex-direction:column}
.inventory-update-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:11px 0;border-bottom:1px solid rgba(0,0,0,.055)}
.inventory-update-row:last-child{border-bottom:0}.inventory-update-row>div:first-child{min-width:0}.inventory-update-row strong,.inventory-update-row span{display:block}.inventory-update-row>div:first-child strong{font-size:12px}.inventory-update-row>div:first-child span{font-size:10px;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.inventory-update-meta{font-size:10px;color:#777;text-align:right;padding-right:0}
.inventory-current-pill{position:absolute;right:0;top:30px!important;display:inline-flex!important;font-size:8px!important;font-weight:750!important;color:#16723b!important;background:#edf8f0;padding:2px 6px;border-radius:999px}
.inventory-empty-note{font-size:11px;color:#999;padding:12px 0}
.inventory-current-card,.inventory-history-card{margin-bottom:12px}
.inventory-current-head{align-items:flex-end}.inventory-search{width:min(340px,40vw);border:1px solid rgba(0,0,0,.1);border-radius:10px;padding:9px 11px;background:#fafafa}
.inventory-current-table{max-height:520px;overflow:auto}.inventory-current-table thead th{position:sticky;top:0;background:#fff;z-index:2}
.inventory-daily-history{display:flex;flex-direction:column}.inventory-history-row{display:grid;grid-template-columns:minmax(180px,1fr) 150px 150px;gap:20px;align-items:center;padding:11px 2px;border-bottom:1px solid rgba(0,0,0,.055)}
.inventory-history-row:last-child{border-bottom:0}.inventory-history-row>div:first-child strong,.inventory-history-row>div:first-child span{display:block}.inventory-history-row>div:first-child strong{font-size:12px}.inventory-history-row>div:first-child span{font-size:10px;color:#888;margin-top:2px}
.inventory-history-row>div:not(:first-child){text-align:right}.inventory-history-row>div:not(:first-child) span,.inventory-history-row>div:not(:first-child) strong{display:block}.inventory-history-row>div:not(:first-child) span{font-size:9px;color:#999;text-transform:uppercase}.inventory-history-row>div:not(:first-child) strong{font-size:12px;margin-top:2px}
@media(max-width:900px){.inventory-grid{grid-template-columns:1fr}.inventory-stats{grid-template-columns:1fr 1fr 1fr}.inventory-preview-summary{grid-template-columns:1fr 1fr}.inventory-history-row{grid-template-columns:1fr auto auto}.inventory-hero{align-items:flex-start;flex-direction:column}.inventory-file-note{align-items:flex-start;max-width:100%}}

/* Keep Inventory preview table header fixed above preview rows */
.inventory-preview-table table{border-collapse:separate;border-spacing:0}
.inventory-preview-table thead{display:table-header-group}
.inventory-preview-table thead th{position:sticky;top:0;z-index:3;background:#f7f7f8}
.inventory-preview-table tbody{display:table-row-group}


.inventory-paste-box{width:100%;min-height:260px;resize:vertical;border:1px solid rgba(0,0,0,.1);border-radius:14px;background:#fafafb;padding:15px 16px;font:500 12px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace;outline:none;box-sizing:border-box;transition:.15s ease}
.inventory-paste-box:focus{background:#fff;border-color:#8abcf0;box-shadow:0 0 0 3px rgba(0,113,227,.08)}
.inventory-paste-hint{font-size:10px;color:#888;margin-top:8px}
.inventory-format-example{border:1px solid rgba(0,0,0,.06);border-radius:13px;overflow:hidden;background:#fafafa}
.inventory-format-example>div{display:grid;grid-template-columns:1fr 100px;gap:16px;padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.05)}
.inventory-format-example>div:last-child{border-bottom:0}.inventory-format-example span{font-size:9px;color:#999;font-weight:750;letter-spacing:.05em}.inventory-format-example strong{font-size:11px}

/* Reports */
#reports-page{max-width:1440px;margin:0 auto;padding:4px 0 64px;color:#151515}
.reports-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin:0 0 24px}.reports-kicker{font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.12em;color:#999;margin-bottom:5px}.reports-head h1{font-size:34px;letter-spacing:-.045em;margin:0 0 5px}.reports-period{display:flex;padding:4px;background:#f1f2f4;border-radius:12px;gap:3px}.reports-period button{border:0;background:transparent;border-radius:9px;padding:8px 13px;font:inherit;font-size:11px;font-weight:700;color:#888}.reports-period button.active{background:#fff;color:#111;box-shadow:0 1px 4px rgba(0,0,0,.09)}
.reports-hero{display:grid;grid-template-columns:1.2fr 1fr;gap:12px;margin-bottom:12px}.reports-hero>div{min-height:170px;padding:26px 28px;border-radius:22px;background:linear-gradient(145deg,#fafafa,#f1f2f4);border:1px solid rgba(0,0,0,.055);display:flex;flex-direction:column;justify-content:flex-end}.reports-hero span,.reports-metrics span{font-size:11px;font-weight:650;color:#858585}.reports-hero strong{font-size:42px;letter-spacing:-.055em;margin:8px 0 4px}.reports-hero small,.reports-metrics small{font-size:10px;color:#999}
.reports-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:12px}.reports-metrics article{padding:20px 21px;background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:18px;box-shadow:0 5px 20px rgba(0,0,0,.022)}.reports-metrics strong{display:block;font-size:25px;letter-spacing:-.04em;margin:8px 0 4px}
.reports-section{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:20px;padding:22px;margin-bottom:12px;box-shadow:0 5px 22px rgba(0,0,0,.022)}.reports-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.reports-section-head span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:750;color:#999}.reports-section-head h2{font-size:19px;letter-spacing:-.03em;margin:4px 0 0}.reports-section p{font-size:11px;line-height:1.6;color:#777;max-width:560px}.reports-health{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:20px}.reports-health>div{padding:16px;background:#f7f7f8;border-radius:14px}.reports-health strong,.reports-health span{display:block}.reports-health strong{font-size:21px;letter-spacing:-.03em}.reports-health span{font-size:10px;color:#888;margin-top:5px}.reports-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.reports-placeholder{margin-top:18px;padding:22px;border-radius:14px;background:#fafafa;color:#aaa;font-size:10px;text-align:center}.reports-footnote{font-size:10px;color:#999;text-align:center;padding:16px 20px}
@media(max-width:900px){.reports-hero,.reports-grid{grid-template-columns:1fr}.reports-metrics{grid-template-columns:1fr 1fr}.reports-health{grid-template-columns:1fr 1fr}.reports-head{align-items:flex-start;flex-direction:column}}

/* Landed cost + purchase planning */
.landed-cost-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin:8px 0 18px}.landed-rate-field{font-size:11px;font-weight:650;color:#777}.landed-rate-field>div{display:flex;align-items:center;gap:6px;margin-top:6px;background:#f4f4f6;border-radius:10px;padding:0 10px}.landed-rate-field input{width:110px;height:38px;border:0;background:transparent;font-weight:700}.landed-cost-toolbar{margin-bottom:10px}.landed-cost-note,.purchase-plan-explainer{font-size:11px;color:#86868b;margin:10px 0 14px}.landed-cost-table{max-height:65vh;overflow:auto}.landed-cost-table thead th{position:sticky!important;top:0!important;z-index:2!important}.purchase-plan-settings{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:10px;margin:16px 0}.purchase-plan-settings label{display:grid;grid-template-columns:1fr auto;align-items:center;gap:6px;padding:10px 12px;border-radius:12px;background:#f5f5f7;color:#666;font-size:11px}.purchase-plan-settings label input,.purchase-plan-settings label select{grid-column:1/2;margin-top:4px;border:0;background:#fff;border-radius:8px;height:34px;padding:0 9px;min-width:0}.purchase-plan-settings label span{grid-column:2;grid-row:2;color:#8e8e93}.purchase-plan-table{max-height:480px;overflow:auto}.purchase-plan-table thead th{position:sticky!important;top:0!important;z-index:2!important}@media(max-width:900px){.purchase-plan-settings{grid-template-columns:1fr 1fr}.landed-cost-head{align-items:flex-start;flex-direction:column}}

/* Keep Landed Cost comparison inside one desktop frame */
.landed-cost-table table{table-layout:fixed;width:100%}
.landed-cost-table th:nth-child(1),.landed-cost-table td:nth-child(1){width:9%}
.landed-cost-table th:nth-child(2),.landed-cost-table td:nth-child(2){width:29%;max-width:29%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.landed-cost-table th:nth-child(3),.landed-cost-table td:nth-child(3){width:10%}
.landed-cost-table th:nth-child(4),.landed-cost-table td:nth-child(4){width:6%}
.landed-cost-table th:nth-child(5),.landed-cost-table td:nth-child(5){width:11%}
.landed-cost-table th:nth-child(6),.landed-cost-table td:nth-child(6){width:9%}
.landed-cost-table th:nth-child(7),.landed-cost-table td:nth-child(7){width:11%}
.landed-cost-table th:nth-child(8),.landed-cost-table td:nth-child(8){width:15%}

.costing-show-variations{margin-left:7px;border:0;border-radius:999px;padding:3px 7px;background:#eef2ff;color:#53627c;font-size:9px;font-weight:750;letter-spacing:.03em;cursor:pointer}.costing-show-variations:hover{background:#e3e9f8}.costing-show-variations:disabled{opacity:.55;cursor:default}

/* Landed Cost autocomplete: quiet, standard dropdown */
#landed-cost-suggestions.costing-search-suggestions{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:40;background:#fff;border:1px solid #e5e5e7;border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.10);padding:5px;max-height:300px;overflow-y:auto;display:block}
#landed-cost-suggestions[hidden]{display:none!important}
.costing-search-field{position:relative}
#landed-cost-suggestions .landed-suggestion{display:flex!important;width:100%;align-items:center;gap:10px;border:0!important;border-radius:8px!important;background:transparent!important;padding:9px 10px!important;text-align:left;white-space:nowrap;overflow:hidden;cursor:pointer}
#landed-cost-suggestions .landed-suggestion:hover{background:#f5f5f7!important}
#landed-cost-suggestions .landed-suggestion strong{flex:0 0 105px;font-size:12px;font-weight:700;color:#1d1d1f}
#landed-cost-suggestions .landed-suggestion span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:400;color:#6e6e73}

/* Apple-style application shell */
body{background:#f6f7f9}
.app-shell{min-height:100vh;display:grid;grid-template-columns:230px minmax(0,1fr)}
.app-sidebar{position:fixed;inset:0 auto 0 0;width:230px;background:rgba(255,255,255,.78);backdrop-filter:blur(22px);border-right:1px solid #e8e9ed;padding:24px 14px;display:flex;flex-direction:column;z-index:100}
.app-brand{padding:0 12px 24px}.app-brand strong{display:block;font-size:21px;letter-spacing:-.5px}.app-brand span{display:block;margin-top:2px;color:#7b8190;font-size:12px}
.app-sidebar .app-tabs{display:flex!important;flex-direction:column;align-items:stretch!important;gap:3px!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;margin:0!important;overflow:visible!important}
.app-sidebar .app-tab{display:flex!important;align-items:center!important;gap:11px!important;width:100%;min-height:42px;padding:0 12px!important;border:0!important;border-radius:10px!important;background:transparent!important;color:#465064!important;font-size:13px!important;font-weight:500!important;text-align:left!important;box-shadow:none!important}
.app-sidebar .app-tab:hover{background:#f2f4f8!important}.app-sidebar .app-tab.active{background:#eaf2ff!important;color:#1769e0!important;font-weight:650!important}.nav-icon{width:18px;text-align:center;font-size:17px;font-weight:700}
.sidebar-foot{margin-top:auto}.sidebar-settings{border:0;background:transparent;color:#536072;padding:10px 12px;font-size:13px}
.app-main{grid-column:2;min-width:0;padding:0 24px 32px}.global-bar{height:78px;display:flex;align-items:center;justify-content:flex-end;gap:18px;position:sticky;top:0;z-index:80;background:rgba(246,247,249,.82);backdrop-filter:blur(18px)}
.global-search{width:min(390px,38vw);height:38px;border:1px solid #e1e4e9;background:#fff;border-radius:999px;display:flex;align-items:center;gap:9px;padding:0 13px;color:#7b8190;font-size:12px;box-shadow:0 2px 12px rgba(0,0,0,.035)}.global-search span{flex:1}.global-search kbd{border:0;background:#f1f2f4;border-radius:6px;padding:3px 6px;color:#747b88}
.presence-preview{display:flex}.presence-preview span{position:relative;width:34px;height:34px;border-radius:50%;background:#eef0f4;border:2px solid #f6f7f9;margin-left:-5px;display:grid;place-items:center;font-size:11px;font-weight:700}.presence-preview i{position:absolute;right:0;bottom:1px;width:8px;height:8px;border-radius:50%;background:#21bf5b;border:2px solid white}
.app-main>.page{width:100%!important;margin:0!important;padding:0!important}.home-page{max-width:1320px;margin:0 auto}.home-hero{display:flex;justify-content:space-between;align-items:end;margin:18px 0 24px}.home-hero h1{font-size:29px;letter-spacing:-.8px}.home-hero p{margin:5px 0 0;color:#6f7680;font-size:14px}.home-sync{font-size:11px;color:#69717e}.home-sync i,.system-ok i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#22c55e;margin-right:5px}
.home-grid{display:grid;gap:18px;margin-bottom:18px}.home-top-grid{grid-template-columns:1.35fr .95fr}.home-middle-grid{grid-template-columns:1.55fr .75fr}.home-card{background:#fff;border:1px solid #e8e9ed;border-radius:16px;box-shadow:0 8px 28px rgba(30,41,59,.045);padding:18px}.home-card-title{font-size:15px;font-weight:700;margin-bottom:15px}.home-card-title small{float:right;color:#8b9099;font-size:10px;font-weight:500}.quick-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.quick-actions button{border:0;border-radius:13px;background:#f7f8fa;min-height:96px;padding:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.quick-actions button:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(0,0,0,.06)}.quick-actions b{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;font-size:18px}.qa-blue{background:#e8f1ff;color:#1473e6}.qa-green{background:#e7f8ee;color:#16a34a}.qa-purple{background:#f1eaff;color:#7c3aed}.qa-red{background:#ffebed;color:#ef4444}.quick-actions span{font-size:12px;font-weight:600}
.today-metrics{display:grid;grid-template-columns:repeat(3,1fr);padding-top:12px}.today-metrics div{padding:4px 14px;border-left:1px solid #eee}.today-metrics div:first-child{border-left:0}.today-metrics strong{display:block;font-size:27px;letter-spacing:-.8px}.today-metrics div:nth-child(1) strong{color:#111827}.today-metrics div:nth-child(2) strong{color:#16a34a}.today-metrics div:nth-child(3) strong{color:#ef4444}.today-metrics span{display:block;margin-top:5px;color:#667085;font-size:11px;line-height:1.45}
.attention-count{display:inline-grid;place-items:center;margin-left:7px;min-width:24px;height:20px;padding:0 7px;border-radius:999px;background:#ef4444;color:#fff;font-size:10px}.attention-list{min-height:210px}.attention-row{display:grid;grid-template-columns:34px 1fr auto;gap:12px;align-items:center;padding:12px 3px;border-top:1px solid #eee}.attention-row:first-child{border-top:0}.attention-row b{font-size:12px}.attention-row span{display:block;color:#818793;font-size:10px;margin-top:2px}.attention-row em{font-style:normal;color:#6f7680;font-size:10px}.attention-badge{width:32px;height:32px;border-radius:50%;display:grid!important;place-items:center;background:#fff1f1;color:#ef4444;font-size:14px!important}.home-empty{color:#8b9099;font-size:12px;padding:28px 4px}
.activity-placeholder{text-align:center;padding:34px 20px;color:#7d8490}.activity-placeholder .activity-icon{margin:auto auto 12px;width:42px;height:42px;border-radius:50%;background:#f1edff;color:#7c3aed;display:grid;place-items:center;font-size:20px}.activity-placeholder strong{font-size:12px;color:#424854}.activity-placeholder p{font-size:10px;line-height:1.5;max-width:230px;margin:6px auto}
.system-card{margin-bottom:0}.system-ok{color:#16a34a;font-size:10px;font-weight:500;margin-left:8px}.system-modules{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.system-modules>div{position:relative;border:1px solid #eceef1;border-radius:12px;padding:13px;display:flex;gap:10px;align-items:center}.system-modules b{width:32px;height:32px;border-radius:50%;background:#f4f6f9;display:grid;place-items:center}.system-modules span{font-size:11px;font-weight:600}.system-modules small{display:block;margin-top:3px;color:#9197a1;font-size:9px;font-weight:400}.system-modules>div>i{position:absolute;right:10px;top:10px;width:7px;height:7px;border-radius:50%;background:#22c55e}
body[data-active-tab="home"] .page{display:none}.home-page[hidden]{display:none!important}
@media(max-width:1000px){.app-shell{grid-template-columns:74px minmax(0,1fr)}.app-sidebar{width:74px}.app-brand span,.app-brand strong,.app-sidebar .app-tab span:not(.nav-icon),.sidebar-settings{font-size:0}.app-sidebar .app-tab{justify-content:center}.nav-icon{font-size:19px}.home-top-grid,.home-middle-grid{grid-template-columns:1fr}.system-modules{grid-template-columns:repeat(2,1fr)}}

.app-brand-logo{display:block;width:148px;height:auto;object-fit:contain;object-position:left center}.app-brand span{margin-top:5px;padding-left:2px}
@media(max-width:1000px){.app-brand-logo{width:46px;height:34px;object-fit:cover;object-position:left center}}

/* Auto-collapsed navigation on operational screens */
.app-shell,.app-sidebar,.app-main{transition:grid-template-columns .22s ease,width .22s ease,padding .22s ease}
.sidebar-expand{display:none;position:absolute;right:-12px;top:24px;width:25px;height:25px;border:1px solid #dde1e7;border-radius:50%;background:#fff;color:#667085;box-shadow:0 3px 10px rgba(0,0,0,.08);cursor:pointer;z-index:2}
body.sidebar-collapsed .app-shell{grid-template-columns:64px minmax(0,1fr)}
body.sidebar-collapsed .app-sidebar{width:64px;padding-left:9px;padding-right:9px}
body.sidebar-collapsed .app-main{padding-left:18px;padding-right:18px}
body.sidebar-collapsed .app-brand{padding-left:4px;padding-right:4px}
body.sidebar-collapsed .app-brand-logo{width:43px;height:32px;object-fit:cover;object-position:left center}
body.sidebar-collapsed .app-brand>span,body.sidebar-collapsed .app-tab>span:not(.nav-icon),body.sidebar-collapsed .sidebar-settings{font-size:0;width:0;overflow:hidden;padding-left:0;padding-right:0}
body.sidebar-collapsed .app-sidebar .app-tab{justify-content:center;padding-left:0!important;padding-right:0!important}
body.sidebar-collapsed .nav-icon{width:38px;font-size:18px}
body.sidebar-collapsed .sidebar-expand{display:grid;place-items:center}
body.sidebar-collapsed .presence-preview{display:none}
body.sidebar-collapsed .global-bar{height:64px}

/* App shell layout fix: operational pages must start directly below the global bar */
.app-main{display:flex;flex-direction:column;min-height:100vh}
.global-bar{flex:0 0 78px}
.app-main>.app-page{flex:0 0 auto;width:100%;margin:0!important}
body.sidebar-collapsed .global-bar{flex-basis:64px}
body.sidebar-collapsed .app-main>.app-page:not([hidden]){margin-top:0!important;padding-top:0!important}
body.sidebar-collapsed .app-main>.app-page:not([hidden])>.topbar,
body.sidebar-collapsed .app-main>.app-page:not([hidden])>.inventory-head,
body.sidebar-collapsed .app-main>.app-page:not([hidden])>.incoming-page-head,
body.sidebar-collapsed .app-main>.app-page:not([hidden])>.product-master-head,
body.sidebar-collapsed .app-main>.app-page:not([hidden])>.reports-head{margin-top:0!important;padding-top:0!important}

/* Operational workspace: pin the active module immediately under the global bar.
   This removes scroll anchoring/legacy document-flow offsets when switching modules. */
body.sidebar-collapsed{overflow-anchor:none}
body.sidebar-collapsed .app-main{position:relative;display:block;min-height:100vh;padding-top:64px}
body.sidebar-collapsed .global-bar{position:fixed;top:0;left:64px;right:0;height:64px;z-index:80;padding:0 18px;background:rgba(246,247,249,.88)}
body.sidebar-collapsed .app-main>.app-page:not([hidden]){
  display:block!important;
  position:relative;
  top:auto!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  min-height:calc(100vh - 64px);
}

/* Navigation performance pass */
.app-shell{display:block!important;min-height:100vh}
.app-sidebar{
  will-change:width;
  transition:width .14s cubic-bezier(.2,.8,.2,1),padding .14s cubic-bezier(.2,.8,.2,1)!important;
}
.app-main{
  margin-left:230px;
  transition:margin-left .14s cubic-bezier(.2,.8,.2,1),padding .14s cubic-bezier(.2,.8,.2,1)!important;
}
body.sidebar-collapsed .app-main{margin-left:64px}
body.sidebar-collapsed .app-shell{display:block!important}
.app-sidebar .app-tab{transition:background-color .12s ease,color .12s ease!important}
.app-sidebar .app-tab,.app-sidebar .nav-icon{will-change:auto}
.app-main>.app-page[hidden]{display:none!important}
body.sidebar-collapsed .global-bar{backdrop-filter:none;-webkit-backdrop-filter:none;background:rgba(246,247,249,.97)}

/* Smooth sidebar pass: keep heavy workspaces out of the animation path */
.app-main{
  transition:none!important;
}
.app-sidebar{
  contain:layout paint style;
  transition:width .12s cubic-bezier(.22,1,.36,1),padding .12s cubic-bezier(.22,1,.36,1)!important;
}
.app-brand-logo,
.app-brand>span,
.app-sidebar .app-tab>span:not(.nav-icon),
.sidebar-settings{
  transition:opacity .08s linear!important;
}
body.sidebar-collapsed .app-brand>span,
body.sidebar-collapsed .app-sidebar .app-tab>span:not(.nav-icon),
body.sidebar-collapsed .sidebar-settings{
  opacity:0!important;
}
body:not(.sidebar-collapsed) .app-brand>span,
body:not(.sidebar-collapsed) .app-sidebar .app-tab>span:not(.nav-icon),
body:not(.sidebar-collapsed) .sidebar-settings{
  opacity:1;
}
body.sidebar-collapsed .app-main{
  margin-left:64px!important;
  padding-left:18px!important;
  padding-right:18px!important;
}
body:not(.sidebar-collapsed) .app-main{
  margin-left:230px!important;
}
.app-sidebar .app-tab{
  transition:background-color .08s linear,color .08s linear!important;
}
.sidebar-expand{
  transition:opacity .08s linear,transform .08s linear!important;
}

/* Slim operational top bar so page headers never feel cropped */
body.sidebar-collapsed .app-main{padding-top:48px!important}
body.sidebar-collapsed .global-bar{
  height:48px!important;
  min-height:48px!important;
  padding:0 14px!important;
}
body.sidebar-collapsed .global-search{height:32px!important}
body.sidebar-collapsed .po-save-status{min-height:32px}
body.sidebar-collapsed .app-main>.app-page:not([hidden]){
  min-height:calc(100vh - 48px)!important;
}

/* New app shell owns the top chrome. Disable the old 72px dock backdrop,
   which was sitting above the new 48px bar and visually cropping module titles. */
body::before{display:none!important;content:none!important}
body.sidebar-collapsed .app-main{padding-top:52px!important}
body.sidebar-collapsed .global-bar{
  height:52px!important;
  min-height:52px!important;
  background:rgba(246,247,249,.96)!important;
}
body.sidebar-collapsed .app-main>.app-page:not([hidden]){
  min-height:calc(100vh - 52px)!important;
}

/* Home operational intelligence */
.today-metrics{grid-template-columns:repeat(4,1fr)!important}
.home-activity-list{display:flex;flex-direction:column;min-height:210px}
.home-activity-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:10px;align-items:center;width:100%;border:0;border-top:1px solid #eee;background:transparent;padding:11px 2px;text-align:left}
.home-activity-row:first-child{border-top:0}
.home-activity-row:hover{background:#fafafa}
.home-activity-icon{width:31px;height:31px;border-radius:50%;display:grid;place-items:center;font-size:12px;background:#f2f4f7;color:#667085}
.home-activity-icon.inventory{background:#eef4ff;color:#1769e0}
.home-activity-icon.receipt{background:#ebf8ef;color:#16a34a}
.home-activity-icon.incoming{background:#f4efff;color:#7c3aed}
.home-activity-row b,.home-activity-row small{display:block}
.home-activity-row b{font-size:11px;color:#252a31}
.home-activity-row small{margin-top:3px;color:#8b9099;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-activity-row em{font-style:normal;color:#9aa0a8;font-size:9px;white-space:nowrap}
.attention-row{border-left:0;border-right:0;border-bottom:0;background:transparent;width:100%;text-align:left}
.attention-row:hover{background:#fafafa}
@media(max-width:1100px){.today-metrics{grid-template-columns:repeat(2,1fr)!important}.today-metrics div:nth-child(3){border-left:0}}

/* Compositor-first sidebar animation: no workspace reflow while opening/closing */
:root{--sidebar-expanded:230px;--sidebar-collapsed:64px}
.app-sidebar{
  width:var(--sidebar-expanded)!important;
  padding:24px 14px!important;
  clip-path:inset(0 0 0 0 round 0);
  transition:clip-path .18s cubic-bezier(.22,1,.36,1)!important;
  will-change:clip-path;
  contain:paint style;
  transform:translateZ(0);
  backface-visibility:hidden;
}
body.sidebar-collapsed .app-sidebar{
  width:var(--sidebar-expanded)!important;
  padding:24px 14px!important;
  clip-path:inset(0 calc(var(--sidebar-expanded) - var(--sidebar-collapsed)) 0 0 round 0);
}
body.sidebar-collapsed .app-sidebar .app-tab{
  justify-content:flex-start!important;
  padding:0 12px!important;
}
body.sidebar-collapsed .nav-icon{width:18px!important}
body.sidebar-collapsed .app-brand-logo{width:148px!important;height:auto!important;object-fit:contain!important}
body.sidebar-collapsed .app-brand>span,
body.sidebar-collapsed .app-sidebar .app-tab>span:not(.nav-icon),
body.sidebar-collapsed .sidebar-settings{
  font-size:inherit!important;
  width:auto!important;
  overflow:visible!important;
  padding-left:initial;
  padding-right:initial;
  opacity:0!important;
  transform:translateX(-8px);
  pointer-events:none;
}
.app-brand>span,
.app-sidebar .app-tab>span:not(.nav-icon),
.sidebar-settings{
  transition:opacity .11s ease,transform .16s cubic-bezier(.22,1,.36,1)!important;
  transform:translateX(0);
}
body:not(.sidebar-collapsed) .app-brand>span,
body:not(.sidebar-collapsed) .app-sidebar .app-tab>span:not(.nav-icon),
body:not(.sidebar-collapsed) .sidebar-settings{
  opacity:1!important;
  transform:translateX(0);
}
.app-main{transition:none!important}
body.sidebar-collapsed .app-main{margin-left:var(--sidebar-collapsed)!important}
body:not(.sidebar-collapsed) .app-main{margin-left:var(--sidebar-expanded)!important}
.sidebar-expand{
  right:calc(var(--sidebar-expanded) - var(--sidebar-collapsed) - 12px)!important;
  transition:transform .18s cubic-bezier(.22,1,.36,1),opacity .1s ease!important;
  transform:translateX(0);
}
body.sidebar-collapsed .sidebar-expand{transform:translateX(calc((var(--sidebar-expanded) - var(--sidebar-collapsed)) * -1))}

.incoming-summary-copy {
  justify-self: center;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text);
  background: #f5f6f7;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.incoming-summary-copy:hover { background:#eceef1; }
.incoming-summary-copy:focus-visible { outline:2px solid #2563eb; outline-offset:2px; }
.incoming-summary-copy.is-copied { background:#e9f8ef; color:#15803d; }


/* Supplier Manager */
.supplier-manager-page{padding:20px 0!important}
.supplier-manager-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px}
.supplier-manager-head-actions{display:flex;align-items:center;gap:10px}
.supplier-manager-count{font-size:12px;color:var(--muted)}
.supplier-manager-panel{overflow:hidden}
.supplier-manager-search{width:250px;height:36px;border:1px solid var(--border-strong);border-radius:9px;padding:0 10px;background:#fff}
.supplier-manager-table{min-width:850px}
.supplier-manager-table th{top:52px}
.supplier-manager-table input[type="number"],.supplier-manager-table select{height:34px;border:1px solid var(--border-strong);border-radius:8px;background:#fff;padding:5px 8px}
.supplier-manager-table input[type="number"]{width:100px}
.supplier-manager-table select{min-width:120px}
.supplier-manager-check{text-align:center}
.supplier-manager-check input{width:18px;height:18px}
.supplier-manager-save-cell{display:flex;align-items:center;gap:8px}
.supplier-manager-row-status{font-size:10px;color:var(--muted)}
.supplier-manager-row-status.success{color:var(--success)}
.supplier-manager-row-status.error{color:var(--danger)}
.supplier-manager-form-grid{display:grid;grid-template-columns:1.4fr .7fr .7fr .9fr;gap:14px;align-items:end}
.supplier-manager-form-grid .field span{font-size:11px;font-weight:700;color:var(--muted)}
.supplier-manager-new-check{display:flex;align-items:center;gap:7px;height:38px;font-size:12px;font-weight:650}
.supplier-manager-form-actions{display:flex;justify-content:flex-end;gap:8px;grid-column:3 / -1}
.winner-option{color:#15803d!important;font-weight:700}
@media(max-width:1050px){.supplier-manager-form-grid{grid-template-columns:1fr 1fr}.supplier-manager-form-actions{grid-column:1/-1}}


/* Supplier Manager v2 */
.supplier-manager-table{min-width:1180px}
.supplier-origin-editor{position:relative;display:flex;align-items:center;gap:6px;min-width:190px}
.supplier-origin-summary{display:flex;gap:5px;flex-wrap:wrap;align-items:center}
.supplier-origin-chip{display:inline-flex;align-items:center;border:1px solid #dfe5d6;background:#f5f8ef;color:#59652f;border-radius:999px;padding:4px 7px;font-size:10px;font-weight:700}
.supplier-origin-empty{font-size:11px;color:var(--muted)}
.supplier-origin-toggle{width:27px;height:27px;border:1px solid var(--border);border-radius:8px;background:#fff;font-size:15px;line-height:1}
.supplier-origin-menu{position:absolute;top:34px;left:0;z-index:90;min-width:150px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:7px;box-shadow:0 12px 30px rgba(17,24,39,.12)}
.supplier-origin-menu label{display:flex;align-items:center;gap:7px;padding:6px;border-radius:7px;font-size:11px}
.supplier-origin-menu label:hover{background:var(--soft)}
.supplier-winning-count strong{display:block;font-size:13px}
.supplier-winning-count small{display:block;margin-top:2px;color:var(--muted);font-size:9px}
.supplier-manager-origin-options{display:flex;gap:6px;flex-wrap:wrap}
.supplier-manager-origin-options label{display:flex;align-items:center;gap:5px;border:1px solid var(--border);border-radius:999px;padding:7px 9px;background:#fff;font-size:11px}
.supplier-payment-detail-row>td{padding:0!important;background:#f8f9fb}
.supplier-payment-detail{padding:18px 20px;border-top:1px solid var(--border)}
.supplier-payment-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px}
.supplier-payment-head>div{display:flex;flex-direction:column;gap:3px}
.supplier-payment-head>div>span{font-size:11px;color:var(--muted)}
.supplier-payment-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px}
.supplier-payment-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:12px}
.supplier-payment-card-top{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:9px}
.supplier-currency-badge,.supplier-preferred-badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 7px;font-size:9px;font-weight:800}
.supplier-currency-badge{background:#eef1e8;color:#5c6634}
.supplier-preferred-badge{background:#fff7df;color:#8a6500;margin-left:5px}
.supplier-payment-remove,.supplier-payment-view-image{border:0;background:transparent;font-size:10px;color:var(--muted);padding:0}
.supplier-payment-remove:hover{color:var(--danger)}
.supplier-payment-view-image{margin-top:8px;color:#4f5f8a;text-decoration:underline}
.supplier-payment-meta{display:flex;flex-direction:column;gap:3px;margin-top:7px;font-size:10px;color:#646b73}
.supplier-payment-notes{margin-top:8px;font-size:10px;color:var(--muted);white-space:normal}
.supplier-payment-empty,.supplier-payment-loading,.supplier-payment-locked{border:1px dashed var(--border);border-radius:10px;padding:14px;color:var(--muted);font-size:11px}
.supplier-payment-locked{display:flex;flex-direction:column;gap:4px}
.supplier-payment-form{margin-top:14px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:14px}
.supplier-payment-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px}
.supplier-payment-grid label{display:flex;flex-direction:column;gap:5px;font-size:10px;font-weight:700;color:var(--muted)}
.supplier-payment-grid input,.supplier-payment-grid select,.supplier-payment-grid textarea{width:100%;border:1px solid var(--border-strong);border-radius:8px;background:#fff;padding:7px 8px;font-size:11px}
.supplier-payment-grid input,.supplier-payment-grid select{height:34px}
.supplier-payment-grid textarea{min-height:64px;resize:vertical}
.supplier-payment-grid .pay-preferred{flex-direction:row;align-items:center;font-weight:600}
.supplier-payment-grid .pay-preferred input{width:auto;height:auto}
.pay-notes-wrap{grid-column:span 2}
.supplier-payment-form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
@media(max-width:1100px){.supplier-payment-grid{grid-template-columns:1fr 1fr}.pay-notes-wrap{grid-column:span 2}}

.supplier-manager-toolbar{display:flex;align-items:center;gap:8px}
.supplier-manager-sort{height:36px;border:1px solid var(--border-strong);border-radius:9px;padding:0 9px;background:#fff;font-size:11px;color:#4f5660}

.supplier-drag-col,.supplier-drag-cell{width:34px;text-align:center;padding-left:4px!important;padding-right:4px!important}
.supplier-row-drag-handle{
  display:inline-flex;align-items:center;justify-content:center;
  width:24px;height:28px;border-radius:7px;
  color:#9aa0a6;cursor:grab;user-select:none;touch-action:none;
  font-size:14px;letter-spacing:-3px;
}
.supplier-row-drag-handle:hover{background:#f1f3f4;color:#5f6368}
.supplier-row-drag-handle.active{cursor:grabbing;background:#eceff1;color:#3c4043}
.supplier-po-row.supplier-row-dragging{opacity:.72;box-shadow:0 8px 20px rgba(20,24,28,.08)}


/* Authentication + access foundation */
body.auth-locked{overflow:hidden;background:#f4f5f2}
body.auth-locked .app-shell{visibility:hidden;pointer-events:none}
body.auth-ready .app-shell{visibility:visible}
.auth-gate{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:28px;background:radial-gradient(circle at 20% 15%,rgba(151,164,94,.10),transparent 30%),#f4f5f2}
.auth-gate[hidden]{display:none!important}
.auth-card{width:min(420px,100%);background:#fff;border:1px solid #e3e5df;border-radius:24px;padding:34px;box-shadow:0 24px 70px rgba(36,40,28,.10)}
.auth-brand{display:flex;align-items:end;justify-content:space-between;gap:16px;padding-bottom:24px;border-bottom:1px solid #eef0ea;color:#858b7d;font-size:11px}
.auth-wordmark{font-size:28px;line-height:1;font-weight:800;letter-spacing:-1.5px;color:#747b32}.auth-wordmark span{font-size:1.05em}
.auth-copy{padding:28px 0 20px}.auth-copy h1{font-size:28px;letter-spacing:-.7px}.auth-copy p{margin:7px 0 0;color:#777f75;font-size:13px}
.auth-form{display:grid;gap:14px}.auth-form label{display:grid;gap:6px}.auth-form label>span{font-size:11px;font-weight:700;color:#62695f}
.auth-form input{width:100%;height:44px;border:1px solid #dfe3dc;border-radius:11px;background:#fbfcfa;padding:0 12px;outline:none}
.auth-form input:focus{border-color:#9da67a;box-shadow:0 0 0 3px rgba(129,139,73,.10)}
.auth-submit{height:44px;margin-top:4px;border:0;border-radius:11px;background:#171a16;color:#fff;font-weight:700}
.auth-submit:hover{background:#292d27}.auth-submit:disabled{opacity:.55;cursor:default}
.auth-status{min-height:18px;font-size:11px;color:#777f75}.auth-status.error{color:#b42318}.auth-status.success{color:#176b3a}
.auth-foot{margin-top:18px;padding-top:18px;border-top:1px solid #eef0ea;color:#a0a69d;font-size:10px;text-align:center}
.auth-user-control{position:relative;flex:0 0 auto}
.auth-user-chip{display:flex;align-items:center;gap:9px;height:38px;border:1px solid #e3e6ea;background:#fff;border-radius:999px;padding:3px 9px 3px 4px;color:#252a31}
.auth-user-chip:hover{background:#f8f9fa}
.auth-user-avatar{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#ecefe7;color:#687032;font-size:10px;font-weight:800}
.auth-user-copy{display:flex;flex-direction:column;align-items:flex-start;line-height:1.05}
.auth-user-copy strong{font-size:10px;max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.auth-user-copy small{font-size:8px;color:#91978e;margin-top:3px}
.auth-user-chevron{font-size:10px;color:#8b9189}
.auth-user-menu{position:absolute;right:0;top:44px;z-index:200;width:150px;background:#fff;border:1px solid #e3e6ea;border-radius:12px;padding:6px;box-shadow:0 14px 34px rgba(17,24,39,.12)}
.auth-user-menu button{width:100%;border:0;background:transparent;border-radius:8px;padding:9px 10px;text-align:left;font-size:11px}.auth-user-menu button:hover{background:#f5f6f7}
@media(max-width:900px){.auth-user-copy,.auth-user-chevron{display:none}.auth-user-chip{padding-right:4px}}

/* Live Reports breakdowns */
.reports-live-breakdown{margin-top:14px}
.reports-breakdown-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:9px;margin-bottom:12px}
.reports-breakdown-stat{border:1px solid var(--border);border-radius:11px;background:#fafbfc;padding:11px}
.reports-breakdown-stat span{display:block;font-size:9px;font-weight:750;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.reports-breakdown-stat strong{display:block;margin-top:5px;font-size:15px}
.reports-breakdown-stat small{display:block;margin-top:3px;font-size:9px;color:var(--muted)}
.reports-mini-table{border:1px solid var(--border);border-radius:11px;overflow:hidden;background:#fff}
.reports-mini-head,.reports-mini-row{display:grid;grid-template-columns:minmax(180px,1.6fr) .55fr .75fr .9fr;gap:10px;align-items:center;padding:8px 10px}
.reports-mini-head{background:#f7f8f9;color:var(--muted);font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}
.reports-mini-row{border-top:1px solid #eef0f2;font-size:10px}
.reports-mini-row>span:first-child{min-width:0}
.reports-mini-row small{display:block;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}
.reports-mini-row>span:nth-child(n+2){text-align:right}
.reports-data-note{margin-top:9px;color:var(--muted);font-size:9px;line-height:1.45}
@media(max-width:900px){.reports-mini-head,.reports-mini-row{grid-template-columns:1.4fr .5fr .8fr}.reports-mini-head>span:nth-child(3),.reports-mini-row>span:nth-child(3){display:none}}


/* Supplier cards are already lazy: collapsed cards do not render their row markup.
   Avoid content-visibility placeholders here because their intrinsic height creates
   large blank cards and delayed paint while scrolling Supplier Orders. */

/* Keyboard row reorder: keep the handle visibly active without blue row/cell selection. */
.drag-handle:focus,
.supplier-row-drag-handle:focus{
  outline:none;
}
.drag-handle.keyboard-reorder-active,
.supplier-row-drag-handle.keyboard-reorder-active{
  color:#3c4043;
  background:#eceff1;
  border-radius:7px;
  opacity:1;
}


/* Suppliers Incoming: order number stays editable for the lifetime of a batch. */
.incoming-reference-display{
  display:inline-flex;
  align-items:center;
  gap:5px;
}
.incoming-reference-edit{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:7px;
  color:#8a8f98;
  cursor:pointer;
  font-size:12px;
  opacity:.72;
  transition:background .16s ease,color .16s ease,opacity .16s ease,transform .16s ease;
}
.incoming-reference-display:hover .incoming-reference-edit,
.incoming-reference-edit:focus{
  background:#f0f1f3;
  color:#4b5159;
  opacity:1;
  outline:none;
}
.incoming-reference-edit:active{transform:scale(.94)}
.incoming-reference-editor{
  display:inline-flex;
  align-items:center;
  gap:5px;
  cursor:default;
}
.incoming-reference-input{
  width:150px;
  height:30px;
  padding:0 9px;
  border:1px solid #c8ccd2;
  border-radius:8px;
  background:#fff;
  color:inherit;
  font:inherit;
  outline:none;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.incoming-reference-input:focus{
  border-color:#8a9098;
  box-shadow:0 0 0 3px rgba(80,86,94,.09);
}
.incoming-reference-save,
.incoming-reference-cancel{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:8px;
  cursor:pointer;
  color:#5e646c;
  background:#f2f3f4;
  transition:transform .14s ease,background .14s ease;
}
.incoming-reference-save:hover,
.incoming-reference-cancel:hover{background:#e7e9eb}
.incoming-reference-save:active,
.incoming-reference-cancel:active{transform:scale(.94)}


/* Suppliers Incoming recycle bin */
.incoming-trash-tab{margin-left:4px}
.incoming-order-card.is-trashed{opacity:.82}
.incoming-trash-actions{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.incoming-restore-order,
.incoming-delete-forever{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 9px;
  border-radius:8px;
  background:#f1f2f3;
  color:#555b63;
  font-size:11px;
  font-weight:650;
  cursor:pointer;
  white-space:nowrap;
  transition:background .15s ease,transform .15s ease;
}
.incoming-restore-order:hover{background:#e5e7e9}
.incoming-delete-forever{color:#a33}
.incoming-delete-forever:hover{background:#f8eaea}
.incoming-restore-order:active,
.incoming-delete-forever:active{transform:scale(.97)}


/* Global centered application dialogs */
.app-dialog[hidden]{display:none!important}
.app-dialog{
  position:fixed;
  inset:0;
  z-index:100000;
  display:grid;
  place-items:center;
  padding:24px;
}
.app-dialog-backdrop{
  position:absolute;
  inset:0;
  background:rgba(24,27,31,.28);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
  animation:app-dialog-fade .16s ease both;
}
.app-dialog-card{
  position:relative;
  width:min(430px,calc(100vw - 36px));
  padding:26px 26px 22px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:20px;
  background:rgba(255,255,255,.97);
  box-shadow:0 24px 70px rgba(0,0,0,.18),0 2px 10px rgba(0,0,0,.06);
  text-align:center;
  animation:app-dialog-in .2s cubic-bezier(.22,1,.36,1) both;
}
.app-dialog-icon{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  margin:0 auto 14px;
  border-radius:13px;
  background:#f0f2f4;
  color:#59616b;
  font-size:18px;
  font-weight:750;
}
.app-dialog-card.is-danger .app-dialog-icon{
  background:#fff0f0;
  color:#b43c3c;
}
.app-dialog-card h2{
  margin:0 0 8px;
  font-size:18px;
  line-height:1.25;
  letter-spacing:-.015em;
}
.app-dialog-card p{
  margin:0 auto;
  max-width:360px;
  color:#666d76;
  font-size:13px;
  line-height:1.55;
  white-space:pre-line;
}
.app-dialog-input{
  box-sizing:border-box;
  width:100%;
  height:40px;
  margin-top:18px;
  padding:0 12px;
  border:1px solid #cfd3d8;
  border-radius:10px;
  background:#fff;
  color:#20242a;
  font:inherit;
  outline:none;
}
.app-dialog-input:focus{
  border-color:#8d949c;
  box-shadow:0 0 0 3px rgba(60,66,73,.09);
}
.app-dialog-actions{
  display:flex;
  justify-content:center;
  gap:9px;
  margin-top:22px;
}
.app-dialog-actions .btn{
  min-width:96px;
}
.app-dialog-card.is-danger #app-dialog-confirm{
  border-color:#b33d3d;
  background:#b33d3d;
  color:#fff;
}
@keyframes app-dialog-fade{from{opacity:0}to{opacity:1}}
@keyframes app-dialog-in{
  from{opacity:0;transform:translateY(8px) scale(.975)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@media (prefers-reduced-motion:reduce){
  .app-dialog-backdrop,.app-dialog-card{animation:none}
}


/* Product Master product-name editing */
.product-name-input{
  box-sizing:border-box;
  width:100%;
  min-width:170px;
  padding:7px 8px;
  border:1px solid transparent;
  border-radius:7px;
  background:transparent;
  color:inherit;
  font:inherit;
  outline:none;
  transition:background .14s ease,border-color .14s ease,box-shadow .14s ease,opacity .14s ease;
}
.product-name-input:hover{background:#f7f8f9}
.product-name-input:focus{
  background:#fff;
  border-color:#aeb4bb;
  box-shadow:0 0 0 3px rgba(75,82,90,.08);
}
.product-name-input.is-saving{opacity:.55}
.product-name-input.is-saved{background:#f1f8f3}


/* Sales Orders / Fulfillment — restrained native-app visual language */
.sales-page{background:#f5f5f7;min-height:calc(100vh - 70px)}
.sales-shell{max-width:1240px;margin:0 auto;padding:42px 34px 70px}
.sales-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:28px}
.sales-eyebrow{display:block;margin-bottom:7px;color:#86868b;font-size:11px;font-weight:700;letter-spacing:.13em}
.sales-hero h1{margin:0;color:#1d1d1f;font-size:36px;line-height:1.08;letter-spacing:-.035em}
.sales-hero p{margin:8px 0 0;color:#6e6e73;font-size:14px}
.sales-layout{display:grid;gap:16px}
.sales-card{padding:24px;border:1px solid rgba(0,0,0,.055);border-radius:20px;background:rgba(255,255,255,.94);box-shadow:0 2px 10px rgba(0,0,0,.025)}
.sales-card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.sales-card-head>div{display:flex;align-items:center;gap:10px}.sales-card-head>div>span{display:grid;place-items:center;width:27px;height:27px;border-radius:9px;background:#f2f2f4;color:#77777c;font-size:10px;font-weight:750}
.sales-card h2{margin:0;color:#1d1d1f;font-size:17px;letter-spacing:-.015em}.sales-card-head small{color:#99999f;font-size:11px}
.sales-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.sales-span-2{grid-column:span 2}
.sales-field{position:relative;display:grid;gap:7px}.sales-field>span{color:#6e6e73;font-size:11px;font-weight:650}
.sales-field input,.sales-field select{box-sizing:border-box;width:100%;height:42px;padding:0 12px;border:1px solid #dedee2;border-radius:11px;background:#fafafa;color:#1d1d1f;font:inherit;outline:none;transition:.16s ease}
.sales-field input:focus,.sales-field select:focus{border-color:#a9a9af;background:#fff;box-shadow:0 0 0 3px rgba(0,0,0,.045)}
.sales-primary,.sales-secondary{height:38px;padding:0 16px;border:0;border-radius:11px;font:inherit;font-size:12px;font-weight:650;cursor:pointer}.sales-primary{background:#1d1d1f;color:#fff}.sales-secondary{background:#ededf0;color:#353539}
.sales-use-existing{position:absolute;right:7px;bottom:6px;height:30px;padding:0 10px;border:0;border-radius:8px;background:#e9e9ed;color:#55555a;font-size:10px;font-weight:700;cursor:pointer}
.sales-suggestions{position:absolute;z-index:50;top:68px;left:0;right:0;padding:6px;border:1px solid rgba(0,0,0,.08);border-radius:13px;background:#fff;box-shadow:0 16px 42px rgba(0,0,0,.12)}
.sales-suggestion{display:flex;width:100%;justify-content:space-between;gap:16px;padding:10px;border:0;border-radius:9px;background:transparent;text-align:left;cursor:pointer}.sales-suggestion:hover{background:#f4f4f6}.sales-suggestion small{color:#8a8a8f}
.sales-items-head,.sales-item-row{display:grid;grid-template-columns:150px minmax(220px,1fr) 120px 90px 160px 34px;gap:10px;align-items:center}.sales-items-head{padding:8px 8px 10px;color:#929297;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;align-items:end}
.sales-item-row{padding:8px;border-top:1px solid #f0f0f2}.sales-item-row input{box-sizing:border-box;width:100%;height:38px;padding:0 10px;border:1px solid transparent;border-radius:9px;background:#f7f7f8;outline:none}.sales-item-row input:focus{border-color:#c7c7cc;background:#fff}
.sales-product-name{font-size:12px;color:#333337}.sales-stock{font-size:12px;color:#6e6e73}.sales-stock strong{color:#1d1d1f}
.sales-remove-item{border:0;background:transparent;color:#a1a1a6;font-size:18px;cursor:pointer}
.sales-submit-bar{position:sticky;bottom:18px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 16px 14px 20px;border:1px solid rgba(0,0,0,.07);border-radius:16px;background:rgba(255,255,255,.88);box-shadow:0 12px 34px rgba(0,0,0,.09);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.sales-submit-bar>div{display:grid;gap:2px}.sales-submit-bar strong{font-size:12px}.sales-submit-bar span{color:#8a8a8f;font-size:10px}
.fulfillment-toolbar{display:flex;justify-content:space-between;gap:18px;margin-bottom:16px}.fulfillment-segment{display:flex;padding:4px;border-radius:12px;background:#e8e8eb}.fulfillment-segment button{height:31px;padding:0 13px;border:0;border-radius:9px;background:transparent;color:#66666b;font-size:11px;font-weight:650;cursor:pointer}.fulfillment-segment button.active{background:#fff;color:#1d1d1f;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.fulfillment-queue{display:grid;gap:12px}.fulfillment-card{padding:20px;border:1px solid rgba(0,0,0,.055);border-radius:18px;background:#fff}.fulfillment-card-head{display:flex;justify-content:space-between;gap:20px}.fulfillment-code{font-weight:750}.fulfillment-meta{margin-top:5px;color:#77777c;font-size:11px}.fulfillment-badge{height:26px;padding:0 9px;border-radius:999px;background:#f0f0f2;font-size:10px;display:flex;align-items:center}.sales-empty{padding:60px;text-align:center;color:#99999f}
@media(max-width:850px){.sales-shell{padding:24px 16px 60px}.sales-grid{grid-template-columns:1fr}.sales-span-2{grid-column:auto}.sales-items-head{display:none}.sales-item-row{grid-template-columns:1fr 1fr}.sales-product-name{grid-column:span 2}.sales-hero h1{font-size:30px}}

.customer-toolbar{max-width:520px;margin-bottom:16px}.customer-db-list{display:grid;gap:8px}.customer-row{display:grid;grid-template-columns:minmax(280px,1fr) 100px 170px;gap:24px;align-items:center;width:100%;padding:17px 20px;border:1px solid rgba(0,0,0,.055);border-radius:15px;background:#fff;color:#1d1d1f;text-align:left;cursor:pointer;transition:.15s ease}.customer-row:hover{transform:translateY(-1px);box-shadow:0 7px 22px rgba(0,0,0,.05)}.customer-row>span{display:grid;gap:3px}.customer-row>span:not(:first-child){text-align:right}.customer-row small{color:#8a8a8f;font-size:10px;font-weight:500}.customer-row strong{font-size:12px}.customer-history{margin-top:18px}.customer-orders{display:grid;gap:8px}.customer-order{display:grid;grid-template-columns:260px 1fr;gap:20px;padding:14px 0;border-top:1px solid #eeeeef}.customer-order>div{display:grid;gap:4px}.customer-order small,.customer-order span{color:#77777c;font-size:11px}.customer-order span{display:block}
@media(max-width:850px){.customer-row{grid-template-columns:1fr 70px}.customer-row>span:last-child{grid-column:span 2}.customer-order{grid-template-columns:1fr}}

.sales-sku-wrap{position:relative;min-width:0}.sales-sku-suggestions{position:absolute;z-index:80;top:42px;left:0;width:330px;max-height:280px;overflow:auto;padding:5px;border:1px solid rgba(0,0,0,.08);border-radius:12px;background:#fff;box-shadow:0 14px 34px rgba(0,0,0,.13)}.sales-sku-suggestions button{display:grid;width:100%;gap:2px;padding:9px 10px;border:0;border-radius:8px;background:transparent;text-align:left;cursor:pointer}.sales-sku-suggestions button:hover{background:#f4f4f6}.sales-sku-suggestions strong{font-size:11px;color:#1d1d1f}.sales-sku-suggestions small{font-size:10px;color:#85858a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.field-optional{font-style:normal;font-weight:500;color:#a0a0a5}

.sales-submit-actions{display:flex;align-items:center;gap:8px}
#salesExportPdf[hidden]{display:none!important}
@media(max-width:700px){.sales-submit-actions{width:100%;justify-content:flex-end;flex-wrap:wrap}.sales-submit-bar{align-items:flex-start}}

.fulfillment-card-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.fulfillment-pdf{height:32px;padding:0 12px}

/* Fulfillment workspace — marketplace density with Apple restraint */
.fulfillment-status-tabs{display:flex;gap:24px;align-items:center;margin:2px 0 18px;border-bottom:1px solid #e7e7ea;overflow:auto}
.fulfillment-status-tabs button{position:relative;display:flex;align-items:center;gap:7px;height:44px;padding:0 2px;border:0;background:transparent;color:#6e6e73;font-size:12px;font-weight:650;cursor:pointer;white-space:nowrap}
.fulfillment-status-tabs button span{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#ededf0;color:#74747a;font-size:10px}
.fulfillment-status-tabs button.active{color:#1d1d1f}
.fulfillment-status-tabs button.active:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;border-radius:999px;background:#1d1d1f}
.fulfillment-status-tabs button.active span{background:#1d1d1f;color:#fff}

.fulfillment-filter-card{display:grid;grid-template-columns:minmax(260px,1fr) 220px auto;gap:12px;align-items:end;padding:14px;margin-bottom:16px;border:1px solid rgba(0,0,0,.055);border-radius:16px;background:rgba(255,255,255,.92)}
.fulfillment-filter-card .sales-field{margin:0}

.fulfillment-approval-panel{margin:0 0 16px;border:1px solid rgba(0,0,0,.07);border-radius:16px;background:#fff;overflow:hidden}
.fulfillment-approval-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #eeeeef}
.fulfillment-approval-head strong{font-size:12px}
.fulfillment-approval-head span{display:grid;place-items:center;min-width:22px;height:22px;border-radius:999px;background:#f0f0f2;color:#66666b;font-size:10px}
.fulfillment-request-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:13px 16px;border-top:1px solid #f1f1f2}
.fulfillment-request-row:first-of-type{border-top:0}
.fulfillment-request-row>div:first-child{display:grid;gap:3px}
.fulfillment-request-row strong{font-size:12px;color:#1d1d1f}
.fulfillment-request-row small{font-size:10px;color:#85858a}
.fulfillment-request-actions{display:flex;align-items:center;gap:8px}
.fulfillment-waiting{font-size:10px;color:#8e8e93}

.fulfillment-order-card{border:1px solid rgba(0,0,0,.055);border-radius:17px;background:#fff;overflow:visible;box-shadow:0 1px 3px rgba(0,0,0,.018)}
.fulfillment-order-top{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 16px;border-bottom:1px solid #eeeeef;background:#fbfbfc;border-radius:17px 17px 0 0}
.fulfillment-order-top>div{display:flex;align-items:baseline;gap:10px;min-width:0}
.fulfillment-order-top strong{font-size:12px;color:#1d1d1f}
.fulfillment-order-top>div span{font-size:10px;color:#8c8c92;white-space:nowrap}
.fulfillment-status-pill{display:inline-flex;align-items:center;height:26px;padding:0 9px;border-radius:999px;font-size:10px;font-weight:700;white-space:nowrap}
.fulfillment-status-pill.status-to_ship{background:#f0f0f2;color:#4a4a4e}
.fulfillment-status-pill.status-shipping{background:#eef4ff;color:#3565a8}
.fulfillment-status-pill.status-completed{background:#edf7ef;color:#347542}
.fulfillment-status-pill.status-cancelled{background:#fff0f0;color:#a44444}

.fulfillment-order-body{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:24px;padding:16px}
.fulfillment-product-list{display:grid;gap:0}
.fulfillment-product-row{display:grid;grid-template-columns:minmax(0,1fr) 64px 110px;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid #f0f0f2}
.fulfillment-product-row:last-child{border-bottom:0}
.fulfillment-product-row>div{display:grid;gap:2px;min-width:0}
.fulfillment-product-row strong{font-size:11px;color:#29292d}
.fulfillment-product-row small{font-size:9px;color:#8d8d92;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.fulfillment-location-badge{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 7px;border-radius:999px;border:1px solid #e2e5e9;background:#f7f8fa;color:#535a63;font-size:8px;font-weight:750;letter-spacing:.01em;line-height:1;white-space:nowrap;box-shadow:0 1px 2px rgba(15,23,42,.025)}
.fulfillment-location-badge svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.fulfillment-location-badge.location-malabon{background:#f5f7f8;color:#475867;border-color:#dfe5e9}
.fulfillment-location-badge.location-cavite{background:#f8f6f3;color:#675c4e;border-color:#e8e1d8}
.fulfillment-location-badge.location-katipunan{background:#f5f7f5;color:#4f6256;border-color:#dfe6e1}
.fulfillment-product-row>span{font-size:10px;color:#77777c;text-align:center}
.fulfillment-product-row>strong:last-child{text-align:right;font-variant-numeric:tabular-nums}

.fulfillment-order-side{display:grid;align-content:start;gap:10px;padding:13px;border-radius:12px;background:#f7f7f8}
.fulfillment-order-side>div{display:flex;justify-content:space-between;gap:14px}
.fulfillment-order-side span{font-size:9px;color:#8d8d92}
.fulfillment-order-side strong{font-size:10px;color:#333337;text-align:right;font-weight:650}

.fulfillment-order-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-top:1px solid #eeeeef}
.fulfillment-order-footer>div:first-child{font-size:10px;color:#88888d}
.fulfillment-card-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.fulfillment-card-actions button{height:32px}

@media(max-width:850px){
  .fulfillment-filter-card{grid-template-columns:1fr}
  .fulfillment-order-body{grid-template-columns:1fr}
  .fulfillment-order-footer{align-items:flex-start;flex-direction:column}
  .fulfillment-card-actions{width:100%;justify-content:flex-start}
  .fulfillment-request-row{align-items:flex-start;flex-direction:column}
}

.app-brand-logo-compact{display:none}
body.sidebar-collapsed .app-brand>.app-brand-logo:not(.app-brand-logo-compact){display:none}
body.sidebar-collapsed .app-brand-logo-compact{display:block;width:32px;height:32px;object-fit:contain;object-position:center;border-radius:9px;margin:0 auto}
@media(max-width:1000px){
  body:not(.sidebar-collapsed) .app-brand-logo-compact{display:none}
  body.sidebar-collapsed .app-brand-logo-compact{width:32px;height:32px;object-fit:contain}
}

/* Final compact-brand override: keep the square mark fully visible in collapsed nav */
body.sidebar-collapsed .app-brand{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  padding-left:0!important;
  padding-right:0!important;
  overflow:visible!important;
}
body.sidebar-collapsed .app-brand .app-brand-logo-compact{
  display:block!important;
  width:28px!important;
  height:28px!important;
  max-width:28px!important;
  max-height:28px!important;
  object-fit:contain!important;
  object-position:center!important;
  margin:0 auto!important;
  border-radius:7px;
}

/* Align compact logo with the collapsed navigation icon column.
   The sidebar itself stays full-width and is visually clipped, so 100% would center
   the logo in the hidden 230px rail instead of the visible collapsed rail. */
body.sidebar-collapsed .app-brand{
  width:calc(var(--sidebar-collapsed) - 2px)!important;
  box-sizing:border-box!important;
  justify-content:center!important;
}
body.sidebar-collapsed .app-brand .app-brand-logo-compact{
  margin:0 auto!important;
}

/* Exact compact logo placement in the visible 64px collapsed rail */
body.sidebar-collapsed .app-brand .app-brand-logo-compact{
  position:fixed!important;
  top:24px!important;
  left:18px!important;
  width:28px!important;
  height:28px!important;
  margin:0!important;
  object-fit:contain!important;
  z-index:102!important;
}

/* Supplier Manager: keep sticky column header above the first supplier row */
.supplier-manager-table th{
  top:0!important;
  z-index:24!important;
}

/* Users & Access */
.users-access-page{background:#f5f5f7;min-height:100vh}
.users-access-shell{max-width:1180px;margin:0 auto;padding:56px 48px 90px}
.users-access-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:26px}
.users-access-hero h1{margin:5px 0 6px;font-size:36px;line-height:1.08;letter-spacing:-.035em;color:#1d1d1f}
.users-access-hero p{margin:0;color:#7a7a80;font-size:13px}
.users-invite-card,.users-access-toolbar,.user-access-card{border:1px solid rgba(0,0,0,.055);background:#fff}
.users-invite-card{margin-bottom:18px;padding:18px;border-radius:18px}
.users-section-head{display:flex;align-items:center;justify-content:space-between;gap:18px}
.users-section-head>div{display:grid;gap:3px}
.users-section-head strong{font-size:13px}
.users-section-head small{font-size:10px;color:#8d8d92}
.users-invite-grid{display:grid;grid-template-columns:1.1fr 1.35fr .9fr 1fr auto;gap:12px;align-items:end;margin-top:16px}
.users-invite-grid label,.users-access-grid label,.users-access-toolbar label{display:grid;gap:5px}
.users-invite-grid label>span,.users-access-grid label>span,.users-access-toolbar label>span{font-size:9px;font-weight:700;color:#8d8d92;text-transform:uppercase;letter-spacing:.05em}
.users-invite-grid input,.users-invite-grid select,.users-access-grid input,.users-access-grid select,.users-access-toolbar input{box-sizing:border-box;width:100%;height:38px;border:1px solid #d9d9de;border-radius:10px;background:#fff;padding:0 11px;font:inherit;font-size:12px;outline:none}
.users-invite-grid input:focus,.users-invite-grid select:focus,.users-access-grid input:focus,.users-access-grid select:focus,.users-access-toolbar input:focus{border-color:#9fa0a5;box-shadow:0 0 0 3px rgba(0,0,0,.045)}
.users-access-toolbar{display:flex;align-items:end;justify-content:space-between;gap:18px;padding:14px 16px;margin-bottom:12px;border-radius:15px}
.users-access-toolbar label{width:min(420px,100%)}
.users-access-count{font-size:11px;color:#8a8a8f}
.users-access-list{display:grid;gap:10px}
.user-access-card{border-radius:16px;overflow:hidden}
.user-access-summary{display:grid;grid-template-columns:40px minmax(0,1fr) auto auto 22px;gap:12px;align-items:center;width:100%;padding:14px 16px;border:0;background:#fff;text-align:left;cursor:pointer}
.user-access-summary:hover{background:#fbfbfc}
.user-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#f0f0f2;color:#55555b;font-size:10px;font-weight:800}
.user-main{display:grid;gap:2px;min-width:0}
.user-main strong{font-size:12px;color:#1d1d1f}
.user-main small{font-size:10px;color:#8a8a8f;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-role-chip,.user-status-dot{display:inline-flex;align-items:center;height:25px;padding:0 9px;border-radius:999px;font-size:9px;font-weight:700;text-transform:capitalize}
.user-role-chip{background:#f2f2f4;color:#58585e}
.user-status-dot.active{background:#edf7ef;color:#347542}
.user-status-dot.disabled{background:#fff0f0;color:#a44444}
.user-chevron{color:#9a9aa0;text-align:center}
.user-access-detail{padding:18px;border-top:1px solid #eeeeef;background:#fbfbfc}
.user-access-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:12px}
.user-location-block,.user-permissions-block{margin-top:18px;padding-top:17px;border-top:1px solid #e8e8eb}
.user-location-block>strong,.user-permissions-block .users-section-head strong{font-size:11px}
.user-location-options{display:flex;gap:9px;flex-wrap:wrap;margin-top:10px}
.user-location-options label,.user-permission-group label{display:flex;align-items:center;gap:7px}
.user-location-options label{padding:8px 10px;border:1px solid #dedee2;border-radius:10px;background:#fff;font-size:10px}
.user-permissions-block{display:grid;gap:12px}
.user-permission-group{display:grid;grid-template-columns:150px 1fr;gap:14px;padding:10px 0;border-top:1px solid #efeff1}
.user-permission-group:first-of-type{border-top:0}
.user-permission-group>strong{font-size:10px;color:#66666c}
.user-permission-group>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 14px}
.user-permission-group label{font-size:10px;color:#48484d}
.user-permission-group input,.user-location-options input{accent-color:#1d1d1f}
.user-access-actions{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:18px;padding-top:16px;border-top:1px solid #e8e8eb}
.user-access-actions>span{font-size:9px;color:#8d8d92}
@media(max-width:900px){
  .users-access-shell{padding:32px 18px 70px}
  .users-access-hero{align-items:flex-start;flex-direction:column}
  .users-invite-grid,.user-access-grid{grid-template-columns:1fr}
  .user-access-summary{grid-template-columns:36px minmax(0,1fr) auto 20px}
  .user-status-dot{display:none}
  .user-permission-group{grid-template-columns:1fr}
  .user-permission-group>div{grid-template-columns:1fr 1fr}
}

.user-access-action-buttons{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.user-revoke-access{color:#b42318!important;border-color:#f2c9c5!important;background:#fff7f6!important}
.user-revoke-access:hover{background:#fff0ee!important}

.user-access-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding-right:12px}
.user-access-row .user-access-summary{min-width:0}
.user-revoke-access-visible{height:30px;padding:0 10px;border:1px solid #f2c9c5;border-radius:9px;background:#fff7f6;color:#b42318;font-size:10px;font-weight:700;cursor:pointer;white-space:nowrap}
.user-revoke-access-visible:hover{background:#fff0ee}
.user-protected-pill{display:inline-flex;align-items:center;height:28px;padding:0 10px;border-radius:999px;background:#f0f0f2;color:#66666b;font-size:9px;font-weight:700;white-space:nowrap}
@media(max-width:760px){.user-access-row{grid-template-columns:1fr}.user-revoke-access-visible,.user-protected-pill{justify-self:start;margin:0 0 10px 16px}}

/* App pages must never render while carrying the hidden attribute. */
.app-page[hidden],
#users-access-page[hidden]{
  display:none!important;
}

/* Route isolation: app pages are never part of another page's document flow. */
.app-main > .app-page{
  display:none!important;
}
.app-main > .app-page.route-active{
  display:block!important;
}


/* Inventory Overall Overview */
.inventory-overview{margin-bottom:12px}
.inventory-overview-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:2px 2px 14px}
.inventory-overview-kicker,.inventory-insight-head span,.inventory-detail-head>div>span{font-size:9px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:#9a9a9f}
.inventory-overview-head h2{margin:4px 0 3px;font-size:24px;letter-spacing:-.035em}
.inventory-overview-head p,.inventory-detail-head p{margin:0;font-size:10px;color:#929297}
.inventory-overview-actions,.inventory-detail-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.inventory-overview-kpis{display:grid;grid-template-columns:1.25fr repeat(3,1fr);gap:10px;margin-bottom:10px}
.inventory-overview-kpis article{min-height:118px;background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:17px;padding:18px 19px;display:flex;flex-direction:column;justify-content:flex-end;box-shadow:0 4px 18px rgba(0,0,0,.022)}
.inventory-overview-kpis article.inventory-overview-primary{background:linear-gradient(145deg,#fafafa,#f1f2f4)}
.inventory-overview-kpis span{font-size:10px;font-weight:700;color:#85858a}
.inventory-overview-kpis strong{font-size:29px;letter-spacing:-.045em;margin:7px 0 3px;font-variant-numeric:tabular-nums}
.inventory-overview-kpis small{font-size:9px;color:#a0a0a5}
.inventory-overview-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:10px;margin-bottom:10px}
.inventory-insight-card{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:17px;padding:18px 19px;box-shadow:0 4px 18px rgba(0,0,0,.022)}
.inventory-insight-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:15px}
.inventory-insight-head h3{font-size:15px;margin:3px 0 0;letter-spacing:-.02em}
.inventory-insight-head small{font-size:9px;color:#9a9a9f}
.inventory-risk-main{display:flex;align-items:baseline;gap:8px;margin-bottom:12px}
.inventory-risk-main strong,.inventory-capital-main strong{font-size:31px;letter-spacing:-.045em}
.inventory-risk-main span,.inventory-capital-main span{font-size:10px;color:#777}
.inventory-risk-lines{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.inventory-risk-lines button{border:1px solid rgba(0,0,0,.055);background:#f8f8f9;border-radius:12px;padding:10px 11px;text-align:left;cursor:pointer;color:inherit}
.inventory-risk-lines button:hover{background:#f2f3f5}
.inventory-risk-lines span,.inventory-risk-lines strong,.inventory-risk-lines small{display:block}
.inventory-risk-lines span{font-size:9px;color:#777;min-height:22px}.inventory-risk-lines strong{font-size:18px;margin:3px 0}.inventory-risk-lines small{font-size:8px;color:#aaa}
.inventory-low-stock-line{display:grid;grid-template-columns:1fr auto;align-items:center;gap:3px 12px;border-top:1px solid rgba(0,0,0,.055);margin-top:11px;padding-top:11px}
.inventory-low-stock-line span{font-size:10px;font-weight:700}.inventory-low-stock-line strong{font-size:16px}.inventory-low-stock-line small{grid-column:1/-1;font-size:8px;color:#999}
.inventory-capital-main{display:flex;align-items:baseline;gap:8px;margin:6px 0 16px}
.inventory-capital-track{height:7px;border-radius:999px;background:#eceef1;overflow:hidden}.inventory-capital-track i{display:block;width:0;height:100%;background:#222;border-radius:inherit;transition:width .25s ease}
.inventory-capital-row{display:flex;justify-content:space-between;align-items:center;margin-top:14px;font-size:10px}.inventory-capital-row strong{font-size:15px}
.inventory-insight-card>p{font-size:9px;line-height:1.5;color:#96969b;margin:7px 0 0}
.inventory-overview-locations{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:10px}
.inventory-location-summary{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:14px;padding:13px 15px;display:grid;grid-template-columns:1fr auto;gap:4px 12px}
.inventory-location-summary span{font-size:10px;font-weight:750}.inventory-location-summary strong{font-size:13px;text-align:right}.inventory-location-summary small{font-size:8px;color:#999}.inventory-location-summary em{font-style:normal;font-size:8px;color:#999;text-align:right}
.inventory-overview-detail{background:#fff;border:1px solid rgba(0,0,0,.07);border-radius:18px;padding:18px 19px;margin-top:10px}
.inventory-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:13px}.inventory-detail-head h3{font-size:16px;margin:3px 0}
.inventory-inactive-toggle{display:flex;align-items:center;gap:6px;font-size:10px;color:#777;white-space:nowrap}
.inventory-risk-table{max-height:520px;overflow:auto}.inventory-risk-table table{width:100%}.inventory-risk-table th,.inventory-risk-table td{padding:9px 10px;font-size:10px}.inventory-risk-table th{position:sticky;top:0;z-index:2;background:#fff;font-size:8px;text-transform:uppercase;letter-spacing:.05em;color:#888}.inventory-risk-table td:nth-child(n+3):nth-child(-n+7){text-align:right;font-variant-numeric:tabular-nums}
.inventory-risk-signal{display:inline-flex;padding:3px 7px;border-radius:999px;background:#f2f3f5;font-size:8px;font-weight:750;white-space:nowrap}.inventory-risk-signal.immediate{background:#edf7ef;color:#19733a}.inventory-risk-signal.incoming{background:#eef4ff;color:#1769e0}.inventory-risk-signal.none{background:#fff2f0;color:#b42318}.inventory-risk-signal.low{background:#fff7e8;color:#9a6200}
@media(max-width:980px){.inventory-overview-kpis{grid-template-columns:1fr 1fr}.inventory-overview-grid{grid-template-columns:1fr}.inventory-overview-locations{grid-template-columns:1fr}.inventory-overview-head,.inventory-detail-head{align-items:flex-start;flex-direction:column}.inventory-risk-lines{grid-template-columns:1fr 1fr 1fr}}
@media(max-width:640px){.inventory-overview-kpis{grid-template-columns:1fr 1fr}.inventory-risk-lines{grid-template-columns:1fr}.inventory-overview-actions,.inventory-detail-actions{width:100%}.inventory-overview-kpis strong{font-size:24px}}

.inventory-capital-buckets{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:11px}
.inventory-capital-buckets>div{border:1px solid rgba(0,0,0,.055);background:#f8f8f9;border-radius:11px;padding:9px 10px}
.inventory-capital-buckets span,.inventory-capital-buckets strong,.inventory-capital-buckets small{display:block}
.inventory-capital-buckets span{font-size:8px;color:#85858a}.inventory-capital-buckets strong{font-size:14px;margin:4px 0 2px}.inventory-capital-buckets small{font-size:8px;color:#aaa}
@media(max-width:640px){.inventory-capital-buckets{grid-template-columns:1fr}}

.inventory-capital-location-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:-1px 0 10px}
.inventory-capital-location-strip article{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:14px;padding:13px 15px;display:grid;gap:4px}
.inventory-capital-location-strip span{font-size:9px;font-weight:750;color:#85858a}.inventory-capital-location-strip strong{font-size:18px;letter-spacing:-.025em;font-variant-numeric:tabular-nums}.inventory-capital-location-strip small{font-size:8px;color:#aaa}
.inventory-capital-location-strip .inventory-dead-value{background:#faf8f7}.inventory-dead-value strong{color:#6d3d35}
.inventory-low-stock-line{width:100%;border:0;background:transparent;text-align:left;color:inherit;cursor:pointer}
.inventory-low-stock-line:hover{background:#fafafa;border-radius:9px}.inventory-low-stock-line:focus-visible{outline:2px solid #222;outline-offset:3px}
.inventory-pullout-dialog{border:0;padding:0;background:transparent;max-width:none}.inventory-pullout-dialog::backdrop{background:rgba(0,0,0,.26);backdrop-filter:blur(3px)}
.inventory-pullout-card{width:min(520px,calc(100vw - 32px));box-sizing:border-box;background:#fff;border-radius:20px;padding:20px;box-shadow:0 24px 70px rgba(0,0,0,.18)}
.inventory-pullout-head{display:flex;justify-content:space-between;gap:16px}.inventory-pullout-head span{font-size:8px;font-weight:800;letter-spacing:.1em;color:#999}.inventory-pullout-head h3{font-size:18px;margin:4px 0}.inventory-pullout-head p{font-size:10px;color:#888;margin:0}
.inventory-pullout-x{border:0;background:#f2f2f4;border-radius:50%;width:30px;height:30px;font-size:18px;cursor:pointer}
.inventory-pullout-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:18px 0 10px}.inventory-pullout-options label{display:flex;align-items:center;gap:10px;border:1px solid #e2e2e5;border-radius:13px;padding:12px;cursor:pointer}.inventory-pullout-options input{accent-color:#1d1d1f}.inventory-pullout-options span{display:grid;gap:2px}.inventory-pullout-options strong{font-size:11px}.inventory-pullout-options small{font-size:8px;color:#999}
.inventory-pullout-preview{background:#f7f7f8;border-radius:12px;padding:12px;font-size:10px;line-height:1.5}.inventory-pullout-rule{font-size:9px!important;color:#999!important;line-height:1.5;margin:10px 1px!important}.inventory-pullout-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
@media(max-width:980px){.inventory-capital-location-strip{grid-template-columns:1fr 1fr}}@media(max-width:640px){.inventory-capital-location-strip,.inventory-pullout-options{grid-template-columns:1fr}}

/* Sales agent draft workspace */
.sales-drafts-card{margin-bottom:14px;padding:18px;border:1px solid rgba(0,0,0,.055);border-radius:18px;background:#fff}
.sales-drafts-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:12px}.sales-drafts-head h2{margin:0;font-size:16px;letter-spacing:-.015em}.sales-drafts-head h2 span{display:inline-grid;place-items:center;min-width:22px;height:22px;margin-left:5px;padding:0 6px;border-radius:999px;background:#f0f0f2;font-size:10px}.sales-drafts-head small{color:#999;font-size:10px}
.sales-draft-list{display:flex;gap:9px;overflow-x:auto;padding-bottom:2px}.sales-draft-list>.sales-empty{width:100%;padding:20px}
.sales-draft-card{flex:0 0 235px;display:grid;gap:9px;padding:13px;border:1px solid #e7e7ea;border-radius:13px;background:#fafafa;text-align:left}.sales-draft-card.is-active{border-color:#b8b8bd;background:#fff;box-shadow:0 3px 12px rgba(0,0,0,.05)}
.sales-draft-main{border:0;background:transparent;padding:0;text-align:left;cursor:pointer}.sales-draft-main strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#1d1d1f}.sales-draft-main small{display:block;margin-top:4px;color:#929297;font-size:9px}.sales-draft-meta{display:flex;justify-content:space-between;color:#8d8d92;font-size:9px}
.sales-draft-actions{display:flex;gap:5px}.sales-draft-actions button{height:27px;padding:0 9px;border:0;border-radius:8px;background:#ececef;font-size:9px;font-weight:650;cursor:pointer}.sales-draft-actions .sales-draft-delete{margin-left:auto;background:#f5eded;color:#8c4747}
.sales-editor-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 2px 10px;padding:0 2px}.sales-editor-head>div{display:flex;align-items:baseline;gap:8px}.sales-editor-head span,.sales-editor-head small{font-size:9px;color:#929297}.sales-editor-head strong{font-size:13px}
.sales-proof-row{display:flex;align-items:center;gap:10px}.sales-proof-row input[type=file]{height:auto;padding:8px}.sales-proof-row span{min-width:170px;color:#777;font-size:10px}
@media(max-width:850px){.sales-drafts-head{align-items:flex-start;flex-direction:column}.sales-draft-card{flex-basis:205px}.sales-editor-head{align-items:flex-start;flex-direction:column}.sales-proof-row{align-items:flex-start;flex-direction:column}}


/* PO route performance: when the workspace is not active, remove its large tables
   from layout/paint entirely. This keeps sidebar navigation independent of PO size. */
#po-generator-page[hidden]{
  display:none!important;
  content-visibility:hidden;
}
#po-generator-page:not([hidden]){
  contain:layout style;
}

.supplier-progressive-loading{
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  background:#fff;
}


/* Final navigation isolation: sidebar animation must never relayout the heavy PO DOM.
   Keep the content canvas fixed; only the lightweight sidebar itself animates. */
.app-main{
  margin-left:var(--sidebar-collapsed)!important;
  transition:none!important;
}
body:not(.sidebar-collapsed) .app-main,
body.sidebar-collapsed .app-main{
  margin-left:var(--sidebar-collapsed)!important;
}
.global-bar{
  left:var(--sidebar-collapsed)!important;
  transition:none!important;
}
.app-sidebar{
  transform:translateZ(0);
  will-change:clip-path;
  contain:strict;
}


/* Fulfillment operations hub */
.fulfillment-module-tabs{display:flex;gap:5px;width:max-content;padding:4px;margin:0 0 18px;border-radius:12px;background:#ececef}
.fulfillment-module-tabs button{height:34px;padding:0 15px;border:0;border-radius:9px;background:transparent;color:#6f6f75;font-size:11px;font-weight:700;cursor:pointer}
.fulfillment-module-tabs button.active{background:#fff;color:#1d1d1f;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.fulfillment-order-badges{display:flex;align-items:center;gap:8px}
.pullout-layout{display:grid;gap:16px}
.pullout-form-card,.pullout-list-card,.ops-report-card{border:1px solid rgba(0,0,0,.06);border-radius:18px;background:#fff;overflow:hidden}
.pullout-form-card{padding:18px}
.pullout-form-grid{display:grid;grid-template-columns:1.15fr 1fr 1fr;gap:12px;margin:16px 0 10px}
.pullout-type-note{padding:10px 12px;border-radius:10px;background:#f6f6f8;color:#66666c;font-size:10px;line-height:1.45}
.pullout-items-field{margin-top:14px}
.pullout-items-field textarea{min-height:150px;resize:vertical;border:1px solid #d9d9de;border-radius:12px;padding:12px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;outline:none}
.pullout-items-field textarea:focus{border-color:#a7a7ad;box-shadow:0 0 0 3px rgba(0,0,0,.04)}
.pullout-items-field small{font-size:9px;color:#929298}
.pullout-submit-row{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:14px}
.pullout-submit-row>span{max-width:720px;color:#77777d;font-size:9px;line-height:1.45}
.pullout-list-card{padding:16px}
.pullout-list-head,.ops-report-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
.pullout-list-head>div,.ops-report-head>div{display:grid;gap:3px}
.pullout-list-head strong,.ops-report-head strong{font-size:13px;color:#1d1d1f}
.pullout-list-head small,.ops-report-head small{font-size:9px;color:#8c8c92}
.pullout-list-head select{height:34px;border:1px solid #dedee2;border-radius:9px;background:#fff;padding:0 10px;font-size:10px}
#pulloutQueue{display:grid;gap:9px}
.pullout-card{border:1px solid #ececef;border-radius:13px;padding:13px 14px;background:#fcfcfd}
.pullout-card-head{display:flex;align-items:center;justify-content:space-between;gap:14px}
.pullout-card-head>div{display:flex;align-items:center;gap:8px}
.pullout-card-head>div:first-child{display:grid;gap:2px}
.pullout-card-head strong{font-size:11px}
.pullout-card-head span{font-size:9px;color:#77777d}
.pullout-type-chip{display:inline-flex!important;align-items:center;height:22px;padding:0 8px;border-radius:999px;background:#f0f0f2;color:#55555b!important;font-weight:700}
.pullout-card-meta{display:flex;align-items:center;gap:16px;margin-top:10px;color:#85858b;font-size:9px}
.pullout-card-meta strong{color:#3d3d42}
.pullout-rule-note{margin-top:9px;padding:7px 9px;border-radius:8px;background:#f6f6f7;color:#77777c;font-size:9px}
.pullout-rule-note.demand{background:#f5f7f5;color:#536358}
.pullout-card-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:10px}
.fulfillment-report-filters{display:grid;grid-template-columns:180px minmax(220px,1fr) minmax(180px,.7fr);gap:12px;margin-bottom:14px}
.ops-report-card{padding:16px;margin-bottom:14px}
.ops-report-wrap{overflow:auto;max-height:520px;border:1px solid #efeff1;border-radius:12px}
.ops-report-table{width:100%;border-collapse:collapse;min-width:920px;font-size:9px}
.ops-report-table th{position:sticky;top:0;z-index:1;background:#f7f7f8;color:#77777d;text-align:left;font-weight:750;padding:9px 10px;border-bottom:1px solid #e6e6e9;white-space:nowrap}
.ops-report-table td{padding:9px 10px;border-bottom:1px solid #f0f0f2;color:#3d3d42;white-space:nowrap}
.ops-report-table tbody tr:hover{background:#fafafa}
@media(max-width:900px){
  .pullout-form-grid,.fulfillment-report-filters{grid-template-columns:1fr}
  .pullout-submit-row,.pullout-card-head{align-items:flex-start;flex-direction:column}
  .users-invite-grid{grid-template-columns:1fr}
}


/* Separate Pull Out Request creator + unified fulfillment queue */
.pullout-items-head,.pullout-item-row{grid-template-columns:150px minmax(240px,1fr) 140px 100px 34px!important}
.pullout-request-recent{display:grid;gap:0}
.pullout-request-recent-row{display:grid;grid-template-columns:minmax(0,1fr) 110px 110px;gap:14px;align-items:center;padding:11px 4px;border-top:1px solid #f0f0f2}
.pullout-request-recent-row:first-child{border-top:0}
.pullout-request-recent-row>div{display:grid;gap:2px}
.pullout-request-recent-row strong{font-size:11px;color:#2a2a2e}
.pullout-request-recent-row small{font-size:9px;color:#8c8c92}
.pullout-request-recent-row>span:nth-child(2){font-size:10px;color:#66666b;text-align:right}
.fulfillment-type-badge,.fulfillment-destination-badge{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:999px;font-size:8px;font-weight:800;letter-spacing:.045em;white-space:nowrap}
.fulfillment-type-badge.type-sales{background:#eef3f8;color:#486173;border:1px solid #dbe5ed}
.fulfillment-type-badge.type-pullout{background:#f8f2e9;color:#765d38;border:1px solid #eadfce}
.fulfillment-destination-badge{background:#f4f4f6;color:#5d5d63;border:1px solid #e4e4e7;letter-spacing:0}
.fulfillment-card-pullout{border-left:4px solid #c8a875}
.fulfillment-card-sales{border-left:4px solid #9eb5c7}
.fulfillment-order-badges{flex-wrap:wrap;justify-content:flex-end}
@media(max-width:850px){
  .pullout-items-head{display:none}
  .pullout-item-row{grid-template-columns:1fr 90px 34px!important}
  .pullout-item-row .sales-product-name,.pullout-item-row .sales-stock{grid-column:1/-1}
  .pullout-request-recent-row{grid-template-columns:1fr}
  .pullout-request-recent-row>span:nth-child(2){text-align:left}
}


/* Product Photos — visual catalog */
.product-photos-page{max-width:1500px;margin:0 auto;padding-bottom:60px}
.product-photos-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:4px 0 20px}
.product-photos-kicker{display:block;margin-bottom:5px;font-size:9px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#9a9aa0}
.product-photos-head h1{margin:0 0 4px;font-size:28px;letter-spacing:-.04em}
.product-photos-toolbar{position:sticky;top:58px;z-index:18;display:grid;grid-template-columns:minmax(260px,1fr) auto auto;gap:12px;align-items:center;margin-bottom:18px;padding:10px;border:1px solid rgba(0,0,0,.055);border-radius:16px;background:rgba(248,248,250,.88);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.product-photos-search{height:38px;display:flex;align-items:center;gap:8px;padding:0 12px;border:1px solid #e1e1e5;border-radius:11px;background:#fff}
.product-photos-search span{font-size:16px;color:#999}.product-photos-search input{width:100%;border:0;outline:0;background:transparent;font-size:11px}
.product-photos-segments,.incoming-location-filter{display:flex;gap:3px;padding:3px;border-radius:10px;background:#ececef}
.product-photos-segments button,.incoming-location-filter button{height:31px;padding:0 11px;border:0;border-radius:8px;background:transparent;color:#77777d;font-size:9px;font-weight:700;cursor:pointer;white-space:nowrap}
.product-photos-segments button.active,.incoming-location-filter button.active{background:#fff;color:#1d1d1f;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.product-photos-count{padding-right:5px;font-size:9px;font-weight:700;color:#8b8b91;white-space:nowrap}
.product-photos-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.product-photos-loading{grid-column:1/-1;display:grid;place-items:center;min-height:220px;border:1px dashed #dedee2;border-radius:18px;color:#929298;font-size:11px}
.product-photo-card{min-width:0;overflow:hidden;border:1px solid rgba(0,0,0,.065);border-radius:17px;background:#fff;box-shadow:0 3px 16px rgba(0,0,0,.025);cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.product-photo-card:hover{transform:translateY(-2px);border-color:rgba(0,0,0,.12);box-shadow:0 10px 28px rgba(0,0,0,.07)}
.product-photo-frame{position:relative;aspect-ratio:1/1;display:grid;place-items:center;overflow:hidden;background:linear-gradient(145deg,#fafafa,#f3f3f5)}
.product-photo-frame img{width:100%;height:100%;object-fit:contain;padding:10px;box-sizing:border-box;transition:transform .22s ease}
.product-photo-card:hover .product-photo-frame img{transform:scale(1.025)}
.product-photo-hover{position:absolute;left:9px;right:9px;bottom:9px;display:flex;justify-content:center;opacity:0;transform:translateY(4px);transition:.16s ease;pointer-events:none}
.product-photo-hover span{padding:7px 10px;border-radius:999px;background:rgba(29,29,31,.82);backdrop-filter:blur(10px);color:#fff;font-size:8px;font-weight:750}
.product-photo-card:hover .product-photo-hover{opacity:1;transform:none}
.product-photo-frame.is-dragging,.product-photo-dropzone.is-dragging{outline:2px solid #1d1d1f;outline-offset:-5px;background:#f0f1f3}
.product-photo-empty{display:grid;justify-items:center;gap:5px;color:#9a9aa0}.product-photo-empty span{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#fff;font-size:20px;box-shadow:0 2px 10px rgba(0,0,0,.05)}.product-photo-empty strong{font-size:10px;color:#68686e}.product-photo-empty small{font-size:8px}
.product-photo-copy{display:grid;gap:3px;padding:11px 12px 12px}.product-photo-copy strong{font-size:10px;letter-spacing:.01em}.product-photo-copy>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:#6f6f75}.product-photo-copy small{font-size:8px;color:#aaa}.product-photo-copy small.cloud{color:#65776a}
.product-photos-pager{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:20px}.product-photos-pager span{min-width:110px;text-align:center;font-size:9px;color:#888}
.product-photo-editor[hidden]{display:none!important}.product-photo-editor{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:20px;background:rgba(0,0,0,.28);backdrop-filter:blur(5px)}
.product-photo-editor-card{width:min(620px,calc(100vw - 32px));max-height:calc(100vh - 40px);overflow:auto;border-radius:22px;background:#fff;box-shadow:0 30px 90px rgba(0,0,0,.2);padding:20px;box-sizing:border-box}
.product-photo-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.product-photo-editor-head span{font-size:9px;font-weight:800;color:#999}.product-photo-editor-head h2{margin:4px 0 0;font-size:18px;letter-spacing:-.025em}.product-photo-editor-head button{width:30px;height:30px;border:0;border-radius:50%;background:#f1f1f3;font-size:18px;cursor:pointer}
.product-photo-editor-preview{height:260px;display:grid;place-items:center;margin:16px 0 12px;overflow:hidden;border-radius:16px;background:#f6f6f7}.product-photo-editor-preview img{width:100%;height:100%;object-fit:contain}.product-photo-editor-preview>div{display:grid;justify-items:center;gap:6px;color:#999}.product-photo-editor-preview>div span{font-size:28px}.product-photo-editor-preview>div strong{font-size:10px}
.product-photo-editor-tabs{display:flex;gap:3px;width:max-content;padding:3px;border-radius:10px;background:#ededf0}.product-photo-editor-tabs button{height:30px;padding:0 14px;border:0;border-radius:8px;background:transparent;font-size:9px;font-weight:750;color:#777;cursor:pointer}.product-photo-editor-tabs button.active{background:#fff;color:#1d1d1f;box-shadow:0 1px 4px rgba(0,0,0,.07)}
.product-photo-editor-panel{margin-top:12px}.product-photo-editor-panel[hidden]{display:none!important}
.product-photo-dropzone{min-height:150px;display:grid;place-items:center;align-content:center;gap:5px;border:1px dashed #cfcfd4;border-radius:15px;background:#fafafb;cursor:pointer;text-align:center;transition:.15s ease}.product-photo-dropzone:hover{background:#f5f5f7}.product-photo-dropzone strong{font-size:11px}.product-photo-dropzone span{font-size:9px;color:#777}.product-photo-dropzone small{margin-top:5px;font-size:8px;color:#aaa}
.product-photo-url-field{display:grid;gap:6px}.product-photo-url-field span{font-size:9px;font-weight:750;color:#777}.product-photo-url-field input{height:40px;border:1px solid #dcdce0;border-radius:11px;padding:0 12px;outline:0;font-size:10px}.product-photo-url-field input:focus{border-color:#aaa;box-shadow:0 0 0 3px rgba(0,0,0,.035)}
.product-photo-url-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:10px}.product-photo-editor-panel p{margin:9px 1px 0;font-size:8px;line-height:1.5;color:#999}
.product-photo-editor-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:12px;border-top:1px solid #eeeef0}.product-photo-editor-foot>span{font-size:9px;color:#777}.product-photo-editor-foot>span[data-tone="success"]{color:#297545}.product-photo-editor-foot>span[data-tone="error"]{color:#b42318}
.product-photo-peek{position:fixed;z-index:4900;width:330px;overflow:hidden;border:1px solid rgba(0,0,0,.08);border-radius:18px;background:rgba(255,255,255,.96);box-shadow:0 18px 55px rgba(0,0,0,.18);backdrop-filter:blur(18px);pointer-events:none;animation:productPeekIn .12s ease-out}
.product-photo-peek img{display:block;width:100%;height:285px;object-fit:contain;background:#f7f7f8;padding:10px;box-sizing:border-box}.product-photo-peek>div{display:grid;gap:2px;padding:10px 12px 12px}.product-photo-peek strong{font-size:10px}.product-photo-peek span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:#777}
@keyframes productPeekIn{from{opacity:0;transform:translateY(4px) scale(.985)}to{opacity:1;transform:none}}
.product-cloud-image-cell{display:flex;align-items:center;justify-content:space-between;gap:7px}.product-cloud-image-cell span{font-size:9px;font-weight:700;color:#5f7163}.product-cloud-image-cell button{border:0;background:#f0f1f2;border-radius:7px;padding:5px 7px;font-size:8px;font-weight:700;cursor:pointer}
.incoming-origin-tags{display:inline-flex;align-items:center;gap:4px;margin-left:2px}.incoming-origin-tags>span{display:inline-flex;align-items:center;height:18px;padding:0 6px;border-radius:999px;background:#f2f2f4;color:#77777d;font-size:7px;font-weight:750;letter-spacing:.02em}
.incoming-order-cbm{display:inline-flex;margin-left:7px;padding-left:8px;border-left:1px solid #dedee2;color:#55555a;font-weight:700}
.incoming-toolbar{flex-wrap:wrap}.incoming-location-filter{margin-left:auto}.incoming-toolbar-actions{margin-left:0}
@media(max-width:900px){.product-photos-toolbar{grid-template-columns:1fr}.product-photos-segments{width:max-content;max-width:100%;overflow:auto}.product-photos-count{padding-left:3px}.product-photos-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.incoming-location-filter{order:3;width:100%;overflow:auto;margin-left:0}.product-photo-peek{display:none}}


/* Reports v3 — live movement + standalone purchase planning */
.reports-grid-clean{grid-template-columns:minmax(0,1.2fr) minmax(360px,.8fr)}
.reports-movement-card{min-width:0}
.reports-section-number{font-size:11px;color:#6e6e73;white-space:nowrap}
.reports-coverage-note{font-size:9px;color:#8e8e93;font-weight:600}
.reports-movement-summary{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.reports-movers-table .reports-mini-row>span:last-child{display:grid;justify-items:end}
.reports-movers-table .reports-mini-row>span:last-child small{display:block;margin-top:2px;font-size:7px;color:#9a9aa0}
.purchase-planning-page{max-width:1500px;margin:0 auto;padding-bottom:60px}
.purchase-planning-head{margin-bottom:18px}
.standalone-purchase-plan{padding:22px}
.purchase-plan-summary{font-size:9px;font-weight:750;color:#77777d;text-align:right}
.purchase-plan-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 10px}
.purchase-plan-toolbar input[type="search"]{width:min(420px,100%);height:38px;padding:0 12px;border:1px solid #e0e0e4;border-radius:11px;background:#fff;outline:0;font-size:10px}
.purchase-plan-toolbar input[type="search"]:focus{border-color:#b9b9be;box-shadow:0 0 0 3px rgba(0,0,0,.035)}
.purchase-plan-toolbar label{display:flex;align-items:center;gap:7px;font-size:9px;font-weight:650;color:#74747a;white-space:nowrap}
.purchase-confidence{display:inline-flex;align-items:center;height:20px;padding:0 7px;border-radius:999px;background:#f1f1f3;color:#6e6e73;font-size:8px;font-weight:750}
.purchase-confidence.high{background:#edf6ef;color:#347046}.purchase-confidence.low{background:#fff1ef;color:#a34a3e}
@media(max-width:1050px){.reports-grid-clean{grid-template-columns:1fr}.purchase-plan-toolbar{align-items:stretch;flex-direction:column}.purchase-plan-toolbar input[type="search"]{width:100%}}


/* ===========================
   WHOLESALE PRICING RULES
=========================== */
.wholesale-rules-head,
.wholesale-tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.wholesale-rule-card,
.wholesale-tier-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
}

.wholesale-rule-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
}

.wholesale-rule-card h3,
.wholesale-tier-card h3 {
  margin: 5px 0 16px;
  font-size: 17px;
  letter-spacing: -.2px;
}

.wholesale-rule-card p,
.wholesale-tier-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 12px 0 0;
}

.wholesale-rule-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.wholesale-rule-field > span {
  font-size: 13px;
  font-weight: 650;
}

.wholesale-rule-field > div,
.wholesale-tier-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wholesale-rule-field input,
.wholesale-tier-input input {
  width: 120px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 9px;
  text-align: right;
  font-weight: 700;
}

.wholesale-rule-field b,
.wholesale-tier-input span {
  color: var(--muted);
  font-size: 12px;
}

.wholesale-formula-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--soft);
  color: #4b5563;
  font-size: 12px;
  font-weight: 650;
}

.wholesale-moq-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.wholesale-moq-preview span {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--soft);
}

.wholesale-moq-preview small,
.wholesale-moq-preview strong {
  display: block;
}

.wholesale-moq-preview small {
  color: var(--muted);
  margin-bottom: 3px;
}

.wholesale-tier-table {
  min-width: 620px;
}

.wholesale-tier-table th {
  top: 0;
}

.wholesale-tier-table td:last-child,
.wholesale-tier-table th:last-child {
  width: 52px;
  text-align: right;
}

.wholesale-tier-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.sales-wholesale-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #d9e7dd;
  background: #f7fbf8;
  border-radius: 14px;
  padding: 16px 18px;
}

.sales-wholesale-summary > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sales-wholesale-summary > div:first-child > strong {
  font-size: 16px;
}

.sales-wholesale-summary > div:first-child > small {
  color: var(--muted);
}

.sales-wholesale-metrics {
  display: flex;
  gap: 20px;
}

.sales-wholesale-metrics span {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.sales-wholesale-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.sales-wholesale-metrics strong {
  font-size: 15px;
}

.sales-price-cell {
  min-width: 0;
}

.sales-price-cell .sales-price {
  width: 100%;
}

.sales-wholesale-line-note {
  display: block;
  margin-top: 4px;
  min-height: 14px;
  color: var(--success);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  white-space: normal;
}

.sales-wholesale-line-note.is-muted {
  color: var(--muted);
  font-weight: 500;
}

.sales-wholesale-line-note.is-qualified {
  color: var(--success);
}

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

  .sales-wholesale-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .sales-wholesale-metrics {
    width: 100%;
    justify-content: space-between;
  }

  .sales-wholesale-metrics span {
    align-items: flex-start;
  }
}


/* ===========================
   PRICING MANAGER
=========================== */
.pricing-manager-page{max-width:1500px;margin:0 auto;padding-bottom:60px}
.pricing-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin:4px 0 18px}
.pricing-head h1{margin:3px 0 4px;font-size:28px;letter-spacing:-.04em}.pricing-head p,.pricing-store-head p,.pricing-card p{margin:0;color:#85858b;font-size:10px;line-height:1.5}
.pricing-kicker{font-size:8px;font-weight:850;letter-spacing:.13em;color:#9a9aa0}.pricing-status{font-size:9px;font-weight:700;color:#727278}
.pricing-tabs{display:flex;width:max-content;gap:3px;padding:3px;margin-bottom:14px;border-radius:11px;background:#ececef}
.pricing-tabs button{height:32px;padding:0 14px;border:0;border-radius:8px;background:transparent;color:#74747a;font-size:9px;font-weight:750;cursor:pointer}.pricing-tabs button.active{background:#fff;color:#1d1d1f;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.pricing-panel{border:1px solid #e7e7ea;border-radius:16px;background:#fff;padding:16px}.pricing-panel[hidden]{display:none!important}
.pricing-toolbar{display:flex;gap:8px;justify-content:flex-end;margin-bottom:12px}.pricing-toolbar input{width:min(360px,100%);height:36px;border:1px solid #dddde1;border-radius:10px;padding:0 11px;outline:0}
.pricing-summary{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.pricing-summary span{padding:7px 9px;border-radius:9px;background:#f6f6f7;color:#77777d;font-size:8px}.pricing-summary strong{color:#333337;font-size:10px}
.pricing-table-wrap{overflow:auto;max-height:620px;border:1px solid #ededf0;border-radius:12px}.pricing-table{width:100%;border-collapse:separate;border-spacing:0;min-width:800px;font-size:9px}
.pricing-table th{position:sticky;top:0;z-index:3;padding:9px 10px;background:#f7f7f8;border-bottom:1px solid #e6e6e9;text-align:left;color:#77777d;white-space:nowrap}.pricing-table th small{display:block;color:#aaa;font-size:7px;margin-bottom:2px}.pricing-table td{padding:9px 10px;border-bottom:1px solid #f0f0f2;white-space:nowrap;color:#444449}.pricing-table tbody tr:hover td{background:#fbfbfc}
.pricing-table .pricing-sticky-col{position:sticky;left:0;z-index:2;background:#fff}.pricing-table th.pricing-sticky-col{z-index:5;background:#f7f7f8}.pricing-needs-price{background:#fff9ed!important;color:#9b6b18!important}
.pricing-import-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.pricing-card{padding:17px;border:1px solid #ececef;border-radius:14px;background:#fcfcfd}.pricing-card h3,.pricing-store-head h3{margin:4px 0 5px;font-size:16px}
.pricing-dropzone{min-height:160px;margin-top:14px;display:grid;place-items:center;align-content:center;gap:4px;border:1px dashed #cfcfd4;border-radius:14px;background:#f8f8fa;cursor:pointer;transition:.15s}.pricing-dropzone:hover,.pricing-dropzone.dragging{background:#f1f2f4;border-color:#999}.pricing-dropzone strong{font-size:11px}.pricing-dropzone span{font-size:9px;color:#777}.pricing-dropzone small{margin-top:5px;font-size:8px;color:#aaa}
.pricing-destination{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:14px 0 7px}.pricing-destination select,.pricing-store-head input{height:36px;border:1px solid #dddde1;border-radius:9px;background:#fff;padding:0 9px;font-size:9px}
#pricingMassPaste{width:100%;height:92px;resize:vertical;box-sizing:border-box;border:1px solid #dddde1;border-radius:10px;padding:9px;font:10px ui-monospace,SFMono-Regular,Menlo,monospace;outline:0;margin-bottom:8px}
.pricing-preview{margin-top:14px}.pricing-preview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}.pricing-preview-head>div:first-child{display:grid;gap:2px}.pricing-preview-head small{font-size:8px;color:#888}
.pricing-chip{display:inline-flex;padding:4px 7px;border-radius:999px;background:#edf6ef;color:#347046;font-size:8px;font-weight:750}.pricing-chip.warn{background:#fff2d8;color:#8b6118}.pricing-chip.muted{background:#f1f1f3;color:#777}
.pricing-store-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:14px}.pricing-store-head form{display:flex;gap:7px}.pricing-store-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px}
.pricing-store-card{border:1px solid #ececef;border-radius:13px;padding:13px}.pricing-store-card>div{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.pricing-store-card>div strong{font-size:11px}.pricing-store-card>div span{font-size:8px;color:#999}.pricing-store-card p{display:grid;grid-template-columns:8px 1fr auto;align-items:center;gap:7px;margin:0;padding:7px 0;border-top:1px solid #f1f1f3}.pricing-store-card p i{width:6px;height:6px;border-radius:50%;background:#c7c7cc}.pricing-store-card p i.on{background:#56a16b}.pricing-store-card p span{font-size:9px}.pricing-store-card p small{font-size:7px;color:#999}
@media(max-width:900px){.pricing-import-grid{grid-template-columns:1fr}.pricing-store-head,.pricing-head{align-items:flex-start;flex-direction:column}.pricing-store-head form{width:100%;display:grid}.pricing-destination{grid-template-columns:1fr}}

.sales-price.is-locked{cursor:not-allowed;background:#f1f2f4;color:#202124}
.sales-wholesale-summary{align-items:flex-start;gap:22px;flex-wrap:wrap}
.sales-wholesale-guide{flex:1 0 100%;border-top:1px solid rgba(0,0,0,.08);padding-top:14px;margin-top:2px}
.sales-wholesale-guide-head,.sales-wholesale-guide-row{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:16px;align-items:center}
.sales-wholesale-guide-head{display:flex;justify-content:space-between;margin-bottom:8px}
.sales-wholesale-guide-row{padding:9px 10px;border-radius:10px}
.sales-wholesale-guide-row.is-current{background:rgba(35,131,82,.08)}
.sales-wholesale-guide-row span{display:flex;flex-direction:column;gap:2px}.sales-wholesale-guide-row small{color:#7a7d83;font-size:11px}

/* Campaign Maker */
.campaign-wrap{padding:28px;display:grid;gap:20px}.campaign-title{display:flex;align-items:center;justify-content:space-between;gap:14px}.campaign-title h1{font-size:28px;margin:0}.campaign-title p,.campaign-card p{color:#858993}.campaign-title button,.campaign-card button{border:0;border-radius:12px;background:#f0f1f5;padding:12px 18px;cursor:pointer}.campaign-card{background:white;border:1px solid #e8e9ef;border-radius:22px;padding:24px}.campaign-card h2{margin:0 0 12px}.campaign-brand-entry{display:flex;gap:10px;max-width:540px;margin:15px 0}.campaign-brand-entry input{flex:1;min-width:0;padding:12px;border:1px solid #ddd;border-radius:10px}.campaign-brand{display:inline-flex;gap:8px;align-items:center;background:#f2f3f6;border-radius:20px;padding:8px 12px;margin:5px}.campaign-brand button{padding:2px 6px}.campaign-scroll{overflow:auto}.campaign-table{width:100%;border-collapse:collapse;min-width:1050px}.campaign-table th{text-align:left;color:#7c818b;font-size:11px;letter-spacing:.08em;padding:16px 8px;border-bottom:1px solid #eee}.campaign-table td{padding:12px 8px;border-bottom:1px solid #eee;vertical-align:middle}.campaign-table input{width:125px;box-sizing:border-box;padding:11px;border:1px solid #e6e7eb;border-radius:9px}.campaign-product{min-width:160px;max-width:300px;font-size:13px}.campaign-table td small{display:block;color:#858993;margin-top:5px}.campaign-join{color:#17814c}.campaign-reject{color:#bd3b42}.campaign-remove{font-size:20px}

/* Spreadsheet-style Campaign Maker */
.campaign-wrap{padding:28px 38px;max-width:100%;gap:16px}
.campaign-grid-card{padding:24px 24px 18px}
.campaign-grid-card .campaign-title{margin-bottom:14px}
.campaign-grid-card .campaign-title p{margin:6px 0 0}
.campaign-scroll{max-height:min(66vh,720px);overflow:auto;border:1px solid #e7e9ee;border-radius:12px;position:relative}
.campaign-table{border-collapse:separate;border-spacing:0;table-layout:fixed;min-width:1080px;width:100%;font-size:13px}
.campaign-table thead{position:sticky!important;top:0;z-index:20;background:#f7f8fa}
.campaign-table thead tr{position:static!important}
.campaign-table thead th{position:sticky!important;top:0!important;z-index:21;background:#f7f8fa!important;padding:12px 10px!important;border-bottom:1px solid #dfe2e8!important;white-space:nowrap;text-align:left}
.campaign-table td{padding:0!important;border-right:1px solid #edf0f3;border-bottom:1px solid #edf0f3;height:43px;background:#fff}
.campaign-table tr:hover td{background:#fafbff}
.campaign-table th:nth-child(1),.campaign-table td:nth-child(1){width:42px}
.campaign-table th:nth-child(2),.campaign-table td:nth-child(2){width:145px}
.campaign-table th:nth-child(3),.campaign-table td:nth-child(3),.campaign-table th:nth-child(4),.campaign-table td:nth-child(4){width:135px}
.campaign-table th:nth-child(5),.campaign-table td:nth-child(5){width:310px}
.campaign-table th:nth-child(6),.campaign-table td:nth-child(6){width:115px}
.campaign-table th:nth-child(7),.campaign-table td:nth-child(7){width:145px}
.campaign-table th:nth-child(8),.campaign-table td:nth-child(8){width:130px}
.campaign-table th:nth-child(9),.campaign-table td:nth-child(9){width:38px}
.campaign-table .campaign-cell{display:block;width:100%;height:42px;box-sizing:border-box;border:0!important;border-radius:0!important;padding:8px 10px!important;background:transparent;font:inherit;outline:0}
.campaign-table .campaign-cell:focus{outline:2px solid #5089ec!important;outline-offset:-2px;background:#fff}
.campaign-table .campaign-product{padding:8px 10px;min-width:0;max-width:none;line-height:1.35}
.campaign-table .campaign-row-number{color:#8b909b;text-align:center;padding:0!important;background:#fafbfc;font-size:11px}
.campaign-table .campaign-profit,.campaign-table .campaign-submission{padding:8px 10px!important;font-variant-numeric:tabular-nums}
.campaign-table .campaign-submission{font-weight:700}
.campaign-table .campaign-status{display:block;padding:4px 10px 0;font-weight:700}
.campaign-table td small{display:block;margin:2px 10px 4px;font-size:10px}
.campaign-table .campaign-remove{padding:7px;background:transparent}
.campaign-rule-field{display:flex;align-items:center;gap:12px;font-weight:600}
.campaign-rule-field input{width:110px;padding:10px;border:1px solid #dfe1e7;border-radius:10px}
#costing-campaign-view{display:grid;gap:16px}
#costing-campaign-view[hidden]{display:none!important}

/* Keep long product names inside their spreadsheet cell */
.campaign-table td.campaign-product{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;max-width:0!important;min-width:0!important;box-sizing:border-box!important}
.campaign-table{table-layout:fixed!important}
.campaign-table th,.campaign-table td{overflow:hidden;box-sizing:border-box}
.campaign-table td.campaign-product{padding:8px 10px!important}

.campaign-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end}
.campaign-actions button{white-space:nowrap;padding:10px 13px}
.campaign-actions button:disabled{opacity:.4;cursor:not-allowed}
#campaignClear{color:#ad3d42;background:#fff0f0}
#campaignCopy{background:#e9f0ff;color:#2759a5}
@media(max-width:900px){.campaign-grid-card>.campaign-title{align-items:flex-start;flex-direction:column}.campaign-actions{justify-content:flex-start}}

/* Campaign Maker: clean Apple-like toolbar and confirmation */
.campaign-grid-card>.campaign-title{align-items:center;gap:24px}
.campaign-actions{gap:7px}
.campaign-actions button{border:1px solid #e7e9ee!important;background:#f7f8fb!important;color:#353942!important;border-radius:10px!important;font-size:12px!important;font-weight:600!important;padding:10px 12px!important;transition:background .15s,transform .15s}
.campaign-actions button:hover:not(:disabled){background:#e9edf5!important}
.campaign-actions button:active:not(:disabled){transform:scale(.98)}
.campaign-actions #campaignCopy{background:#edf3ff!important;color:#315d9d!important}
.campaign-actions #campaignClear{background:#fff6f5!important;color:#b44e4c!important}
.campaign-actions #campaignAdd{background:#25282e!important;color:#fff!important}
.campaign-actions button:disabled{opacity:.35}
.campaign-modal-backdrop{position:fixed;inset:0;background:rgba(23,28,39,.36);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center;z-index:99999;padding:20px}
.campaign-modal-backdrop[hidden]{display:none!important}
.campaign-modal{background:#fff;border:1px solid #e9eaf0;border-radius:22px;padding:28px;max-width:390px;width:100%;box-shadow:0 22px 80px rgba(18,25,40,.16);text-align:left}
.campaign-modal-icon{width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:#fff1f0;color:#bf4d49;border-radius:14px;font-size:25px;margin-bottom:18px}
.campaign-modal h2{font-size:20px;margin:0 0 8px;font-weight:700}
.campaign-modal p{font-size:13px;color:#737987;line-height:1.6;margin:0 0 26px}
.campaign-modal-actions{display:flex;justify-content:flex-end;gap:9px}
.campaign-modal-actions button{border:0;border-radius:10px;padding:11px 17px;font-weight:600;cursor:pointer;background:#f0f1f5;color:#30343b}
.campaign-modal-actions #campaignClearConfirm{background:#c74843;color:#fff}

.campaign-summary-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.campaign-live-status{font-size:12px;color:#427a60;background:#edf7f0;padding:6px 10px;border-radius:9px}.campaign-live-status[hidden]{display:none!important}

/* Compact per-SKU wholesale pricing ladder */
.sales-wholesale-sku-guide{margin-top:16px;border-top:1px solid #e5eae7;padding-top:13px}
.sales-wholesale-sku-guide>summary{cursor:pointer;font-size:13px;font-weight:650;color:#405d50;padding:8px 0}
.sales-wholesale-sku-detail{margin:8px 0;border:1px solid #e6ebe9;border-radius:11px;background:#fff;overflow:hidden}
.sales-wholesale-sku-detail>summary{display:flex;justify-content:space-between;gap:14px;cursor:pointer;padding:12px 14px;font-size:12px}
.sales-wholesale-sku-detail>summary span{color:#66756e}
.sales-wholesale-sku-tiers{padding:8px 14px 14px;display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}
.sales-wholesale-sku-tier{display:flex;flex-direction:column;gap:4px;padding:10px;background:#f5f8f6;border-radius:9px;font-size:12px}
.sales-wholesale-sku-tier small{color:#64736b;font-size:11px}
.sales-wholesale-guide-head small{font-weight:600;color:#438166}

/* Sales Order price hover: unobtrusive 10-tier wholesale forecast */
.sales-price-cell{position:relative}
.sales-tier-preview{display:none;position:absolute;z-index:110;right:calc(100% + 12px);top:-12px;width:340px;max-width:min(340px,80vw);padding:14px;border:1px solid #e1e6e4;border-radius:16px;background:#fff;box-shadow:0 14px 40px rgba(28,40,35,.16);color:#252d29;font-size:12px;pointer-events:none}
.sales-price-cell:hover .sales-tier-preview,.sales-price-cell:focus-within .sales-tier-preview{display:block}
.sales-tier-preview-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;padding-bottom:10px;border-bottom:1px solid #edf0ee}
.sales-tier-preview-heading small{color:#758078;white-space:nowrap}
.sales-tier-preview-row{display:grid;grid-template-columns:minmax(0,1fr) 90px 92px;align-items:center;gap:8px;padding:7px 2px;border-bottom:1px solid #f0f2f1}
.sales-tier-preview-row span{font-weight:600}
.sales-tier-preview-row span small{display:block;font-weight:400;color:#89918c;margin-top:2px}
.sales-tier-preview-row strong{text-align:right;font-variant-numeric:tabular-nums}
.sales-tier-preview-row>small{text-align:right;color:#768179}
.sales-tier-preview-row.is-reached{color:#16804e;background:#f3faf5;border-radius:6px}
.sales-tier-preview-foot{padding-top:10px;color:#7a857f;line-height:1.4;font-size:11px}
@media(max-width:900px){.sales-tier-preview{right:0;top:calc(100% + 6px)}}

/* Keep wholesale qualification visible while agents work down long orders.
   The tier list scrolls inside the pinned panel instead of obscuring the items. */
#salesWholesaleSummary:not([hidden]){
  position:sticky;
  top:12px;
  z-index:35;
  max-height:min(76vh,740px);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  box-shadow:0 8px 26px rgba(29,55,40,.08);
}
#salesWholesaleSummary:not([hidden]) > div:first-child,
#salesWholesaleSummary:not([hidden]) > .sales-wholesale-metrics{
  position:relative;
}
@media(max-height:650px){
  #salesWholesaleSummary:not([hidden]){max-height:62vh}
}
@media(max-width:700px){
  #salesWholesaleSummary:not([hidden]){top:6px;max-height:65vh}
}

/* Compact, Apple-style sticky wholesale overview: full tiers on demand. */
#salesWholesaleSummary:not([hidden]){
  top:72px;
  display:grid;
  grid-template-columns:minmax(210px,1.25fr) minmax(230px,1fr) minmax(165px,.7fr);
  align-items:center;
  gap:12px 20px;
  padding:13px 18px;
  max-height:calc(100dvh - 90px);
  overflow-y:auto;
  background:rgba(250,254,251,.98);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  box-shadow:0 6px 22px rgba(30,53,39,.07);
}
#salesWholesaleSummary .sales-wholesale-metrics{justify-content:flex-start;gap:20px;flex-wrap:wrap}
#salesWholesaleSummary .sales-wholesale-compact-savings{display:flex;flex-direction:column;gap:2px;text-align:right}
#salesWholesaleSummary .sales-wholesale-compact-savings>small{color:#728178;font-size:11px}
#salesWholesaleSummary .sales-wholesale-compact-savings>strong{font-size:17px;font-variant-numeric:tabular-nums;color:#23734c}
#salesWholesaleSummary .sales-wholesale-guide-disclosure{grid-column:1/-1;border-top:1px solid #e4ede6;padding-top:7px;min-width:0}
#salesWholesaleSummary .sales-wholesale-guide-disclosure>summary{display:flex;justify-content:space-between;align-items:center;gap:10px;cursor:pointer;color:#3c6650;font-weight:650;font-size:12px;list-style:none;padding:4px 0}
#salesWholesaleSummary .sales-wholesale-guide-disclosure>summary::-webkit-details-marker{display:none}
#salesWholesaleSummary .sales-wholesale-guide-disclosure>summary::before{content:'▸';font-size:12px}
#salesWholesaleSummary .sales-wholesale-guide-disclosure[open]>summary::before{content:'▾'}
#salesWholesaleSummary .sales-wholesale-guide-disclosure>summary span{margin-left:auto;color:#81918a;font-weight:400}
#salesWholesaleSummary .sales-wholesale-guide{margin-top:8px;padding-top:10px;border-top:1px solid #e4ede6;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 12px}
#salesWholesaleSummary .sales-wholesale-guide-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 10px;padding:8px 10px;border:1px solid #edf1ee;border-radius:10px}
#salesWholesaleSummary .sales-wholesale-guide-row>span:last-child{grid-column:1/-1;flex-direction:row;justify-content:space-between;align-items:center}
#salesWholesaleSummary .sales-wholesale-guide-row span small{font-size:10px}
#salesWholesaleSummary .sales-wholesale-sku-guide{grid-column:1/-1}
@media(max-width:1000px){
 #salesWholesaleSummary:not([hidden]){grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #salesWholesaleSummary .sales-wholesale-compact-savings{grid-column:1/-1;text-align:left;flex-direction:row;align-items:baseline;gap:8px}
}
@media(max-width:700px){
 #salesWholesaleSummary:not([hidden]){top:62px;grid-template-columns:minmax(0,1fr);padding:12px}
 #salesWholesaleSummary .sales-wholesale-metrics{gap:12px}
 #salesWholesaleSummary .sales-wholesale-compact-savings{grid-column:1}
 #salesWholesaleSummary .sales-wholesale-guide{grid-template-columns:minmax(0,1fr)}
}

/* Opaque, compact pinned wholesale totals and order column labels. */
#salesWholesaleSummary:not([hidden]){
  top:0 !important;
  z-index:65;
  background:#fafffc !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  border:1px solid #d6e8dd;
  border-radius:0 0 16px 16px;
  box-shadow:0 8px 20px rgba(29,55,40,.10);
  padding:12px 18px 0;
  gap:6px 16px;
  overflow:visible;
}
#salesWholesaleSummary .sales-wholesale-sticky-columns{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:150px minmax(220px,1fr) 120px 90px 160px 34px;
  gap:10px;
  align-items:center;
  padding:10px 8px 9px;
  margin-top:5px;
  border-top:1px solid #e0eae3;
  background:#fafffc;
  color:#818c85;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
}
body:has(#salesWholesaleSummary:not([hidden])) .sales-items-card>.sales-items-head{visibility:hidden;height:0;padding:0;margin:0;overflow:hidden}
@media(max-width:1100px){
 #salesWholesaleSummary .sales-wholesale-sticky-columns{grid-template-columns:125px minmax(170px,1fr) 85px 70px 120px 25px;gap:8px}
}
@media(max-width:700px){
 #salesWholesaleSummary:not([hidden]){top:0 !important;padding:10px 12px 0}
 #salesWholesaleSummary .sales-wholesale-sticky-columns{overflow-x:auto;grid-template-columns:105px minmax(120px,1fr) 60px 50px 95px 20px;gap:5px;font-size:9px}
}

/* Sales Orders: one opaque Apple-neutral Items header, including wholesale metrics.
   The entire header sticks together below the global toolbar, not as a separate tile. */
.sales-items-card{overflow:visible !important}
.sales-items-card .sales-items-sticky-header{position:relative;background:#fff}
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{
 position:sticky;top:68px;z-index:40;background:#fff;
 margin:-1px -1px 0;padding:1px 1px 0;
 border-radius:18px 18px 0 0;
 box-shadow:0 7px 18px rgba(0,0,0,.055);
}
.sales-items-card #salesWholesaleSummary:not([hidden]){
 position:static !important;display:grid;top:auto !important;z-index:auto;
 grid-template-columns:minmax(200px,1.25fr) minmax(220px,1fr) minmax(150px,.7fr);
 gap:14px;align-items:center;
 margin:0 18px 0;padding:14px 0 12px;
 max-height:none;overflow:visible;
 border:0 !important;border-bottom:1px solid #e5e5e7 !important;
 border-radius:0 !important;box-shadow:none !important;
 background:#fff !important;color:#1d1d1f;
 backdrop-filter:none !important;-webkit-backdrop-filter:none !important;
}
.sales-items-card #salesWholesaleSummary .sales-eyebrow{color:#86868b}
.sales-items-card #salesWholesaleSummary .sales-wholesale-compact-savings>strong{color:#1d1d1f}
.sales-items-card #salesWholesaleSummary .sales-wholesale-compact-savings>small{color:#86868b}
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-head{
 visibility:visible !important;height:auto !important;overflow:visible !important;
 display:grid !important;padding:0 8px 8px !important;margin:0 !important;
 background:#fff;
}
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-card-head{background:#fff}
@media(max-width:700px){
 .sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{top:58px}
 .sales-items-card #salesWholesaleSummary:not([hidden]){grid-template-columns:1fr 1fr;gap:8px;margin:0 10px}
 .sales-items-card #salesWholesaleSummary .sales-wholesale-compact-savings{grid-column:1/-1;text-align:left}
}

/* Sticky only inside Items: never mask Order Details or Payment Notes.
   No pseudo-element curtain, no overlay outside the header. */
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{
 position:sticky !important;
 top:76px !important;
 z-index:35 !important;
 margin:0 !important;
 padding:0 !important;
 border:0 !important;
 border-radius:0 !important;
 outline:0 !important;
 box-shadow:none !important;
 background:#fff !important;
 isolation:isolate;
}
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header::before,
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header::after{
 content:none !important;
 display:none !important;
}
.sales-items-card #salesWholesaleSummary:not([hidden]){
 position:static !important;
 border-radius:0 !important;
 box-shadow:none !important;
 background:#fff !important;
}
@media(max-width:700px){
 .sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{top:64px !important}
}

/* Opaque sticky Items header: cover only the header's own box, not the form above. */
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{
 background:#fff !important;
 isolation:isolate;
}
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header::before{
 content:"" !important;
 display:block !important;
 position:absolute;
 inset:0;
 z-index:0;
 background:#fff;
 pointer-events:none;
}
.sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header > *{
 position:relative;
 z-index:1;
 background:#fff;
}

/* Close the exposed strip above the sticky header: no offset, no overhanging curtain.
   The white surface starts at the viewport top and only occupies its own height. */
@media(min-width:701px){
 .sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{
  top:0 !important;
 }
}
@media(max-width:700px){
 .sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{
  top:0 !important;
 }
}

/* Keep the sales Items sticky summary below the fixed navigation bar. */
body.sidebar-collapsed .sales-items-sticky-header{top:64px !important}
body.sidebar-collapsed .global-bar{background:#f6f7f9 !important;backdrop-filter:none !important;-webkit-backdrop-filter:none !important}

/* Final specificity fix: the earlier :has() top:0 rule was overriding the toolbar offset. */
@media (min-width:701px){
 body.sidebar-collapsed .sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{top:64px !important}
 body:not(.sidebar-collapsed) .sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{top:78px !important}
}

/* Align the sticky summary with the actual visible toolbar edge; remove the exposed strip. */
@media(min-width:701px){
 body.sidebar-collapsed .sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{top:48px !important}
 body:not(.sidebar-collapsed) .sales-items-card:has(#salesWholesaleSummary:not([hidden])) .sales-items-sticky-header{top:48px !important}
}

/* Sales Orders: photo preview only after delayed product-name hover. */
.sales-product-name{cursor:default}
.sales-photo-peek{position:fixed;z-index:1000;width:300px;max-width:calc(100vw - 16px);padding:8px;border:1px solid #e5e5e7;border-radius:16px;background:#fff;box-shadow:0 18px 55px rgba(0,0,0,.14);pointer-events:none}
.sales-photo-peek img{display:block;width:100%;max-height:310px;object-fit:contain;border-radius:10px}


/* Platform Profit Analyzer — quiet Apple-inspired financial workspace */
.ppa-page{max-width:1560px;margin:0 auto;padding:30px 26px 65px;color:#1d1d1f}
.ppa-title{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}
.ppa-eyebrow{font-size:11px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:#86868b}
.ppa-title h1{font-size:30px;letter-spacing:-.035em;margin:7px 0}.ppa-title p,.ppa-control-head p,.ppa-upload p,.ppa-results-head p{color:#86868b;font-size:13px;margin:5px 0}
.ppa-card{background:#fff;border:1px solid #e8e8ed;border-radius:20px;padding:23px;box-shadow:0 8px 25px rgba(20,20,30,.025)}
.ppa-controls{margin-bottom:16px}.ppa-control-head,.ppa-results-head{display:flex;align-items:center;justify-content:space-between}.ppa-control-head h2,.ppa-upload h2,.ppa-results h2{font-size:17px;letter-spacing:-.02em;margin:0}
.ppa-commission-label{font-size:26px;font-weight:700;letter-spacing:-.04em}.ppa-slider-label{display:block;margin:18px 0 6px;font-size:12px;color:#6e6e73}
.ppa-controls input[type=range]{width:100%;accent-color:#555}.ppa-inputs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-top:17px}.ppa-inputs label{font-size:12px;color:#6e6e73;font-weight:600}.ppa-inputs input{display:block;width:100%;box-sizing:border-box;border:1px solid #e5e5ea;border-radius:11px;padding:12px;background:#fafafa;color:#1d1d1f;margin-top:7px;font-size:14px}
.ppa-hint{font-size:11px;line-height:1.5;color:#86868b;margin:14px 0 0}
.ppa-upload{text-align:center;border-style:dashed;margin-bottom:16px;padding:25px}.ppa-upload.dragging{border-color:#555;background:#f7f7f8}.ppa-upload-icon{font-size:26px;color:#8e8e93;margin-bottom:5px}.ppa-file-button{display:inline-block;background:#1d1d1f;color:#fff;border-radius:10px;padding:10px 18px;font-size:13px;font-weight:600;cursor:pointer;margin:12px 0}.ppa-filename,.ppa-status{font-size:12px;color:#86868b}
.ppa-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.ppa-metrics .ppa-card{display:flex;flex-direction:column;gap:9px}.ppa-metrics small,.ppa-secondary small{font-size:12px;color:#86868b}.ppa-metrics strong{font-size:26px;letter-spacing:-.04em}.ppa-primary{background:#f8f8fa}.ppa-primary span{font-size:12px;color:#6e6e73}
.ppa-secondary{display:flex;gap:24px;padding:18px 8px 23px;flex-wrap:wrap}.ppa-secondary>div{display:flex;gap:9px;align-items:center}.ppa-secondary strong{font-size:13px}
.ppa-results{padding:20px}.ppa-table-scroll{overflow:auto;margin-top:16px}.ppa-table-scroll table{width:100%;border-collapse:collapse;min-width:1000px;font-size:12px}.ppa-table-scroll th{text-align:right;white-space:nowrap;color:#86868b;font-size:10px;letter-spacing:.08em;text-transform:uppercase;padding:12px;border-bottom:1px solid #e8e8ed}.ppa-table-scroll th:first-child,.ppa-table-scroll td:first-child{text-align:left}.ppa-table-scroll td{text-align:right;padding:13px 12px;border-bottom:1px solid #f0f0f2;vertical-align:top}.ppa-table-scroll td small{display:block;color:#86868b;font-size:10px;margin-top:5px}.ppa-table-scroll td em,.ppa-alert{color:#a33;font-style:normal}.ppa-alert{font-size:12px;padding:12px;border-radius:10px;background:#fff7f7}.ppa-empty{text-align:center!important;color:#86868b;padding:35px!important}
@media(max-width:900px){.ppa-inputs{grid-template-columns:repeat(2,minmax(0,1fr))}.ppa-metrics{grid-template-columns:1fr}.ppa-title{align-items:flex-start}.ppa-page{padding:16px}}


/* Profit Analyzer: isolate the report table from global sticky TH rules.
   The global table headers otherwise stick midway through the dataset,
   leaving rows above the column labels. Keep the labels in normal flow. */
#platform-profit-analyzer-page .ppa-table-scroll thead,
#platform-profit-analyzer-page .ppa-table-scroll thead tr,
#platform-profit-analyzer-page .ppa-table-scroll thead th{
  position:static !important;
  top:auto !important;
  bottom:auto !important;
  transform:none !important;
}
#platform-profit-analyzer-page .ppa-table-scroll thead th{
  background:#f8f8fa !important;
  z-index:auto !important;
}

/* Profit Analyzer missing-data flags */
.ppa-data-flags{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px;font-size:12px;color:#6e6e73}.ppa-data-flags>div{padding:9px 12px;border-radius:10px;background:#f5f5f7;border:1px solid #e8e8ed;max-width:100%;overflow-wrap:anywhere}

/* Profit Analyzer — financial statement waterfall */
.ppa-waterfall{background:#fff;border:1px solid #e8e8ed;border-radius:20px;overflow:hidden;margin-top:2px;margin-bottom:22px;box-shadow:0 8px 25px rgba(20,20,30,.025)}
.ppa-flow-row{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:18px 24px;border-bottom:1px solid #f0f0f2}
.ppa-flow-row>div{display:flex;align-items:baseline;justify-content:space-between;gap:24px;min-width:min(650px,70%)}
.ppa-flow-row small,.ppa-flow-result small{font-size:13px;color:#6e6e73}.ppa-flow-row strong{font-size:18px;letter-spacing:-.02em;font-weight:600}
.ppa-flow-note{font-size:12px;color:#a1a1a6;text-align:right}.ppa-deduction strong{color:#515154}
.ppa-flow-result{padding:22px 24px;background:#f7f7f9;border-bottom:1px solid #e8e8ed}
.ppa-flow-result>div{display:flex;align-items:baseline;gap:18px}.ppa-flow-result strong{font-size:30px;letter-spacing:-.04em}.ppa-flow-result>div>span{font-size:12px;color:#6e6e73}
.ppa-contribution{background:#f2f2f4;border-bottom:0;display:flex;justify-content:space-between;align-items:center;gap:24px}
.ppa-contribution p{margin:0;color:#86868b;font-size:12px;max-width:430px;text-align:right;line-height:1.45}
@media(max-width:700px){.ppa-flow-row,.ppa-contribution{align-items:flex-start;flex-direction:column}.ppa-flow-row>div{min-width:100%;width:100%}.ppa-flow-note,.ppa-contribution p{text-align:left}.ppa-flow-result>div{flex-wrap:wrap}}

.ppa-upload-actions{display:flex;justify-content:center;align-items:center;gap:8px;margin:12px 0}.ppa-upload-actions .ppa-file-button{margin:0}.ppa-clear-button{appearance:none;border:1px solid #d9d9de;background:#fff;color:#515154;border-radius:10px;padding:9px 14px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}.ppa-clear-button:hover{background:#f5f5f7}

/* Profit Analyzer preview refinements */
.ppa-assumption-head-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}
.ppa-assumption-status{font-size:11px;color:#86868b;min-width:72px}
.ppa-sort-control{display:flex;align-items:center;gap:9px;font-size:12px;color:#6e6e73;font-weight:600}
.ppa-sort-control select{border:1px solid #dedee3;background:#fafafa;border-radius:10px;padding:8px 30px 8px 10px;color:#1d1d1f}
#platform-profit-analyzer-page .ppa-table-scroll th:first-child{width:150px}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(2){text-align:left;width:260px}
#platform-profit-analyzer-page .ppa-table-scroll td:nth-child(2){text-align:left}
#platform-profit-analyzer-page .ppa-sku-cell{padding-right:18px}
#platform-profit-analyzer-page .ppa-product-cell{padding-left:18px;max-width:310px}
#platform-profit-analyzer-page .ppa-product-cell,#platform-profit-analyzer-page .ppa-sku-cell{vertical-align:middle}

/* Profit Analyzer table readability + floating header */
#platform-profit-analyzer-page .ppa-table-scroll table{table-layout:fixed;min-width:1180px}
#platform-profit-analyzer-page .ppa-table-scroll th,
#platform-profit-analyzer-page .ppa-table-scroll td{box-sizing:border-box}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(1){width:12%}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(2){width:26%}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(3){width:7%}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(4){width:12%}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(5){width:12%}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(6){width:10%}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(7){width:12%}
#platform-profit-analyzer-page .ppa-table-scroll th:nth-child(8){width:11%}
#platform-profit-analyzer-page .ppa-product-cell{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:0}
#platform-profit-analyzer-page .ppa-table-scroll thead{position:sticky !important;top:0 !important;z-index:30 !important}
#platform-profit-analyzer-page .ppa-table-scroll thead tr{position:sticky !important;top:0 !important;z-index:30 !important}
#platform-profit-analyzer-page .ppa-table-scroll thead th{position:sticky !important;top:0 !important;z-index:31 !important;background:#f8f8fa !important;box-shadow:0 1px 0 #e8e8ed}


/* Permission visibility must win over sidebar flex/button display rules. */
.app-sidebar .app-tab.permission-hidden,
[data-requires-permission].permission-hidden {
  display: none !important;
}


/* Sales Orders: focusing the first SKU must not visually lift the header row. */
.sales-items-card .sales-items-head{
  min-height:38px;
  box-sizing:border-box;
  align-items:end;
}
.sales-items-card .sales-item-row:first-child,
.sales-items-card .sales-item-row:first-child:focus-within{
  transform:none !important;
  margin-top:0 !important;
}
.sales-items-card .sales-item-row:first-child .sales-sku:focus{
  transform:none !important;
}


/* Sales Orders Items: disable sticky/focus repositioning in normal retail mode.
   The header must remain in document flow while entering the first SKU. */
.sales-items-card:not(:has(#salesWholesaleSummary:not([hidden]))) .sales-items-sticky-header{
  position:static !important;
  top:auto !important;
  transform:none !important;
  margin:0 !important;
}
.sales-items-card:not(:has(#salesWholesaleSummary:not([hidden]))) .sales-items-sticky-header:focus-within{
  position:static !important;
  top:auto !important;
  transform:none !important;
}

/* Chat presence: green online, red offline. */
.chat-contact-avatar{position:relative}
.chat-presence-dot{position:absolute;right:-1px;bottom:-1px;width:12px;height:12px;border-radius:50%;border:2px solid #fff;background:#dc3b3b;box-sizing:border-box}
.chat-contact-avatar.is-online .chat-presence-dot{background:#20ad6b}
.chat-contact-avatar.is-offline .chat-presence-dot{background:#dc3b3b}

/* Incoming compact overview preview */
.incoming-overview-strip{grid-column:1/-1;margin-top:10px;padding:9px 11px;border:1px solid rgba(0,0,0,.055);background:rgba(248,248,250,.86);border-radius:14px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.incoming-overview-metrics{display:flex;align-items:center;gap:4px;min-width:0;flex-wrap:wrap}
.incoming-overview-chip{border:0;background:transparent;border-radius:10px;padding:6px 9px;display:flex;align-items:baseline;gap:6px;color:#6e6e73;cursor:pointer;font:inherit}
.incoming-overview-chip:hover{background:#fff;color:#1d1d1f;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.incoming-overview-chip strong{font-size:13px;color:#1d1d1f}.incoming-overview-chip span{font-size:11px}
.incoming-overview-separator{width:1px;height:18px;background:#d9d9de;margin:0 3px}
.incoming-supplier-overview{position:relative}.incoming-supplier-overview>summary{list-style:none;cursor:pointer;white-space:nowrap;font-size:12px;font-weight:600;color:#3a3a3c;padding:7px 10px;border-radius:10px;background:#fff;border:1px solid #e6e6e9}
.incoming-supplier-overview>summary::-webkit-details-marker{display:none}
.incoming-supplier-overview-panel{position:absolute;right:0;top:calc(100% + 7px);z-index:50;width:min(430px,75vw);max-height:360px;overflow:auto;padding:7px;background:rgba(255,255,255,.98);border:1px solid #e5e5e7;border-radius:14px;box-shadow:0 14px 40px rgba(0,0,0,.14)}
.incoming-supplier-overview-row{width:100%;border:0;background:transparent;border-radius:10px;padding:9px 10px;display:flex;justify-content:space-between;gap:18px;text-align:left;cursor:pointer}.incoming-supplier-overview-row:hover{background:#f5f5f7}
.incoming-supplier-overview-row span{display:flex;flex-direction:column;gap:2px}.incoming-supplier-overview-row strong{font-size:12px;color:#1d1d1f}.incoming-supplier-overview-row small,.incoming-supplier-overview-row em{font-size:10px;color:#86868b;font-style:normal;line-height:1.45}
.incoming-supplier-overview-row em{text-align:right;white-space:nowrap}
.incoming-order-flags{display:inline-flex;gap:4px;align-items:center}.incoming-flag{font-size:9px;font-weight:600;padding:4px 7px;border-radius:999px;background:#f2f2f4;color:#6e6e73;cursor:pointer;white-space:nowrap}.incoming-flag.paid,.incoming-flag.shipped{background:#edf8f0;color:#287a3d}.incoming-flag:hover{filter:brightness(.97)}
@media(max-width:900px){.incoming-overview-strip{align-items:flex-start;flex-direction:column}.incoming-supplier-overview{width:100%}.incoming-supplier-overview>summary{display:inline-block}}

/* Keep Incoming row actions inside the viewport on the overview preview. */
.incoming-order-summary{grid-template-columns:minmax(330px,1.35fr) minmax(260px,.9fr) minmax(110px,.42fr) auto auto auto auto !important;column-gap:10px}
.incoming-order-flags{justify-self:end;min-width:0}
.incoming-summary-copy,.incoming-summary-print,.incoming-status{justify-self:end;white-space:nowrap}
.incoming-order-card{overflow:hidden}
@media(max-width:1500px){
  .incoming-order-summary{grid-template-columns:minmax(300px,1.2fr) minmax(220px,.82fr) minmax(95px,.36fr) auto auto auto auto !important;column-gap:7px}
  .incoming-summary-copy,.incoming-summary-print{padding-left:7px!important;padding-right:7px!important}
  .incoming-flag{padding-left:6px;padding-right:6px}
}

.incoming-overview-chip.active{background:#e9f7ed;color:#237a3b;box-shadow:inset 0 0 0 1px rgba(35,122,59,.10)}
.incoming-overview-chip.active strong,.incoming-overview-chip.active span{color:#237a3b}
.incoming-order.is-expanded,.incoming-order:has(.incoming-detail){position:relative;z-index:8;background:#fff;box-shadow:0 12px 34px rgba(0,0,0,.08);border-radius:16px}

/* PR72: expanded supplier identity + receiving controls travel together while reconciling. */
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])) > .incoming-order-summary{
  position:sticky !important;
  top:0 !important;
  z-index:74 !important;
  min-height:76px !important;
  background:#fff !important;
  box-shadow:0 1px 0 rgba(0,0,0,.07),0 8px 18px rgba(0,0,0,.035);
}
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])) .incoming-workspace-head{
  top:76px !important;
}
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])) .incoming-workspace > .incoming-table-wrap > .incoming-table > thead{
  top:134px !important;
}

/* PR72 sticky stack correction: clear the app topbar and avoid clipped layers. */
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])){
  overflow:visible !important;
}
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])) > .incoming-order-summary{
  top:52px !important;
  z-index:72 !important;
  min-height:88px !important;
  padding-top:12px !important;
  padding-bottom:12px !important;
}
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])) .incoming-workspace{
  overflow:visible !important;
}
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])) .incoming-workspace-head{
  top:140px !important;
  z-index:71 !important;
  min-height:58px;
  background:#f8f8fa !important;
}
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])) .incoming-workspace > .incoming-table-wrap{
  overflow:visible !important;
}
#suppliers-incoming-page .incoming-order-card:has(.incoming-workspace:not([hidden])) .incoming-workspace > .incoming-table-wrap > .incoming-table > thead{
  top:198px !important;
  z-index:70 !important;
}

/* Purchase Planner v33: viewport-level floating section bar + live cost */
.ppx-floating-portal{position:fixed;top:58px;z-index:1000;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:11px 16px;border:1px solid #e5e7eb;border-radius:12px;background:rgba(255,255,255,.96);box-shadow:0 8px 24px rgba(15,23,42,.10);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);font-size:13px;color:#18202a;pointer-events:none}.ppx-floating-portal[hidden]{display:none!important}.ppx-floating-portal strong{font-size:14px}.ppx-floating-portal span{font-size:12px;color:#59616c;font-weight:650}.ppx-recommendation-cost{display:inline-block;margin-top:5px;font-size:12px;color:#1f2937;font-weight:700;white-space:nowrap}

/* Purchase Planner v34: full-card floating headers + sheet-like lost demand cells */
.ppx-floating-portal.ppx-floating-card{top:58px!important;padding:0!important;border-radius:12px!important;overflow:hidden!important;pointer-events:none!important;background:rgba(255,255,255,.98)!important}.ppx-floating-card>.ppx-history-head,.ppx-floating-card>.ppx-floating-subhead{box-sizing:border-box!important;width:100%!important;margin:0!important;padding:14px 18px!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}.ppx-floating-card>.ppx-floating-subhead{min-height:48px!important;display:flex!important;align-items:center!important;gap:12px!important}.ppx-floating-card>.ppx-floating-subhead h4{margin:0!important}.ppx-floating-card .ppx-analysis-note{display:block!important;max-width:780px!important}.ppx-lost-grid .ppx-sheet-cell{box-sizing:border-box!important;width:100%!important;min-width:0!important;height:34px!important;padding:7px 9px!important;border:1px solid transparent!important;border-radius:4px!important;background:transparent!important;font:inherit!important;color:inherit!important;outline:none!important}.ppx-lost-grid .ppx-sheet-cell:hover{border-color:#d9dde3!important;background:#fff!important}.ppx-lost-grid .ppx-sheet-cell:focus{border-color:#8d98a8!important;background:#fff!important;box-shadow:0 0 0 2px rgba(80,96,120,.10)!important}.ppx-system-suggestion.is-addressed b{font-size:11px!important;color:#59636f!important}.ppx-interpretation.addressed{background:#eef1f4!important;color:#59636f!important}


/* Suppliers Incoming print controls */
.incoming-print-status{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border-radius:8px;padding:7px 9px;font-size:12px;font-weight:650;color:#68707b;background:#f4f5f7;cursor:pointer}
.incoming-print-status.is-printed{color:#176b3a;background:#edf9f1}
.incoming-print-menu{background:#fff;border:1px solid #e3e6ea;border-radius:12px;box-shadow:0 14px 38px rgba(0,0,0,.14);padding:6px}
.incoming-print-menu button{display:flex;width:100%;border:0;background:transparent;border-radius:8px;padding:10px 12px;text-align:left;flex-direction:column;gap:2px;cursor:pointer}
.incoming-print-menu button:hover{background:#f5f6f8}
.incoming-print-menu button strong{font-size:13px}
.incoming-print-menu button span{font-size:11px;color:#6f7680}

/* Home 2026 Apple-inspired visual refresh — intentionally scoped to #home-page only */
#home-page.home-page{max-width:1460px;padding:10px 26px 34px}
#home-page .home-hero{position:relative;align-items:center;margin:20px 0 26px;padding:6px 4px}
#home-page .home-hero:before{content:"";position:absolute;z-index:-1;width:760px;height:260px;right:-90px;top:-155px;background:radial-gradient(circle at 42% 55%,rgba(147,197,253,.28),transparent 43%),radial-gradient(circle at 70% 48%,rgba(216,180,254,.22),transparent 42%),radial-gradient(circle at 86% 70%,rgba(253,186,116,.16),transparent 38%);filter:blur(8px);pointer-events:none}
#home-page .home-hero h1{font-size:34px;line-height:1.08;letter-spacing:-1.25px;font-weight:760}
#home-page .home-hero p{margin-top:8px;font-size:14px;color:#77808d}
#home-page .home-hero-actions{display:flex;align-items:center;gap:12px}
#home-page .home-theme-toggle{height:36px;border:1px solid rgba(15,23,42,.08);border-radius:999px;background:rgba(255,255,255,.78);box-shadow:0 4px 18px rgba(15,23,42,.05);padding:0 12px;display:flex;align-items:center;gap:7px;color:#46505e;font-size:11px;font-weight:700;backdrop-filter:blur(18px)}
#home-page .home-theme-toggle:hover{transform:translateY(-1px);box-shadow:0 7px 22px rgba(15,23,42,.08)}
#home-page .home-theme-icon{font-size:15px}
#home-page .home-sync{padding:9px 12px;border-radius:999px;background:rgba(255,255,255,.6);border:1px solid rgba(15,23,42,.05);backdrop-filter:blur(16px)}
#home-page .home-grid{gap:16px;margin-bottom:16px}
#home-page .home-top-grid{grid-template-columns:1.28fr 1fr}
#home-page .home-middle-grid{grid-template-columns:1.45fr .82fr}
#home-page .home-card{border:1px solid rgba(15,23,42,.065);border-radius:22px;box-shadow:0 14px 45px rgba(15,23,42,.055);padding:20px;background:rgba(255,255,255,.86);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)}
#home-page .home-card-title{font-size:14px;letter-spacing:-.2px;margin-bottom:16px}
#home-page .quick-actions{gap:10px}
#home-page .quick-actions button{min-height:104px;border:1px solid rgba(15,23,42,.035);border-radius:17px;background:linear-gradient(145deg,rgba(248,250,252,.98),rgba(244,247,250,.82));transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
#home-page .quick-actions button:hover{transform:translateY(-2px);border-color:rgba(15,23,42,.08);box-shadow:0 12px 26px rgba(15,23,42,.07)}
#home-page .quick-actions b{width:44px;height:44px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.55)}
#home-page .today-metrics{padding-top:8px}
#home-page .today-metrics div{padding:8px 16px;border-color:rgba(15,23,42,.07)}
#home-page .today-metrics strong{font-size:30px;font-weight:760}
#home-page .attention-row,#home-page .home-activity-row{border-color:rgba(15,23,42,.06);padding:13px 5px;border-radius:10px}
#home-page .attention-row:hover,#home-page .home-activity-row:hover{background:rgba(248,250,252,.78)}
#home-page .system-card{padding:18px 20px}
#home-page .system-modules{gap:12px}
#home-page .system-modules>div{border-color:rgba(15,23,42,.055);border-radius:15px;padding:14px;background:rgba(248,250,252,.64)}
#home-page .system-modules b{background:rgba(238,242,247,.88)}
#home-page+.team-task-rail,#home-page .team-task-rail{border-radius:22px!important;border-color:rgba(15,23,42,.065)!important;box-shadow:0 14px 45px rgba(15,23,42,.055)!important}

/* Dark preference is Home-only; operational tabs keep their proven light UI. */
body.home-dark #home-page{color:#f4f6f8}
body.home-dark #home-page:before{content:"";position:fixed;z-index:-2;inset:0 0 0 var(--sidebar-expanded);background:#0b0d11;pointer-events:none}
body.home-dark.sidebar-collapsed #home-page:before{inset-left:var(--sidebar-collapsed)}
body.home-dark #home-page .home-hero:before{background:radial-gradient(circle at 42% 55%,rgba(59,130,246,.19),transparent 43%),radial-gradient(circle at 70% 48%,rgba(139,92,246,.16),transparent 42%),radial-gradient(circle at 86% 70%,rgba(249,115,22,.10),transparent 38%)}
body.home-dark #home-page .home-hero p,body.home-dark #home-page .home-sync{color:#aeb5c0}
body.home-dark #home-page .home-card{background:rgba(24,27,33,.88);border-color:rgba(255,255,255,.075);box-shadow:0 18px 50px rgba(0,0,0,.22)}
body.home-dark #home-page .home-theme-toggle,body.home-dark #home-page .home-sync{background:rgba(29,32,39,.84);border-color:rgba(255,255,255,.08);color:#d7dbe1}
body.home-dark #home-page .quick-actions button,body.home-dark #home-page .system-modules>div{background:rgba(35,39,47,.82);border-color:rgba(255,255,255,.06);color:#f4f6f8}
body.home-dark #home-page .quick-actions button:hover,body.home-dark #home-page .attention-row:hover,body.home-dark #home-page .home-activity-row:hover{background:rgba(42,47,56,.9)}
body.home-dark #home-page .today-metrics div,body.home-dark #home-page .attention-row,body.home-dark #home-page .home-activity-row{border-color:rgba(255,255,255,.075)}
body.home-dark #home-page .today-metrics span,body.home-dark #home-page .attention-row span,body.home-dark #home-page .home-activity-row small,body.home-dark #home-page .home-card-title small{color:#9da5b1}
body.home-dark #home-page .today-metrics div:first-child strong,body.home-dark #home-page .attention-row b,body.home-dark #home-page .home-activity-row b{color:#f5f7fa}
body.home-dark #home-page .system-modules b{background:#30343d;color:#e8ebef}
body.home-dark #home-page .system-modules small{color:#929aa6}
body.home-dark #home-page .home-empty{color:#929aa6}
@media(max-width:1100px){#home-page.home-page{padding-left:18px;padding-right:18px}#home-page .home-top-grid,#home-page .home-middle-grid{grid-template-columns:1fr}}

/* Home aurora treatment — visible Apple-like ambient rainbow, no operational pages affected */
#home-page.home-page{isolation:isolate;overflow:visible}
#home-page.home-page:after{
  content:"";position:absolute;z-index:-1;pointer-events:none;
  top:58px;left:3%;right:1%;height:330px;border-radius:48% 52% 58% 42%;
  background:
    radial-gradient(ellipse at 8% 42%,rgba(255,99,132,.22) 0 14%,transparent 39%),
    radial-gradient(ellipse at 27% 20%,rgba(255,190,92,.22) 0 15%,transparent 39%),
    radial-gradient(ellipse at 47% 33%,rgba(103,232,249,.25) 0 17%,transparent 42%),
    radial-gradient(ellipse at 68% 18%,rgba(96,165,250,.25) 0 16%,transparent 40%),
    radial-gradient(ellipse at 86% 36%,rgba(192,132,252,.25) 0 17%,transparent 42%),
    radial-gradient(ellipse at 96% 62%,rgba(244,114,182,.18) 0 13%,transparent 36%);
  filter:blur(42px) saturate(118%);
  opacity:.92;
  transform:translateY(-76px) scale(1.03);
}
#home-page .home-hero:before{
  width:920px;height:330px;right:-120px;top:-190px;
  background:
    radial-gradient(circle at 15% 62%,rgba(255,119,148,.20),transparent 32%),
    radial-gradient(circle at 36% 48%,rgba(255,201,103,.18),transparent 31%),
    radial-gradient(circle at 55% 52%,rgba(103,232,249,.22),transparent 34%),
    radial-gradient(circle at 73% 43%,rgba(96,165,250,.22),transparent 33%),
    radial-gradient(circle at 88% 56%,rgba(192,132,252,.22),transparent 34%);
  filter:blur(24px);opacity:1;
}
body.home-dark #home-page.home-page:after{
  background:
    radial-gradient(ellipse at 8% 42%,rgba(244,63,94,.18) 0 14%,transparent 39%),
    radial-gradient(ellipse at 29% 22%,rgba(245,158,11,.15) 0 15%,transparent 39%),
    radial-gradient(ellipse at 49% 33%,rgba(34,211,238,.18) 0 17%,transparent 42%),
    radial-gradient(ellipse at 69% 18%,rgba(59,130,246,.22) 0 16%,transparent 40%),
    radial-gradient(ellipse at 87% 36%,rgba(168,85,247,.23) 0 17%,transparent 42%),
    radial-gradient(ellipse at 96% 62%,rgba(236,72,153,.15) 0 13%,transparent 36%);
  opacity:.78;filter:blur(50px) saturate(125%);
}

/* PR92 refinement: seamless Home chrome + complete dark shell */
body[data-active-tab="home"] .global-bar{
  background:transparent!important;border-bottom-color:transparent!important;box-shadow:none!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
body[data-active-tab="home"] .app-main{background:transparent!important}
body.home-dark[data-active-tab="home"]{
  background:#0b0d11!important;color:#f4f6f8;
}
body.home-dark[data-active-tab="home"] .app-main,
body.home-dark[data-active-tab="home"] .global-bar{
  background:#0b0d11!important;color:#f4f6f8;
}
body.home-dark[data-active-tab="home"] .app-sidebar{
  background:#0f1217!important;border-right-color:rgba(255,255,255,.07)!important;color:#e9edf2;
}
body.home-dark[data-active-tab="home"] .app-sidebar .app-tab{color:#aeb6c2}
body.home-dark[data-active-tab="home"] .app-sidebar .app-tab.active{background:#202630!important;color:#fff!important}
body.home-dark[data-active-tab="home"] .app-sidebar .app-tab:hover{background:#191e26!important;color:#fff}
body.home-dark[data-active-tab="home"] .global-bar button,
body.home-dark[data-active-tab="home"] .global-bar .collab-avatar,
body.home-dark[data-active-tab="home"] .global-bar .user-menu{
  background:#151920!important;border-color:rgba(255,255,255,.08)!important;color:#eef1f5!important;
}
body.home-dark[data-active-tab="home"] .team-task-rail{
  background:#171a20!important;border-color:rgba(255,255,255,.08)!important;color:#f3f5f7!important;
  box-shadow:0 18px 50px rgba(0,0,0,.28)!important;
}
body.home-dark[data-active-tab="home"] .team-task-rail *{border-color:rgba(255,255,255,.075)}
body.home-dark[data-active-tab="home"] .team-task-rail small,
body.home-dark[data-active-tab="home"] .team-task-rail span{color:#a6aeba}
body.home-dark[data-active-tab="home"] #home-page:before{
  inset:0!important;background:#0b0d11!important;
}

/* Global dark preference, toggled from Home. Semantic variables carry operational screens safely. */
body.app-dark{
  --bg:#0b0d11;--panel:#15181e;--border:#2a2f38;--border-strong:#3a414c;
  --text:#f1f4f7;--muted:#9ba4b0;--soft:#1b1f26;--soft-2:#222730;--accent:#f4f6f8;
  --danger-bg:#2a1718;--warning-bg:#2b2416;--success-bg:#14251b;
  background:#0b0d11!important;color:var(--text);
}
body.app-dark .app-main,body.app-dark .app-page,body.app-dark .page{background:transparent;color:var(--text)}
body.app-dark .app-sidebar{background:#0f1217!important;border-right-color:var(--border)!important;color:var(--text)}
body.app-dark .app-sidebar .app-tab{color:#aeb6c2}
body.app-dark .app-sidebar .app-tab.active{background:#202630!important;color:#fff!important}
body.app-dark .global-bar{background:rgba(11,13,17,.86)!important;border-color:rgba(255,255,255,.06)!important;color:var(--text);backdrop-filter:blur(18px)!important;-webkit-backdrop-filter:blur(18px)!important}
body.app-dark .panel,body.app-dark .stat,body.app-dark .supplier-card,body.app-dark .modal,
body.app-dark .table-wrap,body.app-dark table,body.app-dark textarea,body.app-dark input,body.app-dark select,
body.app-dark .btn,body.app-dark .filter-tab,body.app-dark .supplier-card-header,body.app-dark .supplier-summary-bar{
  background:var(--panel);color:var(--text);border-color:var(--border);
}
body.app-dark th,body.app-dark .master-po-table-wrap th,body.app-dark .supplier-sheet thead th{background:#1b1f26;color:#b8c0ca}
body.app-dark tbody tr:hover{background:#1a1e25}
body.app-dark .supplier-sheet{background:#101319}
body.app-dark .btn-primary,body.app-dark .filter-tab.active{background:#eef1f5;color:#11151a;border-color:#eef1f5}
body.app-dark .field input,body.app-dark .field select,body.app-dark .qty-input{background:#15181e;color:var(--text);border-color:var(--border-strong)}
body.app-dark .muted,body.app-dark .subtitle,body.app-dark .panel-subtitle,body.app-dark .status{color:var(--muted)}
body.app-dark .modal-backdrop{background:rgba(0,0,0,.68)}

/* Home top chrome must float over the aurora in both themes. */
body[data-active-tab="home"] .global-bar,
body.app-dark[data-active-tab="home"] .global-bar{
  background:transparent!important;border-color:transparent!important;box-shadow:none!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
body.app-dark[data-active-tab="home"] #home-page:before{background:#0b0d11!important;inset:0!important}

/* Dark-mode quality pass: keep surfaces charcoal, typography crisp, controls legible. */
body.app-dark{
  --dark-canvas:#0b0d11;--dark-surface:#14181e;--dark-surface-2:#191e25;--dark-surface-3:#202630;
  --dark-line:#2a3039;--dark-text:#f5f7fa;--dark-muted:#aab2bd;
}
body.app-dark .tab-panel,body.app-dark .tab-content{color:var(--dark-text)}
body.app-dark h1,body.app-dark h2,body.app-dark h3,body.app-dark h4,
body.app-dark .panel-title,body.app-dark .supplier-name,body.app-dark strong{color:var(--dark-text)}
body.app-dark input::placeholder,body.app-dark textarea::placeholder{color:#7f8996;opacity:1}
body.app-dark input,body.app-dark select,body.app-dark textarea{
  background:var(--dark-surface-2)!important;color:var(--dark-text)!important;border-color:#343b46!important;
}
body.app-dark input[type="checkbox"],body.app-dark input[type="radio"]{accent-color:#60a5fa}
body.app-dark .panel,body.app-dark .stat,body.app-dark .supplier-card,body.app-dark .table-wrap{
  background:var(--dark-surface)!important;border-color:var(--dark-line)!important;
}
body.app-dark table{background:var(--dark-surface)!important;color:var(--dark-text)}
body.app-dark th{background:var(--dark-surface-2)!important;color:#c9d0d9!important}
body.app-dark td{color:#e8ecf1;border-color:var(--dark-line)!important}
body.app-dark tbody tr:nth-child(even){background:rgba(255,255,255,.018)}
body.app-dark tbody tr:hover{background:#1d222a!important}

/* PO Generator */
body.app-dark [data-tab-content="po-generator"] .panel,
body.app-dark #po-generator .panel{background:var(--dark-surface)!important}
body.app-dark [data-tab-content="po-generator"] .panel-header,
body.app-dark #po-generator .panel-header,
body.app-dark [data-tab-content="po-generator"] .master-po-header,
body.app-dark #po-generator .master-po-header{background:var(--dark-surface-2)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
body.app-dark [data-tab-content="po-generator"] .supplier-sheet,
body.app-dark #po-generator .supplier-sheet{background:#101319!important}
body.app-dark [data-tab-content="po-generator"] .stat,
body.app-dark #po-generator .stat{background:linear-gradient(145deg,#1b2027,#14181e)!important}

/* Costing Manager: remove washed-out header/filter regions */
body.app-dark [data-tab-content="costing-manager"] .panel,
body.app-dark #costing-manager .panel,
body.app-dark [data-tab-content="costing-manager"] .costing-shell,
body.app-dark #costing-manager .costing-shell{background:var(--dark-surface)!important;color:var(--dark-text)!important}
body.app-dark [data-tab-content="costing-manager"] .panel-header,
body.app-dark #costing-manager .panel-header{background:var(--dark-surface-2)!important;color:var(--dark-text)!important}
body.app-dark [data-tab-content="costing-manager"] button,
body.app-dark #costing-manager button{border-color:#343b46}
body.app-dark [data-tab-content="costing-manager"] .active,
body.app-dark #costing-manager .active{color:var(--dark-text)}

/* Supplier Manager: white editable fields intentionally stay light, therefore force dark ink. */
body.app-dark [data-tab-content="supplier-manager"] input:not([type="checkbox"]):not([type="radio"]),
body.app-dark #supplier-manager input:not([type="checkbox"]):not([type="radio"]){
  background:#f7f8fa!important;color:#111827!important;border-color:#d5d9df!important;
}
body.app-dark [data-tab-content="supplier-manager"] input::placeholder,
body.app-dark #supplier-manager input::placeholder{color:#7b8490!important}
body.app-dark [data-tab-content="supplier-manager"] .panel-header,
body.app-dark #supplier-manager .panel-header{background:var(--dark-surface-2)!important;color:var(--dark-text)!important}

/* Incoming: predominantly dark instead of white order slabs. */
body.app-dark [data-tab-content="suppliers-incoming"],
body.app-dark #suppliers-incoming{background:var(--dark-canvas)!important;color:var(--dark-text)!important}
body.app-dark [data-tab-content="suppliers-incoming"] .panel,
body.app-dark #suppliers-incoming .panel,
body.app-dark [data-tab-content="suppliers-incoming"] .supplier-card,
body.app-dark #suppliers-incoming .supplier-card,
body.app-dark [data-tab-content="suppliers-incoming"] .incoming-card,
body.app-dark #suppliers-incoming .incoming-card{
  background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important;
}
body.app-dark [data-tab-content="suppliers-incoming"] .supplier-card-header,
body.app-dark #suppliers-incoming .supplier-card-header{
  background:var(--dark-surface)!important;color:var(--dark-text)!important;
}
body.app-dark [data-tab-content="suppliers-incoming"] .supplier-name,
body.app-dark #suppliers-incoming .supplier-name,
body.app-dark [data-tab-content="suppliers-incoming"] h1,
body.app-dark #suppliers-incoming h1{color:#fff!important}
body.app-dark [data-tab-content="suppliers-incoming"] .supplier-meta,
body.app-dark #suppliers-incoming .supplier-meta{color:var(--dark-muted)!important}

/* Inventory: convert bright metric cards to real dark surfaces and restore hierarchy. */
body.app-dark [data-tab-content="inventory"] .panel,
body.app-dark #inventory .panel,
body.app-dark [data-tab-content="inventory"] .stat,
body.app-dark #inventory .stat,
body.app-dark [data-tab-content="inventory"] .inventory-card,
body.app-dark #inventory .inventory-card,
body.app-dark [data-tab-content="inventory"] .metric-card,
body.app-dark #inventory .metric-card{
  background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important;
}
body.app-dark [data-tab-content="inventory"] h1,
body.app-dark [data-tab-content="inventory"] h2,
body.app-dark [data-tab-content="inventory"] h3,
body.app-dark #inventory h1,body.app-dark #inventory h2,body.app-dark #inventory h3{color:#fff!important}
body.app-dark [data-tab-content="inventory"] small,
body.app-dark #inventory small{color:var(--dark-muted)}

/* Broad fallback for remaining modules that use inline/legacy light utility surfaces. */
body.app-dark .card,body.app-dark .section-card,body.app-dark .content-card,body.app-dark .sheet,
body.app-dark .toolbar,body.app-dark .summary-card{background:var(--dark-surface)!important;color:var(--dark-text);border-color:var(--dark-line)!important}
body.app-dark .tabs,body.app-dark .segmented-control{background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important}


/* Apple-dark refinement: unified charcoal surfaces across legacy operational modules. */
body.app-dark{background:#080b0f!important}
body.app-dark .app-main{background:#080b0f!important}
body.app-dark .panel,body.app-dark .card,body.app-dark .section-card,body.app-dark .content-card,
body.app-dark .sheet,body.app-dark .toolbar,body.app-dark .summary-card{
  background:linear-gradient(180deg,rgba(22,27,34,.98),rgba(14,18,24,.98))!important;
  color:#f5f7fa!important;border:1px solid rgba(255,255,255,.075)!important;
  box-shadow:0 16px 45px rgba(0,0,0,.18);
}
body.app-dark .panel-header,body.app-dark .section-header,body.app-dark .card-header,
body.app-dark .supplier-summary-bar{
  background:#151a21!important;color:#f5f7fa!important;border-color:rgba(255,255,255,.075)!important;
}
body.app-dark h1,body.app-dark h2,body.app-dark h3,body.app-dark h4,
body.app-dark label,body.app-dark .label,body.app-dark .title{color:#f5f7fa!important}
body.app-dark p,body.app-dark small,body.app-dark .muted,body.app-dark .subtitle{color:#9fa8b5!important}
body.app-dark button:not(.btn-primary):not(.active){
  background:#171c23;color:#e9edf2;border-color:#303844;
}
body.app-dark input,body.app-dark textarea,body.app-dark select{
  background:#171c23!important;color:#f5f7fa!important;border:1px solid #303844!important;
}
body.app-dark input::placeholder,body.app-dark textarea::placeholder{color:#7f8996!important}

/* PO Generator: remove remaining white Master PO / Supplier Orders bands. */
body.app-dark #po-page .panel,body.app-dark #po-page .panel-header,
body.app-dark #po-page .master-po,body.app-dark #po-page .master-po-header,
body.app-dark #po-page .supplier-orders,body.app-dark #po-page .supplier-orders-header,
body.app-dark [data-tab-content="po-generator"] .master-po,
body.app-dark [data-tab-content="po-generator"] .supplier-orders{
  background:#11161c!important;color:#f5f7fa!important;border-color:#29313b!important;
}
body.app-dark #po-page .master-po-table-wrap,
body.app-dark [data-tab-content="po-generator"] .master-po-table-wrap{background:#0f141a!important}

/* Costing + Supplier Manager: crisp dark headers; intentionally light numeric inputs use dark ink. */
body.app-dark #costing-page,body.app-dark #costing-page .panel,
body.app-dark #supplier-manager-page,body.app-dark #supplier-manager-page .panel{background:#0f141a!important;color:#f5f7fa!important}
body.app-dark #supplier-manager-page input:not([type="checkbox"]):not([type="radio"]),
body.app-dark [data-tab-content="supplier-manager"] input:not([type="checkbox"]):not([type="radio"]){
  background:#f7f8fa!important;color:#111827!important;border-color:#d8dde4!important;
}
body.app-dark #supplier-manager-page input::placeholder,
body.app-dark [data-tab-content="supplier-manager"] input::placeholder{color:#737d89!important}

/* Incoming: order rows are dark cards, with high-contrast names, quantities and status copy. */
body.app-dark #incoming-page,body.app-dark #incoming-page .incoming-list,
body.app-dark #incoming-page .incoming-order,body.app-dark #incoming-page .order-card,
body.app-dark [data-tab-content="suppliers-incoming"] .incoming-order,
body.app-dark [data-tab-content="suppliers-incoming"] .order-card{
  background:#10151b!important;color:#f5f7fa!important;border-color:#29313b!important;
}
body.app-dark #incoming-page .incoming-order *,body.app-dark #incoming-page .order-card *,
body.app-dark [data-tab-content="suppliers-incoming"] .incoming-order *,
body.app-dark [data-tab-content="suppliers-incoming"] .order-card *{border-color:#29313b}
body.app-dark #incoming-page .supplier-name,
body.app-dark #incoming-page .order-title,
body.app-dark [data-tab-content="suppliers-incoming"] .supplier-name{color:#fff!important}

/* Inventory / Campaign / Sales / Pull Out / Fulfillment / Customers: eliminate white slabs. */
body.app-dark #inventory-page .metric-card,body.app-dark #inventory-page .inventory-card,
body.app-dark #campaign-maker-page .panel,body.app-dark #campaign-maker-page .sheet,
body.app-dark #sales-orders-page .panel,body.app-dark #sales-orders-page .card,
body.app-dark #pull-out-page .panel,body.app-dark #pull-out-page .card,
body.app-dark #fulfillment-page .panel,body.app-dark #fulfillment-page .card,
body.app-dark #customers-page .panel,body.app-dark #customers-page .card,
body.app-dark [data-tab-content="campaign-maker"] .panel,
body.app-dark [data-tab-content="sales-orders"] .panel,
body.app-dark [data-tab-content="pull-out-request"] .panel,
body.app-dark [data-tab-content="fulfillment"] .panel,
body.app-dark [data-tab-content="customers"] .panel{
  background:#11161c!important;color:#f5f7fa!important;border-color:#29313b!important;
}
body.app-dark #campaign-maker-page td,body.app-dark #sales-orders-page td,
body.app-dark #fulfillment-page td{background:#11161c!important;color:#e8edf3!important}

/* Purchase Planning: product names and all dark-table copy stay readable. */
body.app-dark #purchase-planning-page,body.app-dark #purchase-planning-page table,
body.app-dark [data-tab-content="purchase-planning"],body.app-dark [data-tab-content="purchase-planning"] table{
  background:#0d1218!important;color:#f5f7fa!important;
}
body.app-dark #purchase-planning-page td,body.app-dark #purchase-planning-page td *,
body.app-dark [data-tab-content="purchase-planning"] td,
body.app-dark [data-tab-content="purchase-planning"] td *{color:#dfe5ec!important}
body.app-dark #purchase-planning-page th,
body.app-dark [data-tab-content="purchase-planning"] th{background:#171d24!important;color:#cbd3dd!important}

/* Preserve semantic status colors while keeping Apple-like restraint. */
body.app-dark .success,body.app-dark .status-success,body.app-dark .paid{color:#7ee2a8!important}
body.app-dark .danger,body.app-dark .status-danger,body.app-dark .cancelled{color:#ff8b8b!important}

/* Route safety: collapsing the sidebar must never reveal a non-selected page.
   The collapsed layout's :not([hidden]) display override otherwise beats
   .route-active routing when a module leaves its hidden attribute unset. */
body.sidebar-collapsed .app-main > .app-page:not(.route-active),
body:not(.sidebar-collapsed) .app-main > .app-page:not(.route-active) {
  display: none !important;
}
body.sidebar-collapsed .app-main > .app-page[hidden],
body .app-main > .app-page[hidden] {
  display: none !important;
}

/* Supplier Orders: subtle full-row reconciliation cue, visible even when Status is off-screen. */
.supplier-sheet tr.supplier-po-row.supplier-row-reconciled > td { background-color: #f0faf3; }
.supplier-sheet tr.supplier-po-row.supplier-row-reconciled:hover > td { background-color: #e7f5eb; }
.supplier-sheet tr.supplier-po-row.supplier-row-reconciled > td:first-child { box-shadow: inset 3px 0 0 #a7d8b5; }

/* Reconciled Supplier Orders: full-width pastel green, including narrow screens. */
.supplier-sheet tbody tr.supplier-po-row.supplier-row-reconciled > td,
.supplier-sheet tbody tr.supplier-po-row.supplier-row-reconciled:hover > td {
  background: #eaf7ed !important;
}
.supplier-sheet tbody tr.supplier-po-row.supplier-row-reconciled > td:first-child {
  box-shadow: inset 3px 0 0 #a7d8b5;
}

/* Selection always wins over reconciliation color, including selected green rows. */
.supplier-sheet tbody tr.supplier-po-row.selected > td,
.supplier-sheet tbody tr.supplier-po-row.selected:hover > td,
.supplier-sheet tbody tr.supplier-po-row.supplier-row-reconciled.selected > td,
.supplier-sheet tbody tr.supplier-po-row.supplier-row-reconciled.selected:hover > td {
  background: #dbeafe !important;
}

.supplier-manager-table{min-width:1080px}.supplier-mark-cell{min-width:82px}.supplier-manager-shipping-mark{width:70px;max-width:100%;height:34px;border:1px solid var(--border-strong);border-radius:8px;padding:5px 8px}.supplier-manager-shipping-mark.supplier-mark-duplicate{border:2px solid #dc5050;background:#fff6f6}.supplier-mark-warning{display:block;color:#b42318;font-size:11px;max-width:180px;white-space:normal;margin-top:4px}.supplier-mark-warning[hidden]{display:none}

/* Mixed SKU and manual supplies within one pull-out request */
.pullout-add-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pullout-add-other{border:1px solid #d7dce3!important;background:#fff!important}.pullout-other-row .pullout-other-type{display:flex;align-items:center;min-width:0}.pullout-other-tag{display:inline-flex;align-items:center;white-space:nowrap;font-size:11px;font-weight:700;color:#64748b;background:#f1f4f8;padding:7px 9px;border-radius:8px}.pullout-other-description input,.pullout-other-unit input{box-sizing:border-box;width:100%;min-width:0;border:1px solid #e2e5eb;border-radius:9px;background:#f7f8fa;padding:11px 12px;color:inherit;font:inherit}.pullout-other-description input:focus,.pullout-other-unit input:focus{outline:2px solid #a5c5eb}.pullout-other-unit{min-width:0}.pullout-other-row .sales-qty{min-width:0}@media(max-width:700px){.pullout-add-actions{gap:5px}.pullout-add-actions button{padding:8px}.pullout-other-tag{font-size:10px;padding:6px}.pullout-other-description input,.pullout-other-unit input{padding:8px 5px}}

@media(max-width:700px){.pullout-other-row{grid-template-columns:minmax(0,1fr) 90px 34px!important}.pullout-other-row .pullout-other-type,.pullout-other-row .pullout-other-description{grid-column:1/-1}.pullout-other-row .pullout-other-unit{grid-column:1}.pullout-other-row .pullout-qty{grid-column:2}.pullout-other-row .pullout-remove{grid-column:3}}



/* Save status stays in the floating top bar, aligned to its left edge. */
.global-bar > .po-save-status{margin-left:0;margin-right:auto}


.incoming-health-dashboard{grid-column:1/-1;width:100%;padding:12px 0}.incoming-health-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}.incoming-health-heading span{font-size:12px;opacity:.6}.incoming-health-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.incoming-health-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;padding:14px;border:1px solid #e7e8eb;border-radius:12px;background:transparent;cursor:pointer}.incoming-health-card strong{font-size:25px}.incoming-health-card small{font-size:11px;opacity:.6}.incoming-health-card.is-active{outline:2px solid #64748b}.incoming-health-overdue strong{color:#c65d52}.incoming-health-soon strong{color:#ae8132}.incoming-health-healthy strong{color:#458b6b}.incoming-remarked-badge{padding:3px 7px;border-radius:8px;background:#edf1f6;color:#586777;font-size:11px;font-weight:600}@media(max-width:700px){.incoming-health-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}

.incoming-dashboard-switch{grid-column:1/-1;display:flex;gap:3px;width:max-content;max-width:100%;padding:4px;border-radius:12px;background:#eceef1}.incoming-dashboard-switch button{border:0;background:transparent;border-radius:9px;padding:10px 16px;font-weight:600;color:#6b7280;cursor:pointer}.incoming-dashboard-switch button.active{background:#fff;color:#222;box-shadow:0 1px 5px #00000012}.incoming-summary:not(.is-deadline-view) .incoming-health-dashboard{display:none}.incoming-summary.is-deadline-view>.incoming-stat,.incoming-summary.is-deadline-view>.incoming-overview-strip{display:none}.incoming-summary.is-deadline-view .incoming-health-dashboard{padding-top:0}

/* Master PO reconciliation: selection remains blue and takes priority. */
.master-po-row.master-row-reconciled > td { background: #eaf7ed !important; }
.master-po-row.master-row-reconciled > td:first-child { box-shadow: inset 3px 0 0 #a7d8b5; }
.master-po-row.selected > td, .master-po-row.master-row-reconciled.selected > td { background: #dbeafe !important; }
.master-po-row.master-row-reconciled > td.selected-cell, .master-po-row > td.selected-cell { background: #dbeafe !important; }

/* Capital Health: smooth, honest indeterminate loading indicator. */
.inventory-export-progress{margin:8px 0 16px;padding:14px 16px;border:1px solid #e4e8ef;border-radius:14px;background:linear-gradient(125deg,#fafbff,#f5f7fb);max-width:100%}
.inventory-export-progress[hidden]{display:none!important}
.inventory-export-progress-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px;font-size:13px;font-weight:600;color:#374151}
.inventory-export-progress-track{height:6px;overflow:hidden;border-radius:999px;background:#e4e9f2;position:relative}
.inventory-export-progress-fill{position:absolute;top:0;bottom:0;width:38%;border-radius:999px;background:linear-gradient(90deg,#8db7ff,#2563eb,#8db7ff);animation:inventory-progress-slide 1.7s cubic-bezier(.45,0,.55,1) infinite}
.inventory-export-progress-spinner{width:15px;height:15px;border:2px solid #dbe6fb;border-top-color:#2563eb;border-radius:50%;animation:inventory-progress-spin .85s linear infinite;flex:none}
.inventory-export-progress>small{display:block;margin-top:9px;font-size:11px;color:#7b8494}
@keyframes inventory-progress-slide{from{transform:translateX(-105%)}to{transform:translateX(280%)}}
@keyframes inventory-progress-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.inventory-export-progress-fill,.inventory-export-progress-spinner{animation:none}.inventory-export-progress-fill{width:55%}}

/* Inventory at a glance: lightweight progress bar below snapshot timestamp. */
.inventory-overview-progress{width:min(360px,100%);margin-top:10px}
.inventory-overview-progress[hidden]{display:none!important}
.inventory-overview-progress-track{height:5px;border-radius:999px;background:#e4e9f2;overflow:hidden;position:relative}
.inventory-overview-progress-fill{position:absolute;inset:0 auto 0 0;width:38%;border-radius:999px;background:linear-gradient(90deg,#a5c6ff,#2563eb,#a5c6ff);animation:inventory-progress-slide 1.7s cubic-bezier(.45,0,.55,1) infinite}
.inventory-overview-progress small{display:block;margin-top:6px;color:#7d8796;font-size:11px;letter-spacing:.01em}
@media(prefers-reduced-motion:reduce){.inventory-overview-progress-fill{animation:none;width:55%}}

/* Campaign Maker unified pricing mode */
.campaign-pricing-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:16px 18px;margin-bottom:12px;background:#f7f9fc;border:1px solid #e8ecf2;border-radius:14px}
.campaign-pricing-toolbar>div:first-child{display:flex;flex-direction:column;gap:4px}
.campaign-pricing-toolbar strong{font-size:13px;color:#202733}
.campaign-pricing-toolbar small{font-size:12px;color:#758095}
.campaign-mode-switch{display:inline-flex;gap:4px;padding:4px;border:1px solid #e2e6ed;border-radius:11px;background:#e9edf4}
.campaign-mode-switch button{border:0;background:transparent;border-radius:8px;padding:9px 15px;font-size:12px;font-weight:700;color:#64748b;cursor:pointer;white-space:nowrap}
.campaign-mode-switch button.active{background:#fff;color:#1d4ed8;box-shadow:0 1px 5px #1f29371a}
.campaign-mode-switch button:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
@media(max-width:640px){.campaign-mode-switch{width:100%}.campaign-mode-switch button{flex:1}}

.campaign-global-discount{display:flex;align-items:center;gap:12px;font-size:12px;font-weight:700;color:#475569}
.campaign-global-discount[hidden]{display:none!important}
.campaign-global-discount span{display:flex;align-items:center;gap:6px;background:#fff;border:1px solid #dbe3f1;border-radius:10px;padding:5px 9px}
.campaign-global-discount input{width:65px;border:0;outline:0;font:700 17px inherit;color:#1d4ed8;background:transparent}
.campaign-global-discount b{font-size:11px;color:#64748b;white-space:nowrap}
.campaign-computed-price{font-weight:700;color:#1d4ed8;background:#f8fbff;font-variant-numeric:tabular-nums}

/* Unified pricing: global price increase */
.campaign-increase-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap;width:100%;padding-top:8px}
.campaign-increase-controls[hidden]{display:none!important}
.campaign-increase-controls label{display:flex;align-items:center;gap:9px;color:#475569;font-size:12px;font-weight:650}
.campaign-increase-controls input,.campaign-increase-controls select{border:1px solid #dbe3ee;border-radius:10px;background:#fff;padding:9px 11px;color:#1e293b;font-size:13px;min-width:95px}
.campaign-increase-controls input{width:110px;font-weight:700;font-variant-numeric:tabular-nums}
.campaign-increase-controls small{font-size:11px;color:#64748b}
@media(max-width:640px){.campaign-increase-controls{align-items:stretch}.campaign-increase-controls label{justify-content:space-between;width:100%}.campaign-increase-controls input,.campaign-increase-controls select{width:55%;max-width:230px}.campaign-mode-switch{flex-wrap:wrap}}

/* Price increase: one calculated selling price column, status beneath product name. */
#campaignGridTable.campaign-increase-view th:nth-child(6),#campaignGridTable.campaign-increase-view th:nth-child(7),#campaignGridTable.campaign-increase-view th:nth-child(8),#campaignGridTable.campaign-increase-view td:nth-child(6),#campaignGridTable.campaign-increase-view td:nth-child(7),#campaignGridTable.campaign-increase-view td:nth-child(8){display:none!important}
.campaign-product-state{display:block;width:max-content;max-width:100%;margin-top:5px;padding:2px 7px;border-radius:6px;background:#eaf7ef;color:#15803d;font-size:10px;font-weight:750;letter-spacing:.04em}
.campaign-product-state.campaign-state-dead{background:#fef2f2;color:#b91c1c}

/* Keep the navigation independently scrollable when the sidebar grows. */
@media (min-width: 761px) {
  .app-sidebar{overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}
  .app-sidebar .app-tabs{flex:0 0 auto}
  .app-sidebar .sidebar-foot{flex-shrink:0}
}

/* Quiet completion state: distinguish fully received SKUs without visual noise. */
.incoming-table tbody tr.incoming-completed-row:not([hidden]) {
  background-color: #f4f9f5;
}
.incoming-table tbody tr.incoming-completed-row:not([hidden]) > td {
  border-bottom-color: #e6eee8;
}
.incoming-table tbody tr.incoming-completed-row:not([hidden]) > td:nth-child(5) {
  color: #32704a;
  font-weight: 650;
}
.incoming-table tbody tr.incoming-completed-row:not([hidden]):hover {
  background-color: #edf6ef;
}
.incoming-table .incoming-completed-controls > td {
  background-color: #f7faf8;
  border-top: 1px solid #e5ede7;
  border-bottom: 1px solid #e5ede7;
}
.incoming-table .incoming-toggle-completed[aria-expanded="true"] {
  background-color: #edf5ef;
  border-color: #d6e7da;
  color: #285c3a;
}
