:root {
  color-scheme: light;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #202223;
  background: #f4f5f6;
  --surface: #fff;
  --border: #e1e3e5;
  --muted: #5c6267;
  --accent: #164f43;
}

* { box-sizing: border-box; }
body { margin: 0; }
#cartmatch-admin { max-width: 1120px; margin: 0 auto; padding: 28px 24px 48px; }
.page-header { margin-bottom: 18px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: -.035em; line-height: 1.2; }
h2 { font-size: 16px; line-height: 1.35; }
h3 { font-size: 14px; }
.page-header p { margin-top: 5px; }
.muted, small { color: var(--muted); }

.card {
  display: grid;
  min-width: 0;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.stack { display: grid; gap: 12px; align-content: start; }
.fields, .metrics { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 4px; }
.field label, .progress { font-weight: 600; }
.field input, .field select {
  min-height: 36px;
  width: 100%;
  padding: 6px 9px;
  border: 1px solid #aeb2b6;
  border-radius: 7px;
  background: var(--surface);
  color: inherit;
  font: inherit;
}
.search { max-width: 340px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions.compact { flex-wrap: nowrap; gap: 5px; }

.button, .icon, .link-button, .tabs button {
  appearance: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #cbd0d3;
  border-radius: 7px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-weight: 550;
  line-height: 1.3;
  text-decoration: none;
  padding: 7px 12px;
  min-height: 34px;
  width: fit-content;
  max-width: 100%;
  text-align: center;
  cursor: pointer;
}
.button:hover, .icon:hover, .tabs button:hover { background: #f1f3f3; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: #123f36; }
.button:disabled, .icon:disabled, .field select:disabled { opacity: .58; cursor: default; }
.button.approved { color: #245742; background: #eff7f2; }
.button.destructive { color: #942c30; border-color: #dbb2b2; }
.icon { padding: 5px 8px; min-width: 36px; }
.icon[aria-pressed="true"] { background: #e4f2eb; border-color: #587b69; }
.link-button { border: 0; background: transparent; padding-inline: 0; color: #235c50; text-decoration: underline; }
:focus-visible { outline: 2px solid #276cc3; outline-offset: 2px; }

.notice { margin-bottom: 8px; padding: 11px 13px; border-radius: 8px; background: #e7f1ef; }
.notice.error { color: #922c29; background: #fbeceb; }
.notice p { margin-top: 3px; }
.confirmation { padding: 11px 13px; border: 1px solid #dbb2b2; border-radius: 8px; }
.confirmation[hidden] { display: none; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.tabs button { border-color: transparent; background: transparent; border-radius: 6px 6px 0 0; }
.tabs button[aria-current="page"] { background: var(--surface); box-shadow: inset 0 -2px var(--accent); }
.status-layout { display: flex; gap: 18px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.mode { min-width: 162px; }

.review-row { padding: 13px 0; border-top: 1px solid var(--border); }
.review-row:last-child { padding-bottom: 0; }
.review-header, .review-item, .metric-line, .exit-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.review-header { margin-bottom: 8px; }
.review-items { display: grid; gap: 4px; }
.review-item { padding: 4px 0; }
.item-name { display: grid; min-width: 0; overflow-wrap: anywhere; }
.item-name strong { font-weight: 500; }
.metric-line, .exit-list li { border-top: 1px solid var(--border); padding-block: 6px; }
.metric-line strong { text-align: right; font-variant-numeric: tabular-nums; }
.exit-list { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow-y: auto; }
#product-list > .button { margin-top: 12px; }

@media (max-width: 730px) {
  #cartmatch-admin { padding: 18px 12px 32px; }
  .fields, .metrics { grid-template-columns: 1fr; }
  .card { padding: 13px; }
}
