/* ==========================================================================
   Flavinto Admin — design system
   No external fonts, no frameworks. Everything is driven by the tokens below.
   Reference: PAGE_CONTRACT.md ("Design system" section) lists every class.
   CSP note: style="" attributes are blocked — use classes, SVG attributes,
   or data-width / data-color handled by admin.js.
   ========================================================================== */

:root {
  /* Typography */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --fs-4xl: 36px;
  --lh-tight: 1.2;
  --lh: 1.55;

  /* Spacing (4px grid) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* Colour */
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #f1f3f7;
  --border: #e6e8ee;
  --border-strong: #d4d8e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-press: #3730a3;
  --accent-soft: #eef0ff;
  --accent-ink: #3730a3;

  --green: #059669;  --green-soft: #e8f8f1;  --green-ink: #047857;
  --red: #dc2626;    --red-soft: #fdeeee;    --red-ink: #b91c1c;
  --amber: #d97706;  --amber-soft: #fdf5e6;  --amber-ink: #b45309;
  --blue: #2563eb;   --blue-soft: #ebf2fe;   --blue-ink: #1d4ed8;
  --violet: #7c3aed; --violet-soft: #f3eefe; --violet-ink: #6d28d9;
  --pinterest: #e60023; --pinterest-soft: #fff0f2; --pinterest-ink: #c8001f;

  /* Sidebar */
  --sb-w: 264px;
  --sb-bg: #0f1420;
  --sb-bg-2: #161c2b;
  --sb-border: rgba(255, 255, 255, .07);
  --sb-text: #a3adc2;
  --sb-text-strong: #f3f5fa;
  --sb-hover: rgba(255, 255, 255, .055);
  --sb-active: rgba(255, 255, 255, .09);

  /* Shape + depth */
  --r-xs: 6px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-full: 999px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 10px 24px -8px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lg: 0 28px 56px -16px rgba(16, 24, 40, .28), 0 4px 12px rgba(16, 24, 40, .06);
  --ring: 0 0 0 3px rgba(79, 70, 229, .22);
  --ring-danger: 0 0 0 3px rgba(220, 38, 38, .2);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 120ms;
  --t: 200ms;

  --content-max: 1280px;
  --gutter: var(--s-8);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
[hidden] { display: none !important; }
img, svg, video { display: block; max-width: 100%; }
svg.icon, .site-dot { display: inline-block; flex: none; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.011em; line-height: var(--lh-tight); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .92em; }
::selection { background: rgba(79, 70, 229, .18); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 13px; height: 13px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- Utilities ---------- */
.visually-hidden, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); box-shadow: var(--shadow-md); }
.skip-link:focus { left: 8px; }
.text-muted, .muted { color: var(--muted); }
.text-faint { color: var(--faint); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-green { color: var(--green-ink); }
.text-red { color: var(--red-ink); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.flex { display: flex; align-items: center; gap: var(--s-2); }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-2); }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); } .mb-6 { margin-bottom: var(--s-6); } .mb-8 { margin-bottom: var(--s-8); }
.narrow { max-width: 560px; }
.link-strong { color: var(--text); font-weight: 600; }
.link-strong:hover { color: var(--accent); }
.link-muted { color: var(--muted); }
.link-muted:hover { color: var(--text); }
.divider { height: 1px; background: var(--border); border: 0; margin: var(--s-4) 0; }

/* ==========================================================================
   App shell
   ========================================================================== */
.shell { min-height: 100vh; min-height: 100dvh; }
.main-col { margin-left: var(--sb-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1 0 auto; width: 100%; max-width: calc(var(--content-max) + var(--gutter) * 2); margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-12); outline: none; }
.app-footer { display: flex; gap: var(--s-2); justify-content: center; padding: var(--s-4) var(--gutter) var(--s-6); color: var(--faint); font-size: var(--fs-xs); }
.app-footer .sep { opacity: .6; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-3);
  height: 60px; padding: 0 var(--gutter);
  background: rgba(244, 245, 248, .82);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--border); background: rgba(255, 255, 255, .86); }
.topbar .topbar-menu, .topbar .topbar-brand { display: none; }
.topbar-brand { align-items: center; gap: var(--s-2); color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.topbar-context { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.topbar-site { display: none; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.topbar-site .site-chip { max-width: 100%; overflow: hidden; }
.topbar-site .site-chip-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-site .icon-chev { flex: none; opacity: .6; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

.site-chip {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  height: 28px; padding: 0 10px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

/* Logo */
.logo { width: 30px; height: 30px; flex: none; }
.logo-bg { fill: var(--accent); }
.logo-fg { stroke: #fff; }
.logo-dot { fill: #c7d2fe; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sb-w);
  display: flex; flex-direction: column;
  background: var(--sb-bg);
  background-image: linear-gradient(180deg, var(--sb-bg-2) 0%, var(--sb-bg) 42%);
  color: var(--sb-text);
  border-right: 1px solid rgba(0, 0, 0, .2);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px 18px; }
.sb-brand { display: flex; align-items: center; gap: 11px; color: var(--sb-text-strong); }
.sb-brand:hover { color: #fff; }
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sb-brand-text strong { font-size: 15.5px; letter-spacing: -.01em; }
.sb-brand-text span { font-size: var(--fs-xs); color: var(--sb-text); letter-spacing: .02em; }
.sb-head .sb-close { display: none; color: var(--sb-text); }
.sb-head .sb-close:hover { background: var(--sb-hover); color: #fff; }

/* Site switcher */
.site-switch { position: relative; margin: 2px 12px 10px; }
.site-switch-btn {
  list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; user-select: none;
  background: rgba(255, 255, 255, .045); border: 1px solid var(--sb-border);
  color: var(--sb-text-strong);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.site-switch-btn::-webkit-details-marker { display: none; }
.site-switch-btn:hover { background: rgba(255, 255, 255, .075); border-color: rgba(255,255,255,.12); }
.site-switch[open] .site-switch-btn { background: rgba(255, 255, 255, .09); }
.site-switch-dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.07); flex: none; }
.site-switch-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.site-switch-label { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .08em; color: var(--sb-text); font-weight: 600; }
.site-switch-name { font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-switch-caret { color: var(--sb-text); }
.site-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  padding: 6px; border-radius: 12px;
  background: #1b2233; border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .55);
  animation: pop var(--t) var(--ease);
}
.site-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: var(--sb-text-strong); }
.site-menu-item:hover, .site-menu-item:focus-visible { background: rgba(255, 255, 255, .07); color: #fff; outline: none; }
.site-menu-item.is-active { background: rgba(255, 255, 255, .06); }
.site-menu-icon { width: 22px; display: grid; place-items: center; color: var(--sb-text); flex: none; }
.site-menu-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.site-menu-name { font-size: var(--fs-md); font-weight: 500; }
.site-menu-host { font-size: var(--fs-xs); color: var(--sb-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-menu-check { color: #a5b4fc; }
.site-menu-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 5px 4px; }

/* Nav */
.sb-nav { flex: 1; padding: 4px 12px 12px; }
.sb-group + .sb-group { margin-top: 14px; }
.sb-group-label { padding: 8px 10px 6px; font-size: var(--fs-2xs); font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: rgba(163, 173, 194, .7); }
.sb-link {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px 10px; border-radius: 8px; border: 0; background: transparent;
  color: var(--sb-text); font-size: var(--fs-md); font-weight: 500; text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.sb-link .icon { width: 18px; height: 18px; opacity: .85; }
.sb-link:hover { background: var(--sb-hover); color: var(--sb-text-strong); }
.sb-link.is-active { background: var(--sb-active); color: #fff; }
.sb-link.is-active .icon { opacity: 1; color: #a5b4fc; }
.sb-link.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #818cf8; }
.sb-link-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); display: inline-grid; place-items: center; font-size: var(--fs-2xs); font-weight: 700; background: rgba(255,255,255,.1); color: var(--sb-text-strong); font-variant-numeric: tabular-nums; }
.sb-foot { padding: 10px 12px 16px; border-top: 1px solid var(--sb-border); display: flex; flex-direction: column; gap: 2px; }
.sb-link-muted { color: var(--sb-text); font-size: var(--fs-sm); }
.sb-logout { margin: 0; }

.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(15, 20, 32, .45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity var(--t) var(--ease); }

/* ==========================================================================
   Page building blocks
   ========================================================================== */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin: var(--s-2) 0 var(--s-6); }
.page-header-text { min-width: 0; }
.eyebrow { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.page-title { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -.022em; }
.page-subtitle { margin-top: 6px; color: var(--muted); font-size: var(--fs-base); max-width: 70ch; }
.page-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.section-title { font-size: var(--fs-lg); font-weight: 650; margin: var(--s-8) 0 var(--s-3); }

/* Grid */
.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.span-2 { grid-column: span 2; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-pad { padding: var(--s-6); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6) 0; }
.card-head + .card-body, .card-head + .table-wrap { margin-top: var(--s-4); }
.card-head.bordered { padding-bottom: var(--s-4); border-bottom: 1px solid var(--border); }
.card-body { padding: var(--s-5) var(--s-6) var(--s-6); }
.card-head + .card-body { padding-top: 0; }
.card-foot { padding: var(--s-3) var(--s-6); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-sm); color: var(--muted); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.01em; }
.card-title .icon { color: var(--muted); }
.card-sub { margin-top: 4px; color: var(--muted); font-size: var(--fs-sm); }
.card-muted { background: var(--surface-2); box-shadow: none; }
.card-pad > .card-title + p, .card-pad > .card-title + .text-muted { margin-top: 8px; }
.card-link { transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease); }
.card-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Stat tile */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 18px 20px 20px; min-width: 0; display: flex; flex-direction: column; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: 24px; }
.stat-label { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--muted); font-weight: 550; min-width: 0; max-width: 100%; white-space: nowrap; }
.stat-label-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stat-label .icon { flex: none; }
.stat-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; }
.stat-foot .stat-hint { margin-top: 0; }
.stat-label .icon { color: var(--faint); }
.stat-value { margin-top: 10px; font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); overflow-wrap: anywhere; }
.stat-hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--faint); }
.stat-accent { border-top: 3px solid var(--accent); }

/* Delta pill */
.delta { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta-up { background: var(--green-soft); color: var(--green-ink); }
.delta-down { background: var(--red-soft); color: var(--red-ink); }
.delta-flat { background: var(--surface-3); color: var(--muted); }
.delta-new { background: var(--accent-soft); color: var(--accent-ink); }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; line-height: 1; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-plain::before { display: none; }
.badge-gray { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge-green { background: var(--green-soft); color: var(--green-ink); }
.badge-red { background: var(--red-soft); color: var(--red-ink); }
.badge-amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge-blue { background: var(--blue-soft); color: var(--blue-ink); }
.badge-violet { background: var(--violet-soft); color: var(--violet-ink); }
.badge-pinterest { background: var(--pinterest-soft); color: var(--pinterest-ink); }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 38px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--btn-h); padding: 0 15px; border-radius: 10px; border: 1px solid transparent;
  font-size: var(--fs-md); font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(55, 48, 163, .3), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: #c3c9d4; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(15, 23, 42, .05); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--red-ink); border-color: #f2c4c4; }
.btn-danger:hover { background: var(--red-soft); color: var(--red-ink); border-color: #eaa9a9; }
.btn-danger:focus-visible { box-shadow: var(--ring-danger); }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:hover { background: var(--red-ink); color: #fff; }
.btn-sm { --btn-h: 32px; padding: 0 11px; font-size: var(--fs-sm); border-radius: 8px; gap: 6px; }
.btn-lg { --btn-h: 46px; padding: 0 20px; font-size: var(--fs-base); border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) rgba(255,255,255,.25) rgba(255,255,255,.25);
  animation: spin .7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after, .btn-danger.is-loading::after { border-color: var(--muted) var(--muted) var(--border) var(--border); }
.btn-group { display: inline-flex; gap: var(--s-2); flex-wrap: wrap; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 0; background: transparent; color: var(--muted); flex: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: rgba(15, 23, 42, .06); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: var(--s-5); }
.form-row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.form-actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; padding-top: var(--s-1); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.label .optional { font-weight: 400; color: var(--faint); font-size: var(--fs-sm); }
.help { font-size: var(--fs-sm); color: var(--muted); }
.help.is-error, .field-error { font-size: var(--fs-sm); color: var(--red-ink); font-weight: 500; }
.help.is-ok { color: var(--green-ink); }
.counter { font-size: var(--fs-xs); font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.counter.is-near { color: var(--amber-ink); }
.counter.is-over { color: var(--red-ink); }

.input, .select, .textarea {
  display: block; width: 100%; min-width: 0;
  height: 40px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  font-size: var(--fs-base);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: #bfc5d1; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .input.is-invalid { border-color: var(--red); }
.input[aria-invalid="true"]:focus, .input.is-invalid:focus { box-shadow: var(--ring-danger); }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); }
.textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.textarea.mono, .input.mono { font-family: var(--font-mono); font-size: var(--fs-md); }
.select {
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.input-sm, .select-sm { height: 34px; font-size: var(--fs-md); border-radius: 8px; }
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { flex: 1; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; display: grid; }
.input-icon + .input { padding-left: 38px; }
.input-addon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: 32px; width: 34px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 7px; }
.input-addon:hover { background: var(--surface-3); color: var(--text); }
.input-group .input { padding-right: 44px; }
.input-group .input:only-child, .input-icon + .input:last-child { padding-right: 12px; } /* no addon */

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--fs-md); color: var(--text-2); }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* Switch: <label class="switch"><input type="checkbox" role="switch"><span class="switch-track"></span> Label</label> */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-md); color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #cfd5df; transition: background var(--t) var(--ease); flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--t) var(--ease); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }

/* Password strength meter */
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.meter span { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background var(--t) var(--ease); }
.meter[data-level="1"] span:nth-child(-n+1) { background: var(--red); }
.meter[data-level="2"] span:nth-child(-n+2) { background: var(--amber); }
.meter[data-level="3"] span:nth-child(-n+3) { background: #65a30d; }
.meter[data-level="4"] span { background: var(--green); }

/* Toolbar / filter bar above tables */
.toolbar { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-4) var(--s-6); border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1 1 240px; max-width: 360px; }
.toolbar .spacer { flex: 1; }

/* Segmented control / tabs (links or buttons) */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; }
.segmented > a, .segmented > button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.segmented > a:hover, .segmented > button:hover { color: var(--text); }
.segmented > .is-active, .segmented > [aria-current="page"], .segmented > [aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: var(--s-5); border-bottom: 1px solid var(--border); margin-bottom: var(--s-5); overflow-x: auto; scrollbar-width: none; }
.tabs > a, .tabs > button { position: relative; padding: 10px 0 12px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: var(--fs-md); white-space: nowrap; }
.tabs > a:hover, .tabs > button:hover { color: var(--text); }
.tabs > .is-active, .tabs > [aria-current="page"], .tabs > [aria-selected="true"] { color: var(--text); }
.tabs > .is-active::after, .tabs > [aria-current="page"]::after, .tabs > [aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; font-size: var(--fs-md); }
.table th {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 16px; text-align: left; white-space: nowrap;
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border);
}
.card > .table-wrap:first-child .table th, .card > .table:first-child th { border-top: 0; }
.table th:first-child, .table td:first-child { padding-left: var(--s-6); }
.table th:last-child, .table td:last-child { padding-right: var(--s-6); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover { background: #fafbfd; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { color: var(--text); font-weight: 600; }
.table-compact td { padding-top: 8px; padding-bottom: 8px; }
.table a.row-link { color: var(--text); font-weight: 600; }
.table a.row-link:hover { color: var(--accent); }
th a.sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
th a.sort:hover { color: var(--text); }
.cell-title { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.cell-title .title { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cell-title .sub { font-size: var(--fs-xs); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Horizontal bars (top pages / sources): <div class="bar"><span data-width="42"></span></div> */
.bar { position: relative; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.bar > span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: var(--accent); transition: width .6s var(--ease); }
.bar-pinterest > span { background: var(--pinterest); }
.bar-green > span { background: var(--green); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bar-row:last-child { border-bottom: 0; }
.bar-row .bar { grid-column: 1 / -1; }

/* Key/value list */
.kv { display: flex; flex-direction: column; margin-top: var(--s-3); }
.kv > div { display: flex; justify-content: space-between; gap: var(--s-3); padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: var(--fs-md); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--text); font-weight: 550; text-align: right; }

/* Alerts (inline, persistent) */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: var(--fs-md); border: 1px solid transparent; line-height: 1.45; }
.alert .icon { margin-top: 1px; }
.alert-error { background: var(--red-soft); color: var(--red-ink); border-color: #f6caca; }
.alert-success { background: var(--green-soft); color: var(--green-ink); border-color: #bfe9d6; }
.alert-warning { background: var(--amber-soft); color: var(--amber-ink); border-color: #f5ddb0; }
.alert-info { background: var(--blue-soft); color: var(--blue-ink); border-color: #c9dbfb; }
.form > .alert, .card-body > .alert { margin-bottom: 0; }
.card-body > .alert + .form { margin-top: var(--s-4); }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--s-12) var(--s-6); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: var(--s-4); box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .08); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty-title { font-size: var(--fs-lg); font-weight: 650; }
.empty-text { margin-top: 6px; max-width: 46ch; color: var(--muted); font-size: var(--fs-md); }
.empty-action { margin-top: var(--s-5); display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center; }
.empty-sm { padding: var(--s-8) var(--s-4); }

/* Site cards (dashboard) */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-3); padding: var(--s-5) var(--s-6) var(--s-6); }
.site-card { border: 1px solid var(--border); border-radius: var(--r); padding: 14px 14px 12px 16px; background: linear-gradient(180deg, #fff, var(--surface-2)); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); min-width: 0; }
.site-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.site-card-top { display: flex; align-items: center; gap: 10px; }
.site-card-name { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.site-card-name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card-host { font-size: var(--fs-xs); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card-stats { display: flex; gap: var(--s-6); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.site-card-stats > div { display: flex; flex-direction: column; line-height: 1.25; }
.site-card-stats .num { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.site-card-stats .muted { font-size: var(--fs-xs); }

/* Charts (inline SVG built by pages): <svg class="chart"> … */
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--faint); font-size: 11px; font-family: var(--font-sans); }
.chart .series-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { fill: var(--accent); fill-opacity: .08; stroke: none; }
.chart .series-line.pinterest { stroke: var(--pinterest); }
.chart .series-area.pinterest { fill: var(--pinterest); }
.chart .series-bar { fill: var(--accent); }
.chart .series-bar.muted { fill: #c7cdf9; }
.chart .hover-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart-legend { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }
.chart-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .key::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--accent); }
.chart-legend .key.pinterest::before { background: var(--pinterest); }
.chart-tip { position: fixed; z-index: 70; pointer-events: none; padding: 8px 10px; border-radius: 8px; background: #111827; color: #fff; font-size: var(--fs-xs); box-shadow: var(--shadow-md); white-space: nowrap; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-6); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }
.pagination .btn-group { gap: 6px; }

/* Log / code output (publish log tail) */
.log { margin: 0; padding: 14px 16px; border-radius: var(--r); background: #0f1420; color: #d6deeb; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* Progress bar: <div class="progress"><span data-width="40"></span></div> or .is-indeterminate */
.progress { position: relative; height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.progress > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); border-radius: 8px; transition: width .4s var(--ease); }
.progress.is-indeterminate > span { width: 35%; animation: indeterminate 1.3s var(--ease) infinite; }

/* Skeleton loading */
.skeleton { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 25%, #e9ecf2 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; min-height: 12px; }

/* Status dot (live indicator) */
.pulse { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--green); opacity: 0; animation: pulse 2s var(--ease) infinite; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 10px 12px 14px; border-radius: 12px;
  background: #111827; color: #f3f4f6; box-shadow: var(--shadow-lg);
  font-size: var(--fs-md); line-height: 1.45;
  animation: toast-in .28s var(--ease);
}
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
.toast-icon { display: grid; margin-top: 1px; }
.toast-success .toast-icon { color: #34d399; }
.toast-error .toast-icon { color: #f87171; }
.toast-warning .toast-icon { color: #fbbf24; }
.toast-info .toast-icon { color: #93c5fd; }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-close { display: grid; place-items: center; width: 26px; height: 26px; margin: -3px 0 -3px 0; border: 0; border-radius: 7px; background: transparent; color: #9ca3af; }
.toast-close:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- Modal (Admin.confirm) ---------- */
.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); background: var(--surface); }
.modal::backdrop { background: rgba(15, 20, 32, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal[open] { animation: pop var(--t) var(--ease); }
.modal-body { padding: var(--s-6) var(--s-6) var(--s-4); display: flex; gap: var(--s-4); }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.modal-danger .modal-icon { background: var(--red-soft); color: var(--red); }
.modal-title { font-size: var(--fs-lg); font-weight: 650; }
.modal-text { margin-top: 6px; color: var(--muted); font-size: var(--fs-md); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-6) var(--s-5); }

/* ==========================================================================
   Sign-in page
   ========================================================================== */
body.auth {
  min-height: 100vh; min-height: 100dvh;
  background-color: #f1f3f8;
  background-image:
    radial-gradient(1100px 520px at 12% -10%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(900px 480px at 110% 110%, rgba(236, 72, 153, .08), transparent 60%),
    linear-gradient(180deg, #f6f7fb, #eef0f6);
}
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s-8) var(--s-4); }
.auth-card { width: 100%; max-width: 420px; background: rgba(255, 255, 255, .92); border: 1px solid rgba(255, 255, 255, .9); border-radius: 20px; padding: 36px 32px 26px; box-shadow: 0 40px 80px -24px rgba(30, 27, 75, .25), 0 0 0 1px rgba(15, 23, 42, .05); }
.auth-card > .card { box-shadow: none; border: 0; background: transparent; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand .logo { width: 40px; height: 40px; }
.auth-brand-name { font-weight: 750; font-size: var(--fs-lg); letter-spacing: -.015em; line-height: 1.15; }
.auth-brand-sub { color: var(--muted); font-size: var(--fs-sm); }
.auth-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; }
.auth-lead { margin: 8px 0 22px; color: var(--muted); font-size: var(--fs-md); }
.auth-card .alert { margin-bottom: var(--s-4); }
.auth-card .form { gap: var(--s-4); }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: var(--fs-xs); text-align: center; }

/* ==========================================================================
   Motion
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes indeterminate { 0% { left: -35%; } 100% { left: 100%; } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  :root { --gutter: var(--s-5); }
  .main-col { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .26s var(--ease); box-shadow: none; width: min(var(--sb-w), 86vw); }
  body.sb-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
  body.sb-open .scrim { opacity: 1; }
  body.sb-open { overflow: hidden; }
  .sb-head .sb-close { display: inline-grid; }
  .topbar .topbar-menu { display: inline-grid; margin-left: -8px; }
  .topbar .topbar-brand { display: inline-flex; }
  .topbar-brand .logo { width: 26px; height: 26px; }
  .topbar-context { display: none; }
  .topbar .topbar-site { display: inline-flex; min-width: 0; max-width: 56vw; margin-left: var(--s-2); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --gutter: var(--s-4); }
  body { font-size: var(--fs-md); }
  .topbar { height: 56px; }
  .topbar-brand > span { display: none; }
  .content { padding-top: var(--s-4); }
  .page-header { margin-bottom: var(--s-5); align-items: flex-start; }
  .page-title { font-size: var(--fs-2xl); }
  .page-actions { width: 100%; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .span-2 { grid-column: auto; }
  .stat { padding: 14px 14px 16px; }
  .stat-value { font-size: 24px; }
  .card-pad { padding: var(--s-4); }
  .card-head { padding: var(--s-4) var(--s-4) 0; }
  .card-body { padding: var(--s-4); }
  .card-foot, .pagination, .toolbar { padding-left: var(--s-4); padding-right: var(--s-4); }
  .table th:first-child, .table td:first-child { padding-left: var(--s-4); }
  .table th:last-child, .table td:last-child { padding-right: var(--s-4); }
  .site-grid { padding: var(--s-4); grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none !important; }
  .toast-stack { right: 16px; left: 16px; bottom: 16px; width: auto; }
  .auth-card { padding: 28px 22px 22px; border-radius: 18px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}
