:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --line: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.hero { background: linear-gradient(135deg, #111827, #431407); color: white; padding: 42px min(6vw, 72px); display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.hero h1 { margin: 0 0 12px; font-size: clamp(30px, 5vw, 56px); letter-spacing: -0.04em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { color: #fed7aa; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.dark-eyebrow { color: var(--accent-dark); margin: 0 0 6px; }
main { width: min(1280px, calc(100% - 32px)); margin: -24px auto 64px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat, .toolbar, .product-card, .table-wrap, .panel, .admin-row { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.stat { padding: 18px; }
.stat span, label, .supplier, .muted { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 8px; font-size: 30px; }
.toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(150px, 240px)); gap: 16px; padding: 18px; margin-bottom: 22px; }
.panel { padding: 18px; margin-bottom: 28px; }
.narrow-panel { max-width: 520px; margin-inline: auto; }
.panel .section-title { margin-top: 0; }
label { display: grid; gap: 8px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; background: white; }
textarea { resize: vertical; min-height: 92px; }
.section-title { margin: 28px 0 14px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-card { overflow: hidden; display: grid; grid-template-rows: 170px 1fr; }
.product-card img { width: 100%; height: 170px; object-fit: contain; background: #fff7ed; padding: 16px; }
.product-card img.broken, .admin-row img.broken { display: none; }
.product-body { padding: 16px; display: grid; gap: 12px; }
.product-body h2 { margin: 0; font-size: 17px; line-height: 1.25; }
.supplier { margin: 0; font-weight: 800; color: var(--accent-dark); }
.meta { display: grid; gap: 6px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.actions a, button, .button-light { border: 0; border-radius: 12px; padding: 10px 12px; font-weight: 800; text-decoration: none; cursor: pointer; }
.actions a { background: var(--accent); color: white; }
button { background: #ffedd5; color: var(--accent-dark); }
.hero button, .button-light { background: white; color: #431407; }
.danger-button { background: #fee2e2; color: var(--danger); }
.empty { color: var(--muted); }
.error { color: #fecaca; }
.admin-form { display: grid; gap: 14px; }
.product-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-edit-form label:first-of-type, .form-actions { grid-column: 1 / -1; }
.input-with-button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.input-with-button button { white-space: nowrap; padding-inline: 16px; }
.admin-product-list { display: grid; gap: 12px; }
.admin-row { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 14px; padding: 12px; }
.admin-row img { width: 80px; height: 80px; object-fit: contain; background: #fff7ed; border-radius: 12px; }
.admin-row strong, .admin-row span { display: block; }
.admin-row span { margin-top: 6px; color: var(--muted); font-size: 13px; }
.queue-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.queue-header .section-title { margin: 0 0 8px; }
.affiliate-queue-panel { border-color: #fdba74; background: #fffaf5; }
.affiliate-queue-card { margin-top: 16px; }
.affiliate-current { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.affiliate-current img { width: 140px; height: 120px; object-fit: contain; background: white; border: 1px solid var(--line); border-radius: 14px; }
.affiliate-current img.broken { display: none; }
.affiliate-current-body { display: grid; gap: 10px; }
.affiliate-current-body strong, .affiliate-current-body span { display: block; }
.affiliate-current-body span { color: var(--muted); font-size: 13px; }
.affiliate-save-row { max-width: 760px; }
@media (max-width: 1100px) { .stats, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .toolbar, .product-edit-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .hero { display: block; } .hero-actions { justify-content: flex-start; margin-top: 18px; } .stats, .product-grid, .toolbar, .product-edit-form, .admin-row, .affiliate-current, .queue-header { grid-template-columns: 1fr; display: grid; } main { width: min(100% - 20px, 1180px); } }
