:root {
  --bg: #f6f7f3;
  --surface: #fff;
  --surface-soft: #f0f4ef;
  --line: #d7ddd2;
  --ink: #1d2520;
  --muted: #647067;
  --blue: #225d9c;
  --blue-dark: #174978;
  --green: #246b4d;
  --red: #a33a32;
  --amber: #946100;
  --ok-soft: #edf8f0;
  --ok-strong: #d9f0df;
  --bad-soft: #fff0ef;
  --bad-strong: #f8d9d7;
  --shadow: 0 8px 22px rgba(31, 41, 35, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
a { color: var(--blue); text-decoration: none; }
button, .button, select, input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 11px;
  font: inherit;
}
button, .button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: var(--blue-dark); }
button.danger { color: var(--red); }
button:disabled, select:disabled { opacity: .58; cursor: not-allowed; }
.link-button { border: 0; background: transparent; color: var(--blue); min-height: auto; padding: 0; }
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f1e8;
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
}
.brand small { display: block; color: var(--muted); margin-top: 1px; }
.nav { display: flex; align-items: center; gap: 14px; }
.nav form { margin: 0; }
.workspace { width: min(1680px, calc(100% - 32px)); margin: 20px auto 44px; }
.workspace.narrow { width: min(680px, calc(100% - 32px)); }
.page-title-row, .section-header, .toolbar { display: flex; align-items: center; gap: 10px; }
.page-title-row, .section-header { justify-content: space-between; }
h1, h2, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 16px; line-height: 1.2; }
.muted { color: var(--muted); }
.page-title-row .muted, .section-header .muted { margin-top: 5px; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.summary-grid article, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.summary-grid article { padding: 12px; }
.summary-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.summary-grid strong { font-size: 20px; line-height: 1.1; }
.control-panel {
  margin-bottom: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.field-group, .auth-card label, .profile-form label { display: grid; gap: 6px; }
.field-group label, .auth-card label, .profile-form label { color: var(--muted); font-size: 12px; font-weight: 700; }
.field-group select, .field-group input { width: 100%; }
.toolbar.end { justify-content: flex-end; }
.table-panel { margin-top: 12px; overflow: hidden; }
.section-header { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow: auto; max-height: 62vh; }
.product-table-wrap { max-height: 52vh; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 2; background: var(--surface-soft); font-size: 12px; color: #3f4b43; font-weight: 700; padding: 8px; }
td { background: var(--surface); min-height: 34px; }
.grid-table tr.row-alert td, .report-table tr.row-alert td { background: var(--bad-soft); }
.grid-table tr.row-all-found td, .report-table tr.row-all-found td { background: var(--ok-soft); }
.report-table tr.row-has-missing td { background: #fff8ec; }
.grid-table td[contenteditable="true"] { min-width: 120px; height: 36px; padding: 8px; outline: none; }
.grid-table td[contenteditable="true"]:focus { background: #fbfdf9; box-shadow: inset 0 0 0 2px #c3d7ee; }
.grid-table td.sku-cell-found { background: var(--ok-strong); color: #185c35; font-weight: 700; }
.grid-table td.sku-cell-missing { background: var(--bad-strong); color: #8f2f29; font-weight: 700; }
.grid-table .row-number { min-width: 70px; }
.grid-table .url-cell { min-width: 340px; }
.grid-table .notes-cell { min-width: 220px; }
.active-cell, .action-cell { text-align: center; padding: 6px; white-space: nowrap; }
.report-table th, .report-table td { padding: 9px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status-ok { color: var(--green); background: #e6f3eb; }
.status-missing { color: var(--amber); background: #fff4d6; }
.status-failed { color: var(--red); background: #fbe5e2; }
.sku-list { max-width: 520px; white-space: normal; }
.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.sku-chip { display: inline-flex; align-items: center; min-height: 24px; border-radius: 6px; padding: 3px 7px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.sku-chip-found { background: var(--ok-strong); border-color: #badfc5; color: #185c35; }
.sku-chip-missing { background: var(--bad-strong); border-color: #edbebb; color: #8f2f29; }
.progress-line { padding: 0 14px 10px; color: var(--muted); }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(440px, calc(100vw - 36px));
  background: #1f2a23;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translateY(0); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card, .profile-form {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 14px;
}
.profile-form { width: 100%; }
.auth-brand { margin-bottom: 4px; }
.form-error, .form-success { margin: 0; padding: 9px 10px; border-radius: 6px; font-weight: 700; }
.form-error { color: var(--red); background: var(--bad-soft); }
.form-success { color: var(--green); background: var(--ok-soft); }
@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .control-panel { grid-template-columns: 1fr; }
  .page-title-row, .section-header, .topbar { align-items: flex-start; flex-direction: column; }
  .topbar { height: auto; padding: 12px 16px; gap: 12px; }
  .nav { flex-wrap: wrap; }
}

