/* Winner Admin — Shopify-like ops shell (light, mobile-first, DB-ready) */
:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --ink: #151821;
  --muted: #6b7280;
  --line: #e4e6ec;
  --line-strong: #c8ccd6;
  --accent: #2457e6;
  --accent-soft: #e8eefc;
  --accent-ink: #1637a0;
  --ok: #2457e6;
  --warn: #c98500;
  --warn-soft: #fff5d6;
  --danger: #d72c0d;
  --danger-soft: #feeceb;
  --info: #2457e6;
  --info-soft: #e8eefc;
  --coral: #e85d4c;
  --coral-soft: #fdece9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(26, 28, 29, 0.04);
  --wash: #fafbfb;
  --topbar: rgba(243, 244, 247, 0.92);
  --on-fill: #fff;
  --danger-ink: #9c1f09;
  --warn-ink: #7a5b00;
  --season-ink: #1f4e99;
  --accent-line: #a8baf5;
  --accent-hover: #d9e4ff;
  --coral-ink: #9c2f22;
  --coral-line: #f0a59c;
  --warn-line: #efd48a;
  --danger-line: #f3b2a6;
  --code-bg: #f6f7f8;
  --font: "Plus Jakarta Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --bottom-h: 64px;
  --touch: 44px;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12141a;
  --surface: #1c1f27;
  --ink: #f3f4f7;
  --muted: #a1a6b3;
  --line: #2c313c;
  --line-strong: #3d4452;
  --accent: #9bb4ff;
  --accent-soft: #243156;
  --accent-ink: #d6e2ff;
  --ok: #9bb4ff;
  --warn: #e6b450;
  --warn-soft: #3a2e12;
  --danger: #ff8b78;
  --danger-soft: #3d1c16;
  --info: #9bb4ff;
  --info-soft: #243156;
  --coral: #ff9b8e;
  --coral-soft: #3d221e;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  --wash: #171a21;
  --topbar: rgba(18, 20, 26, 0.92);
  --on-fill: #12141a;
  --danger-ink: #ffc7bd;
  --warn-ink: #ffe1a6;
  --season-ink: #c5d4ff;
  --accent-line: #3d528c;
  --accent-hover: #2c3d6e;
  --coral-ink: #ffc7bd;
  --coral-line: #6a3a32;
  --warn-line: #6a5420;
  --danger-line: #6a3328;
  --code-bg: #141820;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.admin {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom));
}

.ico {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  display: block;
}
.ico-tab { width: 0.95rem; height: 0.95rem; }
.ico-btn { width: 1rem; height: 1rem; }
.ico-ok { width: 1rem; height: 1rem; color: var(--ok); }
.icon-btn .ico { margin: auto; }
.nav-link .ico { opacity: 0.85; }
.tab { display: inline-flex; align-items: center; gap: 0.35rem; }
.btn .ico { margin-right: 0.15rem; }
.resource-chevron .ico { width: 1.1rem; height: 1.1rem; color: var(--muted); }

.sidebar-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.sidebar { display: flex; flex-direction: column; }
.sidebar-nav { flex: 1; overflow: auto; }

.advanced {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: var(--wash);
}
.advanced summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--muted);
}
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.92rem;
}

/* Login */
body.login-page {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(600px 280px at 20% 0%, rgba(11, 122, 92, 0.14), transparent 60%),
    radial-gradient(500px 260px at 90% 100%, rgba(44, 110, 203, 0.1), transparent 55%),
    var(--bg);
  color: var(--ink);
}
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.35rem 1.25rem 1.5rem;
  box-shadow: 0 16px 40px rgba(26, 28, 29, 0.08);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}
.login-brand strong { display: block; font-size: 1.05rem; font-weight: 800; }
.login-brand small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.login-tools h1 { margin: 0; }
.login-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.flash-error {
  margin: 0.75rem 0;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 0.88rem;
  font-weight: 600;
}
.flash-ok {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.9rem;
  font-weight: 650;
  border: 1px solid var(--accent-line);
}

.switch {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  padding: 0.35rem 0;
  font-weight: 650;
  cursor: pointer;
}
.switch input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  accent-color: var(--accent);
}
.switch-inline { min-height: auto; padding: 0; }

.bulk-bar {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}
.bulk-bar select { min-height: 44px; }
.resource-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.resource-row .resource-item { border-bottom: 0; }
.bulk-check {
  display: grid;
  place-items: center;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.bulk-check input { width: auto; min-height: auto; accent-color: var(--accent); }

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.status-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wash);
}
.status-list .ok { color: var(--ok); }
.status-list .off { color: var(--muted); font-weight: 650; }

@media (min-width: 900px) {
  .bulk-bar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; }

.mono { font-family: var(--mono); font-size: 0.85em; }
.muted { color: var(--muted); }

/* Shell */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 28, 29, 0.45);
  z-index: 40;
}
html.drawer-open .drawer-backdrop { display: block; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, var(--sidebar-w));
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 50;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}
html.drawer-open .sidebar { transform: translateX(0); }

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-fill);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy strong { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-copy small { color: var(--muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.nav-label {
  margin: 1rem 0.55rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: var(--touch);
  padding: 0 0.7rem;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.nav-link:hover { background: var(--bg); text-decoration: none; }
button.nav-link {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.logout-form { margin: 0; }
.pager { display: flex; gap: 0.75rem; align-items: center; padding: 0.8rem 1rem 1rem; }
.catalog-cover { max-width: 220px; border-radius: 12px; display: block; }
.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.nav-ico { opacity: 0.7; width: 1.1rem; text-align: center; }
.nav-note {
  margin: 0.5rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.app { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.85rem;
  background: var(--topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title .crumb {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.05rem;
}

.content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1rem 0.85rem 2rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  line-height: 0;
}
.icon-btn:hover { text-decoration: none; background: var(--wash); }
.icon-btn .ico { width: 1.15rem; height: 1.15rem; margin: 0; }

.topbar-account {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  margin-left: 0.15rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--accent-line);
  text-decoration: none;
  line-height: 0;
}
.topbar-account:hover {
  text-decoration: none;
  background: var(--accent-hover);
}
.topbar-account .ico {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
}

.sidebar-close { display: inline-grid; place-items: center; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.bottom-link {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.bottom-link.is-active { color: var(--accent); }
.bottom-link:hover { text-decoration: none; }

/* Page primitives */
.page-head {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.page-head h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-lead { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.92rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  box-shadow: var(--shadow);
}
.stat-card strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.stat-card span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-pad { padding: 1rem; }
.panel + .panel { margin-top: 0.75rem; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.filters {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}
.filters-row {
  display: grid;
  gap: 0.55rem;
}
.chip-row {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}
.chip:hover { text-decoration: none; border-color: var(--line-strong); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-fill);
}
.chip-muted {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

label.field {
  display: grid;
  gap: 0.28rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}
input, select, textarea {
  width: 100%;
  min-height: var(--touch);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 122, 92, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: var(--touch);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-fill);
}
.btn-primary:hover { filter: brightness(1.05); background: var(--accent); }
.btn-ok { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.btn-coral { background: var(--coral-soft); border-color: var(--coral-line); color: var(--coral-ink); }
.btn-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.btn-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
.btn-block { width: 100%; }
.btn-row { display: grid; gap: 0.5rem; }
.stack { display: grid; gap: 0.75rem; }
.form-grid { display: grid; gap: 0.65rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* Product index */
.resource-list { list-style: none; margin: 0; padding: 0; }
.resource-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  background: var(--surface);
}
.resource-item:last-child { border-bottom: 0; }
.resource-item:active,
.resource-item:hover {
  background: var(--wash);
  text-decoration: none;
}
.resource-title {
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
}
.resource-meta {
  color: var(--muted);
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
}
.resource-side {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 0.35rem;
}
.resource-chevron { color: var(--muted); font-size: 1.1rem; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 0.5rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-ACCEPTED { background: var(--accent-soft); color: var(--accent-ink); }
.badge-PENDING_DECISION, .badge-NEW { background: var(--warn-soft); color: var(--warn-ink); }
.badge-KILLED, .badge-REJECTED { background: var(--danger-soft); color: var(--danger-ink); }
.badge-WAITING_FOR_SEASON { background: var(--info-soft); color: var(--season-ink); }

.empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
}

/* Product detail */
.product-hero {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.product-hero h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  word-break: break-word;
}
.product-key {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  word-break: break-all;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.75rem;
  margin: 0 -0.15rem 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
}
.tab:hover { text-decoration: none; }
.tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-fill);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fade 0.18s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.kpi b { display: block; font-size: 1.15rem; font-weight: 800; }
.kpi span { color: var(--muted); font-size: 0.75rem; font-weight: 600; }

.section-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-help {
  margin: -0.35rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.video-list { display: grid; gap: 0.75rem; }
.video-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  background: var(--wash);
}
.video-item video {
  width: 100%;
  max-height: 240px;
  border-radius: 8px;
  background: #111;
  margin-top: 0.4rem;
}

.job {
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  background: var(--info-soft);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}
.job.DONE { border-left-color: var(--ok); background: var(--accent-soft); }
.job.FAILED { border-left-color: var(--danger); background: var(--danger-soft); }
.job.RUNNING, .job.WARN { border-left-color: var(--warn); background: var(--warn-soft); }

pre.box {
  margin: 0;
  padding: 0.75rem;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 220px;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.check-list { display: grid; gap: 0.55rem; }
.check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.check-item input { width: auto; min-height: auto; margin-top: 0.2rem; }

.divider {
  height: 1px;
  background: var(--line);
  margin: 1rem 0;
}

/* Desktop */
@media (min-width: 900px) {
  body.admin { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .sidebar {
    transform: none;
    padding: 1rem 0.85rem;
  }
  .sidebar-close, .topbar .icon-btn[data-drawer-open] { display: none; }
  .drawer-backdrop { display: none !important; }
  .app { margin-left: var(--sidebar-w); }
  .content { padding: 1.35rem 1.5rem 2.5rem; }
  .page-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
  .stats { grid-template-columns: repeat(4, 1fr); min-width: 420px; }
  .filters-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: end;
  }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .btn-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .resource-item {
    grid-template-columns: 1.6fr 1fr auto;
    align-items: center;
  }
  .resource-side {
    grid-template-columns: auto auto;
    gap: 0.75rem;
    align-items: center;
  }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

img, video { max-width: 100%; height: auto; }
.pager { flex-wrap: wrap; }
.status-list li { flex-wrap: wrap; }
.resource-title, .page-head h1, .product-hero h1 { overflow-wrap: anywhere; }
.filters-row > *, .bulk-bar > * { min-width: 0; }

@media (max-width: 420px) {
  .stats, .kpi-grid { grid-template-columns: 1fr; }
  .content { padding-left: 0.7rem; padding-right: 0.7rem; }
  .topbar { padding-left: 0.55rem; padding-right: 0.55rem; gap: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
