@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");

/* —— Section tabs (sticky under topbar; scroll, never overlap brand) —— */
.section-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 18px;
  max-width: 1450px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 8px 2px 10px;
  position: sticky;
  top: var(--topbar-sticky-height, 84px);
  z-index: 25;
  scrollbar-width: thin;
  background: var(--paper);
  border-bottom: 1px solid rgba(20, 56, 52, .06);
  -webkit-overflow-scrolling: touch;
}
.section-tabs::-webkit-scrollbar { height: 4px; }
.section-tabs::-webkit-scrollbar-thumb { background: #c8d4d1; border-radius: 4px; }
.section-tab {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 12px;
  transition: box-shadow .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
  white-space: nowrap;
}
.section-tab:hover {
  border-color: #b8ccc8;
  box-shadow: 0 4px 14px rgba(23, 63, 59, .1);
  color: var(--ink);
}
.section-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 4px 12px rgba(23, 63, 59, .18);
  color: #fff;
}
.section-tab.active:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

/* —— Sidebar hover tooltips (desktop) —— */
@media (min-width: 1001px) {
  .side-nav a[data-nav-tip] { position: relative; }
  .side-nav a[data-nav-tip]::after {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(23, 63, 59, .18);
    color: var(--ink);
    content: attr(data-nav-tip);
    font-size: 11px;
    font-weight: 700;
    left: calc(100% + 10px);
    opacity: 0;
    padding: 8px 12px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(8px, -50%);
    transition: opacity .16s ease, transform .16s ease;
    white-space: nowrap;
    z-index: 40;
  }
  .side-nav a[data-nav-tip]:hover::after {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

/* —— Column mapping panel —— */
.mapping-panel {
  background: linear-gradient(180deg, #fff, #fcfaf6);
  border: 1px solid rgba(20, 56, 52, .08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 22px 20px 20px;
}
.mapping-panel.hidden, .mapping-block-reason.hidden, #bomLinesPanel.hidden { display: none; }
.bom-timeline-strip {
  display: flex;
  gap: 14px;
  margin: 4px 0 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 4px 2px 12px;
  scroll-padding-inline: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.bom-timeline-strip::-webkit-scrollbar { height: 8px; }
.bom-timeline-strip::-webkit-scrollbar-thumb {
  background: #c5d4d0;
  border-radius: 999px;
}
.bom-timeline-card {
  background: linear-gradient(180deg, #fff, #fbfaf7);
  border: 1px solid rgba(20, 56, 52, .1);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(20, 56, 52, .06);
  display: flex;
  flex: 0 0 min(320px, 82vw);
  flex-direction: column;
  max-width: 360px;
  min-width: 280px;
  padding: 12px 12px 10px;
  scroll-snap-align: start;
}
.bom-timeline-card-head {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}
.bom-timeline-card-head strong {
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.bom-timeline-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.bom-timeline-card-head small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}
#bom-timeline .bom-timeline-card {
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
  width: 100%;
}
#bom-timeline .bom-timeline-card .bom-timeline {
  display: grid;
  gap: 10px;
  grid-auto-columns: minmax(128px, 1fr);
  grid-auto-flow: column;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}
#bom-timeline .bom-timeline-card .bom-timeline li {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 0 4px 0 0;
}
#bom-timeline .bom-timeline-card .bom-timeline li:not(:last-child)::before {
  bottom: auto;
  height: 2px;
  left: 16px;
  right: -10px;
  top: 6px;
  width: auto;
}
#bom-timeline .bom-timeline-card .bom-mark { margin-top: 0; }
#bom-timeline .bom-timeline-card .bom-stage-copy { padding: 8px 10px; }
.bom-timeline-card .bom-timeline { margin-top: 2px; }
.bom-timeline-card .bom-stage-copy { padding: 7px 10px; }
.bom-timeline-card .bom-timeline strong { font-size: 13px; }
.bom-timeline-card .bom-timeline small { font-size: 11px; }
.bom-timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.bom-timeline li {
  --stage: #7a8f8b;
  --stage-soft: #eef3f2;
  --rail: color-mix(in srgb, var(--stage) 40%, #cfd9d6);
  align-items: flex-start;
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 18px 1fr;
  margin: 0;
  min-height: 42px;
  padding: 8px 10px 8px 6px;
  position: relative;
}
/* Continuous rail from this stage mark through to the next */
.bom-timeline li:not(:last-child)::before {
  background: var(--rail);
  bottom: -20px;
  content: "";
  left: 12px;
  position: absolute;
  top: 26px;
  width: 2px;
  z-index: 0;
}
.bom-timeline li.is-done:not(:last-child)::before,
.bom-timeline li.is-current:not(:last-child)::before {
  background: var(--stage);
}
.bom-timeline .bom-mark {
  background: #fff;
  border: 2px solid var(--stage);
  border-radius: 50%;
  box-sizing: border-box;
  height: 14px;
  margin-top: 5px;
  position: relative;
  width: 14px;
  z-index: 1;
}
.bom-timeline .bom-stage-copy {
  background: var(--stage-soft);
  border: 1px solid color-mix(in srgb, var(--stage) 28%, transparent);
  border-radius: 10px;
  padding: 8px 12px;
}
/* Completed: solid filled dot */
.bom-timeline li.is-done .bom-mark {
  background: var(--stage);
  border-color: var(--stage);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage) 22%, transparent);
}
/* In progress: filled + continuous pulse (only this stage) */
@keyframes bom-mark-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--stage) 45%, transparent);
    transform: scale(1);
  }
  55% {
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--stage) 0%, transparent);
    transform: scale(1.12);
  }
}
.bom-timeline li.is-current .bom-mark {
  animation: bom-mark-pulse 1.5s ease-out infinite;
  background: var(--stage);
  border-color: var(--stage);
}
@media (prefers-reduced-motion: reduce) {
  .bom-timeline li.is-current .bom-mark { animation: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage) 30%, transparent); }
}
.bom-timeline li.is-current .bom-stage-copy {
  border-color: color-mix(in srgb, var(--stage) 55%, transparent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--stage) 18%, transparent);
}
/* Not yet: blank (hollow) dot */
.bom-timeline li.is-waiting .bom-mark {
  background: #fff;
  border-color: color-mix(in srgb, var(--stage) 55%, #fff);
  box-shadow: none;
}
.bom-timeline li.is-waiting .bom-stage-copy { opacity: .88; }
.bom-timeline strong { color: var(--ink); display: block; font-size: 14px; font-weight: 700; }
.bom-timeline small { color: color-mix(in srgb, var(--stage) 55%, #5c6b68); font-size: 12px; font-weight: 600; }

/* Progress spectrum (cool → warm → success) — pastel fills, richer marks */
.bom-timeline li.bom-stage-in_progress { --stage: #7e57c2; --stage-soft: #ede7f6; }       /* 1 soft violet — start */
.bom-timeline li.bom-stage-import_complete { --stage: #42a5f5; --stage-soft: #e3f2fd; }    /* 2 soft sky */
.bom-timeline li.bom-stage-po_generated { --stage: #26a69a; --stage-soft: #e0f2f1; }       /* 3 soft teal */
.bom-timeline li.bom-stage-pi_received { --stage: #66bb6a; --stage-soft: #e8f5e9; }        /* 4 soft mint */
.bom-timeline li.bom-stage-pdc_note_sent { --stage: #9ccc65; --stage-soft: #f1f8e9; }      /* 5 soft lime */
.bom-timeline li.bom-stage-pdc_generated { --stage: #ffca28; --stage-soft: #fff8e1; }      /* 6 soft butter */
.bom-timeline li.bom-stage-awaiting_awb { --stage: #ffa726; --stage-soft: #fff3e0; }       /* 7 soft peach */
.bom-timeline li.bom-stage-pdc_delivered { --stage: #ff7043; --stage-soft: #fbe9e7; }      /* 8 soft coral */
.bom-timeline li.bom-stage-materials_received { --stage: #ec407a; --stage-soft: #fce4ec; } /* 9 soft rose */
.bom-timeline li.bom-stage-materials_delivered { --stage: #43a047; --stage-soft: #e8f5e9; }/* 10 soft emerald — done */

.bom-timeline-report,
.bom-report-card {
  background: #f7f8f5;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 14px;
  padding: 12px 14px;
}
.bom-report-card + .bom-report-card { margin-top: 10px; }
.bom-report-card summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.bom-report-card summary::-webkit-details-marker { display: none; }
.bom-timeline-report table,
.bom-report-card table {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
}
.bom-timeline-report th,
.bom-timeline-report td,
.bom-report-card th,
.bom-report-card td {
  border-bottom: 1px solid rgba(20, 56, 52, .08);
  font-size: 12px;
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.bom-timeline-report th,
.bom-report-card th { color: var(--muted); font-weight: 700; }
.mapping-panel .empty-state {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  padding: 8px 0 4px;
}
.mapping-panel-head { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 16px; }
.mapping-panel-head h3 { color: var(--ink); font-size: 17px; margin: 0 0 4px; }
.mapping-panel-head p { color: var(--muted); font-size: 12px; margin: 0; }
.mapping-confidence {
  align-items: center;
  background: var(--teal-soft);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  padding: 9px 16px;
  white-space: nowrap;
}
.mapping-confidence::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 8px;
  opacity: .85;
  width: 8px;
}
.mapping-confidence.low { background: var(--red-soft); color: #9e3d36; }
.mapping-confidence.mid { background: var(--gold-soft); color: #8a5a12; }
.mapping-confidence.high { background: #dcefe4; color: #1f6b45; }
.mapping-block-reason {
  background: var(--red-soft);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  color: #8f3a34;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 14px;
  padding: 12px 14px;
}
.mapping-panel .table-wrap,
.mapping-panel .table-wrap--no-scroll {
  border: 1px solid #dce8e5;
  border-radius: 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.mapping-panel .table-wrap,
.mapping-panel .table-wrap--no-scroll {
  max-height: none;
  overflow: visible;
}
.mapping-panel .table-wrap thead th,
.mapping-panel .table-wrap--no-scroll thead th {
  background: #f4f8f7;
  border-bottom: 1px solid #dce8e5;
  box-shadow: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: none;
}
.mapping-panel .table-wrap--no-scroll thead th {
  position: static;
}
.mapping-panel .table-wrap thead th {
  position: static;
  top: auto;
  z-index: auto;
}
.mapping-panel .table-toolbar {
  align-items: center;
  border-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0;
}
.mapping-panel .mapping-table td,
.mapping-panel .mapping-table th {
  white-space: normal;
}
.po-status-stack {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.po-workflow-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 4px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}
.po-workflow-badge.viewed { background: var(--blue-soft); color: #2f5f9e; }
.po-workflow-badge.email-draft { background: var(--gold-soft); color: #8a5a12; }
.po-workflow-badge.email-sent { background: #dcefe4; color: #1f6b45; }
.mapping-table tbody tr.po-row--viewed td:first-child { border-left-color: var(--blue); }
.mapping-table tbody tr.po-row--viewed { background: #f8fbfd; }
.mapping-table tbody tr.po-row--email-draft td:first-child { border-left-color: var(--gold); }
.mapping-table tbody tr.po-row--email-draft { background: #fdfaf3; }
.mapping-table tbody tr.po-row--email-sent td:first-child { border-left-color: #1f6b45; }
.mapping-table tbody tr.po-row--email-sent { background: #f0f9f4; }
.mapping-table tbody tr.po-row--viewed.po-row--email-sent { background: #edf7f1; }
.po-action-muted {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 4px;
}
.po-action-btn--done {
  background: #eef0ed !important;
  border-color: #c5d0cc !important;
  color: var(--muted) !important;
  opacity: .92;
}
.mapping-table { border-collapse: collapse; min-width: 0; width: 100%; }
.mapping-table th {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: none;
}
.mapping-table td, .mapping-table th { font-size: 13px; padding: 14px 16px; white-space: normal; word-break: break-word; }
.mapping-table tbody tr { transition: background .12s ease; }
.mapping-table tbody tr:hover { background: #f8faf9; }
.mapping-table tbody tr td:first-child {
  border-left: 4px solid transparent;
  padding-left: 14px;
}
.mapping-row-green td:first-child { border-left-color: #1f6b45; }
.mapping-row-yellow td:first-child { border-left-color: var(--gold); }
.mapping-row-red td:first-child { border-left-color: var(--red); }
.mapping-table tbody tr:last-child td { border-bottom: none; }

@keyframes mapping-row-red-blink {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(248, 226, 223, 0.9); }
}
@keyframes mapping-stripe-red-blink {
  0%, 100% {
    border-left-color: var(--red);
    box-shadow: none;
  }
  50% {
    border-left-color: #e05a52;
    box-shadow: inset 8px 0 14px -6px rgba(189, 83, 77, 0.45);
  }
}
@keyframes mapping-status-red-blink {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(189, 83, 77, 0);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 5px rgba(189, 83, 77, 0.35);
    opacity: 0.88;
  }
}
.mapping-row-red { animation: mapping-row-red-blink 1.05s ease-in-out infinite; }
.mapping-row-red td:first-child { animation: mapping-stripe-red-blink 1.05s ease-in-out infinite; }
.mapping-table .mapping-row-red .map-status-red { animation: mapping-status-red-blink 1.05s ease-in-out infinite; }
.mapping-table .mapping-row-red .map-status-red .map-status-dot {
  animation: mapping-status-red-blink 1.05s ease-in-out infinite;
}

@keyframes mapping-row-yellow-pulse {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(247, 234, 210, 0.65); }
}
@keyframes mapping-stripe-yellow-pulse {
  0%, 100% { border-left-color: var(--gold); }
  50% { border-left-color: #e8b04a; }
}
@keyframes mapping-status-yellow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 154, 54, 0); }
  50% { box-shadow: 0 0 0 4px rgba(212, 154, 54, 0.28); }
}
.mapping-row-yellow { animation: mapping-row-yellow-pulse 2.4s ease-in-out infinite; }
.mapping-row-yellow td:first-child { animation: mapping-stripe-yellow-pulse 2.4s ease-in-out infinite; }
.mapping-table .mapping-row-yellow .map-status-yellow { animation: mapping-status-yellow-pulse 2.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .mapping-row-red,
  .mapping-row-red td:first-child,
  .mapping-table .mapping-row-red .map-status-red,
  .mapping-table .mapping-row-red .map-status-red .map-status-dot,
  .mapping-row-yellow,
  .mapping-row-yellow td:first-child,
  .mapping-table .mapping-row-yellow .map-status-yellow {
    animation: none;
  }
}
.field-code {
  background: #eef3f2;
  border-radius: 6px;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}
.req-star { color: var(--red); font-weight: 900; }
.excel-col { color: var(--text); font-weight: 600; }
.muted-cell { color: var(--muted); }

.conf-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  min-width: 3.2rem;
  padding: 5px 10px;
  text-align: center;
}
.conf-pill-high { background: #dcefe4; color: #1f6b45; }
.conf-pill-mid { background: var(--gold-soft); color: #8a5a12; }
.conf-pill-low { background: var(--red-soft); color: #9e3d36; }

.map-status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 7px;
  letter-spacing: .02em;
  padding: 6px 12px 6px 10px;
  text-transform: uppercase;
}
.map-status-dot {
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
  height: 8px;
  width: 8px;
}
.map-status-green { background: #e3f3ea; color: #1a6b42; }
.map-status-green .map-status-dot { background: #2d9d62; box-shadow: 0 0 0 3px rgba(45, 157, 98, .22); }
.map-status-yellow { background: #faf0dc; color: #8a5a12; }
.map-status-yellow .map-status-dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(212, 154, 54, .25); }
.map-status-red { background: #fce8e5; color: #9e3d36; }
.map-status-red .map-status-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(189, 83, 77, .22); }
.map-status-neutral { background: #eef0ed; color: var(--muted); }
.map-status-neutral .map-status-dot { background: #9aa6a3; }

.mapping-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 4px; }

.po-detail-dialog { border: none; border-radius: var(--radius); max-width: 920px; padding: 20px; width: min(96vw, 920px); }
.po-detail-dialog .po-action-group { margin-top: 16px; }
.po-detail-dialog::backdrop { background: rgba(23, 63, 59, .45); }

:root {
  --ink: #143834;
  --ink-2: #1f524d;
  --teal: #1a6b65;
  --teal-soft: #e4f1ee;
  --gold: #c8892a;
  --gold-soft: #f8ecd4;
  --paper: #f4efe6;
  --white: #fff;
  --text: #1c3330;
  --muted: #5f736f;
  --line: #e4ddd2;
  --red: #bd534d;
  --red-soft: #f8e2df;
  --blue: #4d7ca6;
  --blue-soft: #e2edf7;
  --violet: #865d94;
  --shadow: 0 16px 40px rgba(20, 56, 52, .07);
  --radius: 20px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Outfit", "Segoe UI", sans-serif;
  --page-pad: 28px;
  --topbar-sticky-height: 84px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: #ead7ae; color: var(--ink); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(980px 420px at 100% -8%, rgba(200, 137, 42, .13), transparent 58%),
    radial-gradient(760px 380px at -8% -4%, rgba(26, 107, 101, .09), transparent 52%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.eyebrow { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .16em; margin: 0 0 7px; }
.brand-lockup { align-items: center; display: flex; gap: 12px; }
.brand-mark { align-items: center; background: var(--gold); border-radius: 12px; color: var(--ink); display: inline-flex; font-size: 16px; font-weight: 900; height: 42px; justify-content: center; width: 42px; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { font-size: 15px; }
.brand-lockup small { color: #a7bbb6; font-size: 11px; margin-top: 2px; }
.login-logo { border-radius: 0; display: block; flex-shrink: 0; object-fit: contain; width: 62px; height: 62px; align-self: center; }
.login-word { border-radius: 0; display: block; height: 72px; width: auto; object-fit: contain; }
.login-brand { align-items: center; }
.login-brand .logo-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 62px;
  gap: 3px;
}
.login-brand .logo-copy .logo-ink,
.login-brand .logo-copy .logo-caption {
  background-image: linear-gradient(180deg, #2ad8ff 0%, #3d7cff 36%, #ff6d6d 64%, #b44bff 100%);
  background-repeat: no-repeat;
  background-size: 100% 62px;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.login-brand .logo-copy .logo-ink { background-position: center top; }
.login-brand .logo-copy .studio-line { background-position: center -26px; }
.login-brand .logo-copy .logo-caption { background-position: center bottom; }
.login-brand .logo-caption {
  display: block;
  margin-top: 0;
  font-size: 14.75px;
  font-weight: 650;
  letter-spacing: 0;
  margin-left: auto;
  margin-right: auto;
  line-height: 1;
  text-transform: none;
}
.login-brand strong { color: #fff; font-size: 27px; font-weight: 800; line-height: 0.8; letter-spacing: 0; }
.login-brand small { color: #a7bbb6; }
.login-brand .logo-ink {
  display: block;
  width: fit-content;
  font-weight: 800;
}
.login-brand .studio-line {
  margin-top: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .02em;
  margin-left: auto;
  margin-right: auto;
  line-height: 1;
}
.sidebar-brand .tenant-logo { border-radius: 0; height: 42px; object-fit: contain; width: 42px; }
.empty-state { color: var(--muted); font-size: 14px; line-height: 1.55; padding: 28px 20px; text-align: center; }
.panel > .empty-state { margin: 0; }

/* Landing */
.landing {
  background:
    radial-gradient(820px 460px at 112% -8%, rgba(200, 137, 42, .32), transparent 60%),
    radial-gradient(640px 420px at -12% 108%, rgba(26, 107, 101, .55), transparent 58%),
    linear-gradient(165deg, #1b4d47 0%, #102c29 58%, #0c221f 100%);
  min-height: 100vh;
  color: #fff;
}
.landing::before { background: radial-gradient(circle, rgba(200,137,42,.16) 0, transparent 64%); content: ""; height: 700px; position: fixed; right: -260px; top: -280px; width: 700px; }
.landing-shell { margin: 0 auto; max-width: 1180px; padding: 64px 36px 28px; position: relative; }
.landing-copy { max-width: 760px; }
.landing-copy .brand-lockup { margin-bottom: 70px; }
.landing-copy .eyebrow { margin-bottom: 15px; }
.landing-copy h1 { font-size: clamp(38px, 5vw, 68px); letter-spacing: -.045em; line-height: 1.03; margin-bottom: 20px; }
.landing-lead { color: #c6d4d1; font-size: 19px; line-height: 1.6; max-width: 690px; }
.demo-note { align-items: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #d5e0de; display: inline-flex; font-size: 13px; gap: 8px; margin-top: 12px; padding: 9px 14px; }
.demo-note span { color: #66c3a9; }
.role-grid { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; margin-top: 52px; }
.role-card { background: linear-gradient(180deg, #fff, #fbf8f3); border-radius: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.16); color: var(--text); display: block; overflow: hidden; padding: 30px; position: relative; transition: transform .2s, box-shadow .2s; }
.role-card:hover { box-shadow: 0 25px 55px rgba(0,0,0,.2); transform: translateY(-5px); }
.role-card::after { background: var(--teal); content: ""; height: 6px; left: 0; position: absolute; right: 0; top: 0; }
.store-card::after { background: var(--gold); }
.role-icon { align-items: center; background: var(--teal-soft); border-radius: 14px; color: var(--teal); display: flex; font-size: 21px; font-weight: 900; height: 52px; justify-content: center; margin-bottom: 26px; width: 52px; }
.store-card .role-icon { background: var(--gold-soft); color: #8b5c0e; }
.role-label { color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.store-card .role-label { color: #9a6815; }
.role-card h2 { color: var(--ink); font-size: 27px; margin: 8px 0 10px; }
.role-card p { color: var(--muted); line-height: 1.55; }
.role-card ul { color: var(--text); line-height: 1.9; list-style: none; margin: 22px 0; padding: 0; }
.role-card li::before { color: var(--teal); content: "✓"; font-weight: 900; margin-right: 10px; }
.store-card li::before { color: var(--gold); }
.role-link { border-top: 1px solid var(--line); color: var(--ink); display: flex; font-weight: 800; justify-content: space-between; margin-top: 25px; padding-top: 20px; }
.landing-footer { color: #98aaa6; display: flex; font-size: 12px; justify-content: space-between; margin-top: 52px; }
.landing-footer b { color: var(--gold); }
.landing-shell.login-shell { box-sizing: border-box; margin: 0; max-width: none; min-height: 100vh; padding: 48px 32px 28px; position: relative; width: 100%; }
.login-shell { align-items: center; display: flex; flex-direction: column; gap: 36px; justify-content: center; }
.login-side { display: flex; flex-direction: column; width: min(420px, 100%); }
.login-shell .landing-footer { color: #8fa29e; justify-content: flex-end; margin-top: 12px; text-align: right; width: 100%; }
.login-shell .landing-footer b { color: inherit; font-weight: 600; }
.login-shell .landing-copy { max-width: 640px; }
.login-shell .product-lockup { align-items: center; display: flex; gap: 18px; margin: 0; }
.login-shell .studio-word { display: block; flex: 0 0 auto; height: 96px; width: auto; }
.login-shell .product-copy { align-items: flex-start; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.login-shell .product-name { background-image: linear-gradient(90deg, #2ad8ff 0%, #3d7cff 46%, #b44bff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; font-family: var(--font); font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 0; text-align: left; }
.login-shell .product-tag { color: #e4b15a; font-size: 15px; font-weight: 600; letter-spacing: 0; line-height: 1.2; margin: 8px 0 0; text-align: left; white-space: nowrap; }
.login-shell .landing-copy h1 { color: #e7eeec; font-family: var(--font); font-size: 22px; font-weight: 500; letter-spacing: 0; line-height: 1.35; margin: 0 0 10px; max-width: none; }
.login-shell .landing-lead { font-size: 16px; line-height: 1.5; margin: 0; max-width: 34rem; }
.login-title { color: var(--ink); font-family: var(--font); font-size: 22px; font-weight: 700; letter-spacing: 0; line-height: 1.2; margin: 0 0 16px; }
.login-panel { background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.45); border-radius: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.28); color: var(--text); max-width: 420px; padding: 26px 26px 22px; }
.login-shell .login-form label { margin-bottom: 12px; }
.login-form label { color: var(--muted); display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; margin-bottom: 14px; text-transform: uppercase; }
.login-shell .login-form input { margin-top: 4px; }
.login-form input { background: #fbf8f3; border: 1px solid var(--line); border-radius: 12px; color: var(--text); display: block; font-size: 15px; margin-top: 8px; outline: 0; padding: 13px 14px; transition: border-color .15s ease, box-shadow .15s ease; width: 100%; }
.login-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(26, 107, 101, .14); }
.login-error { color: var(--red); font-size: 12px; margin: 4px 0 12px; }
.login-submit { margin-top: 8px; min-height: 46px; width: 100%; }
@media (min-width: 1100px) {
  .login-shell { display: block; }
  .login-side { left: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%); width: 420px; }
  .login-shell .landing-copy { left: auto; margin: 0; max-width: none; position: absolute; right: calc(50% + 210px + 56px); top: 50%; transform: translateY(-50%); }
  .login-panel { width: 100%; }
}
.workspace-picker-grid { margin-top: 28px; max-width: 920px; }
.workspace-picker-grid .role-card { cursor: pointer; text-align: left; width: 100%; border: 0; font: inherit; }
.workspace-remember { align-items: center; color: #c6d4d1; display: inline-flex; font-size: 13px; gap: 10px; margin-top: 18px; }
.workspace-remember input { accent-color: var(--gold); height: 16px; width: 16px; }
.workspace-signout { color: #98aaa6; font-size: 12px; text-decoration: none; }
.workspace-signout:hover { color: #fff; text-decoration: underline; }
.admin-form label { color: var(--muted); display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; margin-bottom: 0; text-transform: uppercase; }
.admin-form label > span { display: block; }
.admin-form .field-note { color: var(--muted); display: block; font-size: 12px; font-weight: 500; letter-spacing: 0; line-height: 1.4; margin-top: 6px; text-transform: none; }
.admin-form input::placeholder,
.admin-form textarea::placeholder { color: #8d8478; font-size: 12px; }
.admin-form input, .admin-form select, .admin-form textarea { display: block; font-size: 13px; letter-spacing: 0; margin-top: 6px; text-transform: none; }
.admin-grid { align-items: start; display: grid; gap: 12px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.admin-span { grid-column: 1 / -1; }
.company-field { position: relative; }
.company-suggest {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(20, 56, 52, .12);
  left: 0;
  list-style: none;
  margin: 4px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 6;
}
.company-suggest button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  padding: 8px 10px;
  text-align: left;
  text-transform: none;
  width: 100%;
}
.company-suggest button:hover,
.company-suggest button.is-active { background: var(--teal-soft); }
.admin-form .email-compose input.email-domain[readonly] {
  background: #f3f6f4;
  color: var(--ink-2);
}
.email-at { color: var(--muted); flex: 0 0 auto; font-weight: 800; line-height: 1; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; max-width: 100%; }
.admin-form textarea { line-height: 1.45; min-height: 96px; resize: vertical; }
.user-list-bar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0;
  max-width: none;
  padding: 14px 16px;
}
.user-list-bar label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  font-weight: 700;
  gap: 10px;
  letter-spacing: .06em;
  margin: 0;
  text-transform: uppercase;
}
.user-list-bar select { letter-spacing: 0; min-width: 180px; text-transform: none; width: auto; }
.user-count { color: var(--muted); font-size: 13px; font-weight: 600; margin: 0; }
.desk-panel {
  --desk: #1a6b65;
  --desk-soft: #e5f3f1;
  background:
    radial-gradient(140px 90px at 100% 0%, color-mix(in srgb, var(--desk) 14%, transparent), transparent 70%),
    linear-gradient(180deg, #fff, var(--desk-soft));
  border-color: color-mix(in srgb, var(--desk) 22%, #fff);
  overflow: hidden;
  position: relative;
}
.desk-panel::before {
  background: var(--desk);
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 4px;
}
.desk-panel--alerts { --desk: #e11d48; --desk-soft: #fff1f2; }
.desk-panel--inventory { --desk: #059669; --desk-soft: #ecfdf5; }
.desk-panel-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: flex-start;
}
.desk-panel-head > div { min-width: 0; text-align: left; }
.desk-panel-mark {
  align-items: center;
  background: color-mix(in srgb, var(--desk) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--desk) 20%, transparent);
  border-radius: 14px;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 22px;
  height: 48px;
  justify-content: center;
  width: 48px;
}
.desk-empty {
  align-items: center;
  background: color-mix(in srgb, var(--desk) 6%, #fff);
  border: 1px dashed color-mix(in srgb, var(--desk) 28%, transparent);
  border-radius: 14px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  justify-items: center;
  margin-top: 4px;
  padding: 28px 18px;
  text-align: center;
}
.desk-empty-ico {
  align-items: center;
  background: #fff;
  border-radius: 999px;
  color: var(--desk);
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  margin-bottom: 4px;
  width: 40px;
}
.desk-empty strong { color: var(--ink); font-size: 14px; }
.desk-empty p { font-size: 13px; margin: 0; }
.pi-alert-bar { display: grid; gap: 8px; margin: 0 0 16px; }
.alerts-list { display: grid; gap: 10px; margin: 0 0 8px; }
.pi-alert {
  --alert: #c8892a;
  --alert-soft: #f8ecd4;
  align-items: flex-start;
  background: var(--alert-soft);
  border: 1px solid color-mix(in srgb, var(--alert) 28%, transparent);
  border-left: 4px solid var(--alert);
  border-radius: 14px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--alert) 10%, transparent);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
  width: 100%;
}
.pi-alert:hover {
  box-shadow: 0 12px 24px color-mix(in srgb, var(--alert) 16%, transparent);
  transform: translateY(-1px);
}
.pi-alert--amber { --alert: #d97706; --alert-soft: #fff7ed; }
.pi-alert--sky { --alert: #0284c7; --alert-soft: #f0f9ff; }
.pi-alert--rose { --alert: #e11d48; --alert-soft: #fff1f2; }
.pi-alert--violet { --alert: #7c3aed; --alert-soft: #f5f3ff; }
.pi-alert--coral { --alert: #ea580c; --alert-soft: #fff7ed; }
.pi-alert-ico {
  align-items: center;
  background: #fff;
  border-radius: 12px;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 18px;
  height: 40px;
  justify-content: center;
  width: 40px;
}
.pi-alert-copy { display: grid; gap: 3px; min-width: 0; }
.pi-alert strong { display: block; font-size: 14px; line-height: 1.3; }
.pi-alert span { color: color-mix(in srgb, var(--alert) 45%, #5c6b68); font-size: 13px; line-height: 1.4; }
.pi-map-summary { color: #6d624f; font-size: 14px; margin: 0 0 10px; }
.alerts-bell-wrap { position: relative; }
.alerts-bell-btn { position: relative; }
.alerts-bell-badge {
  align-items: center;
  background: #b42318;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  position: absolute;
  right: -4px;
  top: -4px;
}
.alerts-bell-dialog { max-width: 420px; width: min(420px, 94vw); }
.alerts-bell-list { display: grid; gap: 8px; margin: 12px 0; max-height: 50vh; overflow: auto; }
.alerts-bell-form .modal-actions { align-items: center; display: flex; gap: 10px; justify-content: flex-end; }
/* App shell */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app-shell[hidden] { display: none !important; }
.sidebar {
  background:
    radial-gradient(280px 180px at 20% 0%, rgba(200, 137, 42, .18), transparent 70%),
    linear-gradient(180deg, #1a4742 0%, #102c29 100%);
  border-right: 1px solid rgba(200, 137, 42, .22);
  color: #d9e4e1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.sidebar-brand { padding: 0 9px 26px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { align-items: center; border-radius: 12px; color: #c5d6d2; display: flex; font-size: 14px; font-weight: 600; gap: 12px; padding: 11px 12px; transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.side-nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--nav-accent, var(--gold)) 28%, transparent), rgba(255,255,255,.08)); box-shadow: inset 3px 0 var(--nav-accent, var(--gold)); color: #fff; }
.side-nav a.active:hover { transform: none; }
.side-nav a span,
.side-nav a .nav-ico {
  align-items: center;
  background: #f0f7f5;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  color: #0f3d39;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 16px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  text-align: center;
  width: 34px;
}
.side-nav a.active span,
.side-nav a.active .nav-ico {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--nav-accent, var(--gold)) 70%, #fff), 0 4px 12px rgba(0,0,0,.22);
  transform: scale(1.04);
}
/* Light pastel chips on dark sidebar — high contrast for emoji/glyphs */
.side-nav a[data-nav="dashboard"] { --nav-accent: #14b8a6; }
.side-nav a[data-nav="dashboard"] .nav-ico,
.side-nav a[data-nav="dashboard"] > span { background: #ccfbf1; color: #0f766e; }
.side-nav a[data-nav="suppliers"] { --nav-accent: #3b82f6; }
.side-nav a[data-nav="suppliers"] .nav-ico,
.side-nav a[data-nav="suppliers"] > span { background: #dbeafe; color: #1d4ed8; }
.side-nav a[data-nav="fabric"] { --nav-accent: #8b5cf6; }
.side-nav a[data-nav="fabric"] .nav-ico,
.side-nav a[data-nav="fabric"] > span { background: #ede9fe; color: #6d28d9; }
.side-nav a[data-nav="trims"] { --nav-accent: #ec4899; }
.side-nav a[data-nav="trims"] .nav-ico,
.side-nav a[data-nav="trims"] > span { background: #fce7f3; color: #be185d; }
.side-nav a[data-nav="bom"] { --nav-accent: #f59e0b; }
.side-nav a[data-nav="bom"] .nav-ico,
.side-nav a[data-nav="bom"] > span { background: #fef3c7; color: #b45309; }
.side-nav a[data-nav="alerts"] { --nav-accent: #f43f5e; }
.side-nav a[data-nav="alerts"] .nav-ico,
.side-nav a[data-nav="alerts"] > span { background: #ffe4e6; color: #be123c; }
.side-nav a[data-nav="inventory"] { --nav-accent: #10b981; }
.side-nav a[data-nav="inventory"] .nav-ico,
.side-nav a[data-nav="inventory"] > span { background: #d1fae5; color: #047857; }
.side-nav a[data-nav="reports"] { --nav-accent: #0ea5e9; }
.side-nav a[data-nav="reports"] .nav-ico,
.side-nav a[data-nav="reports"] > span { background: #e0f2fe; color: #0369a1; }
.side-nav a[data-nav="po"] { --nav-accent: #6366f1; }
.side-nav a[data-nav="po"] .nav-ico,
.side-nav a[data-nav="po"] > span { background: #e0e7ff; color: #4338ca; }
.side-nav a[data-nav="pi"] { --nav-accent: #f97316; }
.side-nav a[data-nav="pi"] .nav-ico,
.side-nav a[data-nav="pi"] > span { background: #ffedd5; color: #c2410c; }
.side-nav a[data-nav="pdc"] { --nav-accent: #d97706; }
.side-nav a[data-nav="pdc"] .nav-ico,
.side-nav a[data-nav="pdc"] > span { background: #fef3c7; color: #92400e; }
.side-nav a[data-nav="email"] { --nav-accent: #06b6d4; }
.side-nav a[data-nav="email"] .nav-ico,
.side-nav a[data-nav="email"] > span { background: #cffafe; color: #0e7490; }
.side-nav i { background: var(--gold); border-radius: 4px; color: var(--ink); font-size: 8px; font-style: normal; margin-left: auto; padding: 3px 5px; }
.nav-count { background: rgba(255,255,255,.1); border-radius: 999px; font-size: 10px; margin-left: auto; padding: 3px 7px; }
.nav-count.gold { background: var(--gold); color: var(--ink); }
.nav-count.red { background: var(--red); color: #fff; }
.sidebar-bottom { border-top: 1px solid rgba(255,255,255,.09); margin-top: auto; padding: 20px 7px 2px; }
.system-status { align-items: center; display: flex; gap: 9px; }
.system-status > span { background: #5ccb9c; border-radius: 50%; box-shadow: 0 0 0 4px rgba(92,203,156,.12); height: 8px; width: 8px; }
.system-status b, .system-status small { display: block; }
.system-status b { color: #d9e4e1; font-size: 11px; }
.system-status small { color: #7f9b96; font-size: 9px; margin-top: 2px; }
.role-switch { color: var(--gold); display: block; font-size: 11px; font-weight: 700; margin-top: 18px; }
.main-content { min-width: 0; padding: 0 var(--page-pad) 12px; }
.topbar {
  align-items: center;
  backdrop-filter: blur(16px);
  background: var(--paper);
  border-bottom: 1px solid rgba(20, 56, 52, .07);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 0 calc(var(--page-pad) * -1) 0;
  min-height: var(--topbar-sticky-height);
  padding: 14px var(--page-pad);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h1 { color: var(--ink); font-size: 26px; letter-spacing: 0; margin: 0; }
.topbar-clock { min-width: 0; }
.topbar-clock .eyebrow { margin-bottom: 2px; }
.topbar-clock .today-clock { margin: 0; }
.topbar-clock .today-clock-time { font-size: 24px; }
.topbar-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.topbar-actions:has(.topbar-greeting) {
  align-items: flex-end;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: center;
}
.topbar-identity { align-items: center; display: flex; gap: 10px; }
.topbar-greeting { text-align: right; }
.topbar-greeting-line {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}
.brand-switcher { align-items: center; display: inline-flex; gap: 8px; margin: 0; }
.brand-switcher-label {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 800;
  height: 36px;
  letter-spacing: .06em;
  line-height: 36px;
  margin: 0;
  text-transform: uppercase;
  white-space: nowrap;
}
select.brand-select.secondary-button,
.brand-select-button.secondary-button {
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235f736f' d='M1.2 1.4 6 6.2 10.8 1.4'/%3E%3C/svg%3E") no-repeat right 10px center;
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 700;
  height: 36px;
  letter-spacing: 0;
  line-height: 36px;
  margin: 0;
  max-width: min(180px, 42vw);
  min-width: 120px;
  padding: 0 28px 0 12px;
  text-align: left;
  text-transform: none;
}
select.brand-select-native {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}
.brand-select-menu { display: inline-flex; position: relative; }
.brand-select-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(23, 63, 59, .12);
  list-style: none;
  margin: 6px 0 0;
  max-width: min(220px, 70vw);
  min-width: 100%;
  padding: 6px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 40;
}
.brand-select-option {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}
.brand-select-option:hover,
.brand-select-option[aria-selected="true"] { background: #e5f1ef; }
.date-chip, .icon-button { background: #fff; border: 1px solid var(--line); color: var(--text); }
.date-chip { border-radius: 10px; font-size: 12px; font-weight: 700; padding: 10px 13px; }
.date-chip span { color: var(--muted); margin-left: 8px; }
.icon-button { align-items: center; border-radius: 10px; display: inline-flex; height: 38px; justify-content: center; width: 38px; }
.notification-button { position: relative; }
.notification-button b { align-items: center; background: var(--red); border: 2px solid var(--paper); border-radius: 50%; color: #fff; display: flex; font-size: 7px; height: 15px; justify-content: center; position: absolute; right: -4px; top: -4px; width: 15px; }
.avatar { align-items: center; background: var(--teal); border-radius: 10px; color: #fff; display: flex; font-size: 11px; font-weight: 800; height: 38px; justify-content: center; width: 38px; }
.store-avatar { background: var(--gold); color: var(--ink); }
.menu-button { display: none; }
.demo-banner { align-items: center; background: #e5f1ef; border: 1px solid #cee4e0; border-radius: 12px; color: var(--muted); display: flex; font-size: 12px; gap: 10px; margin-bottom: 24px; padding: 11px 14px; }
.demo-banner b { color: var(--teal); }
.demo-banner button { background: none; border: 0; color: var(--muted); font-size: 18px; margin-left: auto; }
.section-block {
  margin: 0 auto 34px;
  max-width: 1450px;
  scroll-margin-top: calc(var(--topbar-sticky-height, 84px) + 58px);
}
.email-subsection {
  margin-top: 28px;
  scroll-margin-top: calc(var(--topbar-sticky-height, 84px) + 58px);
}
.manual-pi-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 18px 18px;
}
.manual-pi-form .store-field { flex: 1 1 14rem; margin: 0; }
.supplier-pi-block {
  margin-top: 28px;
  padding-top: 8px;
  scroll-margin-top: calc(var(--topbar-sticky-height, 84px) + 58px);
}
.pi-compare-block {
  margin-top: 28px;
  padding-top: 8px;
  scroll-margin-top: calc(var(--topbar-sticky-height, 84px) + 58px);
}
.section-heading { align-items: flex-end; display: flex; justify-content: space-between; margin-bottom: 17px; }
.section-heading.compact { align-items: center; }
.bom-review-head,
.section-page-head { margin-bottom: 17px; }
.bom-review-head-row,
.section-page-head-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: space-between;
}
.bom-review-head-text,
.section-page-head-text { flex: 1 1 14rem; min-width: 0; }
.bom-toolbar-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin: 10px 0 0;
  max-width: 52rem;
}
.bom-toolbar-hint strong { color: var(--ink-2); font-weight: 700; }
.bom-review-head-text .eyebrow,
.section-page-head-text .eyebrow { margin-bottom: 4px; }
.bom-review-head-text h2,
.section-page-head-text h2 { color: var(--ink); font-size: 22px; letter-spacing: -.02em; margin: 0 0 4px; }
.today-clock {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 4px;
}
.today-clock-date {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}
.today-clock-time {
  color: var(--ink);
  font-family: var(--font);
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.bom-review-head-text p,
.section-page-head-text p { color: var(--muted); font-size: 12px; margin: 0; }
.section-page-head-text p.section-lead,
.bom-review-head-text p.section-lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  margin: 0;
}
a.text-link {
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.text-link:hover { color: var(--ink); }
.bom-toolbar {
  align-items: center;
  background: color-mix(in srgb, var(--panel-accent) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--panel-accent) 14%, transparent);
  border-radius: 14px;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 14px;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}
.bom-toolbar .primary-button,
.bom-toolbar .secondary-button {
  flex: 0 0 auto;
  font-size: 13px;
  margin: 0;
  min-height: 42px;
  padding: 11px 18px;
  white-space: nowrap;
}
.section-heading h2 { color: var(--ink); font-size: 22px; letter-spacing: -.02em; margin-bottom: 4px; }
.section-heading p { color: var(--muted); font-size: 12px; margin-bottom: 0; }
.primary-button, .secondary-button { border-radius: 12px; font-size: 13px; font-weight: 600; letter-spacing: .01em; padding: 11px 16px; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease; }
.primary-button { background: linear-gradient(180deg, #227972, var(--teal)); border: 1px solid #165e59; box-shadow: inset 0 1px 0 rgba(255,255,255,.22); color: #fff; }
.primary-button:hover:not(:disabled) { background: var(--ink-2); box-shadow: 0 8px 18px rgba(20, 56, 52, .22); transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; }
label.primary-button.upload-brand-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  position: relative;
  overflow: hidden;
}
label.primary-button.upload-brand-label[hidden] { display: none !important; }
.upload-input-overlay {
  cursor: pointer;
  font-size: 0;
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  width: 100%;
}
.secondary-button { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.secondary-button:hover:not(:disabled) { border-color: #b8ccc8; box-shadow: 0 4px 14px rgba(23, 63, 59, .08); transform: translateY(-1px); }
.icon-button { transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.icon-button:hover { background: #fff; border-color: #c5d5d2; box-shadow: 0 4px 12px rgba(23, 63, 59, .1); }
.text-button { background: none; border: 0; color: var(--teal); font-size: 11px; font-weight: 800; }
.text-button:hover { color: var(--ink); }

/* Dashboard */
.work-chooser {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 18px;
}
.work-choice {
  --desk: #1a6b65;
  --desk-soft: #e5f3f1;
  --desk-mid: #c5ddd6;
  align-items: start;
  background:
    radial-gradient(120px 80px at 100% 0%, color-mix(in srgb, var(--desk) 18%, transparent), transparent 70%),
    linear-gradient(165deg, #fff 0%, var(--desk-soft) 100%);
  border: 1px solid color-mix(in srgb, var(--desk) 28%, #fff);
  border-radius: 16px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--desk) 10%, transparent);
  color: inherit;
  display: grid;
  gap: 10px 14px;
  grid-template-columns: 48px 1fr;
  padding: 18px 18px 16px;
  position: relative;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.work-choice::before {
  background: var(--desk);
  border-radius: 16px 0 0 16px;
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 4px;
}
.work-choice:hover {
  border-color: color-mix(in srgb, var(--desk) 55%, #fff);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--desk) 18%, transparent);
  transform: translateY(-2px);
}
.work-choice--fabric { --desk: #7c3aed; --desk-soft: #f3eefc; --desk-mid: #d8c9f5; }
.work-choice--trims { --desk: #db2777; --desk-soft: #fce7f3; --desk-mid: #f5c6dc; }
.work-choice-mark {
  align-items: center;
  background: color-mix(in srgb, var(--desk) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--desk) 22%, transparent);
  border-radius: 14px;
  color: var(--desk);
  display: inline-flex;
  font-size: 22px;
  height: 48px;
  justify-content: center;
  line-height: 1;
  width: 48px;
}
.work-choice-body { display: grid; gap: 4px; min-width: 0; }
.work-choice strong { color: var(--ink); font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; }
.work-choice p { color: #4a5f5b; font-size: 13px; line-height: 1.4; margin: 0; max-width: 38ch; }
.work-choice-go {
  color: var(--desk);
  font-size: 12px;
  font-weight: 800;
  grid-column: 2;
  letter-spacing: .02em;
  margin-top: 2px;
}
@media (max-width: 720px) {
  .work-chooser { grid-template-columns: 1fr; }
}
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.kpi-card, .panel { background: linear-gradient(180deg, #fff, #fcfaf6); border: 1px solid rgba(20, 56, 52, .08); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .18s ease, transform .18s ease; }
.kpi-card {
  --kpi: var(--teal);
  --kpi-soft: var(--teal-soft);
  overflow: hidden;
  padding: 18px;
  position: relative;
}
.kpi-card::before {
  background: linear-gradient(90deg, var(--kpi), color-mix(in srgb, var(--kpi) 55%, #fff));
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.kpi-card--orders { --kpi: #0f766e; --kpi-soft: #dff7f3; }
.kpi-card--drafts { --kpi: #c8892a; --kpi-soft: #f8ecd4; }
.kpi-card--outbox { --kpi: #2563eb; --kpi-soft: #dbeafe; }
.kpi-card--pdc { --kpi: #7c3aed; --kpi-soft: #f3eefc; }
.kpi-card:hover { box-shadow: 0 18px 36px rgba(20, 56, 52, .12); transform: translateY(-2px); }
.kpi-top { align-items: center; display: flex; justify-content: space-between; }
.kpi-icon {
  align-items: center;
  background: var(--kpi-soft);
  border-radius: 12px;
  color: var(--kpi);
  display: flex;
  font-size: 18px;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 40px;
}
.kpi-icon.teal { background: var(--teal-soft); color: var(--teal); }
.kpi-icon.amber { background: var(--gold-soft); color: #9a6815; }
.kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-icon.red { background: var(--red-soft); color: var(--red); }
.kpi-icon.violet { background: #eee5f1; color: var(--violet); }
.trend { border-radius: 999px; font-size: 9px; font-weight: 800; padding: 4px 7px; }
.trend.up { background: #e5f2e9; color: #3d815b; }
.trend.down { background: var(--red-soft); color: var(--red); }
.trend.neutral { background: #f0f1ee; color: var(--muted); }
.kpi-card > strong { color: var(--ink); display: block; font-family: var(--font); font-size: 30px; font-weight: 600; letter-spacing: 0; margin: 15px 0 2px; }
.kpi-card p { font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.kpi-card small { color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; gap: 18px; }
.dashboard-grid.two-one { grid-template-columns: 1.7fr 1fr; }
.dashboard-grid.half-half { grid-template-columns: 1fr 1fr; }
.mgmt-updated { color: var(--muted); font-size: 10px; font-weight: 700; }
.mgmt-chart-legend { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 10px; font-weight: 700; gap: 14px; margin-bottom: 14px; }
.mgmt-swatch { border-radius: 3px; display: inline-block; height: 10px; margin-right: 5px; vertical-align: -1px; width: 10px; }
.mgmt-swatch.blue { background: var(--blue); }
.mgmt-swatch.teal { background: var(--teal); }
.mgmt-swatch.violet { background: var(--violet); }
.mgmt-chart { align-items: flex-end; display: flex; gap: 10px; justify-content: space-between; min-height: 180px; padding-top: 8px; }
.mgmt-chart-day { align-items: center; display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; }
.mgmt-chart-day small { color: var(--muted); font-size: 9px; font-weight: 700; text-align: center; }
.mgmt-chart-bars { align-items: flex-end; display: flex; gap: 4px; height: 140px; justify-content: center; width: 100%; }
.mgmt-bar { border-radius: 5px 5px 2px 2px; min-height: 4px; width: 12px; }
.mgmt-bar.blue { background: var(--blue); }
.mgmt-bar.teal { background: var(--teal); }
.mgmt-bar.violet { background: var(--violet); }
.mgmt-store-link { font-size: 11px; font-weight: 700; margin-top: 16px; }
.mgmt-store-link a { color: var(--teal); text-decoration: none; }
.mgmt-store-link a:hover { text-decoration: underline; }
.attention-link { align-items: center; background: #fff; border-radius: 10px; color: inherit; display: grid; gap: 10px; grid-template-columns: 34px 1fr 15px; padding: 8px; text-decoration: none; width: 100%; }
.attention-link:hover { background: #f6f7f4; }
.panel { padding: 20px; }
.panel-head { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 18px; }
.panel-head h3 { color: var(--ink); font-size: 16px; margin: 0 0 3px; }
.panel-head p { color: var(--muted); font-size: 10px; margin: 0; }
.progress-stack { display: grid; gap: 14px; }
#mgmtStoreProgress .progress-row { grid-template-columns: minmax(168px, 210px) 1fr 64px; }
#mgmtStoreProgress .progress-row > strong { font-size: 13px; color: var(--ink); }
.progress-row > div:first-child { align-items: center; display: grid; grid-template-columns: 10px 1fr; }
.progress-row b { font-size: 11px; }
.progress-row small { color: var(--muted); font-size: 9px; grid-column: 2; margin-top: 2px; }
.progress-row > strong { color: var(--muted); font-size: 10px; text-align: right; }
.status-dot { border-radius: 50%; height: 7px; width: 7px; }
.status-dot.draft { background: #9aa6a3; }.status-dot.sent { background: var(--blue); }.status-dot.waiting { background: var(--gold); }.status-dot.transit { background: var(--violet); }.status-dot.received { background: var(--teal); }
.progress-track { background: #eef0ed; border-radius: 999px; height: 7px; overflow: hidden; }
.progress-track span { background: var(--teal); border-radius: inherit; display: block; height: 100%; min-width: 8px; }
.attention-list { display: grid; gap: 6px; }
.attention-list button { align-items: center; background: #fff; border: 0; border-radius: 10px; display: grid; gap: 10px; grid-template-columns: 34px 1fr 15px; padding: 8px; text-align: left; width: 100%; }
.attention-list button:hover { background: #f6f7f4; }
.attention-icon { align-items: center; border-radius: 9px; display: flex; font-size: 13px; font-weight: 900; height: 34px; justify-content: center; width: 34px; }
.attention-icon.red { background: var(--red-soft); color: var(--red); }.attention-icon.amber { background: var(--gold-soft); color: #9a6815; }.attention-icon.blue { background: var(--blue-soft); color: var(--blue); }
.attention-list b, .attention-list small { display: block; }
.attention-list b { color: var(--text); font-size: 10px; margin-bottom: 3px; }
.attention-list small { color: var(--muted); font-size: 9px; }
.pill, .status-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 6px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill.danger, .status-pill.danger { background: var(--red-soft); color: #9e3d36; }
.pill.transit, .status-pill.transit { background: #eee5f1; color: var(--violet); }
.pill.waiting, .status-pill.waiting { background: var(--gold-soft); color: #8a5a12; }
.status-pill.received { background: #e3f3ea; color: #1a6b42; }
.status-pill.draft { background: #eef0ed; color: var(--muted); }
.status-pill.po-yet-to-review { background: #eef0ed; color: var(--muted); text-transform: none; letter-spacing: .02em; }
.status-pill.po-viewed { background: var(--blue-soft); color: #2f5f9e; text-transform: none; letter-spacing: .02em; }
.status-pill.po-email-drafted { background: var(--gold-soft); color: #8a5a12; text-transform: none; letter-spacing: .02em; }
.status-pill.po-email-sent { background: #dcefe4; color: #1f6b45; text-transform: none; letter-spacing: .02em; }
.segmented { background: #e9ebe7; border-radius: 9px; display: flex; padding: 3px; }
.segmented button { background: transparent; border: 0; border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 700; padding: 6px 9px; }
.segmented button.active { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.06); color: var(--ink); }
.table-panel { padding: 0; overflow: hidden; }
.table-toolbar { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; padding: 13px 16px; }
.orders-po-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.orders-material-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.orders-material-filter .secondary-button {
  min-height: 34px;
  padding: 6px 12px;
}
.orders-material-filter .secondary-button.active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 700;
}
.orders-po-action-wrap { display: inline-flex; }
.orders-po-action-wrap:has(button:disabled) { cursor: help; }
.orders-po-action-wrap button:disabled { pointer-events: none; }
.search-box { align-items: center; background: #f6f7f4; border: 1px solid #ebede9; border-radius: 8px; color: var(--muted); display: flex; font-size: 16px; gap: 7px; padding: 7px 10px; width: min(340px, 100%); }
.search-box input { background: transparent; border: 0; color: var(--text); font-size: 11px; outline: 0; width: 100%; }
.mapping-panel .table-wrap {
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; font-size: 11px; min-width: 0; width: 100%; }
.mapping-panel .mapping-table { min-width: 0; width: 100%; }
th {
  background: #fafaf8;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .06em;
  padding: 12px 14px;
  text-align: left;
  text-transform: uppercase;
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 var(--line);
}
.table-wrap.scrolled thead th {
  box-shadow: 0 4px 12px rgba(23, 63, 59, .08);
}
td { border-top: 1px solid #eceeea; padding: 12px 14px; white-space: nowrap; }
.mapping-table td { border-top: 1px solid #e8eeec; }
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: #fafcfb; }
td b, td small { display: block; }
td small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.row-action { background: transparent; border: 0; color: var(--muted); letter-spacing: 1px; }

.po-action-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}
.po-action-btn {
  background: #fff;
  border: 1px solid #dce8e5;
  border-radius: 8px;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  padding: 7px 12px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease, color .15s ease;
  white-space: nowrap;
}
.po-action-btn:hover:not(:disabled):not(.is-blocked) {
  border-color: #b8ccc8;
  box-shadow: 0 3px 10px rgba(23, 63, 59, .08);
  transform: translateY(-1px);
}
.po-action-btn:active:not(:disabled):not(.is-blocked) {
  transform: translateY(0) scale(0.97);
}
.po-action-btn--accent {
  background: var(--teal-soft);
  border-color: rgba(31, 116, 110, .35);
  color: var(--teal);
}
.po-action-btn--accent:hover:not(:disabled):not(.is-blocked) {
  background: #d0ebe6;
  border-color: var(--teal);
  color: var(--ink-2);
}
.po-action-btn:disabled,
.po-action-btn.is-blocked,
.po-action-btn.is-blocked:hover {
  cursor: default;
  opacity: .65;
  box-shadow: none;
  transform: none;
}
.po-action-btn--accent.is-blocked,
.po-action-btn--accent.is-blocked:hover {
  background: var(--teal-soft);
  border-color: rgba(31, 116, 110, .35);
  color: var(--teal);
}
.po-action-btn--busy {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}
.po-action-btn--busy::after {
  animation: po-action-spin .65s linear infinite;
  border: 2px solid rgba(31, 116, 110, .25);
  border-radius: 50%;
  border-top-color: var(--teal);
  content: "";
  height: 14px;
  left: 50%;
  margin: -7px 0 0 -7px;
  position: absolute;
  top: 50%;
  width: 14px;
}
.po-action-btn--ok {
  animation: po-action-ok-pop .55s ease;
  background: #dcefe4 !important;
  border-color: #1f6b45 !important;
  color: #1f6b45 !important;
}
@keyframes po-action-spin {
  to { transform: rotate(360deg); }
}
@keyframes po-action-ok-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(31, 107, 69, .2); }
  100% { transform: scale(1); box-shadow: none; }
}
.mapping-table tr.po-row-flash td {
  animation: po-row-flash .7s ease;
}
@keyframes po-row-flash {
  0%, 100% { background-color: transparent; }
  35% { background-color: rgba(220, 236, 233, .85); }
}

/* Purchase orders section — readable table typography (page title unchanged) */
#orders .orders-gst-panel {
  margin-bottom: 28px;
}
#orders .mapping-panel-head h3 {
  font-size: 18px;
  letter-spacing: -0.01em;
}
#orders .mapping-panel-head p,
#orders #ordersPanelSummary {
  font-size: 14px;
  line-height: 1.5;
}
#orders .table-toolbar {
  padding: 16px 18px;
}
#orders .search-box {
  padding: 10px 12px;
}
#orders .search-box input {
  font-size: 14px;
}
#orders .orders-po-actions .secondary-button {
  font-size: 13px;
  padding: 10px 16px;
}
#orders .orders-po-table th {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 14px 18px;
  text-transform: uppercase;
}
#orders .orders-po-table td {
  font-size: 15px;
  line-height: 1.45;
  padding: 16px 18px;
  vertical-align: middle;
}
#orders .orders-po-table td.orders-po-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 28px 18px;
  text-align: center;
}
#orders .po-number {
  color: var(--ink);
  display: inline-block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
#orders .po-cell-supplier {
  font-weight: 600;
  color: var(--ink-2);
}
#orders .po-cell-value {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
#orders .po-cell-date,
#orders .po-cell-muted {
  color: var(--muted);
  font-size: 14px;
}
#orders .po-cell-status .status-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 7px 12px;
  text-transform: none;
}
#orders .po-action-group {
  gap: 8px;
  max-width: 22rem;
}
#orders .po-action-group .po-action-btn {
  font-size: 12px;
  padding: 9px 13px;
}
#orders .mapping-table tbody tr td:first-child {
  border-left-width: 4px;
}
.store-receive-panel { padding: 18px 20px; }
.store-receive-tabs { margin-bottom: 18px; max-width: 420px; }
.store-receive-tabs .store-receive-tab {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  flex: 1;
  font-size: 11px;
  font-weight: 800;
  padding: 8px 10px;
}
.store-receive-tabs .store-receive-tab.active {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  color: var(--ink);
}
.store-receive-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}
.setup-notes { margin: 8px 0 0; padding-left: 18px; }
.setup-notes li { margin: 6px 0; }
.setup-form {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 16px 0 8px;
}
.setup-form-wide { grid-column: 1 / -1; }
.setup-form textarea.store-input { min-height: 72px; resize: vertical; }
.setup-repeat { display: grid; gap: 10px; }
.setup-repeat-head { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.setup-repeat-head h4 { font-size: 14px; margin: 0; }
.setup-hint { color: var(--muted); font-size: 13px; margin: 0; }
.inbound-review-note {
  background: #fff4d6;
  border: 1px solid #e4c56a;
  border-radius: 10px;
  color: #5c4310;
  font-weight: 700;
  margin: 8px 0 0;
  padding: 10px 12px;
}
.setup-repeat-row { align-items: end; display: grid; gap: 12px 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.setup-repeat-row--address { grid-template-columns: minmax(0, 1fr) auto; }
.supplier-name-copy { display: grid; min-width: 0; }
.supplier-address-line { color: var(--muted); font-size: 11px; font-weight: 500; }
.store-field { display: grid; gap: 6px; }
.store-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.store-select,
.store-input,
.admin-form input,
.admin-form select,
.admin-form textarea,
.user-list-bar select {
  background: #fbf8f3;
  border: 1px solid #e4ddd2;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  padding: 11px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
.store-select:focus,
.store-input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(26, 107, 101, .12);
  outline: 0;
}
.admin-form label > span.email-compose {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 6px;
}
.admin-form label > span.email-compose input {
  display: block;
  flex: 1 1 0;
  margin-top: 0;
  max-width: none;
  min-width: 0;
  width: auto;
}
.admin-form label > span.email-compose input.email-domain {
  flex: 0 0 50%;
  max-width: 50%;
  width: 50%;
}
.store-line-stats {
  background: var(--teal-soft);
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
  padding: 12px 14px;
}
.store-line-stats p { margin: 0; }
.store-receive-actions { margin-top: 4px; }
#piCompareBody td, #piLineBody td { vertical-align: top; }
#piLineBody .store-input { min-width: 88px; margin: 0 0 6px; }
.pi-compare-block .pi-compare-scroll {
  max-height: 28rem;
  overflow: auto;
}
.pi-compare-block .pi-compare-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.pi-compare-table { border-collapse: collapse; min-width: 920px; table-layout: auto; width: 100%; }
.pi-compare-table th,
.pi-compare-table td { padding: 10px 12px; vertical-align: top; }
.pi-compare-table th { white-space: nowrap; }
.pi-compare-table td { overflow-wrap: anywhere; white-space: normal; }
.pi-compare-table .pi-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pi-compare-table tr.pi-line-diff td { background: #fff6e8; }
.pi-review-panel { margin-bottom: 18px; }
.pi-review-meta { margin: 0 0 8px; }
.pi-review-foot {
  align-items: end;
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.pi-review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.inbound-row[data-inbound-id] { cursor: pointer; }
.inbound-row--open { align-items: flex-start; }
.inbound-review { margin-top: 16px; width: 100%; cursor: default; }
.inbound-review__title { font-size: 18px; margin: 0 0 4px; }
.inbound-review__intro { color: var(--muted); margin: 0 0 12px; }
.inbound-review .pi-edit-only,
#piMapBody .pi-edit-only { display: none; margin: 0; min-height: 36px; width: 6.5rem; }
.inbound-review.is-editing .pi-read,
#piMapBody.is-editing .pi-read { display: none; }
.inbound-review.is-editing .pi-edit-only,
#piMapBody.is-editing .pi-edit-only { display: inline-block; }
.inbound-row .outbox-row__actions {
  align-items: center;
  align-self: center;
}
.inbound-row--open .outbox-row__actions {
  align-self: start;
  display: none;
}
.pi-review-actions .primary-button,
.pi-review-actions .secondary-button {
  text-decoration: none;
}
tr.pdc-row--focus td { background: #e8f6f3; }
.pi-review-table { min-width: 760px; }
.pi-clearance {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pi-clearance .pi-clearance-qty {
  flex: 0 0 6.5rem;
  margin: 0;
  max-width: 6.5rem;
  min-width: 0;
  width: 6.5rem;
}
.pi-clearance .pi-clearance-note {
  flex: 1 1 9rem;
  margin: 0;
  min-width: 8rem;
  width: auto;
}
.pi-clearance .primary-button { flex: 0 0 auto; margin: 0; }
.store-receipt-list { display: grid; gap: 10px; padding: 4px 0; }
.store-receipt-row {
  align-items: center;
  background: #f8faf9;
  border: 1px solid #dce8e5;
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 14px 16px;
}
.store-receipt-row b,
.store-receipt-row small { display: block; }
.store-receipt-row b { font-size: 13px; }
.store-receipt-row small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.store-receipt-row > strong { color: var(--teal); font-size: 14px; }

@media (max-width: 900px) {
  #orders .orders-po-table td,
  #orders .orders-po-table th {
    font-size: 14px;
    padding: 14px 12px;
  }
  #orders .po-number {
    font-size: 15px;
  }
  #orders .po-action-group .po-action-btn {
    font-size: 11px;
    padding: 8px 10px;
  }
}
.supplier-list { display: grid; gap: 0; }
.supplier-list > div {
  align-items: center;
  border-top: 1px solid #e8eeec;
  display: grid;
  gap: 12px;
  grid-template-columns: 40px 1fr auto;
  padding: 14px 16px;
}
.supplier-list > div:first-child { border-top: 0; }
.supplier-avatar {
  align-items: center;
  background: var(--teal-soft);
  border-radius: 9px;
  color: var(--teal);
  display: flex;
  font-size: 11px;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 40px;
}
.supplier-list b, .supplier-list small { display: block; }
.supplier-list b { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.supplier-list small { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 4px; }
#suppliers .empty-state { font-size: 12px; padding: 14px 16px; text-align: left; }
.score { font-size: 11px; font-weight: 800; }.score.good { color: var(--teal); }.score.warn { color: #a97318; }.score.bad { color: var(--red); }
.period { color: var(--muted); font-size: 10px; }
.donut-row { align-items: center; display: flex; gap: 30px; justify-content: center; }
.donut { align-items: center; background: conic-gradient(var(--teal) 0 42%, var(--gold) 42% 63%, var(--blue) 63% 79%, var(--violet) 79% 91%, #d9dcda 91% 100%); border-radius: 50%; display: flex; height: 150px; justify-content: center; width: 150px; }
.donut::before { background: #fff; border-radius: 50%; content: ""; height: 96px; position: absolute; width: 96px; }
.donut div { position: relative; text-align: center; z-index: 1; }.donut b, .donut small { display: block; }.donut strong { color: var(--ink); font-size: 20px; }.donut small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.legend { display: grid; gap: 10px; min-width: 150px; }
.legend span { align-items: center; display: grid; font-size: 10px; grid-template-columns: 8px 1fr auto; gap: 8px; }.legend i { border-radius: 50%; height: 8px; width: 8px; }
.fabric-grid { display: grid; gap: 13px; grid-template-columns: repeat(3, 1fr); }
.inventory-coverage { display: grid; gap: 13px; grid-template-columns: repeat(3, 1fr); }
.coverage-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 16px; }
.coverage-head { align-items: center; display: grid; gap: 10px; grid-template-columns: 36px 1fr auto; }
.coverage-head b, .coverage-head small { display: block; }
.coverage-head b { font-size: 11px; }
.coverage-head small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.coverage-head > strong { color: var(--teal); font-size: 18px; }
.coverage-bar { background: #edf0ec; border-radius: 999px; height: 8px; margin: 14px 0 10px; overflow: hidden; }
.coverage-bar span { background: linear-gradient(90deg, var(--teal), #59a39b); border-radius: inherit; display: block; height: 100%; }
.coverage-card p { color: var(--muted); font-size: 9px; margin: 0; }
.coverage-card p b { color: var(--ink); }
.fabric-summary { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 11px; grid-template-columns: 36px 1fr; padding: 15px; }
.fabric-swatch { border: 3px solid #e3e5e1; border-radius: 9px; height: 36px; width: 36px; }.fabric-swatch.navy, .colour-dot.navy { background: #243a57; }.fabric-swatch.black, .colour-dot.black { background: #242726; }.fabric-swatch.beige, .colour-dot.beige { background: #c5aa83; }.colour-dot.white { background: #fff; }
.fabric-summary b, .fabric-summary small { display: block; }.fabric-summary b { font-size: 11px; }.fabric-summary small { color: var(--muted); font-size: 9px; margin-top: 3px; }.fabric-summary > strong { color: var(--ink); font-size: 11px; grid-column: 2; }.fabric-summary .status-pill { grid-column: 2; justify-self: start; }
.supplier-directory-table { width: 100%; table-layout: fixed; }
.supplier-directory-table th:nth-child(1),
.supplier-directory-table td:nth-child(1) { width: 24%; }
.supplier-directory-table th:nth-child(2),
.supplier-directory-table td:nth-child(2) { width: 16%; }
.supplier-directory-table th:nth-child(3),
.supplier-directory-table td:nth-child(3) { width: 22%; }
.supplier-directory-table th:nth-child(4),
.supplier-directory-table td:nth-child(4) { width: 14%; }
.supplier-directory-table th:nth-child(5),
.supplier-directory-table td:nth-child(5) { width: 14%; }
.supplier-directory-table .cell-phone { font-size: 12px; white-space: nowrap; }
.supplier-directory-table .supplier-name-cell {
  align-items: center;
  display: flex;
  gap: 10px;
}
.supplier-avatar--sm {
  flex-shrink: 0;
  font-size: 10px;
  height: 32px;
  width: 32px;
}
.supplier-directory-table .cell-email {
  font-size: 12px;
  max-width: 220px;
  word-break: break-all;
}
.supplier-directory-table .cell-mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
}
.supplier-directory-table .cell-contacts {
  font-size: 12px;
  line-height: 1.45;
  max-width: 280px;
}
.pending-supplier-batch {
  border: 1px solid var(--line, #e2e8e6);
  border-radius: 12px;
  margin-top: 14px;
  padding: 14px;
}
.pending-supplier-batch-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pending-supplier-batch-head small { color: var(--muted, #64748b); display: block; }
.pending-supplier-batch-actions { display: inline-flex; gap: 8px; }
.pending-supplier-table { width: 100%; table-layout: fixed; }
.pending-supplier-table td {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.pending-change {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}
.pending-change--new { background: #e6f4ea; color: #1e6b3a; }
.pending-change--update { background: #fff4e0; color: #8a5a00; }
.pending-supplier-dialog {
  max-width: min(1100px, 94vw);
  width: 100%;
}
.pending-supplier-dialog .table-wrap { max-height: 55vh; overflow: auto; }

.reports-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: 240px minmax(0, 1fr);
}
.reports-catalog {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding: 14px 10px;
  position: sticky;
  top: 16px;
}
.reports-catalog-group + .reports-catalog-group { margin-top: 14px; }
.reports-catalog-group h3 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  margin: 0 8px 6px;
  text-transform: uppercase;
}
.reports-catalog-item {
  border-radius: 10px;
  color: var(--text);
  display: block;
  font-size: 13px;
  padding: 8px 10px;
  text-decoration: none;
}
.reports-catalog-item:hover { background: var(--teal-soft); }
.reports-catalog-item.active { background: var(--teal); color: var(--white); font-weight: 600; }
.reports-body {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-width: 0;
  padding: 20px;
}
.reports-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.reports-head h2 { margin: 2px 0 4px; }
.reports-head p { color: var(--muted); margin: 0; }
.reports-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 16px;
}
.reports-cards:empty { display: none; }
.reports-card { padding: 14px 16px; }
.reports-card strong { font-size: 20px; }
.reports-card p { margin: 4px 0 0; }
.reports-card--warn { border-color: var(--gold); background: var(--gold-soft); }
.reports-filters {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.reports-filters .store-field { min-width: 150px; }
.reports-filters .store-field[hidden] { display: none; }
.reports-search { flex: 1 1 200px; }
.reports-filter-actions { display: inline-flex; gap: 8px; }
.reports-table-wrap { max-height: calc(100vh - 220px); overflow: auto; }
.reports-table th, .reports-table td { white-space: nowrap; word-break: normal; padding: 10px 12px; }
.reports-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.reports-table thead th { background: var(--white); }
.reports-sort {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.reports-sort.active { color: var(--teal); }
.reports-table tfoot td {
  background: var(--teal-soft);
  border-top: 2px solid var(--teal);
  bottom: 0;
  font-weight: 700;
  position: sticky;
}
.reports-empty { color: var(--muted); padding: 24px; text-align: center; }
.report-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}
.report-badge--ok { background: var(--teal-soft); color: var(--teal); }
.report-badge--soon { background: var(--gold-soft); color: #8a5a00; }
.report-badge--warn { background: var(--red-soft); color: var(--red); }
.report-overdue { color: var(--red); font-weight: 700; }
.reports-pager {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
}
.reports-pager-buttons { align-items: center; display: inline-flex; gap: 10px; }
@media (max-width: 900px) {
  .reports-layout { grid-template-columns: 1fr; }
  .reports-catalog { max-height: none; position: static; }
  .reports-head { flex-direction: column; }
}
.mapping-panel .channel-strip.mapping-panel-list {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
.mapping-panel .channel-strip > div:not(.outbox-row):not(.outbox-empty) {
  align-items: center;
  background: #f8faf9;
  border: 1px solid #dce8e5;
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 40px 1fr auto;
  padding: 14px 16px;
}
.outbox-empty {
  align-items: center;
  background: #fff;
  border: 1px dashed #dce8e5;
  border-radius: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: 48px 1fr;
  padding: 20px 18px;
}
.outbox-empty__text strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}
.outbox-empty__text p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin: 0;
}
.outbox-empty__text b {
  color: var(--teal);
  font-weight: 800;
}
.mapping-panel .channel-strip .outbox-row {
  align-items: stretch;
  background: #fff;
  border: 1px solid #dce8e5;
  border-radius: 14px;
  display: grid;
  gap: 14px 16px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 16px 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mapping-panel .channel-strip .outbox-row:hover {
  border-color: #c5dbd6;
  box-shadow: 0 4px 14px rgba(23, 63, 59, 0.06);
}
.mapping-panel .channel-strip .outbox-row--failed {
  background: linear-gradient(180deg, #fffaf9 0%, #fff 40%);
  border-color: #ecd4d1;
}
.mapping-panel .channel-strip .outbox-row--sent {
  opacity: 0.92;
}
.mapping-panel .channel-strip .outbox-row .channel-icon {
  align-self: start;
  height: 48px;
  width: 48px;
}
.outbox-row__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.outbox-row__head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: space-between;
}
.outbox-row__title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}
.outbox-row__head .status-pill {
  font-size: 9px;
  letter-spacing: 0.05em;
  padding: 5px 9px;
  text-transform: uppercase;
}
.outbox-row__subject {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outbox-row__recipient {
  align-items: baseline;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  gap: 6px;
  line-height: 1.4;
  margin: 0;
  word-break: break-all;
}
.outbox-row__fields {
  display: grid;
  gap: 8px;
}
.outbox-row__fields--readonly {
  gap: 4px;
}
.outbox-field {
  display: grid;
  gap: 4px;
}
.outbox-input {
  background: #f7faf9;
  border: 1px solid #dce8e5;
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  padding: 8px 10px;
  width: 100%;
}
.outbox-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(31, 116, 110, 0.12);
  outline: 0;
}
.outbox-input::placeholder {
  color: #9aa8a4;
}
.outbox-row__label {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.outbox-row__actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
}
.mapping-panel .channel-strip .outbox-row .po-action-btn {
  font-size: 11px;
  min-width: 96px;
  padding: 9px 14px;
  justify-content: center;
}
.mapping-panel .channel-strip .outbox-row.action-hint-pulse {
  animation: action-hint-pulse 1.05s ease-in-out 4;
  border-color: rgba(31, 116, 110, 0.45);
  box-shadow: 0 0 0 2px rgba(31, 116, 110, 0.2);
  position: relative;
  z-index: 1;
}
@media (max-width: 720px) {
  .mapping-panel .channel-strip .outbox-row {
    grid-template-columns: 40px 1fr;
  }
  .mapping-panel .channel-strip .outbox-row .channel-icon {
    height: 40px;
    width: 40px;
  }
  .outbox-row__actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .mapping-panel .channel-strip .outbox-row .po-action-btn {
    width: 100%;
  }
}
.mapping-panel .report-grid { gap: 10px; }
.channel-strip { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.channel-strip > div { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 12px; grid-template-columns: 40px 1fr auto; padding: 15px; }
.channel-icon { align-items: center; border-radius: 10px; display: flex; font-weight: 900; height: 40px; justify-content: center; width: 40px; }.channel-icon.email { background: var(--blue-soft); color: var(--blue); }.channel-icon.whatsapp { background: #e1f4e8; color: #268b50; }
.channel-strip b, .channel-strip small { display: block; }.channel-strip b { font-size: 11px; }.channel-strip small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.channel-strip > div:not(.outbox-row):not(.outbox-empty) button { background: transparent; border: 0; color: var(--teal); font-size: 10px; font-weight: 800; }
.mapping-panel .channel-strip .outbox-row button.po-action-btn {
  background: var(--teal-soft);
  border: 1px solid rgba(31, 116, 110, 0.35);
  color: var(--teal);
}
.mapping-panel .channel-strip .outbox-row button.po-action-btn:hover:not(:disabled) {
  background: #d0ebe6;
  border-color: var(--teal);
  color: var(--ink-2);
}
.mapping-panel .channel-strip .outbox-row button.po-action-btn:disabled {
  background: #f0f2ef;
  border-color: #e2e6e1;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}
.report-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
.report-grid button { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 10px; grid-template-columns: 36px 1fr; padding: 15px; text-align: left; }
.report-grid button:hover { border-color: #bed8d4; box-shadow: var(--shadow); }
.report-grid button > span { align-items: center; background: var(--teal-soft); border-radius: 9px; color: var(--teal); display: flex; font-size: 17px; height: 36px; justify-content: center; width: 36px; }
.report-grid b, .report-grid small { display: block; }
.report-grid b { font-size: 10px; }.report-grid small { color: var(--muted); font-size: 8px; line-height: 1.4; margin-top: 3px; }
.report-grid button > strong { color: var(--teal); font-size: 9px; grid-column: 2; }

/* Store */
.delivery-grid { display: grid; gap: 12px; }
.delivery-card { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 18px; grid-template-columns: 70px 1fr auto; padding: 15px 18px; }
.delivery-card.due { border-left: 4px solid var(--gold); }
.delivery-time { border-right: 1px solid var(--line); }.delivery-time strong, .delivery-time small { display: block; }.delivery-time strong { color: var(--ink); font-size: 17px; }.delivery-time small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.delivery-main h3 { display: inline; font-size: 13px; margin: 0 6px 0 10px; }.delivery-main p { color: var(--muted); display: inline; font-size: 10px; }.delivery-meta { display: flex; gap: 16px; margin-top: 8px; }.delivery-meta span { color: var(--muted); font-size: 9px; }
.stock-alerts { display: grid; gap: 6px; }
.stock-alerts > div { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 10px; grid-template-columns: 37px 1fr auto 20px; padding: 9px 0; }.stock-alerts > div:last-child { border-bottom: 0; }
.material-chip { align-items: center; background: var(--gold-soft); border-radius: 8px; color: #956317; display: flex; font-size: 8px; font-weight: 900; height: 34px; justify-content: center; width: 34px; }.material-chip.fabric-chip { background: var(--teal-soft); color: var(--teal); }
.stock-alerts b, .stock-alerts small { display: block; }.stock-alerts b { font-size: 10px; }.stock-alerts small { color: var(--muted); font-size: 9px; margin-top: 3px; }.stock-alerts > div > strong { color: var(--red); font-size: 10px; }.stock-alerts button { background: transparent; border: 0; color: var(--teal); }
.quick-actions { display: grid; gap: 5px; }.quick-actions .panel-head { margin-bottom: 5px; }.quick-actions > button { align-items: center; background: transparent; border: 0; border-radius: 9px; display: grid; gap: 10px; grid-template-columns: 34px 1fr auto; padding: 9px; text-align: left; }.quick-actions > button:hover { background: #f5f7f4; }.quick-actions > button > span { align-items: center; background: var(--teal-soft); border-radius: 8px; color: var(--teal); display: flex; font-size: 17px; height: 34px; justify-content: center; }.quick-actions b, .quick-actions small { display: block; }.quick-actions b { font-size: 10px; }.quick-actions small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.fabric-metrics { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); margin-bottom: 13px; }
.fabric-metrics > div { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 13px; display: flex; gap: 10px; padding: 13px; }.fabric-metrics > div > span { align-items: center; background: var(--teal-soft); border-radius: 9px; color: var(--teal); display: flex; height: 34px; justify-content: center; width: 34px; }.fabric-metrics p { margin: 0; }.fabric-metrics b, .fabric-metrics small { display: block; }.fabric-metrics b { color: var(--ink); font-size: 15px; }.fabric-metrics small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.colour-dot { border: 1px solid #d0d4cf; border-radius: 50%; display: inline-block; height: 10px; margin-right: 6px; vertical-align: -1px; width: 10px; }
.movement-list { padding: 6px 20px; }.movement-list > div { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: 34px 1fr 70px 70px; padding: 13px 0; }.movement-list > div:last-child { border: 0; }.move-icon { align-items: center; border-radius: 8px; display: flex; font-weight: 900; height: 34px; justify-content: center; width: 34px; }.move-icon.in { background: var(--teal-soft); color: var(--teal); }.move-icon.out { background: var(--blue-soft); color: var(--blue); }.move-icon.hold { background: var(--red-soft); color: var(--red); }.movement-list b, .movement-list small { display: block; }.movement-list b { font-size: 10px; }.movement-list small, .movement-list time { color: var(--muted); font-size: 9px; }.movement-list > div > strong { font-size: 9px; }

/* Modal, toast, footer */
.modal { border: 0; border-radius: 20px; box-shadow: 0 30px 80px rgba(12,34,31,.35); max-width: 520px; padding: 0; width: calc(100% - 30px); }.modal::backdrop { background: rgba(19,48,45,.68); backdrop-filter: blur(4px); }.modal form { padding: 24px; }.modal-head { align-items: flex-start; display: flex; justify-content: space-between; }.modal-head h2 { color: var(--ink); font-size: 18px; margin: 0 0 6px; }.modal-sub { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0 0 16px; }.modal label { color: var(--text); display: block; font-size: 10px; font-weight: 800; margin-bottom: 13px; }.modal input, .modal select, .modal textarea { background: #f7f8f5; border: 1px solid var(--line); border-radius: 8px; color: var(--text); display: block; font-size: 12px; margin-top: 6px; outline: 0; padding: 10px; width: 100%; }.modal textarea { min-height: 88px; resize: vertical; }.bom-upload-dialog {
  border: 0;
  max-width: 420px;
  padding: 0;
  width: calc(100% - 32px);
}
.bom-upload-dialog::backdrop {
  background: rgba(19, 48, 45, 0.72);
  backdrop-filter: blur(5px);
}
.bom-upload-dialog-inner {
  padding: 28px 26px 26px;
  text-align: center;
}
.bom-upload-dialog h2 {
  color: var(--ink);
  font-size: 18px;
  margin: 0 0 8px;
}
.bom-upload-filename {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
  word-break: break-word;
}
.bom-upload-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
.bom-upload-status--error {
  color: var(--red);
  font-weight: 700;
}
.bom-upload-dialog[data-state="error"] .bom-upload-spinner {
  display: none;
}
.bom-upload-spinner {
  animation: bom-upload-spin 0.85s linear infinite;
  border: 3px solid var(--teal-soft);
  border-radius: 50%;
  border-top-color: var(--teal);
  height: 48px;
  margin: 0 auto 18px;
  width: 48px;
}
@keyframes bom-upload-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bom-upload-spinner { animation: none; border-top-color: var(--teal-soft); opacity: 0.85; }
}
.report-admin-dialog .report-field { margin-bottom: 14px; }.report-admin-dialog select { font-size: 13px; padding: 11px 10px; }.form-grid { display: grid; gap: 12px; grid-template-columns: 2fr 1fr; }.modal-note { background: var(--gold-soft); border-radius: 9px; color: #755112; font-size: 9px; line-height: 1.5; padding: 10px; }.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.app-alert-dialog form { padding: 22px 22px 20px; text-align: center; }
.app-alert-dialog h2 { color: var(--ink); font-size: 17px; margin: 0 0 10px; text-align: center; }
.app-alert-message { color: var(--text); font-size: 12px; line-height: 1.55; margin: 0 auto 18px; max-width: 36em; text-align: center; white-space: pre-line; }
.app-alert-icon { border-radius: 50%; height: 44px; margin: 0 auto 14px; width: 44px; }
.app-alert-dialog[data-tone="error"] .app-alert-icon { background: var(--red-soft); box-shadow: inset 0 0 0 2px rgba(196, 58, 58, .25); }
.app-alert-dialog[data-tone="error"] .app-alert-icon::after { color: var(--red); content: "!"; display: block; font-size: 22px; font-weight: 900; line-height: 44px; }
.app-alert-dialog[data-tone="info"] .app-alert-icon { background: var(--blue-soft); box-shadow: inset 0 0 0 2px rgba(45, 98, 168, .2); }
.app-alert-dialog[data-tone="info"] .app-alert-icon::after { color: var(--blue); content: "i"; display: block; font-size: 20px; font-weight: 900; line-height: 44px; }
.app-alert-dialog[data-tone="success"] .app-alert-icon { background: var(--teal-soft); box-shadow: inset 0 0 0 2px rgba(26, 107, 101, .28); }
.app-alert-dialog[data-tone="success"] .app-alert-icon::after { color: var(--teal); content: "✓"; display: block; font-size: 22px; font-weight: 900; line-height: 44px; }
.app-alert-actions { flex-wrap: wrap; justify-content: center; }
#bom-review { scroll-margin-top: calc(var(--topbar-sticky-height, 84px) + 58px); }
.mapping-actions.action-hint-container { background: linear-gradient(180deg, rgba(31, 116, 110, .06), transparent); border-radius: 12px; margin-inline: -6px; padding: 12px 6px 6px; transition: background .35s ease; }
@keyframes action-hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 116, 110, .45); transform: translateY(0); }
  50% { box-shadow: 0 0 0 14px rgba(31, 116, 110, 0); transform: translateY(-1px); }
}
.primary-button.action-hint-pulse { animation: action-hint-pulse 1.05s ease-in-out 4; outline: 2px solid rgba(31, 116, 110, .35); outline-offset: 3px; position: relative; z-index: 1; }
.po-action-btn.action-hint-pulse { animation: action-hint-pulse 1.05s ease-in-out 5; outline: 2px solid rgba(31, 116, 110, .55); outline-offset: 3px; position: relative; z-index: 2; }
.secondary-button.action-hint-pulse { animation: action-hint-pulse 1.05s ease-in-out 5; outline: 2px solid rgba(31, 116, 110, .45); outline-offset: 3px; }
.mapping-panel .table-wrap.action-hint-pulse {
  animation: action-hint-pulse 1.05s ease-in-out 4;
  border-radius: 12px;
  outline: 2px solid rgba(196, 58, 58, .35);
  outline-offset: 2px;
}
.bom-toolbar.action-hint-container {
  background: linear-gradient(180deg, rgba(31, 116, 110, .08), transparent);
  border-radius: 12px;
  padding: 4px 6px;
  transition: background .35s ease;
}
@keyframes upload-brand-hint-pop {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 116, 110, .5); transform: scale(1); }
  50% { box-shadow: 0 10px 28px rgba(31, 116, 110, .35); transform: scale(1.05); }
}
input.action-hint-pulse,
select.action-hint-pulse,
textarea.action-hint-pulse {
  animation: upload-brand-hint-pop 1.1s ease-in-out 5;
  outline: 3px solid rgba(31, 116, 110, .45);
  outline-offset: 3px;
  position: relative;
  z-index: 3;
}
.bom-toolbar .primary-button.action-hint-pulse {
  animation: upload-brand-hint-pop 1.1s ease-in-out 5;
  outline: 3px solid rgba(31, 116, 110, .45);
  outline-offset: 4px;
  position: relative;
  z-index: 3;
}
@media (max-width: 700px) {
  #bom-review { scroll-margin-top: 72px; }
  .mapping-actions.action-hint-container { margin-inline: 0; padding-inline: 0; }
  .primary-button.action-hint-pulse { animation-duration: .95s; }
}
.toast { background: var(--ink); border-radius: 999px; bottom: 22px; box-shadow: 0 16px 40px rgba(16, 44, 41, .28); color: #fff; font-size: 13px; left: 50%; opacity: 0; padding: 12px 18px; pointer-events: none; position: fixed; transform: translate(-50%, 20px); transition: .2s; z-index: 100; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.app-footer { border-top: 1px solid rgba(20, 56, 52, .08); color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; margin: 45px auto 0; max-width: 1450px; padding: 18px 0 28px; }

@media (min-width: 1500px) {
  :root { --page-pad: 42px; }
  .app-shell { grid-template-columns: 268px minmax(0, 1fr); }
  .main-content { padding: 0 var(--page-pad) 12px; }
}

@media (max-width: 1000px) {
  :root { --topbar-sticky-height: 76px; }
  .section-tabs { margin-bottom: 16px; top: var(--topbar-sticky-height); }
  .side-nav a[data-nav-tip]::after { display: none; }
  .app-shell { display: block; }
  .sidebar { box-shadow: 20px 0 60px rgba(0,0,0,.25); left: -260px; position: fixed; transition: left .2s; width: 240px; }
  .sidebar.open { left: 0; }
  .menu-button { display: inline-flex; margin-right: 8px; }
  .topbar { justify-content: flex-start; }
  .topbar-actions { margin-left: auto; }
  .dashboard-grid.two-one, .dashboard-grid.half-half { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .login-shell .studio-word { height: 78px; }
  .login-shell .product-lockup { align-items: flex-start; flex-wrap: wrap; }
  .login-shell .product-name { font-size: 32px; }
  .login-shell .product-tag { font-size: 13px; }
  .login-shell .landing-copy h1 { font-size: 18px; }
  .landing-shell { padding: 30px 18px 22px; }
  .landing-copy .brand-lockup { margin-bottom: 48px; }
  .landing-copy h1 { font-size: 40px; }
  .landing-lead { font-size: 16px; }
  .role-grid { grid-template-columns: 1fr; margin-top: 36px; }
  .landing-footer { align-items: flex-start; flex-direction: column; gap: 6px; }
  :root { --page-pad: 14px; }
  .main-content { padding: 0 var(--page-pad); }
  :root { --topbar-sticky-height: 72px; }
  .topbar { height: auto; min-height: var(--topbar-sticky-height); }
  .topbar h1 { font-size: 18px; }
  .topbar .eyebrow { font-size: 9px; }
  .date-chip { display: none; }
  .section-heading { align-items: flex-start; gap: 12px; }
  .section-heading h2 { font-size: 20px; }
  .section-heading > button { flex-shrink: 0; }
  .bom-review-head-row,
  .section-page-head-row { align-items: flex-start; flex-direction: column; }
  .bom-review-head-text h2,
  .section-page-head-text h2 { font-size: 20px; }
  .bom-toolbar { justify-content: flex-start; width: 100%; }
  .kpi-grid { gap: 9px; }
  .mgmt-kpi-grid { grid-template-columns: 1fr; }
  .mgmt-chart { gap: 6px; }
  .kpi-card { padding: 14px; }
  .kpi-card > strong { font-size: 23px; }
  .dashboard-grid { gap: 12px; }
  .panel { padding: 16px; }
  .progress-row { grid-template-columns: 125px 1fr 30px; }
  .fabric-grid, .channel-strip { grid-template-columns: 1fr; }
  .inventory-coverage, .report-grid { grid-template-columns: 1fr; }
  .fabric-metrics { grid-template-columns: 1fr 1fr; }
  .delivery-card { gap: 11px; grid-template-columns: 58px 1fr; padding: 13px; }
  .delivery-card > button { grid-column: 2; justify-self: start; }
  .delivery-main h3, .delivery-main p { display: block; margin: 5px 0 0; }
  .stock-alerts > div { grid-template-columns: 35px 1fr auto; }
  .stock-alerts button { display: none; }
  .movement-list > div { grid-template-columns: 34px 1fr auto; }
  .movement-list > div > strong { display: none; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .segmented { align-self: flex-start; }
  .app-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
}

.accounts-list { display: grid; gap: 16px; }
.accounts-invoice-photo { display: block; width: 100%; max-height: 480px; object-fit: contain; margin-top: 12px; border-radius: 8px; background: #f4f1ea; }
.accounts-card { padding: 16px; }
.accounts-card .store-receive-form,
.accounts-card .store-field { margin-top: 12px; }
.accounts-events { margin: 12px 0 0; padding-left: 18px; }
.accounts-events li { margin: 8px 0; }
.barcode-video { width: 100%; max-height: 280px; background: #111; border-radius: 8px; }
.store-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.accounts-vendor { font-size: 18px; margin: 0 0 8px; }
.accounts-facts { display: grid; gap: 8px; margin: 0 0 12px; }
.accounts-facts div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.accounts-facts dt { color: var(--muted); font-size: 12px; }
.accounts-facts dd { margin: 0; text-align: right; }
.accounts-total { font-size: 20px; }
.accounts-phone-nav { display: none; }
.accounts-scan-dialog .dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#barcodeReader { width: 100%; max-width: 420px; margin: 0 auto; }
.accounts-scan-result { color: #1f746e; font-size: 16px; margin: 12px 0 0; }
.accounts-scan-dialog .dialog-actions button { min-height: 48px; }
.accounts-periods { display: grid; gap: 18px; margin-top: 22px; }
.accounts-periods h3 { margin: 0 0 4px; }
.accounts-period-note { color: var(--muted); margin: 0 0 10px; }
.accounts-period-grid { grid-template-columns: repeat(3, 1fr); }
.accounts-period-grid.two { grid-template-columns: repeat(2, 1fr); }
button.kpi-card {
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}
button.kpi-card.is-selected { outline: 2px solid #1f746e; outline-offset: 2px; }
.accounts-custom {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.accounts-custom label { display: grid; font-size: 13px; gap: 4px; }
.accounts-custom input { min-height: 44px; }
.accounts-period-list { display: grid; gap: 10px; }

@media (max-width: 700px) {
  body.accounts-screen .accounts-phone-nav {
    background: #173f3b;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    left: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 40;
  }
  body.accounts-screen .accounts-phone-nav a {
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    padding: 12px 4px;
    text-align: center;
    text-decoration: none;
  }
  body.accounts-screen .accounts-phone-nav a.active { background: rgba(255,255,255,.16); }
  body.accounts-screen .main-content { padding-bottom: 96px; }
  body.accounts-screen .toast { bottom: 88px; }
  body.accounts-screen .app-footer { display: none; }
  body.accounts-screen .kpi-grid,
  body.accounts-screen .accounts-period-grid,
  body.accounts-screen .accounts-period-grid.two { grid-template-columns: 1fr; }
  body.accounts-screen .accounts-custom { display: grid; }
  body.accounts-screen .accounts-custom .secondary-button { min-height: 48px; width: 100%; }
  body.accounts-screen .accounts-card .store-receive-actions { display: grid; gap: 8px; }
  body.accounts-screen .accounts-card .primary-button,
  body.accounts-screen .accounts-card .secondary-button { min-height: 48px; width: 100%; }
  body.accounts-screen .store-input { font-size: 18px; min-height: 48px; }
  body.accounts-screen .accounts-total { font-size: 24px; }
  body.accounts-screen .accounts-scan-dialog {
    border: 0;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    width: 100%;
  }
  body.accounts-screen .barcode-video { max-height: none; height: 52vh; object-fit: cover; }
}

@media (max-width: 430px) {
  .topbar-actions { gap: 6px; }
  .notification-button { display: none; }
  .demo-banner span { line-height: 1.4; }
  .kpi-card p { min-height: 28px; }
  .progress-row { grid-template-columns: 110px 1fr 28px; gap: 8px; }
  .donut-row { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}

body.admin-screen .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
body.admin-screen .sidebar { padding: 0.5cm 0.5cm 18px; }
body.admin-screen .sidebar-bottom { padding-left: 0; padding-right: 0; }
body.admin-screen .admin-brand {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 22px;
  text-align: center;
  width: 107px;
}
body.admin-screen .admin-brand-logo {
  display: block;
  height: auto;
  width: 107px;
}
body.admin-screen .admin-brand-role {
  color: #e7d3a8;
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  margin-top: 8px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
body.admin-screen .side-nav { margin-top: 18px; }
body.admin-screen .side-nav a span {
  align-items: center;
  display: inline-flex;
  height: 20px;
  justify-content: center;
}
body.admin-screen .side-nav a span svg { display: block; }
body.admin-screen .admin-panel .panel h3 { margin: 0 0 14px; }
body.admin-screen .section-heading { margin-bottom: 12px; }
body.admin-screen .section-heading p { max-width: 42rem; }
body.admin-screen .table-panel .table-wrap { overflow-x: auto; }
.user-directory { width: 100%; min-width: 0; table-layout: fixed; }
.user-directory th,
.user-directory td { padding: 14px 12px; vertical-align: middle; white-space: nowrap; width: calc(100% / 7); overflow: hidden; text-overflow: ellipsis; }
.user-directory th:nth-child(7),
.user-directory td:nth-child(7) { overflow: visible; text-align: center; white-space: nowrap; }
.user-email-cell {
  color: var(--ink-2);
  display: inline;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.user-directory td[colspan] { color: var(--muted); padding: 28px 16px; text-align: center; }
.user-id { align-items: center; display: flex; gap: 12px; min-width: 0; }
.user-avatar {
  align-items: center;
  background: linear-gradient(145deg, #2ad8ff 0%, #3d7cff 46%, #b44bff 100%);
  border-radius: 12px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 40px;
  font-size: 12px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  letter-spacing: .02em;
  width: 40px;
}
.user-id-copy { min-width: 0; }
.user-name {
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-handle {
  color: var(--ink-2);
  display: inline-block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}
.user-role {
  background: var(--teal-soft);
  border-radius: 999px;
  color: var(--ink-2);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}
.user-home { color: var(--ink-2); font-size: 13px; font-weight: 650; }
.user-row-actions { display: inline-flex; gap: 8px; justify-content: center; }
.user-row-actions .secondary-button { font-size: 12px; padding: 8px 12px; }
#editUserDialog {
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(12, 34, 31, .28);
  color: var(--text);
  font-family: var(--font);
  max-width: calc(100vw - 32px);
  padding: 0;
  width: 720px;
}
#editUserDialog::backdrop { background: rgba(19, 48, 45, .55); }
#editUserDialog form { padding: 26px 26px 20px; }
#editUserDialog .edit-dialog-head { margin-bottom: 18px; }
#editUserDialog h3 { color: var(--ink); font-size: 28px; letter-spacing: -.02em; margin: 0 0 6px; }
#editUserDialog .edit-dialog-head p { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0; }
#editUserDialog .admin-grid { margin-bottom: 8px; }
#editUserDialog menu.dialog-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  list-style: none;
  margin: 18px 0 0;
  padding: 16px 0 0;
}
@media (max-width: 800px) {
  .admin-grid { grid-template-columns: 1fr; }
  body.admin-screen .app-shell { grid-template-columns: minmax(0, 1fr); }
}

/* —— Global UI polish (safe shared look; desk-panel keeps its own accents) —— */
:root {
  --panel-accent: #1a6b65;
}
body[data-page="fabric"] { --panel-accent: #7c3aed; }
body[data-page="trims"] { --panel-accent: #db2777; }
body[data-page="supplier-directory"] { --panel-accent: #2563eb; }
body[data-page="emails"] { --panel-accent: #0891b2; }
body[data-page="pdc"] { --panel-accent: #c8892a; }
body[data-page="dashboard"] { --panel-accent: #1a6b65; }
body.reports-screen { --panel-accent: #0284c7; }
body.accounts-screen { --panel-accent: #0f766e; }
body.admin-screen { --panel-accent: #475569; }

.mapping-panel:not(.desk-panel) {
  background:
    radial-gradient(160px 100px at 100% 0%, color-mix(in srgb, var(--panel-accent) 10%, transparent), transparent 70%),
    linear-gradient(180deg, #fff 0%, #f7faf9 100%);
  border-color: color-mix(in srgb, var(--panel-accent) 18%, rgba(20, 56, 52, .08));
  box-shadow: 0 12px 28px rgba(20, 56, 52, .07);
  overflow: hidden;
  position: relative;
}
.mapping-panel:not(.desk-panel)::before {
  background: linear-gradient(180deg, var(--panel-accent), color-mix(in srgb, var(--panel-accent) 55%, #fff));
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 4px;
}
.mapping-panel-head h3 {
  letter-spacing: -.01em;
}
.section-page-head-text h2 {
  position: relative;
}
.section-page-head-text .eyebrow {
  color: color-mix(in srgb, var(--panel-accent) 75%, var(--gold));
}

.main-content {
  background:
    radial-gradient(900px 420px at 100% -10%, color-mix(in srgb, var(--panel-accent) 7%, transparent), transparent 55%),
    var(--paper, #f4f1ea);
}

.empty-state:not(.desk-empty) {
  background: color-mix(in srgb, var(--panel-accent) 5%, #fff);
  border: 1px dashed color-mix(in srgb, var(--panel-accent) 22%, transparent);
  border-radius: 14px;
  color: var(--muted);
  margin-top: 4px;
  padding: 22px 18px;
}

.mapping-panel .table-wrap,
.mapping-panel .table-wrap--no-scroll {
  border: 1px solid color-mix(in srgb, var(--panel-accent) 12%, var(--line));
  border-radius: 12px;
  overflow: hidden;
}
.mapping-panel .mapping-table thead th {
  background: color-mix(in srgb, var(--panel-accent) 7%, #f3f6f5);
}

.icon-button {
  border-radius: 12px;
}
.icon-button:hover {
  border-color: color-mix(in srgb, var(--panel-accent) 35%, #c5d5d2);
}

.primary-button {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-accent) 88%, #fff), var(--panel-accent));
  border-color: color-mix(in srgb, var(--panel-accent) 70%, #0b3d39);
}
.primary-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--panel-accent) 82%, #000);
}

.modal {
  background:
    radial-gradient(180px 120px at 100% 0%, color-mix(in srgb, var(--panel-accent) 12%, transparent), transparent 70%),
    #fff;
  border: 1px solid color-mix(in srgb, var(--panel-accent) 16%, transparent);
  overflow: hidden;
}
.modal::before {
  background: linear-gradient(90deg, var(--panel-accent), color-mix(in srgb, var(--panel-accent) 45%, #fff));
  content: "";
  display: block;
  height: 4px;
  width: 100%;
}
.modal::backdrop {
  background: rgba(16, 40, 38, .62);
  backdrop-filter: blur(6px);
}
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: color-mix(in srgb, var(--panel-accent) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--panel-accent) 16%, transparent);
}
.modal-note {
  background: color-mix(in srgb, var(--panel-accent) 10%, var(--gold-soft));
  border: 1px solid color-mix(in srgb, var(--panel-accent) 18%, transparent);
  border-radius: 12px;
  color: color-mix(in srgb, var(--panel-accent) 35%, #755112);
  font-size: 11px;
  line-height: 1.5;
  padding: 12px;
}

.app-alert-dialog {
  background:
    radial-gradient(160px 100px at 50% 0%, color-mix(in srgb, var(--panel-accent) 10%, transparent), transparent 65%),
    #fff;
}
.app-alert-dialog[data-tone="error"] {
  --panel-accent: #bd534d;
}
.app-alert-dialog[data-tone="success"] {
  --panel-accent: #1a6b65;
}
.app-alert-dialog[data-tone="info"] {
  --panel-accent: #4d7ca6;
}

.alerts-bell-dialog {
  --panel-accent: #e11d48;
}
.alerts-bell-list .pi-alert {
  margin: 0;
}

.bom-upload-dialog-inner {
  background:
    radial-gradient(140px 90px at 50% 0%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 70%),
    #fff;
}
.bom-upload-spinner {
  border-color: color-mix(in srgb, var(--panel-accent) 18%, #e5f3f1);
  border-top-color: var(--panel-accent);
}

.login-panel {
  background:
    radial-gradient(180px 120px at 100% 0%, rgba(26, 107, 101, .12), transparent 70%),
    rgba(255,255,255,.97);
  border: 1px solid rgba(26, 107, 101, .14);
}
.login-title {
  letter-spacing: -.02em;
}
.login-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(26, 107, 101, .14);
}

.app-footer {
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--panel-accent) 4%, transparent));
  border-top-color: color-mix(in srgb, var(--panel-accent) 12%, rgba(20, 56, 52, .08));
}

/* Hover-only transitions — avoid animating box-shadow/border on first paint (page blink) */
.kpi-card,
.work-choice,
.bom-timeline-card,
.desk-panel,
.mapping-panel:not(.desk-panel) {
  transition: none;
}
.kpi-card:hover,
.work-choice:hover,
.bom-timeline-card:hover,
.desk-panel:hover,
.mapping-panel:not(.desk-panel):hover {
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.pi-alert-bar {
  min-height: 0;
}
.pi-alert-bar:not([hidden]) {
  /* keep layout stable once shown; no enter animation */
  animation: none;
}

#piMapDialog[open] {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 820px);
  width: min(960px, 96vw);
}
#piMapDialog #piMapBody {
  overflow: auto;
}
#piMapDialog menu.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 12px 0 0;
}
.pi-map-delay { max-width: 16rem; margin: 12px 0; }

.mapping-panel .table-wrap.pi-compare-scroll {
  max-height: 28rem;
  overflow: auto;
}
.pdc-kind.segmented { align-self: center; flex-shrink: 0; }
.pdc-kind.segmented button { font-size: 13px; padding: 8px 14px; cursor: pointer; }
.pdc-note-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pdc-track-panel {
  margin-top: 1.25rem;
}
.pdc-note-table {
  table-layout: fixed;
  width: 100%;
}
.mapping-panel .pdc-note-table--prep,
.mapping-panel .pdc-note-table--track { min-width: 0; width: 100%; }
.pdc-note-table--prep col.pdc-col-supplier { width: 13%; }
.pdc-note-table--prep col.pdc-col-material { width: 7%; }
.pdc-note-table--prep col.pdc-col-po { width: 6%; }
.pdc-note-table--prep col.pdc-col-pi { width: 8%; }
.pdc-note-table--prep col.pdc-col-final { width: 13%; }
.pdc-note-table--prep col.pdc-col-amount { width: 9%; }
.pdc-note-table--prep col.pdc-col-delay { width: 12%; }
.pdc-note-table--prep col.pdc-col-date { width: 9%; }
.pdc-note-table--prep col.pdc-col-status { width: 10%; }
.pdc-note-table--prep col.pdc-col-action { width: 13%; }
.pdc-note-table--track col.pdc-col-supplier { width: 14%; }
.pdc-note-table--track col.pdc-col-material { width: 7%; }
.pdc-note-table--track col.pdc-col-po { width: 6%; }
.pdc-note-table--track col.pdc-col-pi { width: 8%; }
.pdc-note-table--track col.pdc-col-amount { width: 10%; }
.pdc-note-table--track col.pdc-col-date { width: 10%; }
.pdc-note-table--track col.pdc-col-cheque { width: 8%; }
.pdc-note-table--track col.pdc-col-awb { width: 23%; }
.pdc-note-table--track col.pdc-col-status { width: 14%; }
.pdc-note-table--prep,
.pdc-note-table--track { min-width: 0; }
.pdc-note-table--accounts-sent { min-width: 920px; }
.pdc-note-table--accounts-pdc { min-width: 980px; }
.pdc-note-table--accounts-pdc .pdc-col-action { width: 12.5rem; }
.pdc-note-table--accounts-period { min-width: 860px; }
.accounts-period-detail { margin-top: 8px; }
.accounts-period-detail .pdc-note-wrap { margin-top: 10px; }
.pdc-note-table th,
.pdc-note-table td {
  padding: 10px 8px;
  vertical-align: middle;
  word-break: normal;
  overflow-wrap: normal;
}
.pdc-note-table--prep th,
.pdc-note-table--prep td {
  padding: 10px 6px;
}
.pdc-note-table .pdc-col-supplier { width: auto; min-width: 7rem; }
.pdc-note-table .pdc-col-material { white-space: nowrap; width: 4.75rem; }
.pdc-note-table .pdc-col-po,
.pdc-note-table .pdc-col-pi { white-space: nowrap; width: 4.25rem; }
.pdc-note-table .pdc-col-final { width: 11rem; }
.pdc-note-table .pdc-col-amount {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  width: 6.75rem;
}
.pdc-note-table .pdc-col-delay {
  box-sizing: border-box;
  overflow: hidden;
  padding-right: 10px;
  white-space: nowrap;
  width: 8.75rem;
}
.pdc-note-table .pdc-col-date {
  padding-left: 10px;
  white-space: nowrap;
  width: 6.5rem;
}
.pdc-note-table .pdc-col-cheque {
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  width: 7rem;
}
.pdc-note-table .pdc-col-awb { white-space: nowrap; width: 14rem; }
.pdc-note-table--track .pdc-col-awb { width: 15rem; }
.pdc-note-table .pdc-col-status {
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
  width: 7.25rem;
}
.pdc-note-table--prep .pdc-col-status { width: 7rem; }
.pdc-progress {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  max-width: 7rem;
}
.pdc-note-table--prep .pdc-progress,
.pdc-note-table--track .pdc-progress {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
.pdc-progress--next { color: #8a4b12; }
.pdc-progress--wait { color: #1f5f8a; }
.pdc-progress--done { color: #1f6b4a; }
.pdc-progress--alert { color: #9a3412; }
.pdc-note-table .pdc-col-action {
  white-space: normal;
  width: 9.5rem;
}
.pdc-note-table .pdc-col-action .primary-button,
.pdc-note-table .pdc-col-action .secondary-button {
  display: inline-flex;
  margin: 0 0 6px;
  white-space: nowrap;
}
.pdc-action-stack {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pdc-note-table .pdc-action-stack .primary-button,
.pdc-note-table .pdc-action-stack .secondary-button {
  box-sizing: border-box;
  justify-content: center;
  line-height: 1.25;
  margin: 0;
  text-align: center;
  white-space: normal;
  width: 100%;
}
.pdc-note-table .pdc-col-action .muted-cell {
  display: block;
  margin: 0;
}
.pdc-note-table--prep .pdc-col-supplier,
.pdc-note-table--track .pdc-col-supplier,
.pdc-note-table--prep .pdc-col-status,
.pdc-note-table--track .pdc-col-status,
.pdc-note-table--prep .pdc-col-action,
.pdc-note-table--track .pdc-col-awb,
.pdc-note-table--prep .pdc-col-delay {
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  width: auto;
}
.pdc-note-table--track .pdc-awb-form {
  flex-wrap: wrap;
  max-width: 100%;
  width: 100%;
}
.pdc-note-table--track .pdc-awb-form .store-input {
  flex: 1 1 6.5rem;
  max-width: 100%;
  min-width: 0;
  width: auto;
}
.pdc-note-table--prep .pdc-delay-form {
  flex-wrap: wrap;
  max-width: 100%;
}
.pdc-final-pi {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pdc-final-pi__pick {
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  margin: 0;
  padding: 6px 10px;
  position: relative;
  white-space: nowrap;
}
.pdc-final-pi__file {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
.pdc-final-pi__name,
.pdc-final-pi__empty {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdc-delay-form,
.pdc-awb-form {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  max-width: 100%;
}
.pdc-delay-form .store-input {
  box-sizing: border-box;
  flex: 0 0 3.75rem;
  margin: 0;
  min-height: 34px;
  padding-left: 8px;
  padding-right: 8px;
  width: 3.75rem;
}
.pdc-delay-form .secondary-button {
  flex: 0 0 auto;
  font-size: 12px;
  margin: 0;
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}
.pdc-awb-form .store-input {
  box-sizing: border-box;
  flex: 1 1 7rem;
  margin: 0;
  max-width: 9rem;
  min-height: 34px;
  min-width: 6rem;
  width: 7.5rem;
}
.pdc-awb-form .primary-button,
.pdc-awb-form .secondary-button {
  flex: 0 0 auto;
  font-size: 12px;
  margin: 0;
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}
td .muted-cell { display: block; font-size: 12px; }

.mgmt-jump {
  background: color-mix(in srgb, var(--paper) 92%, white);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px 0 12px;
  position: sticky;
  top: 0;
  z-index: 4;
}
.mgmt-jump a {
  background: #fff;
  border: 1px solid rgba(20, 56, 52, .12);
  border-radius: 999px;
  color: var(--ink, #173f3b);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  text-decoration: none;
}
.mgmt-jump a:hover { background: var(--teal-soft); }
.mgmt-chapter { margin-top: 28px; }
.mgmt-chapter:first-of-type { margin-top: 8px; }
.mgmt-attention { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mgmt-attention-card {
  background: #fff;
  border: 1px solid rgba(20, 56, 52, .08);
  border-left: 4px solid var(--gold, #c8892a);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}
.mgmt-attention-card b { font-size: 14px; }
.mgmt-attention-card span { color: var(--muted); font-size: 13px; }
.mgmt-windows { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 16px; }
.mgmt-window {
  background: #fff;
  border: 1px solid rgba(20, 56, 52, .1);
  border-radius: 14px;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
}
.mgmt-window b { font-size: 16px; }
.mgmt-window span { color: var(--muted); font-size: 12px; font-weight: 700; }
.mgmt-window.is-selected { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.mgmt-chapter .table-wrap { overflow-x: auto; }
.mgmt-pipeline { min-width: 980px; }
.mgmt-pipeline td, .mgmt-pipeline th { white-space: nowrap; }
.mgmt-pipeline .num, .data-table .num { font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 1100px) {
  .mgmt-windows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .mgmt-windows { grid-template-columns: 1fr; }
}
