/* ============================================================================
   UK Legal Data — API Platform Admin Portal
   Design system / component stylesheet
   This file doubles as the style spec for hand-off (tokens + components).
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces & neutrals (cool-leaning, low saturation) */
  --bg:            #f6f7f9;   /* app canvas */
  --surface:       #ffffff;   /* cards, tables, sidebar */
  --surface-2:     #fbfcfd;   /* subtle raised / zebra */
  --surface-3:     #f2f4f7;   /* inset wells, code chips */

  /* Borders / lines (thin, quiet) */
  --line:          #e7e9ee;
  --line-strong:   #d8dce3;
  --line-soft:     #eef0f3;

  /* Text */
  --ink:           #11151c;   /* primary text */
  --ink-2:         #515a67;   /* secondary */
  --ink-3:         #7d8694;   /* muted / captions */
  --ink-on-accent: #ffffff;

  /* Primary (blue) */
  --primary:       #2563eb;
  --primary-hover: #1d4ed8;
  --primary-press: #1e40af;
  --primary-tint:  #eef4ff;
  --primary-tint-2:#e0eaff;
  --primary-ring:  rgba(37, 99, 235, 0.30);

  /* Status — green / amber / red (reserved for state only) */
  --ok:            #157f3b;
  --ok-bg:         #e7f4ec;
  --ok-line:       #c2e3cf;
  --warn:          #9a6700;
  --warn-bg:       #fbf1da;
  --warn-line:     #efddb0;
  --err:           #c5292a;
  --err-bg:        #fbe9e9;
  --err-line:      #f1c9c9;

  /* Code surface (dark) */
  --code-bg:       #0f1521;
  --code-bg-2:     #161d2c;
  --code-line:     #243049;
  --code-ink:      #cdd6e8;
  --code-dim:      #7f8aa3;
  --code-key:      #82aaff;
  --code-str:      #a5d6a4;
  --code-num:      #f6c177;
  --code-bool:     #c792ea;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  /* Shadows — very restrained */
  --sh-1: 0 1px 2px rgba(16,24,40,.04), 0 1px 1px rgba(16,24,40,.04);
  --sh-2: 0 1px 2px rgba(16,24,40,.05), 0 4px 12px rgba(16,24,40,.06);
  --sh-3: 0 8px 28px rgba(16,24,40,.12), 0 2px 6px rgba(16,24,40,.06);
  --sh-pop: 0 12px 40px rgba(16,24,40,.18);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --sidebar-w: 250px;
  --topbar-h: 60px;
  --content-max: 1180px;
}

/* ----------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1, "tnum" 0;
}
#root { height: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary-tint-2); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Scrollbar */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #d3d8e0; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b9c0cc; background-clip: content-box; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------------------
   3. App shell
   -------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100%; }

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 20px 16px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(150deg, var(--primary), #4f7cf0);
  display: grid; place-items: center; flex: none;
  box-shadow: 0 2px 6px var(--primary-ring);
}
.brand-mark span { color: #fff; font-weight: 700; font-size: 14px; letter-spacing: -.02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }

.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 12px; }
.nav-group { margin-top: 16px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); padding: 6px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; cursor: pointer;
  position: relative; user-select: none;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item span { white-space: nowrap; }
.nav-item > span:not(.nav-badge) { flex: 1; }
.nav-item.active { background: var(--primary-tint); color: var(--primary-press); font-weight: 600; }
.nav-item.active .nav-ico { color: var(--primary); }
.nav-ico { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.nav-item .ext { margin-left: auto; color: var(--ink-3); width: 14px; height: 14px; }
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-3); border-radius: var(--r-pill); padding: 1px 8px;
}

.side-foot { border-top: 1px solid var(--line); padding: 12px; }
.env-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12px; color: var(--ink-2); background: var(--surface-2);
}
.env-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.env-dot.live { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px; background: rgba(255,255,255,.86);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb svg { width: 14px; height: 14px; }
.topbar-search {
  margin-left: 8px; display: flex; align-items: center; gap: 8px;
  background: var(--surface-3); border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 7px 11px; width: 260px; color: var(--ink-3); cursor: text;
  transition: border-color .12s, background .12s;
}
.topbar-search:hover { background: #eef0f3; }
.topbar-search input { border: 0; background: transparent; outline: none; flex: 1; color: var(--ink); }
.topbar-search input::placeholder { color: var(--ink-3); }
.topbar-search kbd {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px;
  background: #fff;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 8px 5px 5px;
  border-radius: var(--r-pill); cursor: pointer; border: 1px solid transparent;
}
.user-chip:hover { background: var(--surface-3); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, #5b8def, #324f97); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
.user-meta { line-height: 1.15; }
.user-name { font-size: 12.5px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--ink-3); }

/* Content scroll region */
.content { flex: 1; min-height: 0; overflow-y: auto; }
.page { max-width: var(--content-max); margin: 0 auto; padding: 30px 26px 64px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--ink-2); font-size: 13.5px; max-width: 64ch; }
.page-head-row { display: flex; align-items: flex-start; gap: 16px; }
.page-head-row .grow { flex: 1; }

/* ----------------------------------------------------------------------------
   4. Cards & layout helpers
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 620; letter-spacing: -.01em; white-space: nowrap; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-head .segmented { flex: none; }
.card-head .spacer { flex: 1; }
.card-head.clickable { cursor: pointer; user-select: none; }
.card-head.clickable:hover h3 { color: var(--primary-press); }

.section-title { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--ink-3); }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* ----------------------------------------------------------------------------
   5. Stat cards
   -------------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 16px 14px; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-ico { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); flex: none; }
.stat-ico svg { width: 16px; height: 16px; }
.stat-label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 680; letter-spacing: -.025em; line-height: 1.05; }
.stat-value .unit { font-size: 15px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; }
.stat-delta svg { width: 13px; height: 13px; }
.stat-delta.up { color: var(--ok); }
.stat-delta.down { color: var(--err); }
.stat-delta.flat { color: var(--ink-3); }
.stat-foot { font-size: 11.5px; color: var(--ink-3); }

/* ----------------------------------------------------------------------------
   6. Tables
   -------------------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
  text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-3); padding: 10px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
table.data tbody td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .t-strong { font-weight: 600; color: var(--ink); }
table.data .t-mono { font-family: var(--font-mono); font-size: 12px; }
table.data .t-dim { color: var(--ink-3); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.cell-stack { display: flex; flex-direction: column; gap: 1px; }
.cell-stack .sub { font-size: 11.5px; color: var(--ink-3); }

/* Empty state */
.empty { padding: 48px 24px; text-align: center; color: var(--ink-3); }
.empty-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); color: var(--ink-3); display: grid; place-items: center; margin: 0 auto 12px; }
.empty-ico svg { width: 22px; height: 22px; }
.empty h4 { margin: 0 0 4px; color: var(--ink); font-size: 14px; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 38ch; font-size: 13px; }

/* ----------------------------------------------------------------------------
   7. Badges / pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 2px 9px; border-radius: var(--r-pill); border: 1px solid transparent; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.ok    { color: var(--ok);   background: var(--ok-bg);   border-color: var(--ok-line); }
.badge.ok .dot { background: var(--ok); }
.badge.warn  { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge.warn .dot { background: var(--warn); }
.badge.err   { color: var(--err);  background: var(--err-bg);  border-color: var(--err-line); }
.badge.err .dot { background: var(--err); }
.badge.neutral { color: var(--ink-2); background: var(--surface-3); border-color: var(--line); }
.badge.neutral .dot { background: var(--ink-3); }
.badge.primary { color: var(--primary-press); background: var(--primary-tint); border-color: var(--primary-tint-2); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
  padding: 3px 9px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag.code { font-family: var(--font-mono); font-size: 11.5px; }

/* ----------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 550; font-size: 13.5px; cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .04s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px var(--primary-ring); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary:active { background: var(--primary-press); }

.btn.danger { background: var(--surface); border-color: var(--err-line); color: var(--err); }
.btn.danger:hover { background: var(--err-bg); }
.btn.danger.solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger.solid:hover { background: #a82122; }

.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }

.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn.sm svg { width: 14px; height: 14px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn.block { width: 100%; }

.link { color: var(--primary); font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.link:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }
.link svg { width: 14px; height: 14px; }

/* ----------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field .opt { color: var(--ink-3); font-weight: 500; }

.input, .select, textarea.input {
  height: 38px; width: 100%; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  transition: border-color .12s, box-shadow .12s; outline: none;
}
textarea.input { height: auto; padding: 10px 12px; min-height: 78px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input.mono { font-family: var(--font-mono); font-size: 13px; }

.select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237d8694' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 34px;
}
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* Checkbox / radio */
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong);
  background: #fff; flex: none; margin-top: 1px; display: grid; place-items: center;
  transition: background .12s, border-color .12s;
}
.check .box svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.check input:checked + .box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .box svg { opacity: 1; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--primary-ring); }
.check .ctext { line-height: 1.35; }
.check .ctext b { font-weight: 600; }
.check .ctext .sub { display: block; font-size: 12px; color: var(--ink-3); }

/* Toggleable scope list (multi-select) */
.scope-list { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.scope-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft); transition: background .1s;
}
.scope-item:last-child { border-bottom: 0; }
.scope-item:hover { background: var(--surface-2); }
.scope-item.disabled { opacity: .5; pointer-events: none; }
.scope-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.scope-main .nm { font-weight: 550; font-size: 13px; }
.scope-main .rt { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.scope-cat { margin-left: auto; }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--r-sm); gap: 2px; border: 1px solid var(--line); }
.segmented button {
  border: 0; background: transparent; padding: 5px 13px; border-radius: 5px; font-weight: 550; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; transition: background .12s, color .12s, box-shadow .12s; white-space: nowrap;
}
.segmented button.active { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.segmented button:hover:not(.active) { color: var(--ink); }

/* ----------------------------------------------------------------------------
   10. Alerts / banners
   -------------------------------------------------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid; font-size: 13.5px;
}
.alert .a-ico { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.alert .a-body { flex: 1; }
.alert .a-body b { font-weight: 650; }
.alert .a-body p { margin: 2px 0 0; opacity: .9; }
.alert .a-close { cursor: pointer; opacity: .6; flex: none; }
.alert .a-close:hover { opacity: 1; }
.alert.ok   { background: var(--ok-bg);   border-color: var(--ok-line);   color: #0f5e2b; }
.alert.err  { background: var(--err-bg);  border-color: var(--err-line);  color: #92201f; }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: #6f4b00; }
.alert.info { background: var(--primary-tint); border-color: var(--primary-tint-2); color: var(--primary-press); }

/* Toast region */
.toast-region { position: fixed; top: 16px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; width: 360px; }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-3); padding: 12px 14px; display: flex; align-items: flex-start; gap: 11px;
  animation: toastIn .26s cubic-bezier(.2,.9,.3,1);
}
.toast .t-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast .t-ico svg { width: 13px; height: 13px; color: #fff; }
.toast.ok .t-ico { background: var(--ok); }
.toast.err .t-ico { background: var(--err); }
.toast .t-body { flex: 1; font-size: 13px; }
.toast .t-body b { font-weight: 620; display: block; }
.toast .t-body span { color: var(--ink-3); font-size: 12.5px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------------------------
   11. Code / JSON block
   -------------------------------------------------------------------------- */
.code {
  background: var(--code-bg); border: 1px solid var(--code-line); border-radius: var(--r-md);
  color: var(--code-ink); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65;
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 13px;
  border-bottom: 1px solid var(--code-line); background: var(--code-bg-2);
}
.code-head .dots { display: flex; gap: 6px; }
.code-head .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.code-head .dots i:nth-child(1) { background: #f4625d; }
.code-head .dots i:nth-child(2) { background: #f7bd4d; }
.code-head .dots i:nth-child(3) { background: #5bc659; }
.code-head .file { font-size: 11.5px; color: var(--code-dim); }
.code-head .spacer { flex: 1; }
.code-head .c-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--code-dim); cursor: pointer; padding: 3px 8px; border-radius: 5px; transition: background .12s, color .12s; }
.code-head .c-btn:hover { background: rgba(255,255,255,.07); color: var(--code-ink); }
.code-head .c-btn svg { width: 13px; height: 13px; }
.code-body { padding: 13px 15px; overflow: auto; max-height: 460px; }
.code-body pre { margin: 0; white-space: pre; }
.tok-key { color: var(--code-key); }
.tok-str { color: var(--code-str); }
.tok-num { color: var(--code-num); }
.tok-bool { color: var(--code-bool); }
.tok-null { color: var(--code-bool); }
.tok-punc { color: var(--code-dim); }

/* Inline code chip */
.kbd-code {
  font-family: var(--font-mono); font-size: 12px; background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--ink);
}

/* ----------------------------------------------------------------------------
   12. Secret-reveal callout
   -------------------------------------------------------------------------- */
.secret {
  border: 1px solid var(--primary-tint-2); border-radius: var(--r-lg); overflow: hidden;
  background:
    radial-gradient(120% 100% at 0% 0%, #f3f7ff 0%, #ffffff 55%);
  box-shadow: var(--sh-2);
}
.secret-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px 13px; }
.secret-key-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 2px 8px var(--primary-ring); }
.secret-key-ico svg { width: 18px; height: 18px; }
.secret-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.secret-head p { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-2); }
.secret-body { padding: 0 18px 16px; }
.secret-value {
  display: flex; align-items: center; gap: 10px; background: var(--code-bg); border-radius: var(--r-md);
  padding: 12px 14px; border: 1px solid var(--code-line);
}
.secret-value code { font-family: var(--font-mono); font-size: 13.5px; color: #e7edf9; flex: 1; word-break: break-all; }
.secret-warn { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: 12.5px; color: var(--warn); font-weight: 550; }
.secret-warn svg { width: 15px; height: 15px; flex: none; }

/* ----------------------------------------------------------------------------
   13. Catalogue
   -------------------------------------------------------------------------- */
.cat-group { margin-bottom: 26px; }
.cat-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cat-group-head .ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); }
.cat-group-head .ico svg { width: 15px; height: 15px; }
.cat-group-head h3 { margin: 0; font-size: 15px; font-weight: 620; }
.cat-group-head .count { font-size: 12px; color: var(--ink-3); background: var(--surface-3); padding: 1px 8px; border-radius: var(--r-pill); }

.api-row {
  display: grid; grid-template-columns: 1.4fr 1.3fr 1fr auto; gap: 18px; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--line-soft);
}
.api-row:last-child { border-bottom: 0; }
.api-row:hover { background: var(--surface-2); }
.api-name { font-weight: 600; font-size: 14px; }
.api-desc { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.api-meta-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.route-chip { font-family: var(--font-mono); font-size: 12px; color: var(--ink); background: var(--surface-3); border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; display: inline-block; }
.params { display: flex; gap: 6px; flex-wrap: wrap; }

/* ----------------------------------------------------------------------------
   14. Charts (CSS/SVG)
   -------------------------------------------------------------------------- */
.chart-area { padding: 16px 18px 8px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid line { stroke: var(--line-soft); stroke-width: 1; }
.chart-axis text { fill: var(--ink-3); font-size: 10.5px; font-family: var(--font-sans); }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.chart-fill { fill: url(#areaGrad); }
.chart-dot { fill: #fff; stroke: var(--primary); stroke-width: 2; }
.bar { fill: var(--primary); transition: fill .12s; }
.bar:hover { fill: var(--primary-hover); }
.bar-track { fill: var(--surface-3); }
.legend { display: flex; gap: 16px; align-items: center; padding: 0 18px 14px; font-size: 12px; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

.hbar-row { display: grid; grid-template-columns: 130px 1fr 52px; gap: 12px; align-items: center; padding: 7px 0; }
.hbar-label { font-size: 12.5px; font-family: var(--font-mono); color: var(--ink-2); }
.hbar-track { height: 9px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #5b8def); border-radius: var(--r-pill); }
.hbar-val { font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------------------
   15. Login
   -------------------------------------------------------------------------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 32px;
  background:
    radial-gradient(60% 50% at 50% -8%, #eaf0ff 0%, rgba(234,240,255,0) 60%),
    var(--bg);
}
.login-card { width: 100%; max-width: 396px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-brand .brand-mark { width: 42px; height: 42px; border-radius: 11px; }
.login-brand .brand-mark span { font-size: 19px; }
.login-brand .lb-text { text-align: center; }
.login-brand .lb-name { font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.login-brand .lb-sub { font-size: 12.5px; color: var(--ink-3); }
.login-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 26px 26px 24px; }
.login-panel h2 { margin: 0 0 3px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.login-panel .sub { margin: 0 0 20px; font-size: 13px; color: var(--ink-3); }
.login-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--ink-3); }
.login-meta { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.login-meta svg { width: 13px; height: 13px; }
.pw-wrap { position: relative; }
.pw-wrap .pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.field-error { color: var(--err); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.field-error svg { width: 13px; height: 13px; }
.input.invalid { border-color: var(--err-line); }
.input.invalid:focus { box-shadow: 0 0 0 3px var(--err-line); }

/* ----------------------------------------------------------------------------
   17. Number plate preview (Quick Lookup)
   -------------------------------------------------------------------------- */
.ident-preview { margin-top: 12px; min-height: 4px; }
.plate {
  display: flex; width: 100%; align-items: stretch; height: 54px; border-radius: 8px;
  border: 2px solid #15171c; overflow: hidden;
  box-shadow: 0 1px 2px rgba(16,24,40,.18), inset 0 1px 0 rgba(255,255,255,.45);
  font-family: "Oswald", var(--font-sans); user-select: none;
}
.plate.yellow { background: #f7d117; }
.plate.white  { background: #fbfbf9; }
.plate-band {
  width: 34px; background: #04309a; color: #fff; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-right: 1px solid rgba(0,0,0,.25);
}
.plate-band .code { font-size: 13px; font-weight: 600; letter-spacing: .02em; line-height: 1; }
.plate-band svg { margin-top: 1px; }
.plate-text {
  display: flex; align-items: center; padding: 0 16px;
  font-size: 28px; font-weight: 600; letter-spacing: .055em; color: #15171c; line-height: 1;
  white-space: nowrap;
}
.plate-ph { color: rgba(21,23,28,.32); letter-spacing: .12em; }

/* Editable plate (acts as the identifier input) */
.plate.plate-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring), 0 1px 2px rgba(16,24,40,.18); }
.plate-field {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-family: "Oswald", var(--font-sans); font-size: 30px; font-weight: 600; letter-spacing: .08em;
  color: #15171c; padding: 0 16px; text-transform: uppercase; line-height: 1; text-align: center;
}
.plate-field::placeholder { color: rgba(21,23,28,.34); letter-spacing: .08em; }

/* Editable inline-labelled input (VIN / postcode) */
.vin-input {
  display: flex; align-items: stretch; height: 42px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); overflow: hidden; background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.vin-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.vin-input .vin-label {
  background: var(--surface-3); color: var(--ink-3); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; padding: 0 12px; display: flex; align-items: center; border-right: 1px solid var(--line);
}
.vin-input .vin-field {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: .04em; padding: 0 13px; text-transform: uppercase; color: var(--ink);
}
.vin-input .vin-field::placeholder { color: var(--ink-3); }

/* Identifier label + VRM/VIN switch row */
.id-switch-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.id-switch { padding: 3px; display: flex; width: 100%; }
.id-switch button { flex: 1; padding: 6px 14px; font-size: 12.5px; }

.vin-chip {
  display: inline-flex; align-items: center; gap: 0; height: 38px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); overflow: hidden; background: var(--surface);
}
.vin-chip .vin-label {
  background: var(--surface-3); color: var(--ink-3); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; padding: 0 11px; height: 100%; display: flex; align-items: center;
  border-right: 1px solid var(--line); white-space: nowrap;
}
.vin-chip .vin-val { font-family: var(--font-mono); font-size: 13px; padding: 0 13px; color: var(--ink); letter-spacing: .04em; }

/* ----------------------------------------------------------------------------
   19. Bulk processing
   -------------------------------------------------------------------------- */
.cols-bulk { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.cols-bulk > * { min-width: 0; }

.step-n {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none;
}

.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 26px 20px; text-align: center;
  cursor: pointer; transition: border-color .12s, background .12s; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-tint); }
.dropzone .dz-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: var(--primary); display: grid; place-items: center; }
.dropzone.over .dz-ico { background: #fff; }
.dropzone b { font-size: 13.5px; font-weight: 600; }
.dropzone .dz-file { color: var(--primary-press); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.bulk-actions { display: flex; gap: 10px; }
.bulk-actions .btn { flex: none; }
.bulk-actions .btn.primary { flex: 1; }

.progress { height: 8px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #5b8def); border-radius: var(--r-pill); transition: width .12s linear; }

/* Templates rail */
.tpl-list { display: flex; flex-direction: column; }
.tpl-item { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 7px; }
.tpl-item:last-child { border-bottom: 0; }
.tpl-top { display: flex; align-items: center; gap: 8px; }
.tpl-name { font-weight: 600; font-size: 13.5px; flex: 1; }
.icon-btn.sm-x { width: 26px; height: 26px; }
.icon-btn.sm-x svg { width: 14px; height: 14px; }
.icon-btn.sm-x:hover { background: var(--err-bg); color: var(--err); }
.tpl-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.tpl-meta .muted { font-size: 12px; }
.tpl-foot { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.tpl-summary { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; background: var(--surface-3); border-radius: var(--r-sm); font-size: 12.5px; }

@media (max-width: 1080px) { .cols-bulk { grid-template-columns: 1fr; } .field-grid { grid-template-columns: 1fr; } .picker-grid { grid-template-columns: 1fr !important; } }

/* JSON field picker */
.picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.picker-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 9px; }
.picker-label svg { color: var(--ink-3); }
.picker-label .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); font-weight: 500; }

.jsonpick { background: var(--code-bg); border: 1px solid var(--code-line); border-radius: var(--r-md); padding: 10px 10px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; color: var(--code-ink); overflow: auto; max-height: 360px; }
.jp-indent { padding-left: 16px; }
.jp-line { display: flex; align-items: center; padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.jp-check { width: 16px; display: inline-flex; justify-content: center; align-items: center; color: var(--code-dim); flex: none; }
.jp-pickable, .jp-arrhead { cursor: pointer; }
.jp-pickable .jp-check, .jp-arrhead .jp-check { opacity: 0; transition: opacity .1s; }
.jp-pickable:hover, .jp-arrhead:hover { background: rgba(255,255,255,.06); }
.jp-pickable:hover .jp-check, .jp-arrhead:hover .jp-check { opacity: .85; }
.jp-pickable.sel, .jp-arrhead.sel { background: rgba(37,99,235,.22); }
.jp-pickable.sel .jp-check, .jp-arrhead.sel .jp-check { opacity: 1; color: #8fb4ff; }
.jp-listpill { margin-left: 8px; font-size: 10px; background: rgba(255,255,255,.1); color: var(--code-dim); padding: 0 7px; border-radius: 999px; }
.jp-hint { margin-left: auto; font-size: 10.5px; color: var(--code-dim); padding-left: 14px; }
.jp-note { color: var(--code-dim); margin-left: 8px; font-size: 11px; opacity: .8; }
.jp-prims { color: var(--code-str); padding-top: 1px; padding-bottom: 1px; }

/* Selected column chips */
.cols-empty { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 22px 16px; text-align: center; color: var(--ink-3); font-size: 12.5px; background: var(--surface-2); }
.col-chips { display: flex; flex-direction: column; gap: 7px; max-height: 360px; overflow: auto; }
.col-chip { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.col-chip .cc-name { font-size: 12.5px; font-weight: 550; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-chip .cc-tag { font-size: 10px; font-weight: 600; color: var(--ink-3); background: var(--surface-3); padding: 1px 7px; border-radius: 999px; }
.cc-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.cc-mode button { border: 0; background: var(--surface); color: var(--ink-3); font-size: 10.5px; font-weight: 600; padding: 2px 8px; cursor: pointer; }
.cc-mode button.on { background: var(--primary); color: #fff; }
.cc-x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 5px; flex: none; }
.cc-x:hover { background: var(--err-bg); color: var(--err); }

/* Bulk jobs list */
.job-list { display: flex; flex-direction: column; }
.job-item { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .1s; }
.job-item:last-child { border-bottom: 0; }
.job-item:hover { background: var(--surface-2); }
.job-item.active { background: var(--primary-tint); }
.job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.job-title { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.job-count { font-weight: 600; }
.job-progress { display: flex; align-items: center; gap: 12px; }
.job-status { flex: none; width: 130px; display: flex; justify-content: flex-start; }
.job-actions { flex: none; display: flex; align-items: center; gap: 6px; }
@media (max-width: 720px) { .job-status { display: none; } }

/* CSV example + source-column chooser */
.csv-example { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 13px; background: var(--surface-2); }
.csv-example-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.csv-sample { margin: 0 0 9px; background: var(--code-bg); color: var(--code-ink); border-radius: var(--r-sm); padding: 10px 12px; font-size: 11.5px; line-height: 1.6; overflow-x: auto; white-space: pre; }
.src-picker { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.src-head { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.src-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.src-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: var(--r-pill); padding: 4px 11px 4px 9px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .12s; }
.src-chip:hover { border-color: var(--primary); color: var(--ink); }
.src-chip.on { background: var(--primary-tint); border-color: var(--primary-tint-2); color: var(--primary-press); }
.src-chip svg { color: currentColor; }
.data .src-col { background: var(--surface-2); }
.data thead th.src-col { color: var(--ink-2); }
.data thead th.api-col { color: var(--primary-press); }

/* Reporting logs filters */
.log-filters { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.log-filters .log-sel { width: auto; min-width: 130px; height: 34px; }
.log-filters .topbar-search { height: 34px; }

/* Users — permission groups */
.perm-groups { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.perm-group { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface-2); }
.perm-group-head { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.perm-check { padding: 5px 0; font-size: 13px; }
.perm-check .box { width: 17px; height: 17px; }

/* ----------------------------------------------------------------------------
   20. Misc utility (continued)
   -------------------------------------------------------------------------- */
/* Dropdown menu item */
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); cursor: pointer; }
.menu-item:hover { background: var(--surface-3); color: var(--ink); }
.menu-item svg { width: 16px; height: 16px; color: var(--ink-3); }
.menu-item.danger { color: var(--err); }
.menu-item.danger:hover { background: var(--err-bg); }
.menu-item.danger svg { color: var(--err); }

.copy-flash { color: var(--ok) !important; }

/* Modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(17,21,28,.42); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 500; padding: 24px; animation: fadeIn .16s ease; }
.modal-scrim[hidden] { display: none; }
.key-cell { display: inline-flex; align-items: center; gap: 6px; }
.key-cell .key-val { white-space: nowrap; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-pop); width: 100%; max-width: 420px; padding: 22px 22px 18px; animation: modalIn .2s cubic-bezier(.2,.9,.3,1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 13px; }
.modal-ico.danger { background: var(--err-bg); color: var(--err); }
.modal h3 { margin: 0 0 6px; font-size: 16px; font-weight: 650; }
.modal p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, #eef0f3 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 5px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.fade-in { animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.cols-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.cols-form { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
.cols-2 > *, .cols-form > * { min-width: 0; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .cols-form { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
