:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --success: #15803d;
  --danger: #b91c1c;
  --border: #dbe2ea;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
img { max-width: 100%; display: block; }
a { text-decoration: none; }
.app-shell { min-height: 100vh; }
.topbar {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 16px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 0 0 4px; font-size: 1.2rem; }
.topbar p { margin: 0; color: var(--muted); font-size: .9rem; }
.topbar nav { display: flex; gap: 8px; flex-wrap: wrap; }
.container { width: min(1100px, calc(100% - 24px)); margin: 20px auto; }
.card, .auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 16px;
  box-shadow: 0 6px 18px rgba(17,24,39,.04); margin-bottom: 16px;
}
.auth-card { width: min(420px, calc(100% - 24px)); margin: 48px auto; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; }
input, textarea, select {
  width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font: inherit; background: #fff;
}
textarea { resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 11px 14px; font-weight: 700; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-light { background: #fff; color: var(--text); border-color: var(--border); }
.btn-danger { background: #fff1f2; color: var(--danger); border-color: #fecdd3; }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; }
.alert-success { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.filters, .actions, .product-meta, .section-head {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.grid-products {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px;
}
.product-card h3, .section-head h2, .card h3 { margin: 0 0 8px; }
.product-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.muted { color: var(--muted); }
.badge {
  font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 6px 10px; white-space: nowrap;
}
.status-draft { background: #eff6ff; color: #1d4ed8; }
.status-ready { background: #fefce8; color: #a16207; }
.status-published { background: #ecfdf3; color: #15803d; }
.cover { aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; margin: 12px 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.image-grid figure { margin: 0; }
.image-grid img { border-radius: 14px; aspect-ratio: 1 / 1; object-fit: cover; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
.empty-state { text-align: center; }
@media (max-width: 640px) {
  .topbar { position: static; }
  .container { width: calc(100% - 16px); }
  .btn { width: 100%; }
  .topbar nav, .actions { width: 100%; }
}

.checkbox-row { display:flex; align-items:center; gap:10px; font-weight:700; }
.checkbox-row input { width:auto; }
small.muted { display:block; margin-top:4px; }
