:root {
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: rgba(15, 23, 42, 0.08);
  --accent: #ff6b2c;
  --accent-dark: #d84d14;
  --green: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 22px 54px rgba(15, 23, 42, 0.10);
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,107,44,.07), transparent 260px),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  min-height: 100vh;
}

a {
  color: #2457a6;
}

a:hover {
  color: #17428c;
}

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px;
}

.shell-wide {
  max-width: 1720px;
}

.topbar, .panel, .table, .modal-card, .auth-card, .metric {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 10px;
}

.compact-topbar { align-items: center; }
.topbar-title { min-width: 0; }
.slim-topbar {
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
  padding: 10px 12px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.section-actions {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: end;
}

.section-select-label {
  width: 100%;
  min-width: 190px;
}

.compact-action {
  min-height: 40px;
  white-space: nowrap;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.sync-status span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #98a2b3;
}

.sync-status strong,
.sync-status em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status strong {
  color: #344054;
  font-weight: 800;
}

.sync-status em {
  font-style: normal;
}

.sync-ok span { background: var(--green); }
.sync-running span {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 107, 44, .14);
}
.sync-error span { background: var(--danger); }

.section-panel {
  margin-bottom: 10px;
}

.users-panel {
  display: grid;
  gap: 16px;
}

.fbo-panel {
  display: grid;
  gap: 16px;
}

.fbo-upload-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.fbo-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.fbo-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
}

.fbo-summary span,
.fbo-summary strong {
  display: block;
}

.fbo-summary span {
  color: var(--muted);
  font-size: 12px;
}

.fbo-summary strong {
  margin-top: 4px;
  font-size: 18px;
}

.fbo-state {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 800;
}

.fbo-state.ok {
  background: rgba(22, 163, 74, .10);
  color: #166534;
}

.fbo-state.warn {
  background: rgba(245, 158, 11, .12);
  color: #92400e;
}

.fbo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fbo-result-block {
  display: grid;
  gap: 8px;
}

.fbo-result-block h3 {
  margin: 0;
  font-size: 16px;
}

.fbo-problems {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(220, 38, 38, .22);
  border-radius: 8px;
  background: rgba(254, 242, 242, .72);
}

.fbo-problems-head,
.fbo-problem-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(140px, .7fr) minmax(90px, .4fr) minmax(180px, .8fr) minmax(100px, .45fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
}

.fbo-problems-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #991b1b;
}

.fbo-problems-title span {
  color: #7f1d1d;
  font-size: 12px;
}

.fbo-problems-head {
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fbo-problem-row {
  padding-top: 8px;
  border-top: 1px solid rgba(220, 38, 38, .16);
  color: #7f1d1d;
  font-size: 13px;
}

.fbo-hash {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.fbo-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.fbo-row {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(100px, .45fr) minmax(80px, .35fr) minmax(260px, 1.2fr) minmax(260px, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .62);
}

.fbo-write-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.8fr) minmax(150px, .8fr) repeat(3, minmax(120px, .6fr));
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .62);
}

.fbo-write-row:last-child { border-bottom: 0; }
.fbo-write-row strong { overflow-wrap: anywhere; }
.fbo-result-block p { margin: -2px 0 10px; color: var(--muted); font-size: 13px; }

.fbo-row:last-child {
  border-bottom: 0;
}

.fbo-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(15, 23, 42, .045);
}

.fbo-runs {
  display: grid;
  gap: 8px;
}

.fbo-run {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.fbo-run:hover {
  border-color: var(--accent);
}

.fbo-run span:last-child {
  color: var(--accent);
  font-weight: 800;
}

.fbo-run code {
  overflow-wrap: anywhere;
}

.user-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
}

.user-admin-check {
  min-height: 42px;
  align-items: center;
  padding-bottom: 2px;
}

.password-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(22, 163, 74, .20);
  background: rgba(22, 163, 74, .08);
  border-radius: 8px;
}

.password-result div {
  display: grid;
  gap: 2px;
}

.password-result span {
  color: var(--muted);
  font-size: 13px;
}

.password-result code {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, .08);
  font-size: 14px;
  white-space: nowrap;
}

.users-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.users-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(130px, .55fr) minmax(120px, .55fr) minmax(160px, .7fr) minmax(360px, 1.5fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .62);
  border-bottom: 1px solid var(--line);
}

.users-row:last-child {
  border-bottom: 0;
}

.users-head {
  background: rgba(15, 23, 42, .045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.users-row strong,
.users-row em {
  display: block;
}

.users-row em {
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.manager-card-settings {
  display: grid;
  gap: 14px;
}

.assignment-controls {
  display: grid;
  grid-template-columns: minmax(160px, .7fr) minmax(180px, .8fr) minmax(220px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
}

.assignment-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 9px;
  background: #fff;
  color: #1f2937;
  font-weight: 800;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.assignment-layout {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr);
  gap: 12px;
}

.assignment-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.assignment-title {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.assignment-list {
  display: grid;
  gap: 7px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.assignment-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.assignment-row.assignment-missing {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(255, 245, 245, .82);
}

.assignment-row img,
.assignment-image-placeholder,
.assignment-thumb {
  width: 44px;
  height: 54px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(148, 163, 184, 0.18);
}

.assignment-row strong,
.assignment-row span,
.assignment-row em {
  display: block;
  min-width: 0;
}

.candidate-check {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 107, 44, 0.32);
  border-radius: 8px;
  background: rgba(255, 107, 44, 0.08);
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.candidate-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.candidate-check.disabled {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.10);
  color: #667085;
  cursor: default;
}

.assignment-row strong {
  overflow: hidden;
  color: #1f2937;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-row em {
  margin-top: 2px;
  color: #b45309;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.bidder-panel {
  display: grid;
  gap: 14px;
}

.bidder-grid {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr);
  gap: 12px;
  align-items: start;
}

.bidder-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bidder-form label:nth-child(1),
.bidder-form label:nth-child(2),
.bidder-form-actions {
  grid-column: 1 / -1;
}

.bidder-rules,
.bidder-actions-list {
  display: grid;
  gap: 8px;
}

.bidder-row,
.bidder-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255,255,255,.74);
}

.bidder-row strong,
.bidder-action-row strong,
.bidder-row span,
.bidder-action-row span,
.bidder-row em,
.bidder-action-row em {
  display: block;
  min-width: 0;
}

.bidder-row strong,
.bidder-action-row strong {
  color: #1f2937;
  font-size: 13px;
}

.bidder-row span,
.bidder-action-row span {
  color: var(--muted);
  font-size: 12px;
}

.bidder-row em,
.bidder-action-row em {
  margin-top: 3px;
  color: #475467;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.bidder-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bidder-testbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px));
  gap: 10px;
  align-items: end;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle, .muted {
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  border-radius: 8px;
  padding: 10px 12px;
}

.compact-metric {
  min-width: 92px;
  display: grid;
  gap: 2px;
  box-shadow: none;
}

.compact-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.compact-metric strong {
  font-size: 20px;
}

.compact-metric.attention strong {
  color: var(--danger);
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
}

.content-grid,
.main-only {
  min-width: 0;
}

.panel {
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.workbar {
  position: sticky;
  top: 96px;
  z-index: 110;
  display: grid;
  gap: 10px;
}

.workbar-main {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(150px, .75fr) minmax(150px, .7fr) minmax(180px, .85fr);
  gap: 10px;
  align-items: end;
}

.workbar-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-check {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.stack {
  display: grid;
  gap: 10px;
}

.chip-row, .toolbar, .toggle-row, .inline-form, .table-controls, .table-head, .table-row, .account-group-row, .row-card, .row-meta, .gallery-row, .merge-section-head {
  display: flex;
  gap: 10px;
}

.inline-form {
  flex-wrap: wrap;
}

.inline-form > label {
  flex: 1 1 220px;
}

.inline-toggle-wrap {
  display: flex;
  align-items: end;
  flex: 1 1 360px;
}

.toolbar, .table-controls, .merge-section-head {
  align-items: center;
  justify-content: space-between;
}

.toggle-row { align-items: center; flex-wrap: wrap; }
.chip-row { flex-wrap: wrap; }

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

.button {
  border: 0;
  border-radius: 8px;
  padding: 10px 13px;
  background: var(--surface-strong);
  cursor: pointer;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.button:hover,
.date-range-button:hover,
.calendar-preset:hover,
.merge-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.button:focus-visible,
input:focus,
select:focus,
.date-range-button:focus-visible,
.calendar-day:focus-visible,
.merge-card:focus-visible {
  outline: 2px solid rgba(255, 107, 44, 0.42);
  outline-offset: 2px;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #ff8a33);
  color: #fff;
  box-shadow: none;
}

.button.ghost {
  background: rgba(255,255,255,.55);
}

.button.danger {
  background: rgba(220, 38, 38, .10);
  color: #991b1b;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .20);
}

.button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.button.full { width: 100%; }

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.75);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.08));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%,
    calc(100% - 32px) 50%;
  background-size: 5px 5px, 5px 5px, 1px 20px;
  background-repeat: no-repeat;
}

input:hover,
select:hover {
  border-color: rgba(255, 107, 44, 0.34);
  background-color: #fff;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

label.field-error input {
  border-color: rgba(220, 38, 38, .42);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .10);
}

label.field-error small {
  color: var(--danger);
}

.table {
  border-radius: 8px;
  overflow: visible;
  isolation: isolate;
  min-width: calc(340px + (286px * 7));
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-scroll {
  position: relative;
  max-height: calc(100vh - 162px);
  overflow: auto;
  padding: 0 0 8px;
}

.table-head, .table-row, .account-group-row {
  align-items: stretch;
  border-top: 1px solid var(--line);
  width: max-content;
}

.table-head {
  position: sticky;
  top: 0;
  z-index: 95;
  background: #fff;
  font-weight: 700;
  color: #475467;
  box-shadow: 0 1px 0 var(--line), 0 8px 18px rgba(15, 23, 42, 0.04);
}

.table-row {
  background: #fff;
  transition: background .14s ease;
}

.table-row > div {
  background: #fff;
  transition: background .14s ease, box-shadow .14s ease;
}

.table-row:hover {
  background: #fff6ed;
}

.table-row:hover > div {
  background-color: #fff6ed;
  box-shadow: inset 0 1px 0 rgba(255, 107, 44, 0.12), inset 0 -1px 0 rgba(255, 107, 44, 0.12);
}

.table-row:hover .sticky-col {
  background-color: #fff0e5;
  box-shadow: 1px 0 0 rgba(255, 107, 44, 0.18), inset 0 1px 0 rgba(255, 107, 44, 0.12), inset 0 -1px 0 rgba(255, 107, 44, 0.12);
}

.table-row:hover .sheet-day,
.table-row:hover .day-card {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 107, 44, 0.22);
}

.current-day-head {
  display: grid;
  gap: 2px;
  color: #111827;
}

.current-day-head em {
  font-size: 11px;
  font-style: normal;
  color: var(--accent-dark);
  font-weight: 800;
}

.table-head > div, .table-row > div, .account-group-row > div {
  padding: 10px 12px;
}

.col-product { width: 340px; min-width: 340px; }
.col-day { width: 286px; }

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 40;
  background: #fff;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.06);
}

.sticky-product { left: 0; }

.table-head .sticky-col {
  background: #fff;
  z-index: 90;
}

.account-group-row {
  position: sticky;
  top: 59px;
  z-index: 60;
  background: #fff;
}

.account-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #1f2937;
}

.account-group-title span,
.account-group-title em {
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}

.account-group-fill {
  width: 9999px;
  background: #fff;
  border-left: 1px solid rgba(15, 23, 42, 0.04);
}

.mobile-list {
  display: none;
}

.row-card { align-items: flex-start; }
.product-table-row.expanded .sticky-col,
.size-table-row-flat .sticky-col {
  background: #fbfdff;
}

.size-table-row-flat > div {
  background: #fbfdff;
}

.size-left-cell {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  align-content: start;
  min-height: 92px;
}

.size-left-cell strong {
  color: #1f2937;
  font-size: 15px;
}

.size-left-cell em {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.row-expand-button,
.row-expand-spacer {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.row-expand-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-weight: 900;
  cursor: pointer;
}

.row-expand-button.open {
  border-color: rgba(255, 107, 44, 0.34);
  color: var(--accent-dark);
  background: rgba(255, 107, 44, 0.08);
}
.row-card > div {
  min-width: 0;
}
.row-card img,
.row-thumb,
.merge-thumb,
.product-image-placeholder {
  width: 46px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  background: rgba(148, 163, 184, 0.18);
}

.product-image-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.55);
  color: #667085;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.row-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.row-title-link {
  color: var(--text);
  text-decoration: none;
}

.row-title-link:hover {
  color: #2457a6;
  text-decoration: underline;
}

.row-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.row-badges {
  margin-top: 8px;
}

.product-signals { margin-top: 5px; }
.product-signals a {
  font-weight: 700;
  text-decoration: none;
}

.size-button {
  margin-top: 8px;
  width: fit-content;
  border: 1px solid rgba(36, 87, 166, 0.22);
  border-radius: 7px;
  background: rgba(36, 87, 166, 0.08);
  color: #2457a6;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.filter-menu-button.active {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 44, 0.42);
  background: rgba(255, 107, 44, 0.08);
}

.filter-popover {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
}

.filter-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-button {
  padding: 7px 10px;
}

.ad-summary {
  color: #2457a6;
  font-weight: 800;
}

.ad-summary-empty {
  color: #98a2b3;
  font-weight: 700;
}

.ad-campaign-list {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.ad-campaign {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
  align-items: center;
  padding: 6px 7px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.035);
  color: #344054;
  text-decoration: none;
  font-size: 11px;
}

.ad-campaign.active {
  background: rgba(22, 163, 74, 0.09);
}

.ad-campaign.inactive {
  color: #667085;
}

.ad-status {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  font-weight: 900;
}

.ad-campaign.active .ad-status {
  color: #166534;
  background: rgba(22, 163, 74, 0.17);
}

.ad-spend {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 1px 7px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.72);
}

.ad-spend em,
.ad-spend b {
  font-style: normal;
  text-align: center;
}

.ad-spend em {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(15,23,42,.06);
}

.badge.warn { background: rgba(245, 158, 11, 0.16); color: #9a6700; }
.badge.good { background: rgba(22, 163, 74, 0.16); color: #166534; }
.badge.danger { background: rgba(220, 38, 38, 0.14); color: #991b1b; }

.day-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.day-card strong { font-size: 14px; }
.summary-lines {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: #46505f;
}

.summary-warehouse {
  display: grid;
  gap: 3px;
}

.summary-warehouse strong {
  font-size: 13px;
  font-weight: 700;
}

.summary-totals {
  padding-top: 6px;
  border-top: 1px dashed rgba(15, 23, 42, 0.14);
  font-weight: 700;
}

.sheet-day {
  display: grid;
  gap: 4px;
  min-height: 100%;
  padding: 8px 10px 10px;
  border-radius: 4px;
  background: #fffefb;
  border: 1px solid rgba(118, 92, 54, 0.12);
  box-shadow: none;
}

.sheet-day.state-central-low {
  background: linear-gradient(180deg, rgba(255,244,232,.95), rgba(255,255,255,.88));
  border-color: rgba(245, 158, 11, 0.28);
}

.sheet-day.state-central-zero {
  background: linear-gradient(180deg, rgba(255,240,228,.96), rgba(255,251,247,.92));
  border-color: rgba(234, 88, 12, 0.35);
}

.sheet-day.state-card-zero {
  background: linear-gradient(180deg, rgba(255,236,235,.98), rgba(255,247,246,.94));
  border-color: rgba(220, 38, 38, 0.30);
}

.sheet-line {
  font-size: 12.5px;
  line-height: 1.26;
}

.orders-line {
  color: #23824b;
  font-weight: 700;
}

.movement-line,
.muted-line {
  color: #667085;
}

.sheet-divider {
  color: #a49b90;
  font-size: 11px;
  letter-spacing: .35px;
}

.region-block {
  display: grid;
  gap: 2px;
  margin-top: 5px;
}

.region-title {
  color: #305ea8;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.region-title-alert {
  color: #c25122;
}

.warehouse-line {
  color: #1f2937;
  padding-left: 2px;
  overflow-wrap: anywhere;
}

.size-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 10px;
  color: #4b5563;
  font-size: 12px;
}

.size-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 4px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.size-summary span {
  border-radius: 6px;
  background: rgba(36, 87, 166, 0.08);
  color: #2457a6;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 800;
}

.size-stock-details {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(118, 92, 54, 0.20);
}

.size-stock-title {
  color: #344054;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.size-stock-row {
  display: grid;
  gap: 5px;
  padding: 7px 0 0;
  border-top: 1px dotted rgba(118, 92, 54, 0.18);
  background: transparent;
}

.size-stock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.size-stock-head strong {
  color: #344054;
  font-size: 12.5px;
}

.size-stock-head span {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.size-region-block {
  display: grid;
  gap: 2px;
  margin-top: 3px;
}

.warehouse-line-alert {
  color: #c25122;
  font-weight: 700;
}

.fbs-line,
.fbs-total-alert {
  color: #b42318;
  font-weight: 700;
}

.total-line {
  margin-top: 2px;
  font-weight: 800;
}

.event-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.event-chip,
.warehouse-event {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.event-chip {
  padding: 6px 9px;
}

.warehouse-event {
  margin-left: 6px;
  padding: 4px 7px;
}

.chip-supply,
.warehouse-event.supply {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
}

.chip-return,
.warehouse-event.return {
  background: rgba(180, 83, 9, 0.14);
  color: #b45309;
}

.chip-ambiguous,
.warehouse-event.ambiguous {
  background: rgba(107, 114, 128, 0.14);
  color: #4b5563;
}

.chip-zero {
  background: rgba(220, 38, 38, 0.14);
  color: #b42318;
}

.sheet-spacer {
  height: 2px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.55);
}

.list-item small { color: var(--muted); display: block; }

.switch {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  position: relative;
  border: 0;
  background: rgba(148,163,184,.45);
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}

.switch.on {
  background: rgba(255,107,44,.7);
}

.switch.on::after {
  transform: translateX(18px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15,23,42,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card, .auth-card {
  border-radius: 8px;
  width: min(1100px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
}

.password-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-input input {
  min-width: 0;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.gallery-row {
  flex-wrap: wrap;
}

.merge-thumb {
  width: 92px;
  height: 120px;
}

.merge-group {
  padding: 18px;
  border-radius: 8px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(15,23,42,.05);
  margin-bottom: 16px;
}

.section-title {
  margin: 0 0 6px;
  font-size: 18px;
}

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

.date-range-control {
  position: relative;
  flex: 1 1 400px;
  z-index: 1;
}

.date-range-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 107, 44, 0.55);
  border-radius: 4px;
  background: #fff;
  color: #111827;
  padding: 10px 13px;
  font: inherit;
  cursor: pointer;
}

.date-range-button.active {
  box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.14);
}

.calendar-mark {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--accent-dark);
  color: var(--accent-dark);
  font-size: 0;
  position: relative;
}

.calendar-mark::before,
.calendar-mark::after {
  content: "";
  position: absolute;
  background: var(--accent-dark);
}

.calendar-mark::before {
  width: 10px;
  height: 2px;
  top: 4px;
}

.calendar-mark::after {
  width: 2px;
  height: 10px;
  left: 5px;
  top: 6px;
  box-shadow: 5px 0 0 var(--accent-dark);
}

.calendar-layer {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 112px 20px 24px;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(3px);
}

.calendar-popover {
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 136px);
  overflow: auto;
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid #d7d2df;
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(17, 24, 39, 0.22);
  padding: 16px;
}

.calendar-head,
.calendar-body {
  display: grid;
  gap: 14px;
}

.calendar-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--line);
}

.calendar-head strong {
  display: block;
  font-size: 18px;
}

.calendar-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-body {
  grid-template-columns: minmax(0, 1fr) 190px;
}

.calendar-months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.calendar-month-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 16px;
  padding: 0 2px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays span {
  padding: 6px 0;
  text-align: center;
  font-size: 12px;
  color: #4b5563;
}

.calendar-weekdays span:nth-last-child(-n + 2) {
  color: #ff6b2c;
}

.calendar-day {
  min-width: 0;
  height: 38px;
  border: 1px solid #d8d8e2;
  background: #fff;
  color: #111827;
  font: inherit;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.calendar-day:hover {
  background: #fff6ed;
  border-color: #ffb089;
  color: #9a3412;
}

.calendar-day.empty-day {
  border-color: transparent;
  pointer-events: none;
}

.calendar-day.selected {
  background: #eef0ff;
  border-color: #c8d1ff;
}

.calendar-day.edge {
  background: #ffede3;
  border-color: #ff9f73;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 44, 0.32);
}

.calendar-side {
  display: grid;
  gap: 10px;
  align-content: start;
}

.calendar-preset {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.calendar-preset:hover {
  border-color: rgba(255, 107, 44, 0.42);
  background: #fff6ed;
}

.date-readonly,
.date-input {
  background: #f8f8fb;
  color: #111827;
  font-weight: 700;
}

.notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 420;
  width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  color: #1f2937;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.notice-success {
  border-color: rgba(22, 163, 74, 0.22);
  color: #166534;
}

.notice-error {
  border-color: rgba(220, 38, 38, 0.24);
  color: #991b1b;
}

.merge-picker {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.merge-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.merge-actions {
  justify-content: flex-end;
}

.filter-title {
  font-size: 16px;
  font-weight: 800;
}

.advanced-filter {
  display: grid;
  gap: 10px;
}

.advanced-filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.advanced-filter-toggle span {
  font-weight: 800;
}

.advanced-filter-toggle strong {
  color: #2457a6;
  font-size: 13px;
}

.advanced-filter-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,250,246,.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.filter-group-label {
  margin-bottom: 8px;
  font-weight: 800;
}

.selected-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-filter-summary span {
  border-radius: 7px;
  background: rgba(36, 87, 166, 0.08);
  color: #2457a6;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.merge-selected-summary {
  margin-top: 14px;
}

.merge-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.merge-search:focus-within {
  border-color: rgba(255, 107, 44, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.10);
}

.merge-search span {
  color: #667085;
  font-size: 18px;
}

.merge-search input {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 10px 0;
}

.merge-sections {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.merge-strip {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,250,252,.9));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.merge-strip-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #667085;
  font-weight: 800;
}

.merge-toggle {
  width: 44px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #d9dde5;
  position: relative;
  cursor: pointer;
}

.merge-toggle::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 999px;
  transition: transform .18s ease;
}

.merge-toggle.on {
  background: rgba(255,107,44,.74);
}

.merge-toggle.on::after {
  transform: translateX(18px);
}

.merge-card-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.merge-card {
  position: relative;
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f4f5f7;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.merge-card.active {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(255, 107, 44, 0.20);
}

.merge-card img,
.merge-card-image,
.merge-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  object-fit: cover;
  color: #98a2b3;
  font-size: 26px;
}

.merge-image-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}

.merge-image-grid.count-1 {
  display: block;
}

.merge-image-grid img,
.merge-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merge-card span:last-child {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.merge-card em {
  position: absolute;
  left: 6px;
  right: 32px;
  bottom: 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #111827;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-shadow: 0 1px 5px #fff;
}

.mini-empty { padding: 16px; }

.size-modal { width: min(720px, 100%); }

.merge-modal { width: min(760px, 100%); }

.api-modal { width: min(900px, 100%); }

.api-account-list {
  display: grid;
  gap: 12px;
}

.api-add-form {
  display: grid;
  grid-template-columns: minmax(160px, .7fr) minmax(230px, 1.3fr) auto;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(22, 163, 74, .28);
  border-radius: 8px;
  background: rgba(240, 253, 244, .72);
}

.api-add-title {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
}

.api-add-title span {
  color: var(--muted);
  font-size: 13px;
}

.api-account-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.3fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.62);
}

.api-account-info {
  display: grid;
  gap: 5px;
}

.api-account-info strong {
  font-size: 15px;
}

.api-account-info span {
  font-size: 12px;
  font-weight: 700;
}

.api-access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.api-access,
.api-access-pending {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.api-access-ok { background: #dcfce7; color: #166534; }
.api-access-missing { background: #fee2e2; color: #b91c1c; }
.api-access-unknown,
.api-access-pending { background: #f1f5f9; color: #475569; }

.token-ok { color: #047857; }

.token-empty { color: #b45309; }

.token-error { color: #b91c1c; }

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

.wb-tags-list {
  display: grid;
  gap: 8px;
}

.wb-tag-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, .6fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.wb-tag-row:last-child { border-bottom: 0; }

.wb-tag-row div {
  display: grid;
  gap: 3px;
}

.wb-tag-row span:not(.badge) {
  color: var(--muted);
  font-size: 12px;
}

.modal-actions {
  position: sticky;
  bottom: -22px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 18px -22px -22px;
  padding: 14px 22px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
}

.size-table {
  display: grid;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.size-table-head,
.size-table-row {
  display: grid;
  grid-template-columns: 1.1fr repeat(4, minmax(0, .8fr));
}

.real-size-table .size-table-head,
.real-size-table .size-table-row {
  grid-template-columns: .7fr .7fr .7fr .7fr .7fr .7fr minmax(180px, 1.8fr);
}

.size-table-head {
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.size-table-head span,
.size-table-row span,
.size-table-row strong {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.size-table-row:last-child span,
.size-table-row:last-child strong {
  border-bottom: 0;
}

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

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr; }
  .workbar-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bidder-grid {
    grid-template-columns: 1fr;
  }
  .user-create-form,
  .fbo-upload-form,
  .fbo-summary,
  .fbo-problems-head,
  .fbo-problem-row,
  .fbo-write-row,
  .fbo-row,
  .fbo-run,
  .users-row {
    grid-template-columns: 1fr;
  }
  .user-actions {
    justify-content: flex-start;
  }
  .calendar-popover {
    width: min(720px, calc(100vw - 32px));
  }
  .calendar-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    background: #f5f7fb;
  }

  .shell {
    padding: 8px;
  }

  .topbar {
    position: sticky;
    top: 0;
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 8px;
    padding: 9px;
    border-radius: 10px;
  }

  .slim-topbar {
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: 17px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .sync-status {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 4px 6px;
    font-size: 11px;
  }

  .sync-status em {
    grid-column: 2;
  }

  .sync-status strong,
  .sync-status em {
    white-space: normal;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    justify-content: stretch;
  }

  .section-actions {
    grid-template-columns: 1fr 1fr;
  }

  .section-select-label {
    grid-column: span 2;
  }

  .bidder-form,
  .bidder-testbar,
  .bidder-row,
  .bidder-action-row {
    grid-template-columns: 1fr;
  }

  .bidder-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .compact-metric {
    min-width: 0;
    padding: 7px 9px;
  }

  .compact-metric strong {
    font-size: 18px;
  }

  .topbar-actions .button {
    width: 100%;
    padding: 9px 10px;
  }

  .workbar {
    position: static;
    padding: 10px;
    border-radius: 10px;
  }

  .workbar-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .assignment-controls,
  .assignment-layout {
    grid-template-columns: 1fr;
  }

  .assignment-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .assignment-row .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .assignment-list {
    max-height: none;
  }

  .workbar-main label:nth-of-type(2),
  .workbar-main label:nth-of-type(3) {
    display: none;
  }

  .workbar-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .workbar-secondary > .button,
  .inline-check {
    width: 100%;
  }

  .inline-check {
    justify-content: flex-start;
    min-height: 42px;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255,255,255,.7);
    border: 1px solid var(--line);
  }

  .date-range-button,
  input,
  select,
  .button {
    min-height: 42px;
  }

  .panel {
    margin-bottom: 8px;
  }

  .table-panel {
    display: none;
  }

  .mobile-list {
    display: grid;
    gap: 10px;
  }

  .mobile-account {
    display: grid;
    gap: 8px;
  }

  .mobile-account-head {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  }

  .mobile-account-head strong {
    font-size: 13px;
  }

  .mobile-account-head span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-align: right;
  }

  .mobile-product {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  }

  .mobile-product-head {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    min-width: 0;
  }

  .mobile-product-head img,
  .mobile-thumb {
    width: 46px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 auto;
    background: rgba(148, 163, 184, 0.18);
  }

  .mobile-product-head > div {
    min-width: 0;
  }

  .mobile-article {
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

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

  .mobile-actions .size-button {
    margin-top: 0;
  }

  .mobile-days {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-day {
    flex: 0 0 280px;
    scroll-snap-align: start;
    display: grid;
    gap: 5px;
    padding: 9px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.07);
  }

  .mobile-day.current {
    background: #fff2e8;
    border-color: rgba(255, 107, 44, 0.34);
  }

  .mobile-sizes {
    display: grid;
    gap: 8px;
  }

  .mobile-size-block {
    display: grid;
    gap: 7px;
    padding: 8px;
    border-radius: 8px;
    background: #f8fbff;
    border: 1px solid rgba(36, 87, 166, 0.10);
  }

  .mobile-size-title {
    position: sticky;
    left: 0;
    width: max-content;
    min-width: 48px;
    padding: 4px 8px;
    border-radius: 7px;
    background: #fff;
    color: #1f2937;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  }

  .mobile-size-day {
    background: #fbfdff;
  }

  .mobile-day-date {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
  }

  .mobile-day-date strong,
  .mobile-day-orders {
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-day-date span {
    color: var(--accent-dark);
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-day-line {
    color: #46505f;
    font-size: 11px;
  }

  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .row-title {
    font-size: 13px;
    line-height: 1.15;
  }

  .row-meta,
  .summary-lines,
  .sheet-line { font-size: 11px; }

  .row-badges {
    gap: 5px;
    margin-top: 6px;
  }

  .badge,
  .size-button,
  .event-chip,
  .warehouse-event {
    font-size: 10px;
    padding: 4px 6px;
  }

  .day-card,
  .sheet-day {
    padding: 8px;
    gap: 5px;
  }

  .toggle-row { align-items: flex-start; }
  .calendar-layer {
    align-items: stretch;
    padding: 10px;
  }

  .calendar-popover {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  .calendar-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .calendar-months { grid-template-columns: 1fr; }

  .calendar-day {
    height: 34px;
    font-size: 13px;
  }

  .calendar-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-side label {
    grid-column: span 2;
  }

  .modal {
    padding: 8px;
  }

  .modal-card,
  .auth-card {
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .merge-modal,
  .size-modal,
  .api-modal {
    width: 100%;
  }

  .modal-head {
    display: grid;
    gap: 10px;
  }

  .api-account-card {
    grid-template-columns: 1fr;
  }

  .api-add-form {
    grid-template-columns: 1fr;
  }

  .wb-tag-row {
    grid-template-columns: 1fr;
  }

  .api-account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .merge-card {
    width: 78px;
    height: 78px;
    flex-basis: 78px;
  }

  .merge-sections {
    max-height: 58vh;
  }

  .modal-actions {
    margin: 14px -14px -14px;
    padding: 12px 14px;
  }

  .notice {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .table-controls {
    align-items: flex-start;
    flex-direction: column;
  }
  .table-controls > .chip-row,
  .merge-actions {
    width: 100%;
  }
  .merge-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .workbar-secondary,
  .topbar-actions {
    grid-template-columns: 1fr 1fr;
  }

  .workbar-secondary #apply-filters {
    grid-column: span 2;
  }
}
