/* Bulk Product Editor — light admin styling in the PlatformDTC / Polaris idiom. */
:root {
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-muted: #f7f7f7;
  --text: #303030;
  --text-muted: #616161;
  --border: #e3e3e3;
  --border-strong: #c9c9c9;
  --primary: #303030;
  --primary-text: #ffffff;
  --focus: #005bd3;
  --dirty: #fff5d6;
  --dirty-border: #e6b000;
  --critical: #8e1f0b;
  --critical-bg: #fee9e8;
  --success-bg: #cdfee1;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
body.app { padding: 16px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0; }
.muted { color: var(--text-muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-muted); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-primary:hover { background: #1a1a1a; }
.btn-plain { border-color: transparent; background: transparent; color: var(--focus); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e3e3e3; font-size: 12px; font-weight: 550; }
.badge-pro { background: var(--success-bg); }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.banner { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--focus); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.banner p { margin: 0; }
.banner-warn { border-left-color: var(--dirty-border); }
.notice { background: var(--surface); padding: 16px; border-radius: var(--radius); }

.card { background: var(--surface); border-radius: 12px; box-shadow: 0 1px 0 rgba(0,0,0,.07), inset 0 0 0 1px var(--border); padding: 16px; margin-bottom: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { flex: 1; }
.progress p { margin: 0 0 8px; }
.progress progress { width: 100%; height: 8px; }

.filters, .bulk-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; background: var(--surface);
  border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); padding: 12px; margin-bottom: 12px;
}
.filters p { margin: 0; flex: 1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 1; }
.field span { font-size: 12px; color: var(--text-muted); }
input[type="text"], input[type="search"], select {
  font: inherit; min-height: 32px; padding: 4px 8px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--text); width: 100%;
}
.filter-actions { display: flex; gap: 8px; }
.bulk-bar { align-items: center; background: #f0f5ff; }
.bulk-bar select, .bulk-bar input { width: auto; min-width: 160px; }
.bulk-value { display: contents; }

.grid-wrap { background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; min-width: 860px; }
.grid th { position: sticky; top: 0; background: var(--surface-muted); text-align: left; font-size: 12px; font-weight: 550; color: var(--text-muted); padding: 8px; border-bottom: 1px solid var(--border); }
.grid td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; height: 40px; }
.grid td[role="gridcell"]:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
.grid td.is-editable { cursor: text; }
.grid td.is-editable:hover { background: var(--surface-muted); }
.grid td.is-dirty { background: var(--dirty); box-shadow: inset 3px 0 0 var(--dirty-border); }
.grid td.has-error { background: var(--critical-bg); }
.grid td input, .grid td select { min-height: 28px; }
.grid .col-select { width: 36px; }
.grid .col-price, .grid .col-compare_at_price { width: 130px; text-align: right; }
.grid th.col-price, .grid th.col-compare_at_price { text-align: right; }
.grid .col-status { width: 110px; }
.grid .col-tags { min-width: 180px; }
.grid .col-sku { color: var(--text-muted); }
.row-variant td.col-variant { padding-left: 20px; }
.row-variant { background: #fcfcfc; }
.product-cell { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.product-cell img { border-radius: 6px; object-fit: cover; flex: none; border: 1px solid var(--border); }
.cell-error { display: block; color: var(--critical); font-size: 12px; margin-top: 2px; text-align: left; }
.hint { font-size: 12px; padding: 8px 12px; margin: 0; }
.empty { background: var(--surface); padding: 24px; border-radius: 12px; text-align: center; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list th { font-size: 12px; color: var(--text-muted); font-weight: 550; }
table.list tr.has-error td { background: var(--critical-bg); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

@media (max-width: 640px) {
  body.app { padding: 8px; }
  .page-head { align-items: flex-start; }
  .field { min-width: 100%; }
  .bulk-bar select, .bulk-bar input { min-width: 100%; }
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.list td { display: block; border: 0; padding: 2px 8px; }
}

/* Public pages (home, privacy, support) */
body.doc { background: var(--surface); }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); max-width: 880px; margin: 0 auto; }
.doc-head nav { display: flex; gap: 16px; }
.doc-brand { font-weight: 650; color: var(--text); text-decoration: none; }
.doc-main { max-width: 880px; margin: 0 auto; padding: 24px 16px 48px; }
.doc-main h1 { font-size: 28px; margin-bottom: 12px; }
.doc-main h2 { font-size: 18px; margin: 28px 0 8px; }
.doc-main h3 { font-size: 15px; margin: 20px 0 4px; }
.doc-main .lead { font-size: 16px; }
.doc-list { padding-left: 20px; }
.doc-list li { margin: 6px 0; }
.doc-foot { max-width: 880px; margin: 0 auto; padding: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }
a { color: var(--focus); }
code { background: var(--surface-muted); padding: 1px 4px; border-radius: 4px; font-size: 13px; }
