/* ============================================================================
   CP Master Manager — global stylesheet
   Single source of truth for the operator UI: tokens → reset → components → utilities.
   The only thing the layout still injects per-request is `--accent` (user-configurable
   brand colour). Everything else lives here, browser-cacheable.
   ============================================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Accent is overridden inline in layout.php; these are sane defaults. */
  --accent: #ef833b;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 35%, transparent);
  --accent-strong: color-mix(in srgb, var(--accent) 92%, white);

  /* Surfaces */
  --bg: #0a0a0b;
  --bg-deep: #050506;
  --surface: #111114;
  --surface-2: #17171b;
  --surface-3: #1d1d22;
  --surface-hover: #202028;
  --border: #27272d;
  --border-strong: #3a3a42;

  /* Text */
  --text: #fafafa;
  --text-secondary: #c8c8cf;
  --text-muted: #8b8b94;
  --text-faint: #5e5e66;

  /* Semantic */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, .12);
  --success-border: rgba(16, 185, 129, .4);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, .12);
  --warning-border: rgba(245, 158, 11, .4);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, .12);
  --danger-border: rgba(239, 68, 68, .4);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, .12);
  --info-border: rgba(59, 130, 246, .4);

  /* Spacing scale (used by utilities) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 10px;
  --space-4: 14px;
  --space-5: 18px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  /* Radii */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 4px 12px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h:  60px;
  --content-max: 1280px;

  /* Motion */
  --t-fast: .12s ease;
  --t:      .18s ease;

  /* Type */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--text-secondary);
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }
p  { margin: 0 0 12px; }
ol, ul { margin: 0 0 12px; padding-left: 18px; }
img { max-width: 100%; }

/* ---------- App shell ---------- */
.app {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  height: var(--topbar-h); flex-shrink: 0;
}
.sidebar__brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  object-fit: cover;
  background: var(--surface-3);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.sidebar__brand-name { font-weight: 700; letter-spacing: -.01em; font-size: 14.5px; }
.sidebar__brand-name small { display: block; color: var(--text-muted); font-weight: 500; font-size: 11px; letter-spacing: 0; }
.sidebar__nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
.sidebar__group { margin-bottom: 14px; }
.sidebar__group-title {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  color: var(--text-faint); padding: 8px 12px 6px; text-transform: uppercase;
}
.sidebar__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin: 1px 0;
  border-radius: var(--radius);
  color: var(--text-secondary); font-weight: 500; font-size: 13.5px;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar__link svg { color: var(--text-muted); flex-shrink: 0; transition: color var(--t-fast); }
.sidebar__link:hover { background: var(--surface-hover); color: var(--text); }
.sidebar__link:hover svg { color: var(--text-secondary); }
.sidebar__link--active { background: var(--accent-soft); color: var(--accent); }
.sidebar__link--active svg { color: var(--accent); }

.sidebar__user {
  border-top: 1px solid var(--border); padding: 12px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar__user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #000));
  display: grid; place-items: center;
  color: #111; font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name  { font-weight: 600; font-size: 13px; line-height: 1.2; }
.sidebar__user-email { color: var(--text-muted); font-size: 11.5px; line-height: 1.2; }
.sidebar__logout {
  color: var(--text-muted); margin-left: auto;
  padding: 6px; border-radius: 6px; transition: all var(--t-fast);
}
.sidebar__logout:hover { color: var(--danger); background: var(--danger-bg); }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar__base { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; }
.topbar__base code { background: var(--surface-2); }
.topbar__spacer { flex: 1; }
.topbar__pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text-secondary); font-size: 12px;
}
.topbar__pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.content { padding: 28px; max-width: var(--content-max); margin: 0 auto; width: 100%; }

/* ---------- Page header ---------- */
.page-head {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.page-head__title { flex: 1; min-width: 200px; }
.page-head__title p { color: var(--text-muted); margin: 4px 0 0; font-size: 13.5px; }
.page-head__back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-muted); margin-bottom: 4px;
}
.page-head__back:hover { color: var(--text); }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Cards ---------- */
.card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  width: 100%;
}
/* When cards are direct children of forms or generic containers, default to full-width
   so they fill the tab area cleanly instead of shrinking to content. */
.content > form > .card,
.content > .card,
.content > .grid-2 > .card,
.content > .split-2 > .card { width: 100%; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-header > div:first-child { flex: 1; min-width: 0; }
.card-header h2, .card-header h3 { flex: 1; min-width: 0; }
.card-header__sub { color: var(--text-muted); margin: 2px 0 0; font-size: 12.5px; }
.card-body { padding: 20px; }
.card-body--tight { padding: 12px; }
.card-table { padding: 0; }
.card-table .table-wrap { border: 0; border-radius: 0; border-top: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 8px 14px; height: 36px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all var(--t-fast);
  text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary { background: var(--accent); color: #111; border-color: var(--accent); }
.btn--primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); color: #111; }
.btn--ghost   { background: transparent; }
.btn--danger  { background: transparent; color: var(--danger); border-color: var(--danger-border); }
.btn--danger:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn--success { background: var(--success); color: #052e1f; border-color: var(--success); }
.btn--sm      { height: 30px; padding: 4px 10px; font-size: 12px; gap: 4px; }
.btn--xs      { height: 24px; padding: 2px 8px; font-size: 10.5px; gap: 4px; }
.btn--icon    { padding: 0; width: 36px; }
.btn--icon.btn--sm { width: 30px; }
.btn--icon.btn--xs { width: 24px; }
.btn--block   { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field--inline   { margin: 0; }
.field--minw-md  { min-width: 200px; }
.field--minw-lg  { min-width: 280px; }
.field__label    { display: block; font-size: 12.5px; color: var(--text-secondary); font-weight: 500; margin-bottom: 6px; }
.field__label--xs{ font-size: 11px; }
.field__hint     { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%; min-height: 38px;
  background: var(--bg-deep); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px;
  font: inherit; font-size: 13.5px;
  transition: border var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus, .input:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.textarea { min-height: 110px; line-height: 1.55; resize: vertical; font-family: inherit; }
.input--mono, .input.mono { font-family: var(--font-mono); font-size: 12.5px; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type=file].input { padding: 7px 10px; }

.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none; font-size: 13px;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

.checkbox-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; cursor: pointer;
  transition: all var(--t-fast);
}
.checkbox-card:hover { background: var(--surface-hover); }

/* Radio-style picker card (used on the user form for role selection) */
.radio-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg-deep);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--t-fast);
}
.radio-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.radio-card input[type=radio] { margin-top: 2px; }

/* Password / secret reveal — eye toggle inside an .input wrapper */
.input-reveal { position: relative; }
.input-reveal .input { padding-right: 44px; }
.input-reveal__btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 6px;
  color: var(--text-muted); cursor: pointer; transition: all var(--t-fast);
}
.input-reveal__btn:hover { background: var(--surface-hover); color: var(--text); }
.input-reveal__eye-off { display: none; }   /* JS toggles to inline when password is revealed */

/* Audit log details cell — single-line truncation with ellipsis */
.cell-truncate {
  max-width: 420px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Two-factor setup card layout */
.twofa-setup {
  display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap;
  margin-top: 6px;
}
.twofa-setup img {
  border-radius: var(--radius); background: #fff; padding: 6px;
  flex-shrink: 0;
}
.twofa-setup__info { flex: 1; min-width: 200px; }
.twofa-setup__secret {
  display: inline-block; word-break: break-all; font-size: 12px;
  background: var(--surface-2); padding: 6px 10px; border-radius: 6px;
  color: var(--text-secondary);
}

/* ---------- Storefront page (v1.7.0) ----------
 *
 * Three layout pieces:
 *   .storefront-hero       — empty-state CTA when there are 0 products
 *   .storefront-bar        — slim status row with feed URL + Sync button
 *   .storefront-advanced   — collapsed <details> wrapping the granular
 *                            register / enable / push controls
 *
 * The legacy .storefront-actions grid is kept for the Advanced
 * expander; it just has a tighter look now since the actions sit
 * inside a <details>. */

.storefront-hero {
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 92%, black) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  margin-bottom: 18px;
}
.storefront-hero__icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.storefront-hero h2 {
  margin: 0 0 6px;
  font-size: 22px; letter-spacing: -0.01em;
}
.storefront-hero > p {
  max-width: 560px; margin: 0 auto 20px;
  color: var(--text-muted); font-size: 14px;
}
.storefront-hero__steps {
  list-style: none; counter-reset: step;
  padding: 0; margin: 0 auto;
  max-width: 640px;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
}
.storefront-hero__steps li {
  counter-increment: step;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.storefront-hero__steps li::before {
  content: counter(step);
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.storefront-hero__steps li > div {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.storefront-hero__steps li > div strong { font-size: 14px; }

.storefront-bar {
  display: flex; align-items: stretch; gap: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.storefront-bar__feed {
  flex: 1; min-width: 280px;
  display: flex; flex-direction: column; gap: 8px;
}
.storefront-bar__feed-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.storefront-bar__feed-row {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.storefront-bar__feed-row .input { min-width: 0; flex: 1 1 280px; }
.storefront-bar__meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-size: 12px;
}
.storefront-bar__sync {
  display: flex; align-items: center;
  flex: none;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}
@media (max-width: 720px) {
  .storefront-bar__sync {
    border-left: 0; border-top: 1px solid var(--border);
    padding-left: 0; padding-top: 12px;
    width: 100%;
  }
  .storefront-bar__sync .btn { width: 100%; }
}

.storefront-advanced {
  margin-bottom: 18px;
}
.storefront-advanced > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  user-select: none;
  transition: all var(--t-fast);
}
.storefront-advanced > summary:hover {
  color: var(--text); border-color: var(--border-strong);
}
.storefront-advanced > summary svg { transition: transform .15s ease; }
.storefront-advanced[open] > summary svg { transform: rotate(90deg); }
.storefront-advanced[open] > summary { color: var(--text); }
.storefront-advanced > summary::-webkit-details-marker { display: none; }

.storefront-actions {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .storefront-actions { grid-template-columns: repeat(3, 1fr); }
}
.storefront-action {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  justify-content: space-between;
}
.storefront-action__head h4 {
  margin: 0 0 6px;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  color: var(--text);
}
.storefront-action__head h4 svg { color: var(--accent); }
.storefront-action__head p { margin: 0; line-height: 1.5; }
.storefront-action__btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tab badge muted variant — used when count is 0 ("nothing here yet"). */
.badge--zero {
  background: var(--surface-2) !important;
  color: var(--text-faint) !important;
  border-color: var(--border) !important;
}

/* ---------- API version: bulk import-from-HTML disclosure ---------- */
.api-version-import {
  margin-bottom: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  background: var(--surface-2);
}
.api-version-import > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text);
}
.api-version-import > summary::-webkit-details-marker { display: none; }
.api-version-import > summary:hover { color: var(--accent); }
.api-version-import > summary svg { color: var(--accent); }
.api-version-import[open] > summary { border-bottom: 1px solid var(--border); }
.api-version-import__body { padding: 14px; }
.api-version-import textarea {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- Module API versions (per-module dropdown options) ---------- */
.api-version-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.api-version-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.api-version-group__title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
}
.api-version-rows { display: flex; flex-direction: column; gap: 4px; }
.api-version-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.api-version-row__val {
  background: var(--surface-3);
  padding: 2px 6px; border-radius: 4px;
  font-size: 12px;
  min-width: 100px;
}
.api-version-row__lbl { flex: 1; min-width: 200px; color: var(--text); }

/* ---------- Version chips (Modules catalog inline) ---------- */
.version-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.version-chip {
  display: inline-flex; align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  overflow: hidden;
  line-height: 1;
}
.version-chip__ver {
  padding: 4px 8px;
  color: var(--text);
}
.version-chip__del {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.version-chip__del:hover {
  background: color-mix(in srgb, var(--danger, #f87171) 18%, transparent);
  color: var(--danger, #f87171);
}
.version-chip--err {
  border-color: color-mix(in srgb, var(--danger, #f87171) 45%, var(--border));
  background: color-mix(in srgb, var(--danger, #f87171) 8%, var(--surface-2));
}
.version-chip--err .version-chip__ver { color: var(--danger, #f87171); }

/* ---------- Danger zone (reset data) ---------- */
.tab--danger { color: var(--danger, #f87171); }
.tab--danger.active { color: var(--danger, #f87171); border-bottom-color: var(--danger, #f87171); }

.card--danger { border-color: color-mix(in srgb, var(--danger, #f87171) 35%, var(--border)); }
.card--danger > .card-header { border-bottom-color: color-mix(in srgb, var(--danger, #f87171) 35%, var(--border)); }
.card--danger > .card-header h2 { display: inline-flex; align-items: center; gap: 8px; color: var(--danger, #f87171); }

.reset-grid {
  display: grid; gap: 8px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .reset-grid { grid-template-columns: 1fr 1fr; }
}
.reset-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.reset-item:hover { background: var(--surface-3); }
.reset-item input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.reset-item__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.reset-item__title { font-weight: 600; font-size: 14px; color: var(--text); }
.reset-item__note  { font-size: 12px; }
.reset-item--danger {
  background: color-mix(in srgb, var(--danger, #f87171) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--danger, #f87171) 30%, var(--border));
}
.reset-item--danger:hover {
  background: color-mix(in srgb, var(--danger, #f87171) 14%, var(--surface-2));
}
.reset-item--danger .reset-item__title { color: var(--danger, #f87171); }

/* ---------- CP login cell on Clients page ---------- */
.cp-login__row {
  display: inline-flex; gap: 6px; flex-wrap: wrap;
  align-items: center;
}
.cp-login__btn { white-space: nowrap; }
.cp-login__btn svg { flex-shrink: 0; }

/* ---------- License missing — clients table pill + dashboard list ---------- */
.license-missing-pill {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  background: color-mix(in srgb, var(--danger, #f87171) 16%, transparent);
  color: var(--danger, #f87171);
  transition: background var(--t-fast);
}
.license-missing-pill:hover { background: color-mix(in srgb, var(--danger, #f87171) 28%, transparent); }
.license-missing-pill svg { flex-shrink: 0; }

.license-missing-list { display: flex; flex-direction: column; gap: 6px; }
.license-missing-list__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--danger, #f87171) 25%, var(--border));
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.license-missing-list__item:hover {
  background: color-mix(in srgb, var(--danger, #f87171) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--danger, #f87171) 50%, var(--border));
}
.license-missing-list__item code { color: var(--text); }
.license-missing-list__item .ml-auto { margin-left: auto; }

/* ---------- Credentials modal (copy-to-clipboard block) ---------- */
.modal__panel--sm { max-width: 480px; }
.cred-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted);
  margin: 0 0 8px;
}
.cred-block {
  display: flex; align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.cred-block__text {
  flex: 1;
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
  background: transparent;
}
.cred-block__copy {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  min-width: 88px;
  padding: 0 16px;
  background: var(--surface-3);
  border: 0;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.cred-block__copy:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-3));
  color: var(--accent);
}
.cred-block__copy svg { color: var(--accent); }
.cred-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- CAPTCHA widget container ---------- */
.captcha-widget {
  display: flex; justify-content: center;
  margin: 14px 0 6px;
  /* Provider widgets self-style their dark theme; we just give them breathing room. */
}

/* ---------- Captcha setup-guide ordered list ---------- */
.setup-steps {
  margin: 0; padding: 0 0 0 22px;
  display: grid; gap: 10px;
}
.setup-steps li {
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 14px;
}
.setup-steps li strong { color: var(--text); }
.setup-steps li code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12.5px;
}
.setup-steps a { color: var(--accent); text-decoration: underline; }
.setup-steps a:hover { color: var(--accent-strong); }

/* ---------- Profile page ---------- */
.profile-hero {
  display: flex; gap: 18px; align-items: center;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 16%, var(--surface)),
    var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.profile-hero__avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #000));
  display: grid; place-items: center;
  font-weight: 800; font-size: 24px; color: #111;
  flex-shrink: 0;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent);
}
.profile-hero__meta { flex: 1; min-width: 0; }
.profile-hero__meta h1 { margin: 0; font-size: 22px; }
.profile-hero__meta p  { margin: 2px 0 0; color: var(--text-muted); font-size: 13.5px; }
.profile-hero__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.profile-grid {
  display: grid; gap: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .profile-grid { grid-template-columns: 1.05fr 1fr; }
}
.profile-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted);
  margin: 0 0 10px;
}
.profile-section-title svg { color: var(--accent); }

.row   { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row--sm { gap: 6px; }

/* ---------- Tables ---------- */
.table-wrap {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
}
.table-wrap--scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead { background: var(--surface-2); }
.table th {
  text-align: left; padding: 11px 16px;
  font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.table th a { color: var(--text-muted); }
.table th a:hover { color: var(--text); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table .col-actions { width: 1px; white-space: nowrap; text-align: right; }
.table .col-actions .row-actions { display: inline-flex; gap: 6px; }

/* ---------- Action dropdown ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown__trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.dropdown__trigger:hover { background: var(--surface-3); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.dropdown__trigger svg { transition: transform var(--t-fast); }
.dropdown.is-open .dropdown__trigger svg.caret { transform: rotate(90deg); }
.dropdown__menu {
  position: fixed;
  min-width: 180px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  /* Max 32-bit signed int — beats every browser extension overlay we've
     seen (Adobe Acrobat's FAB uses 2147483646, Grammarly ~2000000,
     LastPass ~999999). Without this the kebab menu can open behind a
     full-viewport extension surface and look like it's not opening
     at all, even though the JS fires correctly. */
  z-index: 2147483647;
  text-align: left;
  /* Hidden via visibility instead of display:none so the browser still
     computes layout for it — JS can read offsetHeight/Width reliably on
     the first click without a flash of incorrect positioning. The menu
     is parked off-screen via CSS defaults until JS sets top/left. The
     pointer-events:none keeps the hidden menu from intercepting clicks
     that should go to the page underneath. */
  visibility: hidden;
  pointer-events: none;
  top: -9999px;
  left: -9999px;
}
.dropdown.is-open .dropdown__menu,
.dropdown__menu--open {
  visibility: visible;
  pointer-events: auto;
}
/* When the menu is portaled to <body> on open (to escape ancestor
   backdrop-filter / transform / filter / perspective which all create
   a containing block for position:fixed), the .dropdown.is-open
   selector no longer matches because the menu isn't a descendant.
   The .dropdown__menu--open class above keeps it visible. */
/* When the dropdown is opened on a row near the page bottom, JS sets
   the top via inline style (rect.top - menuH - 4). The styling here
   just ensures the right edge stays anchored to the trigger so the
   menu doesn't drift horizontally as the page scrolls. */
.dropdown__item, .dropdown__item button {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--text);
  font-size: 13px; font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast);
}
.dropdown__item:hover, .dropdown__item:hover button { background: var(--surface-2); color: var(--text); }
.dropdown__item--danger { color: var(--danger, #f87171); }
.dropdown__item--danger:hover { background: color-mix(in srgb, var(--danger, #f87171) 14%, var(--surface-2)); color: var(--danger, #f87171); }
.dropdown__item form { display: contents; margin: 0; padding: 0; }
.dropdown__item form button {
  width: 100%; padding: 8px 10px;
  display: flex; align-items: center; gap: 8px;
  text-align: left;
  background: transparent; border: 0; border-radius: 4px;
  color: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.dropdown__sep { height: 1px; background: var(--border); margin: 4px 2px; }
.dropdown__hd { padding: 6px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }

/* ---------- Badges & status pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 11.5px; font-weight: 500;
}
.badge--accent  { background: var(--accent-soft);  color: var(--accent);  border-color: transparent; }
.badge--success { background: var(--success-bg);   color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-bg);   color: var(--warning); border-color: transparent; }
.badge--danger  { background: var(--danger-bg);    color: var(--danger);  border-color: transparent; }
.badge--xs { padding: 1px 5px; font-size: 9.5px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 600; line-height: 1;
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill--ok      { background: var(--success-bg); color: var(--success); }
.status-pill--warn    { background: var(--warning-bg); color: var(--warning); }
.status-pill--err     { background: var(--danger-bg);  color: var(--danger); }
.status-pill--info    { background: var(--info-bg);    color: var(--info); }
.status-pill--neutral { background: var(--surface-3);  color: var(--text-muted); }

/* ---------- KPIs (v1.6.10 redesign — number-as-chip) ----------
 *
 * Horizontal card layout: a colour-tinted chip with the number itself
 * sits on the left where the icon used to be, and the label + descriptor
 * stack to the right. The chip IS the value — no separate hero number
 * row. Result is a shorter, denser tile that still reads "X widgets,
 * subtitle" in a single glance, and lets six tiles fit comfortably in
 * one desktop row.
 *
 * State semantics:
 *   - .kpi (no modifier)  → neutral chip, plain text colour
 *   - .kpi--zero          → "all clear" alert, chip in faint grey
 *   - .kpi--warn          → amber tinted chip + amber number
 *   - .kpi--err           → red tinted chip + red number
 *   - .kpi--ok            → accent tinted chip + accent number
 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 1280px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 94%, black) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  min-width: 0;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.kpi:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.32);
}

/* Subtle accent strip across the top — only renders on alert states. */
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background .15s ease;
}
.kpi--ok::before   { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.kpi--warn::before { background: linear-gradient(90deg, transparent, #f59e0b, transparent); }
.kpi--err::before  { background: linear-gradient(90deg, transparent, #ef4444, transparent); }

.kpi__chip {
  flex: none;
  min-width: 56px;
  height: 56px;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: background .15s ease, color .15s ease;
}

.kpi__body {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}

.kpi__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi__delta {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  /* Two-line clamp keeps cards uniformly tall even when the descriptor
     wraps, but stops descriptors from pushing the row taller than two
     lines on narrow viewports. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* State variants */
.kpi--ok   .kpi__chip { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.kpi--warn .kpi__chip { background: color-mix(in srgb, #f59e0b 20%, transparent);       color: #fbbf24; }
.kpi--err  .kpi__chip { background: color-mix(in srgb, #ef4444 20%, transparent);       color: #f87171; }
.kpi--zero .kpi__chip { color: var(--text-faint); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  align-self: flex-start;
}
.tabs a {
  padding: 7px 14px; border-radius: 7px;
  color: var(--text-muted); font-weight: 500; font-size: 13px;
  transition: all var(--t-fast);
}
.tabs a:hover  { color: var(--text); background: var(--surface-2); }
.tabs a.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Toolbar / filters / search ---------- */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.toolbar--card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 14px;
}
.toolbar__filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; min-width: 0; }
.toolbar__count   { color: var(--text-muted); font-size: 12.5px; }
/* Form controls inside a generic .toolbar should not stretch to 100% —
 * the global .input/.select rules do that, which makes selects claim
 * a whole row in a flex container. Override here to auto-size by
 * content with a sensible minimum so the row stays a single line. */
.toolbar__filters > .select,
.toolbar__filters > .input { width: auto; flex: 0 0 auto; }
.toolbar__filters > .select { min-width: 170px; }

.search { position: relative; min-width: 240px; flex: 1; max-width: 320px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search .input { padding-left: 38px; }

/* ---------- Filter bar (Clients page, v1.6.2) ----------
 *
 * A purpose-built filter row that doesn't fight the global form-control
 * width:100%. The search box flexes to fill leftover space, selects
 * are content-sized with a small minimum so labels never clip, and
 * the Apply / Reset buttons sit at the end. Wraps below 720px so each
 * control lands on its own row at phone widths.
 */
.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  flex-wrap: wrap;
}
.filterbar__search {
  position: relative;
  flex: 1 1 280px;
  min-width: 240px;
}
.filterbar__search svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.filterbar__input {
  width: 100%;
  height: 38px;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px 8px 38px;
  font-size: 13.5px;
  transition: border var(--t-fast), box-shadow var(--t-fast);
}
.filterbar__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.filterbar__input::placeholder { color: var(--text-faint); }
.filterbar__input::-webkit-search-cancel-button { display: none; }

.filterbar__select {
  /* Mirrors .select but sized to its widest option, not its container. */
  appearance: none; -webkit-appearance: none;
  height: 38px;
  padding: 8px 36px 8px 12px;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  flex: 0 0 auto;
  min-width: 170px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border var(--t-fast);
}
.filterbar__select:hover  { border-color: var(--border-strong); }
.filterbar__select:focus  { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.filterbar__select--narrow { min-width: 100px; }
@media (max-width: 720px) {
  .filterbar { flex-direction: column; align-items: stretch; }
  .filterbar__search { flex-basis: auto; min-width: 0; }
  .filterbar__select { width: 100%; }
}

/* ---------- Page-head count badge (Clients title, etc.) ---------- */
.page-head__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px;
  padding: 0 8px;
  margin-left: 10px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  vertical-align: 4px;
}

/* Search inside the Provision modal — full width, no max constraint */
.module-search { max-width: none; min-width: 0; }
.module-search .input { width: 100%; }

/* ---------- Alerts (flash messages) ---------- */
.alert {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid;
  font-size: 13.5px; margin-bottom: 12px;
}
.alert--ok   { background: var(--success-bg); border-color: var(--success-border); color: #c4f1de; }
.alert--err  { background: var(--danger-bg);  border-color: var(--danger-border);  color: #ffcfcf; }
.alert--info  { background: var(--info-bg);    border-color: var(--info-border);    color: #c2dcff; }
.alert--muted { background: var(--surface-2);  border-color: var(--border);          color: var(--text-muted); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty svg { color: var(--text-faint); margin-bottom: 12px; }
.empty h3  { color: var(--text-secondary); font-weight: 600; margin-bottom: 4px; }

/* ---------- Pager ---------- */
.pager { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.pager a {
  padding: 6px 11px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface);
  color: var(--text-secondary); font-size: 13px;
}
.pager a:hover { border-color: var(--border-strong); color: var(--text); }
.pager a.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: all var(--t);
}
.product-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card__thumb { aspect-ratio: 16 / 10; background: var(--bg-deep) center/cover no-repeat; border-bottom: 1px solid var(--border); }
.product-card__body  { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-card__cat   { color: var(--text-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.product-card__title { font-weight: 600; font-size: 14.5px; }
.product-card__desc  { font-size: 12.5px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__price { font-weight: 700; font-size: 16px; margin-top: 8px; }
.product-card__actions { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 6px; }

/* ---------- Image preview chip ---------- */
.image-preview {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  margin-top: 8px;
}
.image-preview img {
  width: 54px; height: 54px; border-radius: 6px;
  object-fit: cover; background: var(--bg-deep);
}
.image-preview code { font-size: 11px; word-break: break-all; }

/* ---------- Modal ---------- */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 100; padding: 20px; overflow-y: auto;
  backdrop-filter: blur(2px);
  animation: modalFade .15s ease;
}
.modal.open { display: flex; align-items: flex-start; justify-content: center; }
.modal__panel {
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 760px; margin: 40px auto;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: modalPop .18s ease;
}
.modal__head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal__head > div:first-child { flex: 1; }
.modal__close {
  background: transparent; border: 0;
  color: var(--text-muted); cursor: pointer;
  padding: 6px; border-radius: 6px; transition: all var(--t-fast);
}
.modal__close:hover { color: var(--text); background: var(--surface-2); }
.modal__body { padding: 20px 24px; max-height: calc(100vh - 200px); overflow-y: auto; }
.modal__foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: sticky; bottom: 0;
}
@keyframes modalFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes modalPop  { from { opacity: 0; transform: translateY(-8px) scale(.98) } to { opacity: 1; transform: none } }
/* When a modal is open we lock both the html and body scroll. body
 * alone is not enough — depending on which element is the actual scroll
 * container (`html` on most viewports), scroll wheel events still
 * propagate to the page behind. overscroll-behavior keeps the modal's
 * own scroll from "rubber-banding" into the page. */
html.modal-open, body.modal-open { overflow: hidden; height: 100%; }
.modal.open { overscroll-behavior: contain; }
.modal.open .modal__panel { overscroll-behavior: contain; }

/* ---------- Module list (provisioning + license editor) ---------- */
.module-list {
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; background: var(--bg-deep);
}
.module-list__group { margin-bottom: 10px; }
.module-list__section {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; color: var(--text-muted); padding: 4px 6px;
}
.module-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 6px;
}
.module-row__main {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; cursor: pointer;
}
.module-row__title { flex: 1; font-size: 13px; }
.module-row__title small { font-size: 11px; color: var(--text-muted); }
.module-row__svc {
  display: none;
  padding: 0 12px 12px 32px;
  border-top: 1px solid var(--border);
}
.module-row__svc-hint { color: var(--text-muted); font-size: 11px; margin: 8px 0 6px; }

/* ---------- Layouts ---------- */
.grid-2  { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.split-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: flex-start; }
@media (max-width: 980px) { .split-2 { grid-template-columns: 1fr; } }

.checkbox-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px;
}

.scroll-list {
  max-height: 55vh; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px;
}
.scroll-row {
  display: flex; padding: 6px 8px; border-radius: 6px;
}
.scroll-row:hover { background: var(--surface-2); }

/* Auto-fit grid that prefers ~280px columns (used in module settings, etc) */
.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}
.grid-auto-fit-sm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

/* Section divider / form group with bottom border (used between settings forms) */
.section-form {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.section-form:last-child {
  margin-bottom: 0; padding-bottom: 0; border-bottom: 0;
}

/* Section heading with badge / count */
.section-head {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* Highlighted table row (e.g. selected module being edited) */
.table tbody tr.row--active { background: var(--accent-soft); }
.table tbody tr.row--active:hover { background: var(--accent-soft); }

/* Card content immediately after card-header without padding (e.g. table-wrap that should butt up to header) */
.card-flush-top { border-top: 1px solid var(--border); border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }

/* Sticky form footer — used at the bottom of long product/edit forms to keep Save / Cancel always visible */
.form-foot {
  position: sticky; bottom: var(--space-4);
  display: flex; gap: var(--space-2);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: var(--space-2) 0;
}

/* ---------- Utilities (replace inline styles) ---------- */

/* Display */
.d-block         { display: block !important; }
.d-inline        { display: inline !important; }
.d-inline-block  { display: inline-block !important; }
.d-inline-flex   { display: inline-flex !important; }
.d-flex          { display: flex !important; }
.d-grid          { display: grid !important; }
.d-none          { display: none !important; }

/* Flex helpers */
.flex-col         { flex-direction: column; }
.flex-wrap        { flex-wrap: wrap; }
.flex-nowrap      { flex-wrap: nowrap; }
.flex-1           { flex: 1; }
.flex-grow        { flex-grow: 1; }
.flex-shrink-0    { flex-shrink: 0; }
.items-start      { align-items: flex-start; }
.items-center     { align-items: center; }
.items-end        { align-items: flex-end; }
.justify-start    { justify-content: flex-start; }
.justify-between  { justify-content: space-between; }
.justify-end      { justify-content: flex-end; }
.justify-center   { justify-content: center; }

/* Gaps (tied to spacing scale) */
.gap-1 { gap: var(--space-1); } /* 4 */
.gap-2 { gap: var(--space-2); } /* 8 */
.gap-3 { gap: var(--space-3); } /* 10 */
.gap-4 { gap: var(--space-4); } /* 14 */
.gap-5 { gap: var(--space-5); } /* 18 */
.gap-6 { gap: var(--space-6); } /* 24 */

/* Margin */
.m-0  { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }

/* Padding */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.pt-2 { padding-top: var(--space-2); }
.pb-4 { padding-bottom: var(--space-4); }

/* Width / size */
.w-full   { width: 100%; }
.w-auto   { width: auto; }
.maxw-sm  { max-width: 480px; }
.maxw-md  { max-width: 640px; }
.maxw-lg  { max-width: 760px; }
.maxw-xl  { max-width: 900px; }
.minw-sm  { min-width: 140px; }
.minw-md  { min-width: 200px; }
.minw-lg  { min-width: 280px; }
.minw-xl  { min-width: 320px; }
.field--minw-sm  { min-width: 140px; }
.field--minw-md  { min-width: 200px; }
.field--minw-lg  { min-width: 280px; }
.field--minw-xl  { min-width: 320px; }
.field--minw-sm.field--inline,
.field--minw-md.field--inline,
.field--minw-lg.field--inline,
.field--minw-xl.field--inline { flex: 1; }

/* Typography */
.text-xs    { font-size: 11.5px; }
.text-sm    { font-size: 12.5px; }
.text-base  { font-size: 13px; }
.fw-400     { font-weight: 400; }
.fw-500     { font-weight: 500; }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }
.muted      { color: var(--text-muted); }
.faint      { color: var(--text-faint); }
.nowrap     { white-space: nowrap; }
.text-mono  { font-family: var(--font-mono); font-size: 12.5px; }
.text-break { word-break: break-all; }

/* Colors */
.color-warning { color: var(--warning) !important; }
.color-danger  { color: var(--danger)  !important; }
.color-success { color: var(--success) !important; }

/* ---------- Mobile ---------- */
.mobile-toggle { display: none; }
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    width: var(--sidebar-w); transform: translateX(-100%);
    transition: transform var(--t); z-index: 50; box-shadow: var(--shadow-lg);
  }
  .sidebar--open { transform: translateX(0); }
  .mobile-toggle { display: inline-flex; }
  .content { padding: 18px; }
  .topbar { padding: 0 18px; }
  /* Long BASE_DIR pushes buttons off-screen on narrow viewports —
     hide it; the deployment page is the canonical place for it
     anyway. */
  .topbar__base { display: none; }
  /* The page-head action row stays right-aligned on desktop but
     drops to its own row on tablet+ widths. */
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head__actions { width: 100%; }
}
@media (max-width: 720px) {
  /* Tables can be wider than the viewport on small screens. The
     wrapper already has rounded corners + a fixed overflow strategy;
     swap it to horizontal-scroll so rows don't truncate silently. */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 8px 10px; }
  /* Toolbar (search + status filter + per-page) stacks vertically. */
  .toolbar__filters { flex-direction: column; align-items: stretch; }
  .toolbar__filters .search { min-width: 0; }
  /* Hide the floating "?" topbar button on phones — keyboard
     shortcuts aren't useful without a physical keyboard, and the
     button competes for space with the connection pill. */
  .topbar__kbd { display: none; }
}

/* ---------- Definition list (license status, etc.) ---------- */
.def-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 0;
  font-size: 13.5px;
}
.def-list dt {
  color: var(--text-muted);
  font-weight: 500;
  align-self: start;
}
.def-list dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}
.def-list dd code { font-size: 12.5px; }

/* ---------- Manager footer (data/footer.json) ----------
   Used by the app shell, the login page hero, and the install page.
   Login + install variants are styled by their own CSS files; the
   default 'app' variant is what shows under every authed page. The
   wrapper matches .content's max-width so the line lands centered
   under the page on wide screens. */
.manager-footer {
  border-top: 1px solid var(--border);
  margin: 0 auto;
  padding: 14px 28px 18px;
  max-width: var(--content-max);
  width: 100%;
  font-size: 12px;
  color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 6px 8px;
  align-items: center;
  box-sizing: border-box;
}
.manager-footer a { color: var(--text-secondary); text-decoration: none; }
.manager-footer a:hover { color: var(--accent); text-decoration: underline; }
.manager-footer__sep { opacity: 0.5; }
.manager-footer__ver { margin-left: auto; opacity: 0.7; }
/* Telegram brand mark — always full-colour even on hover (don't tint
   the official logo with the accent). The label still picks up the
   accent on hover. */
.manager-footer__tg { display: inline-flex; align-items: center; gap: 6px; }
.manager-footer__tg-icon {
  width: 14px; height: 14px;
  flex-shrink: 0;
  display: block;
}
.manager-footer__tg:hover { text-decoration: none; }
.manager-footer__tg:hover span { color: var(--accent); text-decoration: underline; }
@media (max-width: 720px) {
  .manager-footer { padding: 12px 16px 16px; }
  .manager-footer__ver { margin-left: 0; flex-basis: 100%; }
}

/* ---------- Superadmin CP avatar field ---------- */
.avatar-field {
  display: flex; gap: 12px; align-items: stretch;
}
.avatar-field__preview {
  flex: 0 0 64px; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  overflow: hidden;
  color: var(--text-muted);
}
.avatar-field__preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-field__inputs {
  flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}

/* ---------- Branding page ---------- */
.textarea--code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}
.brand-url-preview {
  margin-top: 6px;
  display: inline-flex;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  max-width: 120px;
}
.brand-url-preview img {
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
  display: block;
}

/* ---------- Default-branding tab ---------- */
.brand-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
  margin-bottom: 6px;
}
@media (min-width: 720px)  { .brand-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .brand-grid { grid-template-columns: repeat(3, 1fr); } }
.brand-slot {
  display: flex; gap: 12px; align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.brand-slot__preview {
  flex: 0 0 88px; width: 88px; height: 88px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.brand-slot__preview img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  display: block;
}
.brand-slot__empty {
  display: flex; flex-direction: column; gap: 4px;
  align-items: center; justify-content: center;
  color: var(--text-muted);
}
.brand-slot__body {
  flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.brand-slot__title { font-weight: 600; font-size: 13px; color: var(--text); }
.brand-slot__path  { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.brand-slot__form {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-top: auto;
}
.brand-slot__form .input { flex: 1; min-width: 0; }

/* ---------- Path cell — truncate long absolute paths gracefully ---------- */
.path-cell {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* ---------- Module licence filter bar (v1.6.4) ----------
 *
 * Segmented pill group ("All / Missing / Configured") + a search box
 * sit on a single row above the licence table. The pill group uses a
 * tinted background so it reads as a single control, and per-pill
 * count badges shift colour to flag urgency (warn for missing, ok
 * for configured).
 */
.modlic-filterbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--border);
}
.modlic-filterbar__search { position: relative; flex: 1 1 260px; min-width: 220px; }
.modlic-filterbar__search svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.modlic-filterbar__search .filterbar__input { padding-left: 38px; }

.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: transparent;
  border: 0; border-radius: 7px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.seg__btn:hover { color: var(--text); background: var(--surface-hover); }
.seg__btn--active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.seg__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--surface-3, color-mix(in srgb, var(--surface-2) 70%, white 6%));
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
}
.seg__btn--active .seg__count { background: var(--surface-2); color: var(--text); }
.seg__count--warn { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #fbbf24; }
.seg__count--ok   { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }

/* ---------- Manager update release notes (v1.6.0) ---------- */
.changelog {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.changelog li {
  position: relative;
  padding: 8px 12px 8px 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
}
.changelog li::before {
  content: '';
  position: absolute;
  left: 12px; top: 13px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Form submit loading state (v1.5.2) ----------
 *
 * Buttons mid-request pick up .btn--loading + aria-busy. The icon is
 * replaced with a small spinner so width is preserved (the operator
 * doesn't see the button collapse and trigger a layout shift).
 */
.btn--loading { pointer-events: none; opacity: .85; }
.btn--loading .spinner { margin-right: 6px; }
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cp-spin .7s linear infinite;
  vertical-align: -2px;
}
@keyframes cp-spin { to { transform: rotate(360deg); } }

/* ---------- Keyboard shortcuts help (v1.5.0) ---------- */
.kbd-table { width: 100%; border-collapse: collapse; }
.kbd-table th {
  text-align: left; padding: 12px 4px 6px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.kbd-table td { padding: 6px 4px; vertical-align: middle; }
.kbd-table td:first-child { width: 130px; white-space: nowrap; }
.kbd-table tr + tr td { border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
kbd {
  display: inline-block; min-width: 22px; padding: 2px 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; line-height: 1.4;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--text);
  text-align: center;
}
kbd + kbd { margin-left: 2px; }

/* ---------- Dashboard insights (v1.4.4) ----------
 *
 * Two-up grid for the Action items + Storage cards. Collapses to a
 * single column under 980px so each card gets its full width and the
 * progress bar still reads cleanly. */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }

.action-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.action-list__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.action-list__item:hover { background: var(--surface-3, color-mix(in srgb, var(--surface-2) 80%, white 8%)); border-color: var(--border-strong, var(--border)); }
.action-list__item > span { flex: 1; min-width: 0; }
.action-list__item--ok   { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.action-list__item--warn { border-color: color-mix(in srgb, #d97706 50%, transparent); }
.action-list__item--err  { border-color: color-mix(in srgb, #dc2626 50%, transparent); }
.action-list__item--ok   svg:first-of-type { color: var(--accent); }
.action-list__item--warn svg:first-of-type { color: #f59e0b; }
.action-list__item--err  svg:first-of-type { color: #ef4444; }

.storage-bar {
  width: 100%; height: 10px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.storage-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 80%, white));
  transition: width .25s ease;
}
.storage-bar__fill--warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.storage-bar__fill--err  { background: linear-gradient(90deg, #dc2626, #ef4444); }
.storage-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px;
}
.storage-meta strong { color: var(--text); }

/* ---------- Inline bulk-action bar (Clients page, v1.4.1) ----------
 *
 * The bar is position:fixed at the bottom of the viewport so the
 * operator can keep scrolling the row list while the action menu stays
 * within reach. Hidden by default (the [hidden] attribute); JS toggles
 * .bulk-bar--shown to slide it up. The contents form a single row that
 * wraps on narrow viewports — buttons stay on one line at desktop width.
 */
.col-check { width: 32px; padding-right: 0 !important; }
.col-check .checkbox--bare,
.col-check input[type="checkbox"] { margin: 0; }
.checkbox--bare { display: inline-flex; align-items: center; gap: 0; }
.checkbox--bare > span { display: none; }

.table--bulk thead th.col-check,
.table--bulk tbody td.col-check { text-align: center; }

.bulk-bar {
  position: fixed; left: 50%; bottom: 18px;
  transform: translateX(-50%) translateY(8px);
  z-index: 60; max-width: calc(100vw - 32px);
  background: color-mix(in srgb, var(--surface) 95%, black);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3);
  backdrop-filter: blur(10px);
  padding: 10px 14px;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.bulk-bar--shown { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.bulk-bar[hidden] { display: none; }
.bulk-bar__inner {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.bulk-bar__count {
  font-size: 13px; color: var(--text);
  white-space: nowrap;
}
.bulk-bar__count strong { color: var(--accent); font-size: 15px; margin-right: 4px; }
.bulk-bar__actions {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.bulk-bar__form { display: inline-block; }
.bulk-bar__names { display: none; }
@media (max-width: 720px) {
  .bulk-bar { left: 8px; right: 8px; transform: translateY(8px); max-width: none; }
  .bulk-bar--shown { transform: translateY(0); }
}
