/* OCTAPRINT Job Tracker — single stylesheet.
   Desktop-only (min 1280px). No @media queries. No animations or transitions.
   Brand: navy #243880, yellow #f4ea29. Font: DM Sans 400/500/600. */

/* =========================================================
   Tokens
   ========================================================= */
:root {
  --navy:           #243880;
  --navy-deep:      #1a2a64;
  --navy-ink:       #0f1a44;
  --yellow:         #f4ea29;
  --yellow-deep:    #e6dc1a;

  --bg:             #f5f6fa;
  --surface:        #ffffff;
  --surface-alt:    #f8fafc;
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;

  --text:           #0f172a;
  --text-muted:     #475569;
  --text-faint:     #94a3b8;

  --danger:         #f04438;
  --danger-bg:      #fef2f2;
  --warning:        #f97316;
  --warning-bg:     #fff7ed;
  --success:        #12b76a;
  --info:           #2e90fa;

  --radius:         6px;
  --radius-lg:      10px;
  --shadow-sm:      0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow:         0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg:      0 12px 32px rgba(15, 23, 42, 0.18);

  --topbar-h:       56px;
  --sidebar-w:      320px;
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { min-width: 1280px; background: #f5f6fa; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================================
   Brand mark — used in topbar, login, empty state
   "O" rendered as a yellow tile, rest of the wordmark in navy.
   ========================================================= */
.brand-mark {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy);
  user-select: none;
}
.brand-mark__square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--yellow);
  color: var(--navy-ink);
  font-weight: 600;
  border-radius: 4px;
  font-size: 14px;
  margin-right: 1px;
}
.brand-mark__rest { font-size: 16px; }
.brand-mark--lg .brand-mark__square { width: 36px; height: 36px; font-size: 22px; border-radius: 6px; }
.brand-mark--lg .brand-mark__rest   { font-size: 22px; }
.brand-mark--xl .brand-mark__square { width: 56px; height: 56px; font-size: 36px; border-radius: 8px; }
.brand-mark--xl .brand-mark__rest   { font-size: 32px; }

/* =========================================================
   Login page
   ========================================================= */
.login-body {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--surface);
  width: 380px;
  padding: 36px 32px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.login-subtitle {
  margin: 8px 0 28px;
  color: var(--text-muted);
  font-size: 14px;
}
.field {
  display: block;
  margin-bottom: 16px;
}
.field__label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(36, 56, 128, 0.12); }
.form-error {
  margin: 8px 0 16px;
  padding: 10px 12px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 13px;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn:hover { background: var(--surface-alt); }
.btn--primary {
  background: var(--navy);
  color: var(--yellow);
  border-color: var(--navy);
  font-weight: 600;
}
.btn--primary:hover { background: var(--navy-deep); }
.btn--block { width: 100%; padding: 12px 14px; font-size: 14px; }
.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
}

/* The dominant sidebar action — yellow, full width, navy text. */
.btn--newjob {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--yellow);
  color: var(--navy-ink);
  border: 1px solid var(--yellow-deep);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.btn--newjob:hover { background: var(--yellow-deep); }

/* =========================================================
   Top bar
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.topbar .brand-mark { margin-right: 0; }
.topbar__divider {
  width: 1px;
  height: 22px;
  background: var(--border-strong);
  margin: 0 14px;
}
.topbar__product {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 32px;
}
.topbar__link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.topbar__link:hover { background: var(--surface-alt); text-decoration: none; }
.topbar__link.is-active { color: var(--navy); background: rgba(36, 56, 128, 0.08); }
.topbar__user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar__email { font-size: 13px; color: var(--text-muted); }
.topbar__logout {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
}
.topbar__logout:hover { background: var(--surface-alt); }

/* =========================================================
   Layout: fixed sidebar + flexible main panel
   ========================================================= */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h));
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  height: calc(100vh - var(--topbar-h));
  position: sticky;
  top: var(--topbar-h);
}
.sidebar__search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
.sidebar__search:focus { border-color: var(--navy); }
.sidebar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.filter-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.filter-pill.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.job-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.main-panel {
  padding: 24px;
  min-width: 0; /* needed for grid children with overflow */
}

/* =========================================================
   Empty state
   ========================================================= */
.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-faint);
}
.empty-state__line {
  font-size: 14px;
  margin: 0;
  color: var(--text-muted);
}

/* =========================================================
   Status colour pills (reusable, used everywhere)
   ========================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  background: var(--text-muted);
}

/* Overall job statuses */
.status-received       { background: #2e90fa; color: #fff; }
.status-submitted      { background: #f79009; color: #fff; }
.status-in-production  { background: #7c3aed; color: #fff; }
.status-ready          { background: #0e9384; color: #fff; }
.status-collected      { background: #4f46e5; color: #fff; }
.status-fulfilled      { background: #12b76a; color: #fff; }
.status-on-hold        { background: #f04438; color: #fff; }
.status-cancelled      { background: #667085; color: #fff; }

/* Per-item production statuses */
.prod-to-confirm       { background: #e2e8f0; color: #243880; }
.prod-payment-made     { background: #06b6d4; color: #ffffff; }
.prod-reviewing        { background: #f4ea29; color: #243880; }
.prod-printing         { background: #22c55e; color: #ffffff; }
.prod-preparing        { background: #86efac; color: #243880; }
.prod-ready-for-pickup { background: #f97316; color: #ffffff; }
.prod-collected        { background: #7c3aed; color: #ffffff; }
.prod-on-hold          { background: #f04438; color: #ffffff; }
.prod-cancelled        { background: #667085; color: #ffffff; }

/* Tier badges — bold, screaming where it matters. */
.tier {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tier-standard { background: #e2e8f0; color: #243880; }
.tier-urgent   { background: #f97316; color: #ffffff; font-weight: 600; }
.tier-express  { background: #f04438; color: #ffffff; font-weight: 600; }

/* =========================================================
   Job card (sidebar)
   ========================================================= */
.job-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.job-card:hover { border-color: var(--border-strong); }
.job-card.is-selected { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.job-card__id {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.job-card__customer { font-size: 13px; color: var(--text); }
.job-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}
.job-card__ready {
  font-size: 12px;
  color: var(--text-muted);
}
.job-card__ready.is-today    { color: var(--warning); font-weight: 500; }
.job-card__ready.is-overdue  { color: var(--danger); font-weight: 600; }

/* =========================================================
   Toast (Phase 7+ behaviour, styles ready now)
   ========================================================= */
.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}
.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.toast--success { border-left: 4px solid var(--success); }
.toast--error   { border-left: 4px solid var(--danger); }

/* =========================================================
   Modal (custom confirm — Phase 7+)
   ========================================================= */
.modal-host {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 420px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal__title { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.modal__body  { font-size: 14px; color: var(--text-muted); margin: 0 0 20px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* =========================================================
   Lightbox (artwork preview — Phase 7+)
   ========================================================= */
.lightbox-host {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-host img { max-width: 90vw; max-height: 90vh; box-shadow: var(--shadow-lg); }

/* =========================================================
   Forms (used in Phase 7 detail/edit views)
   ========================================================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.form-section__title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.field__input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  outline: none;
}
.field__input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(36, 56, 128, 0.12); }
textarea.field__input { resize: vertical; min-height: 56px; }

/* Sidebar list extras */
.job-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.job-card__dot { color: var(--text-faint); }
.job-card__tracking-pending {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
}
.field__input--filter {
  font-size: 12px;
  padding: 4px 6px;
  margin-bottom: 4px;
}

/* Invoice import zone (new-job only) */
.invoice-import {
  background: #fffbe6;
  border: 1px solid #fde68a;
}
.invoice-import__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.invoice-import__hint {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.invoice-import__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.invoice-import__sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 720px;
}
.invoice-import__summary {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.invoice-import__summary--loading {
  background: #e2e8f0;
  color: var(--text-muted);
  font-style: italic;
}
.invoice-import__summary--ok {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}
.invoice-import__summary--error {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger);
}
.invoice-import__summary__line1 {
  font-weight: 600;
}
.invoice-import__summary__line2 {
  color: var(--text);
}
.item-form__warn {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 10px;
}
.item-form__warn--bad {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger);
}
.item-form__warn--low {
  background: var(--warning-bg);
  border: 1px solid #fed7aa;
  color: var(--warning);
}

/* Fix 2: searchable product dropdown */
.product-search {
  position: relative;
}
.product-search__input {
  width: 100%;
}
.product-search__list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin: 2px 0 0 0;
  padding: 4px 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.product-search__item {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.product-search__item:hover {
  background: var(--surface-alt);
}
.product-search__empty {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.kv__sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--text-muted); }
.job-list__empty {
  padding: 24px 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Detail header */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.detail-header__id {
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.detail-header__customer {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-top: 2px;
}
.detail-header__sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.detail-header__right { display: flex; gap: 8px; }
.kv__sep { color: var(--text-faint); }
.detail-loading { padding: 24px; color: var(--text-muted); }

/* Status timeline */
.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.timeline__step {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.55;
}
.timeline__step.is-active { opacity: 1; border-color: var(--navy-ink); }
.timeline__step:hover { opacity: 1; }

/* Key-value rows used in detail + item cards */
.kv__k {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.kv__v { display: block; font-size: 14px; color: var(--text); }
.kv__v.is-today { color: var(--warning); font-weight: 600; }
.kv__v.is-overdue { color: var(--danger); font-weight: 600; }

/* Item card (detail view) */
.item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  background: var(--surface-alt);
}
.item-card__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.item-card__num {
  font-weight: 600; color: var(--navy); margin-right: 8px;
}
.item-card__product { margin-bottom: 12px; font-size: 14px; }
.item-card__variant, .item-card__size, .item-card__qty { color: var(--text-muted); }
.item-card__grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px; margin-bottom: 12px;
}
.item-card__remarks {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.item-prod-select {
  padding: 4px 8px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); font: inherit;
}

/* Artwork blocks (used in detail + form) */
.item-artwork {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
}
.item-artwork__meta { display: flex; flex-direction: column; gap: 8px; }
.item-artwork__name { font-size: 13px; color: var(--text); }
.item-artwork__actions { display: flex; gap: 6px; }
.artwork-thumb {
  width: 96px; height: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff center / cover no-repeat;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted); font-weight: 600;
}
.artwork-thumb--empty { background: var(--surface-alt); cursor: default; }
.artwork-thumb--pdf { background: #ef4444; color: #fff; }
.btn--sm { padding: 4px 10px; font-size: 12px; }

/* Form: ready preview + cut-off warning + items */
.item-form__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ready-block {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ready-block__label {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 2px;
}
.ready-preview { font-size: 14px; font-weight: 500; color: var(--text); }
.ready-preview.is-empty { font-weight: 400; color: var(--text-muted); }
.cutoff-warning {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger);
  border-left: 3px solid var(--danger);
  font-size: 13px;
  font-weight: 500;
}
.form-actions { display: flex; gap: 8px; padding: 0 0 24px; }

/* ========== SETTINGS PAGE ========== */
.settings-header { padding: 0 0 12px; }
.settings-title  { margin: 0; font-size: 22px; font-weight: 600; color: var(--text); }

.settings-tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.settings-tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; font: inherit; font-weight: 500; color: var(--text-muted);
  cursor: pointer; margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.is-active { color: var(--navy); border-bottom-color: var(--navy); }

.settings-subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.settings-subtab {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 12px; font: inherit; font-size: 13px; color: var(--text-muted);
  cursor: pointer;
}
.settings-subtab:hover { color: var(--text); }
.settings-subtab.is-active {
  background: var(--navy); color: #fff; border-color: var(--navy);
}

.settings-body, .settings-subbody { display: block; }

.settings-note {
  font-size: 13px; color: var(--text-muted); margin: 0 0 12px;
}

.settings-row {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 16px;
}
.settings-row .field { flex: 1 1 200px; }

.settings-list { display: block; margin-bottom: 16px; }

.settings-section__h {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  margin: 14px 0 6px;
}

.settings-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 6px; background: var(--surface);
}
.settings-item__main { flex: 1; min-width: 0; }
.settings-item__title { font-weight: 500; color: var(--text); }
.settings-item__sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.settings-item__actions { display: flex; gap: 4px; }
.settings-empty { padding: 12px; color: var(--text-muted); font-size: 13px; }

/* ========== PRODUCT SLIDE-IN PANEL ========== */
.product-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.22s ease-out;
  z-index: 60;
}
.product-panel.is-open { transform: translateX(0); }
.product-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.product-panel__title { margin: 0; font-size: 18px; font-weight: 600; }
.product-panel__close {
  background: transparent; border: 0; font-size: 26px; line-height: 1;
  cursor: pointer; color: var(--text-muted); padding: 0 4px;
}
.product-panel__close:hover { color: var(--text); }
.product-panel__body {
  padding: 16px 20px; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.product-panel__foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border);
}

.field--checkbox {
  flex-direction: row !important; align-items: center; gap: 8px;
}
.field--checkbox .field__label { margin-bottom: 0; }

.reorder-block { display: flex; flex-direction: column; gap: 6px; }
.reorder-block__head {
  display: flex; align-items: center; justify-content: space-between;
}
.reorder-block__head h4 {
  margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
}
.reorder-list { display: flex; flex-direction: column; gap: 4px; }
.reorder-row {
  display: flex; gap: 4px; align-items: center;
}
.reorder-row .field__input { flex: 1; }

/* ========== SUPPLIER DOCS ========== */
.docs-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.docs-list { display: flex; flex-direction: column; gap: 6px; }
.docs-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.docs-row__main { flex: 1; min-width: 0; }
.docs-row__link {
  font-weight: 500; color: var(--navy); text-decoration: none;
}
.docs-row__link:hover { text-decoration: underline; }
.docs-row__meta {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

/* ========== DASHBOARD ========== */
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 18px;
}
.dash-title { font-size: 22px; color: var(--navy); margin: 0; font-weight: 600; }
.dash-head__right { display: flex; align-items: center; gap: 12px; }
.dash-today { font-size: 13px; color: var(--text-muted); }

.dash-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.dash-count {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #94a3b8;
  border-radius: var(--radius);
  padding: 12px 14px;
}
.dash-count__n { font-size: 26px; font-weight: 600; color: var(--text); line-height: 1.1; }
.dash-count__label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.dash-section { margin-bottom: 26px; }
.dash-section__h {
  font-size: 16px; color: var(--navy); margin: 0 0 6px;
  font-weight: 600;
}
.dash-section__sub {
  font-size: 12px; color: var(--text-muted); margin: 0 0 10px;
}

.dash-empty {
  background: var(--surface-alt); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 13px; color: var(--text-muted);
}
.dash-empty--ok { color: #0f766e; background: #ecfdf5; border-color: #a7f3d0; }

.dash-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; font-size: 13px;
}
.dash-table th {
  text-align: left; padding: 9px 12px; font-weight: 600;
  background: var(--surface-alt); color: var(--text-muted);
  border-bottom: 1px solid var(--border); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.dash-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr.dash-row { cursor: pointer; }
.dash-table tr.dash-row:hover { background: var(--surface-alt); }
.dash-table tr.dash-row:focus { outline: 2px solid var(--navy); outline-offset: -2px; }
.dash-table--danger tbody tr { background: #fef2f2; }
.dash-table--danger tbody tr:hover { background: #fee2e2; }

.dash-cell-id { font-weight: 600; color: var(--navy); white-space: nowrap; }
.dash-cell-ready { white-space: nowrap; }
.dash-cell-ready.is-overdue { color: #b91c1c; font-weight: 600; }
.dash-cell-ready.is-today   { color: #b45309; font-weight: 600; }
.dash-muted { color: var(--text-muted); }

.dash-platforms { display: flex; flex-direction: column; gap: 8px; }
.dash-platform {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.dash-platform__row {
  display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px;
}
.dash-platform__name { font-weight: 500; }
.dash-platform__count { color: var(--text-muted); }
.dash-platform__bar {
  height: 6px; background: var(--surface-alt); border-radius: 3px; overflow: hidden;
}
.dash-platform__fill { height: 100%; background: var(--navy); }

/* ========== COMPLETE SUBMISSION + PRINT (Phase 8B/C) ========== */
.side-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(620px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.22s ease-out;
  z-index: 60;
}
.side-panel.is-open { transform: translateX(0); }
.side-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.side-panel__title { margin: 0; font-size: 18px; font-weight: 600; color: var(--navy); }
.side-panel__close {
  background: transparent; border: 0; font-size: 26px; line-height: 1;
  cursor: pointer; color: var(--text-muted); padding: 0 4px;
}
.side-panel__close:hover { color: var(--text); }
.side-panel__body {
  padding: 16px 20px; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.side-panel__foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border);
}

.cs-cta { padding: 12px 0; }
.btn--cs {
  background: var(--navy); color: #f4ea29;
  font-weight: 600; padding: 12px 18px; font-size: 14px;
  border: none; border-radius: var(--radius); cursor: pointer;
  display: block; width: 100%;
}
.btn--cs:hover { background: #1c2c64; }

.cs-items { display: flex; flex-direction: column; gap: 16px; }
.cs-item {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.cs-item__title { font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.cs-item__variant { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.cs-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.cs-grid > .field { display: flex; flex-direction: column; gap: 4px; }
.cs-grid .field__label { font-size: 12px; color: var(--text-muted); }
.cs-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.cs-doc {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-alt); border: 1px dashed var(--border);
  padding: 10px 12px; border-radius: var(--radius);
}
.cs-doc-status { font-size: 12px; color: var(--text-muted); }
.cs-submit { background: var(--navy); color: #f4ea29; font-weight: 600; }
.cs-submit:hover { background: #1c2c64; }

.print-section {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
}
.btn--print {
  background: var(--surface-alt); color: var(--navy);
  font-weight: 600; padding: 9px 14px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer;
}
.btn--print:hover { background: #e2e8f0; }
.print-badge-wrap { font-size: 12px; }
.print-once { color: var(--text-muted); }
.print-warn {
  background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
  padding: 6px 10px; border-radius: var(--radius); font-weight: 500;
}
