/* TOM Production UI — shared tokens & layout (Shop, Production Review, All Drawings) */

:root {
  --bg: #C0B8AB;
  --surface: #F2EBDD;
  --surface-2: #EAE0CC;
  --surface-inset: #EAE0CC;
  --border: #D9CFB8;
  --border-2: #C9BCA0;
  --text: #2E2A24;
  --text-2: #5A5048;
  --muted: #8A7E72;
  --accent: #C97B5C;
  --accent-deep: #A85E40;
  --green: #059669;
  --hold: #d97706;
  --danger: #b91c1c;
  --info: #1d4ed8;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  --radius-sm: 8px;
  --radius-card: 12px;
  --radius-shell: 16px;

  --page-max: min(1680px, 96vw);
  --page-max-shop: min(1920px, 98vw);
  --header-sticky: 72px;
  --touch-min: 44px;
}

* { box-sizing: border-box; }

body.tom-production-ui {
  font-family: 'Outfit', system-ui, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body.page-shop .wrap { max-width: 480px; margin: 0 auto; padding: var(--space-4); }
body.page-review .wrap,
body.page-drawings .wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-4);
}

@media (min-width: 768px) {
  body.page-shop .wrap { max-width: min(720px, 96vw); }
}

@media (min-width: 900px) {
  body.page-shop .wrap { max-width: var(--page-max-shop); padding: var(--space-5); }
}

@media (min-width: 1024px) {
  body.page-review .wrap,
  body.page-drawings .wrap { padding: var(--space-6); }
}

/* Typography */
body.tom-production-ui h1 { font-size: 1.35rem; margin: 0; font-weight: 800; }
body.page-shop h1 { font-size: 1.25rem; margin: 0 0 var(--space-2); }
body.tom-production-ui .sub {
  color: var(--text-2);
  font-size: 0.9rem;
  margin: var(--space-1) 0 var(--space-4);
}
body.tom-production-ui a { color: var(--accent-deep); font-weight: 600; }

/* Shell */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.page-header--sticky {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  padding: var(--space-2) 0 var(--space-3);
  margin-bottom: var(--space-4);
}
.nav-cluster {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}
a.nav-btn, button.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  width: auto;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
a.nav-btn:hover, button.nav-btn:hover { background: var(--border); }
a.nav-btn.active-page { background: var(--accent-deep); color: #fff; }
a.nav-btn.shop { background: var(--accent); color: #fff; }
a.nav-btn.shop:hover { background: var(--accent-deep); }
a.nav-btn.drawings { background: var(--accent); color: #fff; }
a.nav-btn.drawings:hover { background: var(--accent-deep); }
a.nav-btn.production { background: var(--text-2); color: #fff; }
a.nav-btn.production:hover { background: var(--text); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-shell);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.card--inset {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.pin-gate { max-width: 420px; margin: 0 auto; }
.section-label {
  font-size: 0.72rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--space-2);
  font-weight: 700;
}
.filter-label {
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 var(--space-1);
}

/* Forms */
body.tom-production-ui label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: var(--space-1);
  font-weight: 600;
}
body.tom-production-ui input,
body.tom-production-ui select,
body.tom-production-ui textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
  margin-bottom: var(--space-2);
}
body.tom-production-ui button {
  background: var(--accent-deep);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
body.tom-production-ui button:hover:not(:disabled) {
  background: #8f4e32;
  box-shadow: 0 2px 8px rgba(46, 42, 36, 0.12);
}
body.tom-production-ui button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}
body.tom-production-ui button.secondary { background: var(--text-2); color: #fff; }
body.tom-production-ui button.secondary:hover:not(:disabled) { background: var(--text); }
body.tom-production-ui button.danger { background: var(--danger); }
body.tom-production-ui button.danger:hover:not(:disabled) { background: #991b1b; }
body.tom-production-ui button:disabled { opacity: 0.5; cursor: not-allowed; }
body.tom-production-ui a.nav-btn:focus-visible,
body.tom-production-ui button:focus-visible,
body.tom-production-ui input:focus-visible,
body.tom-production-ui select:focus-visible,
body.tom-production-ui textarea:focus-visible {
  outline: 2px solid rgba(168, 94, 64, 0.55);
  outline-offset: 2px;
}
.hidden { display: none !important; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: min(92vw, 480px);
  width: max-content;
  min-width: min(92vw, 280px);
  background: var(--text);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  text-align: center;
  z-index: 10050;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  line-height: 1.4;
  word-wrap: break-word;
}

/* Tab bar (scrollable dept tabs) */
.tab-bar-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-3);
  max-width: 100%;
}
.tab-bar-scroll button {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
}
.tab-bar-scroll button.active { background: var(--accent-deep); }
.tab-bar-scroll button.secondary { background: var(--text-2); }
.tab-bar-scroll button:hover:not(:disabled):not(.active) { background: var(--border); }
body.page-review .view-tabs button:hover:not(:disabled):not(.active) { background: var(--border); }

/* Tables */
.data-table-wrap,
.table-wrap {
  overflow-x: auto;
  max-height: min(55vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.page-drawings .table-wrap { max-height: min(70vh, 720px); }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td {
  border: 1px solid var(--border);
  padding: var(--space-2);
  text-align: left;
  vertical-align: middle;
}
body.page-review table.drawings-table th,
body.page-review table.drawings-table td {
  vertical-align: middle;
}
body.page-review table.drawings-table input[type="text"],
body.page-review table.drawings-table input[type="number"] {
  width: 100%;
  margin: 0;
  padding: 4px 6px;
  font-size: 0.78rem;
}
body.page-review table.drawings-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}
body.page-review .sup-hold-control {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  width: 100%;
  max-width: 220px;
  min-height: 34px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
body.page-review .sup-hold-control.is-active {
  border-color: #818cf8;
}
body.page-review .sup-hold-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 11px;
  background: var(--surface-2);
  border-right: 1px solid var(--border-2);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
body.page-review .sup-hold-control.is-active .sup-hold-toggle {
  background: #e0e7ff;
  color: #3730a3;
}
body.page-review .sup-hold-control .super-hold-reason {
  margin: 0;
  padding: 0 10px;
  border: none;
  border-radius: 0;
  font-size: 0.8rem;
  line-height: 34px;
}
th {
  background: var(--surface-2);
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
tr.on-hold { background: #fff7ed; }
tr.added-row { background: #eff6ff; }
tr.active-row { background: #ecfdf5; }
th.col-ot, td.col-ot { color: var(--danger); font-weight: 700; }
th.col-mfg, td.col-mfg { color: var(--green); font-weight: 700; }
th.col-hold, td.col-hold { color: var(--hold); font-weight: 700; }
th.col-qty, td.col-qty { width: 4%; min-width: 2.5rem; text-align: center; }
.counts-bar { font-size: 0.82rem; color: var(--text-2); margin: 0 0 var(--space-2); }

.badge-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--surface-2);
  margin-left: 6px;
}
.badge-status.added { background: #dbeafe; color: var(--info); }
.badge-status.active { background: #d1fae5; color: #047857; }
.badge-status.hold { background: #ffedd5; color: #c2410c; }
.badge-status.supervisor { background: #e0e7ff; color: #3730a3; }

/* Production Review — dept grid */
.overview-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.overview-toolbar h2 { margin: 0; font-size: 1.1rem; }

.employee-report-list,
.dept-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
@media (min-width: 1200px) {
  .dept-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
    align-items: start;
  }
  .dept-layout > .employee-block--full,
  .dept-layout > .division-head-block,
  .dept-layout > .painter-note,
  .dept-layout > .trade-section-title,
  .dept-layout > .qc-panelists,
  .dept-layout > p {
    grid-column: 1 / -1;
  }
}

.employee-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
}
@media (min-width: 1024px) {
  .employee-block { padding: var(--space-5); }
}
.employee-block.senior { border-left: 4px solid var(--accent-deep); }
.employee-block.flagged { border-left: 4px solid var(--danger); background: var(--surface-2); }
.employee-block--full { width: 100%; }

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}
.client-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  cursor: pointer;
}
.client-card:hover,
.client-card.active {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(46, 42, 36, 0.1);
}
.client-card.flagged { border-color: var(--danger); background: var(--surface-2); }

/* Client master/detail (Production Review) */
.client-mode-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
@media (min-width: 1100px) {
  .client-mode-layout.has-selection {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: var(--space-5);
    align-items: start;
  }
  .client-mode-layout.has-selection .client-mode-aside {
    max-height: min(75vh, 800px);
    overflow-y: auto;
  }
  .client-mode-layout.has-selection .report-panel {
    position: sticky;
    top: var(--header-sticky);
    max-height: min(75vh, 800px);
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
  }
  .client-mode-layout.has-selection .report-panel .data-table-wrap {
    flex: 1;
    min-height: 200px;
  }
}

.report-panel { margin-bottom: var(--space-4); }

.division-head-block {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 2px solid var(--accent-deep);
  border-radius: 14px;
  padding: var(--space-5);
  margin-bottom: var(--space-2);
}
.emp-head-row { display: flex; gap: var(--space-3); align-items: center; margin-bottom: var(--space-2); }
.senior-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: var(--accent-deep);
  color: #fff;
  padding: 2px var(--space-2);
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 700;
}
.division-badge {
  display: inline-block;
  font-size: 0.72rem;
  background: var(--text);
  color: var(--surface);
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 700;
  text-transform: uppercase;
}
.painter-note {
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4);
  color: var(--text-2);
  margin-bottom: var(--space-3);
  font-size: 0.88rem;
}
.trade-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin: var(--space-4) 0 var(--space-2);
  color: var(--text-2);
}

/* QC */
.qc-panelists {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  width: 100%;
}
@media (max-width: 720px) {
  .qc-panelists { grid-template-columns: 1fr; }
}
.qc-panelist-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: center;
  min-height: 88px;
}
.qc-list { display: flex; flex-direction: column; gap: var(--space-3); }
.qc-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
}

/* All Drawings ops layout */
.ops-layout {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(240px, 300px) minmax(340px, min(640px, 42vw)) minmax(0, 1fr);
  align-items: start;
}
/* All Drawings: filters + table when idle; table over detail when selected */
body.page-drawings .ops-layout {
  grid-template-columns: 1fr;
}
body.page-drawings .ops-layout:not(.has-drawing-selected) .detail-card {
  display: none;
}
body.page-drawings .detail-card {
  min-width: 0;
}
body.page-drawings .detail-card .store-table-scroll {
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-subtle, #e8ddd4);
  border-radius: var(--radius-sm);
}
@media (min-width: 1400px) {
  .ops-layout {
    gap: var(--space-5);
    grid-template-columns: minmax(260px, 320px) minmax(380px, min(720px, 44vw)) minmax(0, 1fr);
  }
  body.page-drawings .ops-layout {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 1101px) {
  body.page-drawings .ops-layout.has-drawing-selected {
    grid-template-rows: none;
  }
  body.page-drawings .ops-layout .filters-card { order: 1; }
  body.page-drawings .ops-layout .table-card { order: 2; }
  body.page-drawings .ops-layout .detail-card { order: 3; }
  body.page-drawings .ops-layout.has-drawing-selected .filters-card,
  body.page-drawings .ops-layout.has-drawing-selected .table-card,
  body.page-drawings .ops-layout.has-drawing-selected .detail-card {
    grid-column: auto;
    grid-row: auto;
    display: block;
  }
}
@media (max-width: 1100px) {
  .ops-layout { grid-template-columns: 1fr; }
  body.page-drawings .ops-layout .filters-card { order: 1; }
  body.page-drawings .ops-layout .table-card { order: 2; }
  body.page-drawings .ops-layout .detail-card { order: 3; }
  body.page-drawings .ops-layout:not(.has-drawing-selected) .detail-card {
    display: none;
  }
}
@media (min-width: 1101px) {
  .ops-layout .filters-card {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }
}
.carpenter-list {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Shop-specific (linked when body.page-shop) */
body.page-shop .shop-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0;
}
body.page-shop .shop-action-stack--tight { margin-top: 6px; }
body.page-shop .shop-action-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
}
body.page-shop .shop-action-btn {
  display: block;
  width: 100%;
  margin: 0;
  min-height: 46px;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 10px;
  text-align: center;
  box-sizing: border-box;
}
body.page-shop button.shop-action-btn.secondary,
body.page-shop button.shop-action-btn {
  background: var(--accent);
  color: #fff;
}
body.page-shop button.shop-action-btn:hover:not(:disabled) {
  background: var(--accent-deep);
}
body.page-shop button.shop-action-btn--primary {
  background: var(--accent-deep);
  font-size: 0.98rem;
  min-height: 50px;
}
body.page-shop button.shop-action-btn--primary:hover:not(:disabled) {
  background: #8f4e32;
}
body.page-shop button.shop-action-btn.danger {
  background: var(--danger);
}
body.page-shop button.shop-action-btn.danger:hover:not(:disabled) {
  background: #991b1b;
}
body.page-shop .btn-row .shop-action-btn,
body.page-shop .team-pick-row .shop-action-btn,
body.page-shop .team-pick-row .row-btn {
  width: auto;
  min-width: 76px;
  flex: 0 0 auto;
}
body.page-shop .btn-row .shop-action-btn {
  flex: 1 1 0;
  min-width: 0;
}
body.page-shop .card { margin-bottom: var(--space-3); }
body.page-shop .card--inset {
  margin-top: var(--space-3);
  margin-bottom: 0;
}
/* Shop Start tab — left rail (1·2·3·Store) | right work area (current job | next drawing) */
body.page-shop .shop-tab-start {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
body.page-shop .shop-layout-main,
body.page-shop .shop-layout-left,
body.page-shop .shop-layout-right,
body.page-shop .shop-setup-column,
body.page-shop .shop-form-column,
body.page-shop .shop-store-column,
body.page-shop .shop-work-band {
  min-width: 0;
}
body.page-shop .shop-work-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
body.page-shop .shop-work-band {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: stretch;
}
@media (min-width: 1100px) {
  body.page-shop .shop-store-column {
    position: static;
    max-height: none;
    overflow: visible;
    z-index: 0;
    isolation: isolate;
  }
}
body.page-shop .shop-store-column .store-lines-table {
  min-width: 0;
}
body.page-shop .shop-store-column .store-table-scroll {
  max-width: 100%;
}
body.page-shop .shop-store-column .store-grid-input,
body.page-shop .shop-store-column .store-lines-table select,
body.page-shop .shop-store-column .store-lines-table input {
  font-size: 0.86rem;
  min-width: 0;
}
body.page-shop .shop-store-column .mat-master { min-width: 120px; }
body.page-shop .shop-store-column .mat-cat { min-width: 88px; }
body.page-shop .shop-store-column .mat-qty,
body.page-shop .shop-store-column .paint-qty {
  min-width: 64px;
  max-width: 80px;
  font-weight: 700;
}
body.page-shop .paint-unit-cell,
body.page-review .paint-unit-cell {
  white-space: nowrap;
  font-weight: 600;
  color: var(--muted, #666);
}
body.page-shop .paint-qty-unit,
body.page-review .store-paint-unit,
body.page-review .paint-qty-unit {
  display: inline-block;
  min-width: 2.5rem;
  font-weight: 700;
}
body.page-shop .store-lines-table th.col-qty,
body.page-review .store-lines-table th.col-qty {
  min-width: 56px;
}
body.page-shop .store-lines-table th.col-unit,
body.page-review .store-lines-table th.col-unit {
  min-width: 48px;
}
body.page-shop .store-qty-cell,
body.page-review .store-qty-cell {
  white-space: nowrap;
  text-align: center;
}
body.page-shop .store-qty-cell input,
body.page-review .store-qty-cell input {
  max-width: 56px;
  min-width: 44px;
  text-align: center;
  font-weight: 700;
}
body.page-review .store-qty-cell input.store-qty-narrow,
body.page-production-review .store-qty-cell input.store-qty-narrow {
  max-width: 2.35rem;
  min-width: 2rem;
  width: 2.35rem;
  padding-left: 2px;
  padding-right: 2px;
}
body.page-review table.drawings-table.store-section-table th.col-qty,
body.page-review table.drawings-table.store-section-table th.col-recd,
body.page-review table.drawings-table.store-section-table th.col-bal,
body.page-review table.drawings-table.store-section-table td.store-qty-cell,
body.page-production-review table.drawings-table.store-section-table th.col-qty,
body.page-production-review table.drawings-table.store-section-table th.col-recd,
body.page-production-review table.drawings-table.store-section-table th.col-bal,
body.page-production-review table.drawings-table.store-section-table td.store-qty-cell {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding: 2px 1px;
  overflow: visible;
  vertical-align: middle;
}
body.page-review table.drawings-table.store-section-table .store-qty-field,
body.page-production-review table.drawings-table.store-section-table .store-qty-field {
  display: block;
  width: 2rem !important;
  min-width: 2rem !important;
  max-width: 2rem !important;
  height: 1.75rem;
  margin: 0 auto;
  padding: 0 !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  line-height: 1.75rem;
  text-align: center;
  border: 1px solid #b8a88c;
  border-radius: 6px;
  box-sizing: border-box;
  background: #fffdf8;
  color: #2c2416;
  -moz-appearance: textfield;
  appearance: textfield;
}
body.page-review table.drawings-table.store-section-table .store-qty-field-display,
body.page-review table.drawings-table.store-section-table span.store-qty-bal,
body.page-production-review table.drawings-table.store-section-table .store-qty-field-display,
body.page-production-review table.drawings-table.store-section-table span.store-qty-bal {
  display: inline-block;
  width: 2rem;
  min-height: 1.75rem;
  line-height: 1.75rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: #2c2416;
  background: #ebe4d4;
  border-radius: 6px;
  border: 1px solid #b8a88c;
  box-sizing: border-box;
}
body.page-review table.drawings-table.store-section-table .store-qty-field:focus,
body.page-production-review table.drawings-table.store-section-table .store-qty-field:focus {
  outline: 2px solid rgba(13, 148, 136, 0.45);
  outline-offset: 1px;
}
body.page-review #store-table-hardware .store-master-pick-cell,
body.page-review #store-table-paint .store-master-pick-cell,
body.page-production-review #store-table-hardware .store-master-pick-cell,
body.page-production-review #store-table-paint .store-master-pick-cell {
  min-width: 0;
  max-width: none;
}
body.page-review .store-master-pick-cell .store-hw-item,
body.page-review .store-master-pick-cell .store-hw-pick,
body.page-production-review .store-master-pick-cell .store-hw-item,
body.page-production-review .store-master-pick-cell .store-hw-pick {
  overflow-x: auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.page-shop .store-qty-bal,
body.page-review .store-qty-bal {
  max-width: 56px;
  min-width: 44px;
  text-align: center;
  font-weight: 800;
}
body.page-review .store-qty-bal.store-qty-narrow,
body.page-production-review .store-qty-bal.store-qty-narrow {
  max-width: 2.35rem;
  min-width: 2rem;
  background: #f0ebe0;
}
body.page-shop .store-qty-cell input.store-qty-bal,
body.page-review .store-qty-cell input.store-qty-bal {
  color: inherit;
}
body.page-shop .paint-unit-cell select,
body.page-review .paint-unit-cell select,
body.page-review .store-paint-unit {
  min-width: 4.5rem;
  font-weight: 700;
}
body.page-review .paint-master-table select,
body.page-review .paint-master-table input {
  max-width: 120px;
}
body.page-review .material-master-panel .paint-master-table select,
body.page-review .material-master-panel .paint-master-table input,
body.page-review .material-master-panel .master-materials-table select,
body.page-review .material-master-panel .master-materials-table input {
  max-width: none;
}
body.page-shop .session-row button {
  min-height: var(--touch-min);
}
body.page-shop .collation-row,
body.page-review .collation-row,
body.page-production-review .collation-row,
body.page-all-drawings .collation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
body.page-shop .collation-row input,
body.page-shop .collation-row select,
body.page-review .collation-row input,
body.page-review .collation-row select,
body.page-production-review .collation-row input,
body.page-production-review .collation-row select {
  margin: 0;
  font-size: 0.88rem;
  padding: 6px 8px;
  width: auto;
  flex: 1;
  min-width: 72px;
}
body.page-shop .collation-row input.qty-inp,
body.page-review .collation-row input.qty-inp,
body.page-production-review .collation-row input.qty-inp {
  max-width: 64px;
  flex: 0 0 64px;
}
body.page-shop .collation-row button,
body.page-review .collation-row button,
body.page-production-review .collation-row button {
  margin: 0;
  padding: 6px 10px;
  font-size: 0.78rem;
  width: auto;
  min-height: var(--touch-min);
}
body.page-review .store-grid-input,
body.page-production-review .store-grid-input,
body.page-shop .store-lines-table .store-grid-input,
body.page-shop .store-lines-table input,
body.page-shop .store-lines-table select,
body.page-review .store-lines-table .store-grid-input,
body.page-review .store-lines-table input,
body.page-review .store-lines-table select,
body.page-drawings .store-lines-table .store-grid-input,
body.page-drawings .store-lines-table input,
body.page-drawings .store-lines-table select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  margin-bottom: 0;
  padding: 6px 8px;
  font-size: 0.85rem;
  min-height: 34px;
  box-sizing: border-box;
  border-radius: 6px;
}
body.page-drawings .store-lines-table .mat-cat { min-width: 96px; }
body.page-drawings .store-lines-table .mat-thickness { min-width: 88px; }
body.page-drawings .store-lines-table .mat-qty,
body.page-drawings .store-lines-table .hw-qty {
  min-width: 56px;
  max-width: 72px;
  font-weight: 700;
}
body.page-drawings .store-lines-table .mat-size,
body.page-drawings .store-lines-table .hw-size { min-width: 88px; }
body.page-drawings .store-lines-table .mat-brand,
body.page-drawings .store-lines-table .mat-code,
body.page-drawings .store-lines-table .hw-brand,
body.page-drawings .store-lines-table .hw-code,
body.page-drawings .store-lines-table .hw-item { min-width: 72px; }
body.page-drawings .store-lines-table .store-eta-input {
  min-width: 118px;
  max-width: 140px;
}
body.page-drawings .store-lines-table .store-status-cell {
  min-width: 128px;
  white-space: nowrap;
}
body.page-drawings .store-lines-table .btn-rm-mat,
body.page-drawings .store-lines-table .btn-rm-hw {
  width: auto;
  min-width: 2.25rem;
  min-height: 34px;
  padding: 4px 10px;
  margin: 0;
  line-height: 1.1;
}
body.page-drawings .store-lines-table .mat-thickness-other {
  margin-top: 4px;
}
body.page-review tr.store-row-warn,
body.page-production-review tr.store-row-warn {
  background: rgba(180, 83, 9, 0.12);
}
body.page-shop .store-table-scroll,
body.page-review .store-table-scroll,
body.page-production-review .store-table-scroll,
body.page-drawings .store-table-scroll {
  overflow-x: auto;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}
body.page-shop .store-lines-table,
body.page-review .store-lines-table,
body.page-production-review .store-lines-table,
body.page-drawings .store-lines-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}
body.page-drawings .store-lines-table th:nth-child(1),
body.page-drawings .store-lines-table td:nth-child(1) { width: 14%; min-width: 96px; }
body.page-drawings .store-lines-table th:nth-child(2),
body.page-drawings .store-lines-table td:nth-child(2) { width: 12%; min-width: 88px; }
body.page-drawings .store-lines-table th:nth-child(3),
body.page-drawings .store-lines-table td:nth-child(3) { width: 7%; min-width: 56px; }
body.page-drawings .store-lines-table th:nth-child(4),
body.page-drawings .store-lines-table td:nth-child(4) { width: 12%; min-width: 88px; }
body.page-drawings .store-lines-table th:nth-child(5),
body.page-drawings .store-lines-table td:nth-child(5) { width: 11%; min-width: 72px; }
body.page-drawings .store-lines-table th:nth-child(6),
body.page-drawings .store-lines-table td:nth-child(6) { width: 11%; min-width: 72px; }
body.page-drawings .store-lines-table th:nth-child(7),
body.page-drawings .store-lines-table td:nth-child(7) { width: 14%; min-width: 118px; }
body.page-drawings .store-lines-table th:nth-child(8),
body.page-drawings .store-lines-table td:nth-child(8) { width: 16%; min-width: 128px; }
body.page-drawings .store-lines-table th:nth-child(9),
body.page-drawings .store-lines-table td:nth-child(9) { width: 3%; min-width: 40px; }
body.page-drawings #detail-materials-section,
body.page-drawings #detail-hardware-section {
  overflow: visible;
}
body.page-drawings #detail-material-rows,
body.page-drawings #detail-hardware-rows {
  width: 100%;
  min-width: 0;
}
body.page-shop .store-status-cell {
  white-space: nowrap;
}
body.page-drawings .drawing-shift-unlock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #EAE0CC;
  border-radius: 10px;
  border: 1px solid #D9CFB8;
  font-size: 0.85rem;
  color: #5A5048;
}
body.page-drawings .drawing-shift-unlock-bar.is-unlocked {
  border-color: #059669;
  background: #ecfdf5;
}
body.page-drawings .drawing-act-btn,
body.page-review .drawing-act-btn {
  min-width: var(--touch-min, 44px);
  min-height: var(--touch-min, 44px);
  width: var(--touch-min, 44px);
  height: var(--touch-min, 44px);
  margin: 0;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #EAE0CC;
  border: 1px solid #D9CFB8;
  color: var(--text, #2E2A24);
  cursor: pointer;
}
body.page-drawings .drawing-act-btn:hover:not(:disabled),
body.page-review .drawing-act-btn:hover:not(:disabled) {
  border-color: #C97B5C;
  background: #F2EBDD;
}
body.page-drawings .drawing-act-btn.is-on,
body.page-review .drawing-act-btn.is-on {
  background: #d97706;
  border-color: #b45309;
  color: #fff;
}
body.page-drawings .drawing-act-btn.drawing-act-stage:not(:disabled),
body.page-review .drawing-act-btn.drawing-act-stage:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
}
body.page-drawings .drawing-act-btn.drawing-act-dispatch:not(:disabled),
body.page-review .drawing-act-btn.drawing-act-dispatch:not(:disabled) {
  background: #EAE0CC;
}
body.page-drawings .drawing-act-btn:disabled,
body.page-review .drawing-act-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}
body.page-drawings .drawing-row-actions,
body.page-review .drawing-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}
body.page-drawings .pause-reason-hint,
body.page-review .pause-reason-hint {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-2, #5A5048);
  line-height: 1.25;
  margin-top: 2px;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.page-drawings .category-icon-btn,
body.page-review .category-icon-btn {
  min-width: var(--touch-min, 44px);
  min-height: var(--touch-min, 44px);
  width: var(--touch-min, 44px);
  height: var(--touch-min, 44px);
  margin: 0;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 10px;
  background: #EAE0CC;
  border: 1px solid #D9CFB8;
  color: var(--text, #2E2A24);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.page-drawings .category-icon-btn .category-icon-img,
body.page-review .category-icon-btn .category-icon-img,
body.page-drawings .drawing-act-btn .category-icon-img,
body.page-review .drawing-act-btn .category-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
body.page-drawings .category-icon-btn:hover:not(:disabled),
body.page-review .category-icon-btn:hover:not(:disabled) {
  border-color: #C97B5C;
  background: #F2EBDD;
}
body.page-drawings .category-icon-btn.is-dispatch,
body.page-review .category-icon-btn.is-dispatch {
  background: #ecfdf5;
  border-color: #6ee7b7;
}
body.page-drawings .category-icon-btn:disabled,
body.page-review .category-icon-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
body.page-drawings #drawings-table th.col-category,
body.page-drawings #drawings-table td.col-category,
body.page-drawings table.drawings-table th.col-category,
body.page-drawings table.drawings-table td.col-category,
body.page-review table.drawings-table th.col-category,
body.page-review table.drawings-table td.col-category {
  width: 4.25rem;
  min-width: 4.25rem;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
body.page-drawings #drawings-table th.col-drawing-actions,
body.page-drawings #drawings-table td.col-drawing-actions,
body.page-drawings table.drawings-table th.col-drawing-actions,
body.page-drawings table.drawings-table td.col-drawing-actions,
body.page-review table.drawings-table th.col-drawing-actions,
body.page-review table.drawings-table td.col-drawing-actions {
  width: 10.5rem;
  min-width: 10.5rem;
  text-align: right;
  white-space: nowrap;
}
body.page-shop .store-status-btn,
body.page-review .store-status-btn,
body.page-production-review .store-status-btn,
body.page-drawings .store-status-btn {
  display: inline-block;
  width: auto;
  margin: 0 4px 0 0;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border-2, #C9BCA0);
  background: var(--surface-2, #EAE0CC);
  color: var(--text-2, #5A5048);
  cursor: pointer;
  line-height: 1.2;
}
body.page-shop .store-status-btn.store-in,
body.page-review .store-status-btn.store-in,
body.page-production-review .store-status-btn.store-in {
  padding: 3px 7px;
  font-size: 0.68rem;
  min-width: 2.2rem;
}
body.page-shop .store-status-btn.is-on,
body.page-review .store-status-btn.is-on,
body.page-production-review .store-status-btn.is-on,
body.page-drawings .store-status-btn.is-on,
body.page-review tr.store-row-ordered .store-status-btn.store-ordered,
body.page-production-review tr.store-row-ordered .store-status-btn.store-ordered {
  background: #059669;
  border-color: #047857;
  color: #fff;
}
body.page-review tr.store-row-in-house .store-status-btn.store-in.is-on,
body.page-production-review tr.store-row-in-house .store-status-btn.store-in.is-on {
  background: #0d9488;
  border-color: #0f766e;
  color: #fff;
}
body.page-shop .store-status-btn:hover:not(:disabled):not(.is-on),
body.page-review .store-status-btn:hover:not(:disabled):not(.is-on),
body.page-drawings .store-status-btn:hover:not(:disabled):not(.is-on) {
  border-color: var(--accent);
  background: var(--surface);
}
body.page-shop .store-eta-input,
body.page-review .store-eta-input,
body.page-production-review .store-eta-input,
body.page-drawings .store-eta-input {
  min-width: 88px;
  max-width: 120px;
}
body.page-shop .shop-store-column .store-lines-table {
  min-width: 920px;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: auto;
}
/* Shop store — keep cells inside column bounds (fixes Thick overlap) */
body.page-shop .shop-store-column .store-lines-table td,
body.page-shop .shop-store-column .store-lines-table th {
  overflow: hidden;
}
body.page-shop .shop-store-column .store-lines-table .store-grid-input,
body.page-shop .shop-store-column .store-lines-table select,
body.page-shop .shop-store-column .store-lines-table input {
  max-width: 100%;
}
body.page-shop .shop-store-column .store-master-pick-cell {
  min-width: 0;
  max-width: 100%;
}
body.page-shop .shop-store-column .mat-thickness {
  min-width: 0;
}
body.page-shop .shop-store-column .store-lines-table .mat-cat,
body.page-shop .shop-store-column .store-lines-table .mat-code-pick,
body.page-shop .shop-store-column .store-lines-table .hw-item-pick,
body.page-shop .shop-store-column .store-lines-table .paint-brand-pick,
body.page-shop .shop-store-column .store-lines-table .paint-type {
  min-width: 0;
}
/* Material table (11 columns) */
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-type { width: 11%; }
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-brand { width: 9%; }
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-code { width: 20%; }
body.page-shop .shop-store-column .mat-code-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-thick { width: 8%; }
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-qty,
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-recd,
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-bal { width: 5%; }
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-size { width: 9%; }
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-eta { width: 9%; }
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-status { width: 12%; }
body.page-shop .shop-store-column .store-lines-table.store-mat-table col.col-rm { width: 3%; }
/* Hardware table (10 columns) */
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-type { width: 20%; }
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-brand { width: 10%; }
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-code { width: 11%; }
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-qty,
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-recd,
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-bal { width: 5%; }
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-size { width: 10%; }
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-eta { width: 9%; }
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-status { width: 12%; }
body.page-shop .shop-store-column .store-lines-table.store-hw-table col.col-rm { width: 3%; }
/* Paint table (10 columns) */
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-paint { width: 12%; }
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-brand { width: 14%; }
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-code { width: 12%; }
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-qty,
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-recd,
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-bal { width: 5%; }
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-unit { width: 6%; }
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-eta { width: 9%; }
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-status { width: 12%; }
body.page-shop .shop-store-column .store-lines-table.store-paint-table col.col-rm { width: 3%; }
body.page-shop .store-lines-table th,
body.page-review .store-lines-table th,
body.page-production-review .store-lines-table th,
body.page-drawings .store-lines-table th {
  background: var(--surface-2, #EAE0CC);
  padding: 8px 6px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid var(--border, #D9CFB8);
}
body.page-shop .store-lines-table td,
body.page-review .store-lines-table td,
body.page-production-review .store-lines-table td,
body.page-drawings .store-lines-table td {
  padding: 6px;
  vertical-align: middle;
  border: 1px solid var(--border-subtle, #e8ddd4);
  background: var(--surface, #F2EBDD);
}
body.page-drawings .store-lines-table tbody tr:nth-child(even) td {
  background: var(--surface-2, #EAE0CC);
}
body.page-shop details.upholstery-section[open] #upholstery-start-hint.hidden,
body.page-shop details.upholstery-section:not([open]) #upholstery-start-box {
  display: none;
}
body.page-shop #upholstery-start-box.hidden {
  display: none;
}
body.page-shop .active-work-row .finish-panel,
body.page-shop .active-work-row .new-drawing-box {
  min-height: auto;
}
body.page-shop .active-work-row.has-active-panel .finish-panel {
  min-height: 280px;
}
body.page-shop .active-work-row .new-drawing-box {
  min-height: auto;
}
body.page-shop #parked-jobs {
  flex: 1;
  min-height: 0;
  max-height: min(55vh, 560px);
  overflow-y: auto;
}
body.page-shop .head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-2); }
body.page-shop .head-row .head-title { display: flex; gap: var(--space-3); align-items: center; flex: 1; min-width: 0; }
body.page-shop .head-row .head-title h1 { margin: 0; }
body.page-shop .logo-img { height: 48px; width: auto; max-width: 110px; object-fit: contain; border-radius: var(--radius-sm); flex-shrink: 0; }

.admin-only.hidden-by-role { display: none !important; }

.printing-form-grid {
  display: grid;
  gap: 10px 12px;
  align-items: end;
}
.printing-form-grid--order {
  grid-template-columns: 1.4fr 0.95fr 0.6fr 0.8fr 1.15fr 1.5fr 0.9fr;
}
.printing-form-grid--output {
  grid-template-columns: 1.4fr 0.95fr 0.6fr 0.8fr 1.65fr;
}
@media (max-width: 1100px) {
  .printing-form-grid--order,
  .printing-form-grid--output {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    align-items: end;
  }
}
.print-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  justify-content: flex-end;
}
.print-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8A7E72;
  line-height: 1.2;
  min-height: 0.9rem;
}
.print-field--material {
  grid-column: span 1;
  align-self: end;
}
.print-field--wide {
  min-width: 0;
}
.print-field--narrow input {
  width: 100%;
  max-width: none;
}
.print-field--check {
  align-self: end;
}
.print-field--check .print-check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #d9cfb8);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: #5A5048;
  box-sizing: border-box;
  white-space: nowrap;
}
.print-field--check .print-check-row > span {
  line-height: 1.2;
}
.store-product-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border, #d9cfb8);
  display: block;
  margin: 0 auto;
}
body.page-review .store-photo-cell .store-product-thumb,
body.page-review .store-photo-cell .product-photo-thumb {
  cursor: zoom-in;
}
.store-photo-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px dashed #c9bca4;
  font-size: 0.68rem;
  color: #8a7e72;
  background: #faf7f2;
  margin: 0 auto;
}
.store-drawing-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
.store-drawing-photo .store-product-thumb {
  width: 56px;
  height: 56px;
}
body.page-review .store-lines-table .col-photo,
body.page-shop .store-lines-table .col-photo {
  width: 52px;
  min-width: 52px;
  text-align: center;
  padding: 4px;
  vertical-align: middle;
}
.print-material-picker {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
}
.print-material-select {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  height: auto;
  line-height: 1.35;
}
.print-material-new-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px dashed #C9BCA4;
  background: #FFFCF7;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8A7E72;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  box-sizing: border-box;
}
.print-material-new-chip.is-on {
  border-style: solid;
  border-color: #C97B5C;
  background: #FFF4EE;
  color: #C97B5C;
}
.print-material-new-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.print-material-new-input {
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #C97B5C;
  background: #FFF9F5;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 34px;
  box-sizing: border-box;
}
.printing-form-actions {
  margin-top: 10px;
}
.printing-entry-form input:not([type="checkbox"]):not([type="radio"]),
.printing-entry-form select {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #d9cfb8);
  background-color: #fff;
  color: var(--text, #2e2a24);
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 40px;
  height: auto;
  line-height: 1.35;
  box-sizing: border-box;
  -webkit-text-fill-color: var(--text, #2e2a24);
  color-scheme: light;
}
.printing-entry-form select {
  padding-right: 28px;
}
.printing-entry-form select option {
  color: var(--text, #2e2a24);
  background-color: #fff;
  font-weight: 600;
}
.printing-entry-form input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: #c97b5c;
}
.print-material-new-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  min-height: 0;
  pointer-events: none;
}
.printing-entry-form input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.printing-form-grid > .print-field,
.printing-form-grid > label.print-field {
  margin: 0;
}
.printing-entry-form input:focus,
.printing-entry-form select:focus {
  outline: none;
  border-color: #C97B5C;
  box-shadow: 0 0 0 3px rgba(201, 123, 92, 0.16);
}
#printing-report-panel section {
  padding: 14px 16px;
  border: 1px solid var(--border, #d9cfb8);
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFCF7 0%, #FAF7F2 100%);
}
#printing-report-panel section + section {
  margin-top: 18px;
}
.printing-form-grid label.print-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: inherit;
  margin-bottom: 0;
  font-weight: inherit;
}
body.page-review #printing-report-panel .print-field-label,
body.page-production-review #printing-report-panel .print-field-label {
  color: var(--muted, #8a7e72);
  font-weight: 700;
}
body.page-review #printing-report-panel .printing-entry-form .print-field > select,
body.page-review #printing-report-panel .printing-entry-form .print-field > input:not([type="checkbox"]):not([type="radio"]),
body.page-production-review #printing-report-panel .printing-entry-form .print-field > select,
body.page-production-review #printing-report-panel .printing-entry-form .print-field > input:not([type="checkbox"]):not([type="radio"]),
body.page-review #printing-report-panel .print-material-select,
body.page-production-review #printing-report-panel .print-material-select,
body.page-review #printing-report-panel .print-material-new-input,
body.page-production-review #printing-report-panel .print-material-new-input {
  color: var(--text, #2e2a24);
  background-color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 40px;
  height: auto;
  line-height: 1.35;
  padding: 8px 10px;
  margin-bottom: 0;
  -webkit-text-fill-color: var(--text, #2e2a24);
}
body.page-review #printing-report-panel .printing-entry-form .print-field > select,
body.page-production-review #printing-report-panel .printing-entry-form .print-field > select,
body.page-review #printing-report-panel .print-material-select,
body.page-production-review #printing-report-panel .print-material-select {
  padding-right: 28px;
}
.pipeline-workload-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pipeline-chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border, #d9cfb8);
  font-size: 0.85rem;
}
.pipeline-chip--need {
  border-color: var(--accent, #c97b5c);
}
.pipeline-photo-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-height: 48px;
  padding: 4px;
  border-radius: 8px;
  border: 1px dashed #c9bca4;
  background: #fff9f5;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: #b45309;
  box-sizing: border-box;
}

/* Production Review — shared dept layout (replaces inline styles) */
body.page-review .u-m0 { margin: 0; }
body.page-review .u-m0-0-4 { margin: 0 0 4px; }
body.page-review .u-sub-flush { margin: 0; }
body.page-review .u-sub-tight { margin: 4px 0 0; }
body.page-review .u-mt-8 { margin-top: 8px; }
body.page-review .u-mt-12 { margin-top: 12px; }
body.page-review .u-mt-16 { margin-top: 16px; }
body.page-review .u-mt-24 { margin-top: 24px; }
body.page-review .u-mt-10 { margin-top: 10px; }
body.page-review .u-mb-10 { margin: 0 0 10px; }
body.page-review .u-mt-8-btn { margin-top: 8px; }
body.page-review .panel-title { margin: 0; font-size: 1.1rem; }
body.page-review .panel-title-sm { margin: 0; font-size: 1.05rem; }
body.page-review .panel-title-xs { margin: 0 0 8px; font-size: 1rem; }
body.page-review .panel-sub { margin: 4px 0 0; }
body.page-review .dept-toolbar {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
body.page-review .dept-toolbar .nav-btn,
body.page-review .dept-toolbar .secondary,
body.page-review .dept-toolbar button { margin: 0; }
body.page-review .btn-logout-compact { width: auto; margin: 0; padding: 8px 12px; }
body.page-review .btn-compact-danger { margin: 0; padding: 4px 8px; font-size: 0.78rem; }
body.page-review .table-wrap-spaced { margin-top: 12px; }
body.page-review .trade-section-flush { margin-top: 0; }
body.page-review .store-summary-total { margin: 0 0 6px; font-size: 0.8rem; font-weight: 700; }
body.page-review .store-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 8px;
}
body.page-review .store-subtab {
  margin: 0;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 999px;
}
body.page-review .store-subtab:hover:not(.is-active) {
  border-color: var(--border-2);
  background: var(--surface-2);
}
body.page-review .store-subtab.is-active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}
body.page-review .store-tab-pane { margin-top: 4px; }
body.page-review .store-tab-summaries { margin-bottom: 12px; }
body.page-review tr.store-row-placeholder .store-mat-cat,
body.page-review tr.store-row-placeholder .store-mat-label {
  border-color: #C9BCA0;
}
body.page-review .open-sessions-list { margin: 8px 0 0; padding-left: 18px; font-size: 0.82rem; }
body.page-review .qc-stat-muted { font-weight: 400; color: var(--muted); font-size: 0.78rem; }
body.page-review .pin-gate-note { margin: 0; max-width: 36rem; line-height: 1.45; }
body.page-review .view-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 0; }
body.page-review .view-tabs button { margin: 0; }
body.page-review .view-tabs button.view-tab-dept {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-3);
  white-space: nowrap;
}
body.page-review .view-tab-emoji {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
body.page-review .view-tab-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
body.page-review .view-tab-text {
  line-height: 1.2;
}
body.page-review .view-tabs button.active { background: var(--accent-deep); }
body.page-review .view-tabs-grouped { display: flex; flex-direction: column; gap: 10px; }
body.page-review .view-tab-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
body.page-review .view-tab-group-label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 4.75rem;
}
body.page-review .view-tab-group .view-tabs { flex: 1; min-width: 0; }
body.page-review .printing-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  body.page-review .printing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body.page-review .printing-summary-value {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-deep);
}
body.page-review .carpenter-summary-bar { margin-bottom: 16px; }
body.page-review .dept-stat-codes {
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 220px;
  line-height: 1.3;
}

/* Admin workflow dashboard */
body.page-review .admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-3);
}
@media (max-width: 900px) {
  body.page-review .admin-dashboard-grid { grid-template-columns: 1fr; }
}
body.page-review .admin-dashboard-grid.loading {
  opacity: 0.72;
  pointer-events: none;
}
body.page-review .dashboard-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: dashboard-card-in 0.45s ease both;
  animation-delay: calc(var(--dash-delay, 0) * 60ms);
}
@keyframes dashboard-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
body.page-review .dashboard-chart-card-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}
body.page-review .dashboard-chart-card-head .sub {
  margin: var(--space-1) 0 0;
  font-size: 0.78rem;
}
body.page-review .dashboard-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
body.page-review .dashboard-kpi {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-2);
  line-height: 1.2;
}
body.page-review .dashboard-kpi strong {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--accent-deep);
}
body.page-review .dashboard-chart-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 220px;
  min-height: 160px;
}
body.page-review .dashboard-chart-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
body.page-review .dashboard-card-link {
  align-self: flex-start;
  margin: 0;
  font-size: 0.78rem;
  padding: 6px 12px;
}

/* Phase 3–4 polish — scroll, store overflow, finish buttons */
body.page-shop .store-table-scroll,
body.page-review .store-table-scroll,
body.page-drawings .store-table-scroll {
  overscroll-behavior: contain;
}
body.page-drawings .carpenter-list {
  overscroll-behavior: contain;
  max-height: min(60vh, 520px);
}
.tab-bar-scroll {
  overscroll-behavior: contain;
}
body.page-review table.drawings-table.store-section-table td.store-status-cell,
body.page-review table.drawings-table.store-section-table td.store-master-pick-cell,
body.page-review table.drawings-table.store-section-table td.col-supervisor,
body.page-review table.drawings-table.store-section-table td.paint-brand-cell,
body.page-review table.drawings-table.store-section-table td.paint-code-cell {
  overflow: visible;
}
body.page-review table.drawings-table td.col-supervisor {
  overflow: visible;
}
body.tom-production-ui button.finish-btn {
  background: var(--green);
  color: #fff;
  font-size: 1rem;
  padding: 14px 16px;
  width: 100%;
  margin: 0;
}
body.tom-production-ui button.finish-btn:hover:not(:disabled) {
  background: #047857;
}
body.tom-production-ui button.finish-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
body.page-shop .store-status-btn,
body.page-review .store-status-btn {
  padding: 5px 9px;
  font-size: 0.74rem;
  min-height: 24px;
}
body.page-review .store-status-btn.store-in {
  padding: 4px 8px;
  font-size: 0.7rem;
}
body.page-review .cc-filter-btn:hover:not(.is-active) {
  background: var(--surface-2);
  border-color: var(--border-2);
}
body.page-review .cost-centre-sticky-bar {
  background: var(--bg);
}
/* Store section tables — Paint / Hardware / Wood (intentional min-width + scroll) */
body.page-review table.drawings-table.store-section-table {
  width: 100%;
  table-layout: fixed;
}
body.page-review #store-table-upholstery { min-width: 1180px; }
body.page-review #store-table-upholstery col.col-client { width: 172px; }
body.page-review #store-table-upholstery col.col-code { width: 124px; }
body.page-review #store-table-upholstery col.col-photo { width: 56px; }
body.page-review #store-table-upholstery col.col-type { width: 148px; }
body.page-review #store-table-upholstery col.col-size { width: 108px; }
body.page-review #store-table-upholstery col.col-brand { width: 108px; }
body.page-review #store-table-upholstery col.col-eta { width: 100px; }
body.page-review #store-table-upholstery col.col-status { width: 104px; }
body.page-review #store-table-upholstery td.store-col-client,
body.page-review #store-table-upholstery td:first-child {
  overflow: hidden;
}
body.page-review #store-table-upholstery .store-cell-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
body.page-review #store-table-paint { min-width: 1240px; }
body.page-review #store-table-hardware { min-width: 1320px; }
body.page-review #store-table-wood { min-width: 1260px; }

/* Shared store column widths */
body.page-review #store-table-paint col.col-store-client,
body.page-review #store-table-hardware col.col-store-client,
body.page-review #store-table-wood col.col-store-client { width: 156px; }
body.page-review #store-table-paint col.col-store-drawing,
body.page-review #store-table-hardware col.col-store-drawing,
body.page-review #store-table-wood col.col-store-drawing { width: 116px; }
body.page-review #store-table-paint col.col-store-photo,
body.page-review #store-table-hardware col.col-store-photo,
body.page-review #store-table-wood col.col-store-photo { width: 56px; }
body.page-review table.drawings-table.store-section-table col.col-store-qty,
body.page-review table.drawings-table.store-section-table col.col-store-recd,
body.page-review table.drawings-table.store-section-table col.col-store-bal,
body.page-review table.drawings-table.store-section-table col.col-qty,
body.page-review table.drawings-table.store-section-table col.col-recd,
body.page-review table.drawings-table.store-section-table col.col-bal { width: 36px; }
body.page-review #store-table-paint col.col-store-eta,
body.page-review #store-table-hardware col.col-store-eta,
body.page-review #store-table-wood col.col-store-eta { width: 100px; }
body.page-review #store-table-paint col.col-store-status,
body.page-review #store-table-hardware col.col-store-status,
body.page-review #store-table-wood col.col-store-status { width: 104px; }

/* Paint */
body.page-review #store-table-paint col.col-store-brand { width: 172px; }
body.page-review #store-table-paint col.col-store-paint-code { width: 128px; }
body.page-review #store-table-paint col.col-store-paint-type { width: 172px; }
body.page-review #store-table-paint col.col-store-unit { width: 76px; }

/* Hardware */
body.page-review #store-table-hardware col.col-store-hw-type { width: 216px; }
body.page-review #store-table-hardware col.col-store-size { width: 140px; }
body.page-review #store-table-hardware col.col-store-brand { width: 140px; }
body.page-review #store-table-hardware col.col-store-item-code { width: 140px; }

/* Wood / sheet stock */
body.page-review #store-table-wood col.col-store-mat-type { width: 168px; }
body.page-review #store-table-wood col.col-store-thick { width: 68px; }
body.page-review #store-table-wood col.col-store-size { width: 124px; }
body.page-review #store-table-wood col.col-store-brand { width: 124px; }
body.page-review #store-table-wood col.col-store-item-code { width: 124px; }

/* Ellipsis + tooltip text (single-line, no uneven row heights) */
body.page-review table.drawings-table.store-section-table td.store-col-client,
body.page-review table.drawings-table.store-section-table td.store-col-drawing,
body.page-review table.drawings-table.store-section-table td.store-col-field,
body.page-review table.drawings-table.store-section-table td.store-col-thick,
body.page-review table.drawings-table.store-section-table td.store-col-unit,
body.page-review table.drawings-table.store-section-table td.store-col-eta {
  overflow: hidden;
}
body.page-review .store-cell-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
body.page-review table.drawings-table.store-section-table td.store-col-field .store-grid-input,
body.page-review table.drawings-table.store-section-table td.store-col-thick .store-grid-input,
body.page-review table.drawings-table.store-section-table td.paint-code-cell .store-paint-code {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.page-review table.drawings-table.store-section-table td.store-master-pick-cell .store-grid-input,
body.page-review table.drawings-table.store-section-table td.store-col-mat-type .store-grid-input,
body.page-review table.drawings-table.store-section-table td.store-col-paint-type .store-grid-input,
body.page-review table.drawings-table.store-section-table td.store-col-hw-type .store-grid-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.page-review .paint-code-cell .store-paint-code {
  width: 100%;
  min-width: 0;
  margin: 0;
}

/* Compact Unit / ETA / Status */
body.page-review #store-table-paint td.store-col-unit {
  text-align: center;
  padding: 4px 3px;
}
body.page-review #store-table-paint td.store-col-unit .store-paint-unit,
body.page-review #store-table-paint td.store-col-unit select {
  width: 100%;
  min-width: 0;
  padding: 4px 2px;
  font-size: 0.78rem;
  font-weight: 700;
}
body.page-review table.drawings-table.store-section-table td.store-col-eta {
  padding: 4px 3px;
}
body.page-review table.drawings-table.store-section-table td.store-col-eta .store-eta,
body.page-review table.drawings-table.store-section-table td.store-col-eta input[type="date"] {
  width: 100%;
  min-width: 0;
  padding: 4px 2px;
  font-size: 0.78rem;
}
body.page-review table.drawings-table.store-section-table td.store-status-cell {
  padding: 4px 3px;
  white-space: nowrap;
  text-align: center;
}
body.page-review table.drawings-table.store-section-table td.store-status-cell .store-status-btn {
  padding: 4px 6px;
  font-size: 0.68rem;
  min-height: 22px;
  line-height: 1.1;
}
body.page-review table.drawings-table.store-section-table td.store-status-cell .store-status-btn.store-in {
  padding: 3px 5px;
  font-size: 0.66rem;
}

/* Sales admin tab */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sales-head {
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.sales-head-title {
  flex: 1 1 220px;
  min-width: 0;
}
.sales-head-primary {
  flex: 0 1 auto;
}
.sales-head-more {
  position: relative;
  flex: 0 0 auto;
}
.sales-head-more--disabled summary {
  pointer-events: none;
  opacity: 0.55;
}
.sales-head-more-btn {
  list-style: none;
  cursor: pointer;
  margin: 0;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.sales-head-more-btn::-webkit-details-marker {
  display: none;
}
.sales-head-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(46, 42, 36, 0.12);
}
.sales-btn-danger {
  color: #991b1b;
  border-color: #fecaca;
  background: #fef2f2;
}
.sales-stale-banner {
  margin: 0 0 var(--space-3);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.85rem;
}
.sales-kpi-grid {
  margin-bottom: var(--space-2);
  gap: 6px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) {
  .sales-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1200px) {
  .sales-kpi-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}
#sales-panel .sales-kpi-card.store-summary-card {
  padding: 6px 8px 7px;
  border-radius: 8px;
  border: 1px solid #D9CFB8;
  background: linear-gradient(180deg, #F5EFE3 0%, #EAE0CC 100%);
  box-shadow: 0 1px 2px rgba(46, 42, 36, 0.06);
  min-height: 0;
}
.sales-kpi-card {
  border-left: 2px solid var(--border);
}
.sales-kpi-card--critical {
  border-left-color: #b91c1c;
}
.sales-kpi-card--warn {
  border-left-color: #ea580c;
}
.sales-kpi-card--ok {
  border-left-color: #16a34a;
}
.sales-kpi-label {
  margin: 0 0 1px;
  font-size: 0.68rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8A7E72;
}
.sales-kpi-value {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: #3D3830;
}
.sales-kpi-value--sm {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
}
.sales-summary-secondary {
  margin: 0 0 var(--space-2);
  min-height: 0;
  font-size: 0.78rem;
}
.sales-config-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-bottom: 4px;
  padding: 8px 10px;
  border: 1px solid #D9CFB8;
  border-radius: 8px;
  background: #F0E8D8;
}
.sales-config-strip-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8A7E72;
  padding-bottom: 6px;
  align-self: center;
}
.sales-config-foot {
  margin: 0 0 var(--space-3);
  font-size: 0.76rem;
  line-height: 1.3;
}
.sales-config-strip-mode {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 1 auto;
}
.sales-config-strip-mode > .hint {
  font-size: 0.68rem;
  margin: 0;
  line-height: 1;
}
.sales-config-save {
  margin: 0;
  padding: 7px 12px;
  font-size: 0.82rem;
  flex: 0 0 auto;
}
.sales-settings-field {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sales-settings-field--url {
  flex: 2 1 280px;
}
.sales-settings-field--narrow {
  flex: 0 1 72px;
}
.sales-settings-field .hint {
  font-size: 0.68rem;
  margin: 0;
  line-height: 1.1;
}
.sales-settings-field .store-grid-input {
  padding: 6px 8px;
  min-height: 32px;
  font-size: 0.82rem;
}
.sales-mode-toggle {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
  border: 1px solid #D9CFB8;
  border-radius: 6px;
  overflow: hidden;
  background: #F2EBDD;
}
.sales-mode-toggle__option {
  margin: 0;
  cursor: pointer;
}
.sales-mode-toggle__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sales-mode-toggle__option span {
  display: block;
  padding: 5px 8px;
  font-size: 0.74rem;
  border-right: 1px solid #D9CFB8;
  white-space: nowrap;
}
.sales-mode-toggle__option:last-child span {
  border-right: none;
}
.sales-mode-toggle__option input:checked + span {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.sales-registry-section {
  margin-top: var(--space-4);
}
.sales-registry-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: var(--space-2);
}
.sales-search-input {
  flex: 1 1 200px;
  max-width: 320px;
  margin: 0;
}
.sales-registry-count {
  margin-left: auto;
  white-space: nowrap;
}
.sales-ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.sales-col-tab .sales-ellipsis {
  max-width: 14ch;
}
.sales-col-name .sales-ellipsis {
  max-width: 18ch;
}
.sales-img-dot {
  color: var(--accent);
  font-size: 0.65rem;
  vertical-align: middle;
}
.sales-status-note {
  font-size: 0.72rem;
}
.badge-status.sales-sheet-final {
  background: #e8f5e9;
  color: #047857;
}
.badge-status.sales-sheet-draft {
  background: #fff3e0;
  color: #c2410c;
}
.badge-status.sales-sheet-pending {
  background: #eff6ff;
  color: #1d4ed8;
}
.badge-status.sales-sheet-skipped,
.badge-status.sales-sheet-unknown {
  background: #f1f5f9;
  color: #64748b;
}
.badge-status.sales-sheet-imported {
  background: #f0fdf4;
  color: #15803d;
}
.sales-attention-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.sales-attn-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.sales-attn-section--critical {
  border-color: #fecaca;
  background: #fffbfb;
}
.sales-attn-section--warn {
  border-color: #fed7aa;
  background: #fffdf9;
}
.sales-attn-section--info {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.sales-attn-section-summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  list-style: none;
}
.sales-attn-section-summary::-webkit-details-marker {
  display: none;
}
.sales-attn-section-count {
  font-weight: 600;
  color: var(--text-2);
}
.sales-attn-show-all {
  margin: 8px 12px 12px;
  font-size: 0.82rem;
  padding: 6px 10px;
  width: auto;
}
.sales-issue-row--prominent td:first-child strong {
  color: #b91c1c;
}
.sales-tab-inventory-details {
  margin-top: var(--space-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px 10px;
}
.sales-tab-inventory-details summary {
  cursor: pointer;
  padding: 10px 0;
  list-style: none;
}
.sales-tab-inventory-details summary::-webkit-details-marker {
  display: none;
}
.sales-price-cards {
  display: none;
}
.sales-attention-panel {
  margin: 12px 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #b91c1c;
  background: #ffebee;
}
.sales-attention-hint {
  margin: 4px 0 10px;
}
.sales-attention-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(185, 28, 28, 0.15);
  font-size: 0.82rem;
}
.sales-attention-row:first-child {
  border-top: none;
}
.sales-attention-missing strong {
  color: #b91c1c;
}
.sales-attention-warn strong {
  color: #c2410c;
}
.sales-attention-warn span {
  color: #9a3412;
}
.sales-health-wrap {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sales-health-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}
.sales-health-banner.health-ok {
  border-color: #16a34a;
  background: #f0fdf4;
}
.sales-health-banner.health-warn {
  border-color: #ea580c;
  background: #fff7ed;
}
.sales-health-banner.health-critical {
  border-color: #b91c1c;
  background: #fef2f2;
}
.sales-health-level {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1.2;
}
.health-ok .sales-health-level {
  background: #15803d;
  color: #fff;
}
.health-warn .sales-health-level {
  background: #c2410c;
  color: #fff;
}
.health-critical .sales-health-level {
  background: #991b1b;
  color: #fff;
}
.sales-health-banner.health-info {
  border-color: #93c5fd;
  background: #f8fbff;
}
.health-info .sales-health-level {
  background: #1d4ed8;
  color: #fff;
}
.sales-health-text strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
  line-height: 1.3;
}
#sales-health-scanned {
  font-size: 0.76rem;
  line-height: 1.35;
}
.sales-attention-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sales-attn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  line-height: 1.2;
}
.sales-attn-chip strong {
  font-variant-numeric: tabular-nums;
}
.sales-attn-chip--zero {
  opacity: 0.55;
}
.sales-attn-chip--critical {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.sales-attn-chip--warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.sales-attn-chip--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}
.sales-attention-issues {
  margin: 12px 0;
}
.sales-attention-issues .sales-attention-hint {
  margin-bottom: 8px;
}
.sales-issues-table-wrap {
  max-height: min(280px, 40vh);
  overflow: auto;
}
.sales-issues-table {
  min-width: 960px;
  font-size: 0.82rem;
}
.sales-issues-table td {
  vertical-align: top;
}
.sales-severity {
  font-weight: 600;
  text-transform: capitalize;
}
.sales-severity--critical {
  color: #b91c1c;
}
.sales-severity--warn {
  color: #c2410c;
}
.sales-severity--info {
  color: #1d4ed8;
}
.sales-issue-type {
  color: #64748b;
  font-size: 0.75rem;
}
.sales-sync-table,
.sales-prices-table {
  min-width: 960px;
}
.sales-prices-table .sales-col-code {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
  min-width: 9ch;
}
.sales-sync-table .sales-td-num,
.sales-prices-table .sales-td-num {
  text-align: right;
  white-space: nowrap;
}
.sales-col-emphasis strong {
  color: var(--text);
}
.sales-sync-loading {
  opacity: 0.65;
  pointer-events: none;
}
@media (max-width: 1099px) {
  .sales-prices-table .sales-col-name {
    display: none;
  }
}
@media (max-width: 719px) {
  .sales-head {
    flex-direction: column;
    align-items: stretch;
  }
  .sales-head-primary {
    justify-content: flex-start;
  }
  .sales-head-more-menu {
    position: static;
    box-shadow: none;
    margin-top: 6px;
  }
  .sales-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sales-config-strip {
    flex-direction: column;
    align-items: stretch;
  }
  .sales-config-strip-label {
    align-self: flex-start;
    padding-bottom: 0;
  }
  .sales-config-save {
    width: 100%;
  }
  .sales-registry-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .sales-registry-count {
    margin-left: 0;
  }
  .sales-prices-wrap {
    display: none;
  }
  .sales-price-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .sales-price-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: var(--surface);
  }
  .sales-price-card--stale {
    opacity: 0.85;
    background: #fafafa;
  }
  .sales-price-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }
  .sales-price-card-pack {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    font-size: 0.85rem;
  }
  .sales-price-card-pack input {
    max-width: 5rem;
    margin: 0;
  }
}
.badge-status.sales-status-ok {
  background: #e8f5e9;
  color: #047857;
}
.badge-status.sales-status-warn {
  background: #fff3e0;
  color: #c2410c;
}
tr.sales-row-stale {
  background: #fafafa;
  opacity: 0.85;
}
.sales-pack-input {
  max-width: 4.5rem;
  text-align: right;
}
#profitability-panel .pf-kpi-grid {
  margin: var(--space-3) 0 var(--space-2);
  gap: 6px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) {
  #profitability-panel .pf-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  #profitability-panel .pf-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
#profitability-panel .pf-kpi-card.store-summary-card {
  padding: 6px 8px 7px;
  border-radius: 8px;
  border: 1px solid #D9CFB8;
  background: linear-gradient(180deg, #F5EFE3 0%, #EAE0CC 100%);
  box-shadow: 0 1px 2px rgba(46, 42, 36, 0.06);
}
.pf-summary-secondary {
  margin: 0 0 var(--space-2);
  font-size: 0.78rem;
}
.pf-filter-bar {
  margin-top: var(--space-2);
}
.pf-search {
  margin-top: var(--space-2);
  max-width: 420px;
}
.pf-stale-banner {
  margin-top: var(--space-2);
}
.pf-sync-loading {
  opacity: 0.65;
  pointer-events: none;
}
.profitability-table {
  min-width: 1480px;
  table-layout: fixed;
  font-size: 0.82rem;
}
.profitability-table .pf-col-code { width: 9%; }
.profitability-table .pf-col-client { width: 10%; }
.profitability-table .pf-col-desc { width: 14%; }
.profitability-table .pf-col-num { width: 7.5%; }
.profitability-table .pf-col-num-sm { width: 5%; }
.profitability-table .pf-col-notes { width: 11%; }
.profitability-table .pf-col-status { width: 12%; }
.pf-ellipsis { max-width: 100%; }
.pf-col-desc .pf-ellipsis { max-width: 22ch; }
.pf-col-client .pf-ellipsis { max-width: 16ch; }
.pf-td-edit .store-grid-input,
.pf-others-input {
  max-width: 5.5rem;
  text-align: right;
  margin: 0;
}
.pf-notes-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 0.8rem;
}
.pf-badge-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.badge-status.pf-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-status.pf-badge--ok {
  background: #e8f5e9;
  color: #047857;
}
.badge-status.pf-badge--warn {
  background: #fff3e0;
  color: #c2410c;
}
.badge-status.pf-badge--critical {
  background: #ffebee;
  color: #b91c1c;
}
.badge-status.pf-badge--info {
  background: #e0f2fe;
  color: #0369a1;
}
.pf-profit-pos {
  color: #047857;
  font-weight: 700;
}
.pf-profit-neg {
  color: #b91c1c;
  font-weight: 700;
}
.pf-margin-warn {
  color: #c2410c;
  font-weight: 700;
}
tr.pf-row-loss {
  background: #ffebee;
}
tr.pf-row-partial {
  background: #fff8e1;
}
button.linkish.pf-code-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-deep);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.pf-price-cards {
  display: none;
}
@media (max-width: 719px) {
  #profitability-panel .pf-head {
    flex-direction: column;
    align-items: stretch;
  }
  #profitability-panel .pf-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #profitability-panel .pf-table-wrap {
    display: none;
  }
  #profitability-panel .pf-price-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: var(--space-2);
  }
  .pf-price-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: var(--surface);
  }
  .pf-price-card.pf-row-loss {
    background: #ffebee;
  }
  .pf-price-card.pf-row-partial {
    background: #fff8e1;
  }
  .pf-price-card.pf-row-sales-only {
    border-left: 3px solid #0369a1;
  }
  .pf-price-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
  }
  .pf-price-card-desc {
    margin: 4px 0 8px;
    font-size: 0.85rem;
    color: var(--text-muted, #6b6560);
  }
  .pf-price-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    margin: 0 0 10px;
    font-size: 0.82rem;
  }
  .pf-price-card-grid dt {
    margin: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #8A7E72;
  }
  .pf-price-card-grid dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .pf-price-card-field {
    display: block;
    margin-bottom: 8px;
  }
  .pf-price-card-field .pf-others-input,
  .pf-price-card-field .pf-notes-input {
    width: 100%;
    max-width: none;
    margin-top: 4px;
  }
}
