/* Vesta Design System v4: components
   Reference implementation of every pattern in the system, written against
   tokens.css only. Classes carry a v- prefix so they never collide with Onsen
   (.card, .button, .list), MUI (.Mui*) or Tailwind utilities.
   Port notes for MUI, Tailwind v4 and Onsen live in index.html. */

/* ── Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--v-bg);
  color: var(--v-text);
  font-family: var(--v-font-sans);
  font-size: var(--v-text-md);
  line-height: var(--v-leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { text-wrap: balance; font-weight: var(--v-weight-semibold); line-height: var(--v-leading-tight); }
::selection { background: var(--v-accent-soft); color: var(--v-text); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--v-focus); outline-offset: 2px; border-radius: var(--v-radius-xs); }
[hidden] { display: none !important; }

/* ── Motion: page entrance, theme switch ───────────────────────────
   Both respect prefers-reduced-motion. Durations come from tokens.css. */
/* Page content fades up once when it mounts. Re-mount the element on navigation
   (React: key it on the route) so each page replays it while the shell stays put.
   No fill-forwards: once it ends there is no leftover transform to trap fixed or sticky children. */
@keyframes v-page-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: no-preference) { .v-page-in { animation: v-page-in var(--v-dur-slow) var(--v-ease-out) backwards; } }

/* Theme toggle: render both icons; the current one rotates in from data-theme on <html>, so there is no state to hydrate.
   <button class="v-btn v-btn--ghost v-btn--icon v-theme-toggle"><svg class="v-i v-theme-toggle__moon">…<svg class="v-i v-theme-toggle__sun">…</button> */
.v-theme-toggle { position: relative; overflow: hidden; }
.v-theme-toggle:active { transform: scale(0.9); }
.v-theme-toggle .v-i { position: absolute; inset: 0; margin: auto; transition: transform var(--v-dur-slow) var(--v-ease-out), opacity var(--v-dur-base); }
.v-theme-toggle__sun { transform: rotate(120deg) scale(0.4); opacity: 0; }
:root[data-theme="dark"] .v-theme-toggle__sun { transform: none; opacity: 1; }
:root[data-theme="dark"] .v-theme-toggle__moon { transform: rotate(-120deg) scale(0.4); opacity: 0; }
/* Add .v-theming to <html> just before flipping data-theme and remove it ~400ms later: every colour eases for one beat instead of snapping. */
@media (prefers-reduced-motion: no-preference) {
  :root.v-theming, :root.v-theming *, :root.v-theming *::before, :root.v-theming *::after { transition: background-color var(--v-dur-theme) ease, color var(--v-dur-theme) ease, border-color var(--v-dur-theme) ease, fill var(--v-dur-theme) ease, stroke var(--v-dur-theme) ease, box-shadow var(--v-dur-theme) ease !important; }
}

/* ── Type helpers ─────────────────────────────────────────────────── */
.v-title { font-size: var(--v-text-2xl); font-weight: var(--v-weight-semibold); letter-spacing: -0.01em; }
.v-h2 { font-size: var(--v-text-xl); font-weight: var(--v-weight-semibold); }
.v-h3 { font-size: var(--v-text-lg); font-weight: var(--v-weight-semibold); }
.v-eyebrow { font-size: var(--v-text-xs); font-weight: var(--v-weight-semibold); text-transform: uppercase; letter-spacing: var(--v-tracking-caps); color: var(--v-text-3); }
.v-muted { color: var(--v-text-3); }
.v-subtle { color: var(--v-text-2); }
.v-small { font-size: var(--v-text-sm); }
.v-xs { font-size: var(--v-text-xs); }
.v-num { font-variant-numeric: tabular-nums; }
.v-mono { font-family: var(--v-font-mono); font-size: 0.92em; }
.v-id { font-variant-numeric: tabular-nums; color: var(--v-text-3); font-size: var(--v-text-sm); }
.v-strong { font-weight: var(--v-weight-semibold); }
.v-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.v-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v-link { color: var(--v-accent); font-weight: var(--v-weight-medium); }
.v-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.v-kbd { font-family: var(--v-font-mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--v-border); border-bottom-width: 2px; border-radius: var(--v-radius-xs); color: var(--v-text-3); background: var(--v-surface); }

/* ── Layout helpers ───────────────────────────────────────────────── */
.v-row { display: flex; align-items: center; gap: var(--v-space-2); min-width: 0; }
.v-row--wrap { flex-wrap: wrap; }
.v-row--between { justify-content: space-between; }
.v-row--top { align-items: flex-start; }
.v-stack { display: flex; flex-direction: column; gap: var(--v-space-4); min-width: 0; }
.v-stack--sm { gap: var(--v-space-2); }
.v-stack--xs { gap: var(--v-space-1); }
.v-stack--lg { gap: var(--v-space-6); }
.v-grow { flex: 1 1 auto; min-width: 0; }
.v-grid { display: grid; gap: var(--v-space-4); }
.v-grid > * { min-width: 0; }
.v-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.v-grid--stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.v-grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .v-grid--2-1 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) { .v-grid--3, .v-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .v-grid--2, .v-grid--3, .v-grid--4 { grid-template-columns: minmax(0, 1fr); } }
.v-divider { height: 1px; background: var(--v-border); border: 0; margin: 0; }
.v-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Icons (Tabler, 24 grid, stroke 1.75) ─────────────────────────── */
.v-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.v-i--sm { width: 16px; height: 16px; }
.v-i--lg { width: 20px; height: 20px; }
.v-i--xl { width: 24px; height: 24px; }

/* ── Buttons ──────────────────────────────────────────────────────────
   One primary per view. Secondary is the default. Ghost for toolbars.
   Danger is outline in place; solid danger lives only inside a confirm. */
.v-btn {
  --btn-h: var(--v-control-md);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--v-space-2);
  height: var(--btn-h); padding: 0 var(--v-space-4);
  border: 1px solid var(--v-border-strong); border-radius: var(--v-radius-md);
  background: var(--v-surface); color: var(--v-text);
  font-size: var(--v-text-md); font-weight: var(--v-weight-semibold); line-height: 1; white-space: nowrap;
  box-shadow: var(--v-shadow-xs);
  transition: background var(--v-dur-fast), border-color var(--v-dur-fast), color var(--v-dur-fast);
}
.v-btn:hover { background: var(--v-surface-2); }
.v-btn:active { background: var(--v-surface-3); }
.v-btn:disabled, .v-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.v-btn--primary { background: var(--v-primary); border-color: var(--v-primary); color: var(--v-on-primary); }
.v-btn--primary:hover { background: var(--v-primary-hover); border-color: var(--v-primary-hover); }
.v-btn--primary:active { background: var(--v-flame-800); }
.v-btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--v-text-2); }
.v-btn--ghost:hover { background: var(--v-surface-2); color: var(--v-text); }
.v-btn--danger { color: var(--v-red-fg); border-color: var(--v-red-line); }
.v-btn--danger:hover { background: var(--v-red-bg); }
.v-btn--danger-solid { background: var(--v-red); border-color: var(--v-red); color: #fff; }
.v-btn--danger-solid:hover { filter: brightness(0.92); background: var(--v-red); }
.v-btn--sm { --btn-h: var(--v-control-sm); padding: 0 var(--v-space-3); font-size: var(--v-text-sm); }
.v-btn--lg { --btn-h: var(--v-control-lg); padding: 0 var(--v-space-5); font-size: var(--v-text-lg); }
.v-btn--xl { --btn-h: var(--v-control-xl); padding: 0 var(--v-space-6); font-size: var(--v-text-lg); border-radius: var(--v-radius-lg); }
.v-btn--block { width: 100%; }
.v-btn--icon { width: var(--btn-h); padding: 0; }
.v-btn--icon.v-btn--ghost { color: var(--v-text-3); }
.v-btn .v-count { margin-left: 2px; }

/* ── Form fields ──────────────────────────────────────────────────── */
.v-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.v-label { font-size: var(--v-text-sm); font-weight: var(--v-weight-semibold); color: var(--v-text); }
.v-label .v-req { color: var(--v-red-fg); margin-left: 2px; }
.v-label .v-opt { color: var(--v-text-3); font-weight: var(--v-weight-regular); margin-left: 4px; }
.v-hint { font-size: var(--v-text-xs); color: var(--v-text-3); }
.v-error { font-size: var(--v-text-xs); color: var(--v-red-fg); display: flex; align-items: center; gap: 4px; }
.v-input, .v-select, .v-textarea {
  width: 100%; min-width: 0; height: var(--v-control-md);
  padding: 0 var(--v-space-3);
  border: 1px solid var(--v-border-strong); border-radius: var(--v-radius-md);
  background: var(--v-surface); color: var(--v-text);
  font-size: var(--v-text-md);
  transition: border-color var(--v-dur-fast), box-shadow var(--v-dur-fast);
}
.v-textarea { height: auto; min-height: 88px; padding: var(--v-space-2) var(--v-space-3); resize: vertical; line-height: var(--v-leading-normal); }
.v-select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--v-text-3) 50%), linear-gradient(135deg, var(--v-text-3) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.v-input::placeholder, .v-textarea::placeholder { color: var(--v-text-4); }
.v-input:hover, .v-select:hover, .v-textarea:hover { border-color: var(--v-text-4); }
.v-input:focus, .v-select:focus, .v-textarea:focus { outline: none; border-color: var(--v-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--v-focus) 18%, transparent); }
.v-input[aria-invalid="true"], .v-textarea[aria-invalid="true"], .v-select[aria-invalid="true"] { border-color: var(--v-red); }
.v-input--lg, .v-select.v-input--lg { height: var(--v-control-lg); font-size: var(--v-text-lg); }
.v-affix { position: relative; display: flex; align-items: center; min-width: 0; }
.v-affix > .v-i { position: absolute; left: 10px; color: var(--v-text-4); pointer-events: none; }
/* Only indent when a leading icon is actually there (a bare input inside .v-affix keeps its normal padding). */
.v-affix > .v-i + .v-input { padding-left: 34px; }
.v-affix > .v-kbd { position: absolute; right: 8px; }
/* A trailing icon (placed after the input, e.g. the pick selector) sits at the end, not over the leading icon. */
.v-affix > .v-input ~ .v-i { left: auto; right: 10px; }
.v-affix > .v-input:has(~ .v-i) { padding-right: 32px; }

/* Checkbox and radio: native control, branded */
.v-check { display: inline-flex; align-items: center; gap: var(--v-space-2); font-size: var(--v-text-md); cursor: pointer; min-height: 24px; }
.v-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--v-primary); cursor: pointer; }

/* Switch */
.v-switch { display: inline-flex; align-items: center; gap: var(--v-space-3); cursor: pointer; font-size: var(--v-text-md); }
.v-switch input { appearance: none; width: 36px; height: 20px; margin: 0; border-radius: var(--v-radius-full); background: var(--v-border-strong); position: relative; cursor: pointer; transition: background var(--v-dur-fast); flex: none; }
.v-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--v-shadow-xs); transition: transform var(--v-dur-base) var(--v-ease-out); }
.v-switch input:checked { background: var(--v-primary); }
.v-switch input:checked::after { transform: translateX(16px); }

/* Segmented control: one pattern for date presets, view toggles, sub-filters
   (replaces four hand-rolled variants). Active is a raised neutral, not flame. */
.v-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--v-radius-md); background: var(--v-surface-2); border: 1px solid var(--v-border); max-width: 100%; overflow-x: auto; }
.v-seg > button { height: calc(var(--v-control-md) - 8px); padding: 0 var(--v-space-3); border: 0; border-radius: 6px; background: transparent; color: var(--v-text-2); font-size: var(--v-text-sm); font-weight: var(--v-weight-semibold); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.v-seg > button:hover { color: var(--v-text); }
.v-seg > button[aria-pressed="true"] { background: var(--v-surface); color: var(--v-text); box-shadow: var(--v-shadow-xs), 0 0 0 1px var(--v-border); }

/* Option buttons: big tappable choices (checklist answers, priority picker) */
.v-options { display: flex; flex-wrap: wrap; gap: var(--v-space-2); }
.v-option { min-height: var(--v-control-lg); padding: 0 var(--v-space-4); border: 1px solid var(--v-border-strong); border-radius: var(--v-radius-md); background: var(--v-surface); font-weight: var(--v-weight-semibold); display: inline-flex; align-items: center; gap: var(--v-space-2); color: var(--v-text); }
.v-option:hover { border-color: var(--v-text-4); }
.v-option[aria-pressed="true"], .v-option[aria-checked="true"] { border-color: var(--v-primary); background: var(--v-accent-soft); color: var(--v-accent); box-shadow: inset 0 0 0 1px var(--v-primary); }
.v-option--yes[aria-pressed="true"] { border-color: var(--v-green); background: var(--v-green-bg); color: var(--v-green-fg); box-shadow: inset 0 0 0 1px var(--v-green); }
.v-option--no[aria-pressed="true"] { border-color: var(--v-red); background: var(--v-red-bg); color: var(--v-red-fg); box-shadow: inset 0 0 0 1px var(--v-red); }

/* ── Tabs ─────────────────────────────────────────────────────────── */
.v-tabs { display: flex; gap: var(--v-space-5); border-bottom: 1px solid var(--v-border); overflow-x: auto; scrollbar-width: none; }
.v-tab { position: relative; padding: var(--v-space-3) 0; border: 0; background: none; color: var(--v-text-3); font-weight: var(--v-weight-semibold); font-size: var(--v-text-md); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.v-tab:hover { color: var(--v-text); }
.v-tab[aria-selected="true"] { color: var(--v-text); }
.v-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--v-primary); }

/* ── Chips, status, tags, counts ──────────────────────────────────────
   .v-status: a record's state. Soft pill + leading dot + label; the icon
   variant is used where a dot is too small to read (mobile). Tone comes
   from data-tone so markup never names a hex. */
.v-status, .v-chip {
  --t-fg: var(--v-neutral-fg); --t-bg: var(--v-neutral-bg); --t-line: var(--v-neutral-line); --t-solid: var(--v-neutral);
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 var(--v-space-2);
  border-radius: var(--v-radius-full); border: 1px solid var(--t-line);
  background: var(--t-bg); color: var(--t-fg);
  font-size: var(--v-text-xs); font-weight: var(--v-weight-semibold); line-height: 1; white-space: nowrap;
}
.v-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--t-solid); flex: none; }
.v-status--icon::before { display: none; }
.v-status .v-i, .v-chip .v-i { width: 14px; height: 14px; }
.v-chip { border-radius: var(--v-radius-sm); }
.v-chip--lg { height: 28px; font-size: var(--v-text-sm); padding: 0 10px; }

/* Tag: quiet rectangular label for sources, categories, departments */
.v-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px; border-radius: var(--v-radius-xs); background: var(--v-surface-2); color: var(--v-text-2); font-size: var(--v-text-xs); font-weight: var(--v-weight-medium); white-space: nowrap; }
.v-tag .v-i { width: 13px; height: 13px; color: var(--v-text-3); }

/* Priority: shape differs from status (flag + text, no fill) so the two
   never blur. Normal priority renders nothing; only exceptions are flagged. */
.v-prio { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-size: var(--v-text-xs); font-weight: var(--v-weight-bold); text-transform: uppercase; letter-spacing: var(--v-tracking-caps); }
.v-prio .v-i { width: 14px; height: 14px; stroke-width: 2.25; }
.v-prio--urgent { color: var(--v-amber-fg); }
.v-prio--critical { color: var(--v-red-fg); }

/* Count badge */
.v-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--v-radius-full); background: var(--v-surface-3); color: var(--v-text-2); font-size: 11px; font-weight: var(--v-weight-bold); font-variant-numeric: tabular-nums; }
.v-count--brand { background: var(--v-primary); color: var(--v-on-primary); }

/* Live dot: realtime connection, just-updated rows */
.v-live { width: 8px; height: 8px; border-radius: 50%; background: var(--v-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--v-green) 22%, transparent); flex: none; }
.v-live--off { background: var(--v-smoke); box-shadow: 0 0 0 3px color-mix(in srgb, var(--v-smoke) 22%, transparent); } /* gone quiet, not failed */
.v-live--warn { background: var(--v-amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--v-amber) 22%, transparent); }

/* ── Avatar ───────────────────────────────────────────────────────── */
.v-avatar { --s: 32px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: var(--v-surface-3); color: var(--v-text-2); font-size: calc(var(--s) * 0.38); font-weight: var(--v-weight-semibold); overflow: hidden; }
.v-avatar img { width: 100%; height: 100%; object-fit: cover; }
.v-avatar--sm { --s: 24px; }
.v-avatar--lg { --s: 40px; }
.v-avatar--xl { --s: 64px; }
.v-orglogo { width: 32px; height: 32px; border-radius: var(--v-radius-sm); flex: none; display: grid; place-items: center; font-size: 11px; font-weight: var(--v-weight-bold); letter-spacing: 0.02em; color: #fff; }

/* ── Cards ────────────────────────────────────────────────────────── */
.v-card { background: var(--v-surface); border: 1px solid var(--v-border); border-radius: var(--v-radius-lg); box-shadow: var(--v-shadow-xs); min-width: 0; }
.v-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--v-space-3); padding: var(--v-space-4) var(--v-space-5) 0; min-height: 52px; }
.v-card__title { font-size: var(--v-text-md); font-weight: var(--v-weight-semibold); }
.v-card__sub { font-size: var(--v-text-xs); color: var(--v-text-3); margin-top: 2px; }
.v-card__body { padding: var(--v-space-4) var(--v-space-5) var(--v-space-5); }
.v-card__foot { padding: var(--v-space-3) var(--v-space-5); border-top: 1px solid var(--v-border); display: flex; align-items: center; justify-content: space-between; gap: var(--v-space-3); }
.v-card--flush .v-card__body { padding: 0; }
.v-card--link { transition: border-color var(--v-dur-fast), box-shadow var(--v-dur-fast); }
.v-card--link:hover { border-color: var(--v-border-strong); box-shadow: var(--v-shadow-sm); }

/* Stat tile: label, value, change, context. Clickable tiles filter a list. */
.v-stat { display: flex; flex-direction: column; gap: 6px; padding: var(--v-space-4); background: var(--v-surface); border: 1px solid var(--v-border); border-radius: var(--v-radius-lg); box-shadow: var(--v-shadow-xs); min-width: 0; text-align: left; color: inherit; }
button.v-stat { cursor: pointer; font: inherit; }
button.v-stat:hover, a.v-stat:hover { border-color: var(--v-border-strong); }
a.v-stat { transition: border-color var(--v-dur-fast); }
.v-stat[aria-pressed="true"] { border-color: var(--v-primary); box-shadow: 0 0 0 1px var(--v-primary); }
.v-stat__label { display: flex; align-items: center; gap: 6px; font-size: var(--v-text-sm); color: var(--v-text-2); font-weight: var(--v-weight-medium); }
.v-stat__label .v-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--t-solid, var(--v-neutral)); }
.v-stat__value { font-size: var(--v-text-3xl); font-weight: var(--v-weight-semibold); letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.v-stat__value small { font-size: var(--v-text-md); font-weight: var(--v-weight-medium); color: var(--v-text-3); letter-spacing: 0; margin-left: 2px; }
.v-stat__foot { display: flex; align-items: center; gap: 6px; font-size: var(--v-text-xs); color: var(--v-text-3); }
.v-delta { display: inline-flex; align-items: center; gap: 2px; font-weight: var(--v-weight-semibold); font-variant-numeric: tabular-nums; }
.v-delta--up { color: var(--v-green-fg); }
.v-delta--down { color: var(--v-red-fg); }
.v-delta .v-i { width: 14px; height: 14px; stroke-width: 2.25; }

/* ── Tables ───────────────────────────────────────────────────────────
   44px rows by default (was 80px), sticky head, numbers right-aligned,
   whole row opens the record. Primary column carries title + meta line. */
.v-table-wrap { overflow-x: auto; border: 1px solid var(--v-border); border-radius: var(--v-radius-lg); background: var(--v-surface); box-shadow: var(--v-shadow-xs); }
.v-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--v-text-sm); }
.v-table th { position: sticky; top: 0; z-index: 1; background: var(--v-surface-2); color: var(--v-text-3); font-size: var(--v-text-xs); font-weight: var(--v-weight-semibold); text-align: left; white-space: nowrap; padding: 0 var(--v-space-3); height: 36px; border-bottom: 1px solid var(--v-border); }
.v-table th:first-child, .v-table td:first-child { padding-left: var(--v-space-4); }
.v-table th:last-child, .v-table td:last-child { padding-right: var(--v-space-4); }
.v-table td { padding: var(--v-space-2) var(--v-space-3); height: 44px; border-bottom: 1px solid var(--v-border); vertical-align: middle; }
.v-table tbody tr:last-child td { border-bottom: 0; }
.v-table tbody tr { transition: background var(--v-dur-fast); }
.v-table tbody tr[data-href], .v-table tbody tr.is-clickable { cursor: pointer; }
.v-table tbody tr:hover { background: var(--v-surface-2); }
.v-table tbody tr[aria-selected="true"] { background: var(--v-accent-soft); }
.v-table tbody tr.is-fresh { box-shadow: inset 3px 0 0 var(--v-green); }
.v-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.v-table .is-tight { width: 1%; white-space: nowrap; }
.v-table .v-cell-title { font-weight: var(--v-weight-semibold); color: var(--v-text); font-size: var(--v-text-sm); }
.v-table .v-cell-meta { color: var(--v-text-3); font-size: var(--v-text-xs); margin-top: 2px; }
.v-table--roomy td { height: 56px; }
.v-table--fixed { table-layout: fixed; }
.v-table--fixed td > * { min-width: 0; }
.v-th-sort { display: inline-flex; align-items: center; gap: 4px; }
.v-th-sort .v-i { width: 12px; height: 12px; }

/* Toolbar above lists: search, quick filters, more filters, view, actions */
.v-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--v-space-2); }
.v-filter { display: inline-flex; align-items: center; gap: 6px; height: var(--v-control-sm); padding: 0 10px; border: 1px dashed var(--v-border-strong); border-radius: var(--v-radius-md); background: transparent; color: var(--v-text-2); font-size: var(--v-text-sm); font-weight: var(--v-weight-medium); white-space: nowrap; }
.v-filter:hover { background: var(--v-surface-2); color: var(--v-text); }
.v-filter.is-set { border-style: solid; border-color: var(--v-accent-border); background: var(--v-accent-soft); color: var(--v-accent); }
.v-filter .v-i { width: 14px; height: 14px; }
.v-filter b { font-weight: var(--v-weight-semibold); color: var(--v-text); }
.v-filter.is-set b { color: inherit; }

/* Pagination */
.v-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--v-space-3); padding: var(--v-space-3) var(--v-space-4); border-top: 1px solid var(--v-border); font-size: var(--v-text-sm); color: var(--v-text-3); flex-wrap: wrap; }

/* ── Page header & breadcrumbs ────────────────────────────────────── */
.v-crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--v-text-sm); color: var(--v-text-3); flex-wrap: wrap; }
.v-crumbs a:hover { color: var(--v-text); }
.v-crumbs .v-i { width: 14px; height: 14px; color: var(--v-text-4); }
.v-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--v-space-4); flex-wrap: wrap; }
.v-page-head__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v-page-head__desc { color: var(--v-text-3); font-size: var(--v-text-md); max-width: 70ch; }
.v-page-head__actions { display: flex; gap: var(--v-space-2); flex-wrap: wrap; }

/* ── Key-value list (record facts) ────────────────────────────────── */
.v-kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: var(--v-space-3) var(--v-space-4); font-size: var(--v-text-sm); }
.v-kv dt { color: var(--v-text-3); display: flex; align-items: center; gap: 6px; }
.v-kv dt .v-i { width: 15px; height: 15px; color: var(--v-text-4); }
.v-kv dd { color: var(--v-text); min-width: 0; }

/* ── Activity timeline ────────────────────────────────────────────── */
.v-timeline { display: flex; flex-direction: column; }
.v-timeline__item { display: grid; grid-template-columns: 28px 1fr; gap: var(--v-space-3); position: relative; padding-bottom: var(--v-space-4); }
.v-timeline__item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--v-border); }
.v-timeline__dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--t-bg, var(--v-surface-2)); color: var(--t-fg, var(--v-text-3)); border: 1px solid var(--t-line, var(--v-border)); }
.v-timeline__dot .v-i { width: 14px; height: 14px; }
.v-timeline__body { font-size: var(--v-text-sm); min-width: 0; padding-top: 4px; }
.v-timeline__meta { font-size: var(--v-text-xs); color: var(--v-text-3); margin-top: 2px; }
.v-bubble { margin-top: var(--v-space-2); padding: var(--v-space-2) var(--v-space-3); background: var(--v-surface-2); border-radius: var(--v-radius-md); color: var(--v-text); font-size: var(--v-text-sm); }
.v-attach { display: inline-flex; align-items: center; gap: var(--v-space-2); margin-top: var(--v-space-2); padding: 6px 10px 6px 6px; border: 1px solid var(--v-border); border-radius: var(--v-radius-md); font-size: var(--v-text-xs); color: var(--v-text-2); background: var(--v-surface); }
.v-attach__thumb { width: 36px; height: 36px; border-radius: var(--v-radius-sm); background: var(--v-surface-3); display: grid; place-items: center; color: var(--v-text-3); }

/* ── Alerts / banners ─────────────────────────────────────────────── */
.v-alert { --t-fg: var(--v-blue-fg); --t-bg: var(--v-blue-bg); --t-line: var(--v-blue-line); --t-solid: var(--v-blue); display: flex; gap: var(--v-space-3); align-items: flex-start; padding: var(--v-space-3) var(--v-space-4); border: 1px solid var(--t-line); background: var(--t-bg); color: var(--v-text); border-radius: var(--v-radius-md); font-size: var(--v-text-sm); }
.v-alert > .v-i { color: var(--t-solid); margin-top: 1px; }
.v-alert__title { font-weight: var(--v-weight-semibold); color: var(--t-fg); }

/* ── Toast ────────────────────────────────────────────────────────── */
.v-toast { display: flex; align-items: center; gap: var(--v-space-3); min-width: 280px; max-width: 420px; padding: var(--v-space-3) var(--v-space-4); background: var(--v-stone-900); color: #f2f0ea; border-radius: var(--v-radius-md); box-shadow: var(--v-shadow-md); font-size: var(--v-text-sm); }
.v-toast .v-i { color: var(--t-solid, #f2f0ea); }
.v-toast .v-toast__action { margin-left: auto; color: var(--v-flame-300); font-weight: var(--v-weight-semibold); background: none; border: 0; padding: 0; }

/* ── Empty, loading ───────────────────────────────────────────────── */
.v-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--v-space-2); padding: var(--v-space-12) var(--v-space-6); color: var(--v-text-3); }
.v-empty__icon { width: 48px; height: 48px; border-radius: var(--v-radius-lg); background: var(--v-surface-2); display: grid; place-items: center; color: var(--v-text-3); margin-bottom: var(--v-space-2); }
.v-empty__title { font-size: var(--v-text-lg); font-weight: var(--v-weight-semibold); color: var(--v-text); }
.v-empty > p, .v-empty > .v-small { max-width: 36ch; margin: 0; }
.v-empty > .v-row { margin-top: var(--v-space-2); justify-content: center; }
/* Tone: the icon tile takes a status colour; the text does not. */
.v-empty[data-tone="green"] .v-empty__icon { background: var(--v-green-bg); color: var(--v-green-fg); }
.v-empty[data-tone="amber"] .v-empty__icon { background: var(--v-amber-bg); color: var(--v-amber-fg); }
.v-empty[data-tone="red"] .v-empty__icon { background: var(--v-red-bg); color: var(--v-red-fg); }
.v-empty[data-tone="flame"] .v-empty__icon { background: var(--v-accent-soft); color: var(--v-accent); }
/* Compact: one row, for table cells, drawers and small cards. */
.v-empty--compact { flex-direction: row; text-align: left; align-items: center; gap: var(--v-space-3); padding: var(--v-space-4); }
.v-empty--compact .v-empty__icon { width: 36px; height: 36px; margin: 0; }
.v-empty--compact .v-empty__icon .v-i { width: 20px; height: 20px; }
.v-empty--compact .v-empty__title { font-size: var(--v-text-md); }
.v-empty--compact .v-empty__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.v-empty--compact .v-btn { margin-left: auto; flex: none; }
.v-skel { background: linear-gradient(90deg, var(--v-surface-2) 0%, var(--v-surface-3) 50%, var(--v-surface-2) 100%); background-size: 200% 100%; border-radius: var(--v-radius-xs); animation: v-shimmer 1.4s linear infinite; }
@keyframes v-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.v-progress { height: 6px; border-radius: var(--v-radius-full); background: var(--v-surface-3); overflow: hidden; }
.v-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--t-solid, var(--v-primary)); }
.v-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--v-surface-3); border-top-color: var(--v-primary); animation: v-spin 0.8s linear infinite; }
@keyframes v-spin { to { transform: rotate(360deg); } }

/* ── Menus, popovers ──────────────────────────────────────────────── */
.v-menu { min-width: 220px; padding: var(--v-space-1); background: var(--v-surface); border: 1px solid var(--v-border); border-radius: var(--v-radius-md); box-shadow: var(--v-shadow-md); }
.v-menu__item { display: flex; align-items: center; gap: var(--v-space-2); width: 100%; min-height: 34px; padding: 0 var(--v-space-2); border: 0; border-radius: 6px; background: none; text-align: left; font-size: var(--v-text-sm); color: var(--v-text); }
.v-menu__item:hover, .v-menu__item[aria-selected="true"] { background: var(--v-surface-2); }
.v-menu__item .v-i { color: var(--v-text-3); }
.v-menu__item:disabled { color: var(--v-text-4); background: none; cursor: not-allowed; }
.v-menu__item:disabled .v-i { color: var(--v-text-4); }
.v-menu__item--danger { color: var(--v-red-fg); }
.v-menu__item--danger .v-i { color: var(--v-red-fg); }
.v-menu__sep { height: 1px; margin: var(--v-space-1) 0; background: var(--v-border); }
.v-menu__label { padding: 6px var(--v-space-2) 2px; font-size: 11px; font-weight: var(--v-weight-semibold); color: var(--v-text-3); text-transform: uppercase; letter-spacing: var(--v-tracking-caps); }

/* ── Pick: search and select (combobox), org switcher ─────────────────
   Markup: .v-pick[data-pick] > trigger[data-pick-trigger] + .v-pick__pop
   (.v-menu). Options are .v-menu__item[role=option][data-value]. The
   trigger is either the search input itself (field combobox) or a button
   with its own [data-pick-input] inside the popover (org switcher).
   Behaviour in assets/pick.js: filter as you type, arrows, Enter, Esc. */
.v-pick { position: relative; min-width: 0; }
.v-pick__pop { position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(360px, calc(100vw - 32px)); z-index: var(--v-z-menu); display: none; }
.v-pick.is-open .v-pick__pop { display: block; }
.v-pick__pop--up { top: auto; bottom: calc(100% + 4px); }
.v-pick__search { margin: 2px 2px 6px; }
.v-pick__search .v-input { height: var(--v-control-sm); font-size: var(--v-text-sm); }
.v-pick__list { max-height: 280px; overflow-y: auto; }
/* Option rows are scoped to .v-pick__list as well, so popups rendered in a portal (outside .v-pick) behave the same. */
:is(.v-pick, .v-pick__list) [role="option"] { cursor: pointer; }
:is(.v-pick, .v-pick__list) [role="option"] .v-pick__check { margin-left: auto; width: 14px; height: 14px; color: var(--v-accent); visibility: hidden; }
:is(.v-pick, .v-pick__list) [role="option"][aria-selected="true"] .v-pick__check { visibility: visible; }
:is(.v-pick, .v-pick__list) [role="option"].is-active { background: var(--v-surface-2); }
:is(.v-pick, .v-pick__list) [role="option"] mark { background: none; color: var(--v-accent); font-weight: var(--v-weight-semibold); }
.v-pick__empty { padding: 10px var(--v-space-2); font-size: var(--v-text-sm); color: var(--v-text-3); }
.v-pick__footer { margin-top: 2px; padding-top: 2px; border-top: 1px solid var(--v-border); }
/* Org rows inside the switcher: small logo, two lines. */
:is(.v-pick, .v-pick__list) .v-orglogo { width: 28px; height: 28px; font-size: 10px; }
/* Two-line rows (name + meta). Also matches menus rendered in a portal, where .v-pick is not an ancestor. */
:is(.v-pick, .v-pick__list) [role="option"]:has(.v-pick__two), .v-menu__item:has(.v-pick__two) { padding: 8px var(--v-space-2); gap: 10px; }
.v-pick__two { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
.v-pick__two small { font-size: var(--v-text-xs); color: var(--v-text-3); }

/* ── Date and date range ───────────────────────────────────────────────
   Markup: .v-date[data-date] > trigger[data-date-trigger] + hidden inputs
   (one for a date, from and to for a range). The trigger is a field-shaped
   button (.v-input.v-date__field), a filter chip (.v-filter), or a segmented
   control's Custom button. date.js builds the popover: an optional preset
   column, one month (date) or two (range), a footer with the range in words
   and Apply. The month and year in a heading open a jump grid in place, at
   the same height as the days so Apply stays put. A date commits on click;
   a range on Apply. Desk only: on the
   floor keep the native <input type="date">, the OS picker is faster. */
.v-date { position: relative; min-width: 0; }
.v-date__field { display: inline-flex; align-items: center; gap: var(--v-space-2); text-align: left; cursor: pointer; }
.v-date__field > .v-i { color: var(--v-text-4); }
.v-date__field > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-date__field.is-empty > span { color: var(--v-text-4); }
.v-date__pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: var(--v-z-menu); display: none; width: max-content; max-width: calc(100vw - 32px); background: var(--v-surface); border: 1px solid var(--v-border); border-radius: var(--v-radius-lg); box-shadow: var(--v-shadow-md); }
.v-date.is-open .v-date__pop { display: flex; }
.v-date__pop--up { top: auto; bottom: calc(100% + 4px); }
.v-date__pop--right { left: auto; right: 0; }
.v-date__presets { display: flex; flex-direction: column; gap: 1px; width: 148px; flex: none; padding: var(--v-space-2); border-right: 1px solid var(--v-border); }
@media (max-width: 640px) {
  .v-date__pop { flex-direction: column; }
  .v-date__presets { flex-direction: row; flex-wrap: wrap; width: auto; border-right: 0; border-bottom: 1px solid var(--v-border); }
}
.v-date__presets .v-menu__item { min-height: 32px; }
.v-date__presets .v-menu__item[aria-pressed="true"] { background: var(--v-accent-soft); color: var(--v-accent); font-weight: var(--v-weight-semibold); }
.v-date__body { display: flex; flex-direction: column; min-width: 0; }
.v-date__months { display: flex; flex-wrap: wrap; gap: var(--v-space-5); padding: var(--v-space-3) var(--v-space-4) var(--v-space-4); }
.v-date__foot { display: flex; align-items: center; gap: var(--v-space-2); padding: var(--v-space-3) var(--v-space-4); border-top: 1px solid var(--v-border); font-size: var(--v-text-sm); }
.v-date__sum { flex: 1; min-width: 0; color: var(--v-text-2); }
.v-cal { --cell: 36px; width: calc(var(--cell) * 7); }
@media (pointer: coarse) { .v-cal { --cell: 40px; } }
.v-cal__head { display: flex; align-items: center; justify-content: space-between; height: var(--v-control-sm); margin-bottom: var(--v-space-1); }
.v-cal__head > span:empty { width: var(--v-control-sm); }
.v-cal__title { display: inline-flex; align-items: center; gap: 2px; min-width: 0; color: var(--v-text); font-size: var(--v-text-sm); font-weight: var(--v-weight-semibold); }
.v-cal__titlebtn { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 4px 0 6px; border: 0; border-radius: var(--v-radius-md); background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.v-cal__titlebtn:hover { background: var(--v-surface-2); }
.v-cal__titlebtn:focus-visible { outline-offset: -2px; }
.v-cal__titlebtn .v-i { width: 12px; height: 12px; color: var(--v-text-4); }
.v-cal__titlebtn:hover .v-i { color: var(--v-text-2); }
.v-cal__grid { display: grid; grid-template-columns: repeat(7, var(--cell)); align-content: start; min-height: calc(28px + var(--cell) * 6); }
.v-cal__jump { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); place-items: center; height: calc(28px + var(--cell) * 6); }
.v-cal__jumpcell { position: relative; width: 72px; height: var(--v-control-md); padding: 0; border: 0; border-radius: var(--v-radius-md); background: none; color: var(--v-text); font-size: var(--v-text-sm); font-variant-numeric: tabular-nums; cursor: pointer; }
.v-cal__jumpcell:hover { background: var(--v-surface-2); }
.v-cal__jumpcell:disabled { color: var(--v-text-4); background: none; cursor: not-allowed; }
.v-cal__jumpcell:focus-visible { outline-offset: -2px; }
.v-cal__jumpcell.is-today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--v-accent); }
.v-cal__jumpcell.is-on { background: var(--v-primary); color: var(--v-on-primary); font-weight: var(--v-weight-semibold); }
.v-cal__jumpcell.is-on.is-today::after { background: var(--v-on-primary); }
.v-cal__dow { height: 28px; display: grid; place-items: center; font-size: var(--v-text-xs); font-weight: var(--v-weight-semibold); color: var(--v-text-3); }
.v-cal__day { height: var(--cell); width: var(--cell); padding: 0; border: 0; border-radius: var(--v-radius-md); background: none; color: var(--v-text); font-size: var(--v-text-sm); font-variant-numeric: tabular-nums; position: relative; }
.v-cal__day:hover { background: var(--v-surface-2); }
.v-cal__day:disabled { color: var(--v-text-4); cursor: not-allowed; background: none; }
.v-cal__day.is-empty { visibility: hidden; }
.v-cal__day.is-today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--v-accent); }
.v-cal__day.is-in { background: var(--v-accent-soft); border-radius: 0; }
.v-cal__day.is-start, .v-cal__day.is-end { background: var(--v-primary); color: var(--v-on-primary); font-weight: var(--v-weight-semibold); }
.v-cal__day.is-start.is-today::after, .v-cal__day.is-end.is-today::after { background: var(--v-on-primary); }
.is-range .v-cal__day.is-start:not(.is-end) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.is-range .v-cal__day.is-end:not(.is-start) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.v-cal__day:focus-visible { outline-offset: -2px; z-index: 1; }

/* ── Overlays: scrim, drawer, dialog, sheet ───────────────────────── */
.v-scrim { position: fixed; inset: 0; background: var(--v-scrim); z-index: var(--v-z-drawer); }
.v-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); z-index: calc(var(--v-z-drawer) + 1); background: var(--v-surface); border-left: 1px solid var(--v-border); box-shadow: var(--v-shadow-lg); display: flex; flex-direction: column; }
.v-drawer--wide { width: min(760px, 100%); }
.v-drawer__head { display: flex; align-items: flex-start; gap: var(--v-space-3); padding: var(--v-space-4) var(--v-space-5); border-bottom: 1px solid var(--v-border); }
.v-drawer__body { flex: 1; overflow-y: auto; padding: var(--v-space-5); display: flex; flex-direction: column; gap: var(--v-space-5); }
.v-drawer__foot { display: flex; align-items: center; gap: var(--v-space-2); padding: var(--v-space-3) var(--v-space-5); border-top: 1px solid var(--v-border); background: var(--v-surface); flex-wrap: wrap; }
.v-dialog-wrap { position: fixed; inset: 0; z-index: var(--v-z-dialog); display: grid; place-items: center; padding: var(--v-space-4); background: var(--v-scrim); overflow-y: auto; }
.v-dialog { width: min(640px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--v-surface); border: 1px solid var(--v-border); border-radius: var(--v-radius-xl); box-shadow: var(--v-shadow-lg); overflow: hidden; }
.v-dialog--sm { width: min(440px, 100%); }
.v-dialog--lg { width: min(880px, 100%); }
.v-dialog__head { display: flex; align-items: flex-start; gap: var(--v-space-3); padding: var(--v-space-5) var(--v-space-6) var(--v-space-3); }
.v-dialog__body { padding: var(--v-space-2) var(--v-space-6) var(--v-space-5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--v-space-4); }
.v-dialog__foot { display: flex; justify-content: flex-end; gap: var(--v-space-2); padding: var(--v-space-4) var(--v-space-6); border-top: 1px solid var(--v-border); background: var(--v-surface-2); flex-wrap: wrap; }

/* ── Application shell (admin + superadmin) ───────────────────────── */
.v-shell { display: grid; grid-template-columns: var(--v-sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.v-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--v-surface); border-right: 1px solid var(--v-border); z-index: var(--v-z-nav); min-width: 0; }
.v-sidebar__top { padding: var(--v-space-3); border-bottom: 1px solid var(--v-border); }
.v-sidebar__scroll { flex: 1; overflow-y: auto; padding: var(--v-space-3) var(--v-space-3) var(--v-space-4); }
.v-sidebar__bottom { padding: var(--v-space-2) var(--v-space-3) var(--v-space-3); border-top: 1px solid var(--v-border); display: flex; flex-direction: column; gap: 2px; }
.v-brandrow { display: flex; align-items: center; gap: 10px; padding: 6px 6px 10px; }
.v-brandrow svg { width: 22px; height: 22px; }
.v-brandrow b { font-size: var(--v-text-md); font-weight: var(--v-weight-bold); letter-spacing: 0.08em; }
.v-brandrow span { font-size: var(--v-text-xs); color: var(--v-text-3); margin-left: auto; }

/* Org switcher: who you are acting for. Org logo first (co-branding). */
.v-org { display: flex; align-items: center; gap: var(--v-space-3); width: 100%; padding: 6px; border: 1px solid var(--v-border); border-radius: var(--v-radius-md); background: var(--v-surface); text-align: left; }
.v-org:hover { background: var(--v-surface-2); }
.v-org__name { font-size: var(--v-text-sm); font-weight: var(--v-weight-semibold); }
.v-org__meta { font-size: var(--v-text-xs); color: var(--v-text-3); }

.v-nav { display: flex; flex-direction: column; gap: 1px; }
.v-nav__label { padding: var(--v-space-4) var(--v-space-2) 6px; font-size: 11px; font-weight: var(--v-weight-semibold); color: var(--v-text-3); text-transform: uppercase; letter-spacing: var(--v-tracking-caps); }
.v-nav__label:first-child { padding-top: var(--v-space-1); }
.v-nav__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 var(--v-space-2); border: 0; border-radius: var(--v-radius-md); background: none; color: var(--v-text-2); font-size: var(--v-text-sm); font-weight: var(--v-weight-medium); text-align: left; }
.v-nav__item:hover { background: var(--v-surface-2); color: var(--v-text); }
.v-nav__item .v-i { color: var(--v-text-3); }
.v-nav__item[aria-current="page"], .v-nav__item.is-active { background: var(--v-accent-soft); color: var(--v-accent); font-weight: var(--v-weight-semibold); }
.v-nav__item[aria-current="page"] .v-i, .v-nav__item.is-active .v-i { color: var(--v-accent); }
.v-nav__item .v-count { margin-left: auto; }
.v-nav__item .v-nav__chev { margin-left: auto; width: 14px; height: 14px; color: var(--v-text-4); transition: transform var(--v-dur-fast); }
.v-nav__group[open] > summary .v-nav__chev { transform: rotate(90deg); }
.v-nav__group > summary { list-style: none; }
.v-nav__group > summary::-webkit-details-marker { display: none; }
.v-nav__group.is-open-parent > summary { color: var(--v-text); }
.v-nav__group.is-open-parent > summary .v-i:first-child { color: var(--v-text); }
.v-nav__sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 18px; padding-left: 10px; border-left: 1px solid var(--v-border); }
.v-nav__sub .v-nav__item { min-height: 30px; }
.v-nav__lock { margin-left: auto; font-size: 10px; font-weight: var(--v-weight-semibold); color: var(--v-text-4); text-transform: uppercase; letter-spacing: var(--v-tracking-caps); }

.v-main { display: flex; flex-direction: column; min-width: 0; }
.v-topbar { position: sticky; top: 0; z-index: var(--v-z-sticky); height: var(--v-topbar-h); display: flex; align-items: center; gap: var(--v-space-3); padding: 0 var(--v-page-pad); background: color-mix(in srgb, var(--v-bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--v-border); }
.v-cmd { display: flex; align-items: center; gap: var(--v-space-2); height: var(--v-control-md); width: min(420px, 100%); padding: 0 10px; border: 1px solid var(--v-border); border-radius: var(--v-radius-md); background: var(--v-surface); color: var(--v-text-4); font-size: var(--v-text-sm); text-align: left; }
.v-cmd:hover { border-color: var(--v-border-strong); }
.v-cmd .v-kbd { margin-left: auto; }
.v-page { width: 100%; max-width: var(--v-content-max); margin: 0 auto; padding: var(--v-space-6) var(--v-page-pad) var(--v-space-12); display: flex; flex-direction: column; gap: var(--v-space-5); }

@media (max-width: 1024px) {
  .v-shell { grid-template-columns: minmax(0, 1fr); }
  .v-sidebar { position: fixed; left: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform var(--v-dur-base) var(--v-ease-out); box-shadow: var(--v-shadow-lg); }
  .v-shell.is-nav-open .v-sidebar { transform: none; }
  :root { --v-page-pad: 16px; }
}
.v-only-narrow { display: none; }
@media (max-width: 1024px) { .v-only-narrow { display: inline-flex; } .v-only-wide { display: none !important; } }

/* ── Mobile app (Checklists) ──────────────────────────────────────── */
.v-app { display: flex; flex-direction: column; min-height: 100%; background: var(--v-bg); font-size: var(--v-text-lg); }
.v-appbar { position: sticky; top: 0; z-index: var(--v-z-sticky); display: flex; align-items: center; gap: var(--v-space-2); height: var(--v-control-xl); padding: 0 var(--v-space-2) 0 var(--v-space-4); background: var(--v-surface); border-bottom: 1px solid var(--v-border); }
.v-appbar__title { font-size: var(--v-text-lg); font-weight: var(--v-weight-semibold); line-height: 1.2; }
.v-appbar__sub { font-size: var(--v-text-xs); color: var(--v-text-3); }
.v-appbar .v-btn--icon { --btn-h: var(--v-control-lg); }
.v-appbody { flex: 1; padding: var(--v-space-4); display: flex; flex-direction: column; gap: var(--v-space-4); }
.v-tabbar { position: sticky; bottom: 0; z-index: var(--v-z-sticky); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 64px; background: var(--v-surface); border-top: 1px solid var(--v-border); }
.v-tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--v-text-3); font-size: 11px; font-weight: var(--v-weight-semibold); position: relative; }
.v-tabbar__item .v-i { width: 22px; height: 22px; }
.v-tabbar__item[aria-current="page"] { color: var(--v-accent); }
.v-tabbar__item .v-count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10px; }
.v-actionbar { position: sticky; bottom: 0; z-index: var(--v-z-sticky); display: flex; gap: var(--v-space-2); padding: var(--v-space-3) var(--v-space-4); background: color-mix(in srgb, var(--v-surface) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--v-border); }
.v-list { background: var(--v-surface); border: 1px solid var(--v-border); border-radius: var(--v-radius-lg); overflow: hidden; }
.v-list__item { display: flex; align-items: center; gap: var(--v-space-3); min-height: 64px; padding: var(--v-space-3) var(--v-space-4); border-bottom: 1px solid var(--v-border); background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; }
.v-list__item:last-child { border-bottom: 0; }
.v-list__item:active { background: var(--v-surface-2); }
.v-list__icon { width: 40px; height: 40px; border-radius: var(--v-radius-md); display: grid; place-items: center; flex: none; background: var(--t-bg, var(--v-surface-2)); color: var(--t-fg, var(--v-text-2)); }
.v-list__title { font-size: var(--v-text-md); font-weight: var(--v-weight-semibold); color: var(--v-text); }
.v-list__meta { font-size: var(--v-text-xs); color: var(--v-text-3); margin-top: 2px; }
.v-list__chev { color: var(--v-text-4); margin-left: auto; }
/* Compact rows inside a flush card (top lists, people, recent items) */
.v-rows > li { display: flex; align-items: center; gap: var(--v-space-3); padding: 10px var(--v-space-5); border-top: 1px solid var(--v-border); min-width: 0; }
.v-rows > li:first-child { border-top: 0; }
.v-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--v-space-2); font-size: var(--v-text-xs); font-weight: var(--v-weight-semibold); text-transform: uppercase; letter-spacing: var(--v-tracking-caps); color: var(--v-text-3); }
.v-section-title a { text-transform: none; letter-spacing: 0; font-size: var(--v-text-sm); color: var(--v-accent); }
.v-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--v-z-dialog); background: var(--v-surface); border-radius: var(--v-radius-xl) var(--v-radius-xl) 0 0; box-shadow: var(--v-shadow-lg); padding: var(--v-space-2) var(--v-space-4) var(--v-space-6); }
.v-sheet__grab { width: 36px; height: 4px; border-radius: 2px; background: var(--v-border-strong); margin: 0 auto var(--v-space-3); }

/* Photo evidence slot */
.v-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 112px; padding: var(--v-space-3); border: 1.5px dashed var(--v-border-strong); border-radius: var(--v-radius-md); background: var(--v-surface-2); color: var(--v-text-2); font-size: var(--v-text-sm); font-weight: var(--v-weight-semibold); text-align: center; width: 100%; }
.v-photo .v-i { width: 24px; height: 24px; color: var(--v-text-3); }
.v-photo--req { border-color: var(--v-amber); background: var(--v-amber-bg); color: var(--v-amber-fg); }
.v-photo--req .v-i { color: var(--v-amber-fg); }
.v-photo--done { padding: 0; border-style: solid; border-color: var(--v-border); overflow: hidden; position: relative; }

/* ── Kiosk (Guest feedback) ───────────────────────────────────────────
   Always light: put .v-light on the kiosk root (class="v-kiosk v-light").
   Org-branded: an org theme may set only --v-kiosk-brand (must reach 4.5:1
   against white, it carries white text), --v-kiosk-bg and its logo. Every
   system part inside (buttons, fields, focus) follows the kiosk brand. */
.v-kiosk {
  --v-kiosk-brand: var(--v-flame-600);
  --v-kiosk-bg: var(--v-stone-50);
  --v-kiosk-ink: var(--v-text);
  --v-kiosk-ink-2: var(--v-text-2);
  --v-kiosk-brand-soft: color-mix(in srgb, var(--v-kiosk-brand) 10%, #fff);
  --v-bg: var(--v-kiosk-bg);
  --v-primary: var(--v-kiosk-brand);
  --v-primary-hover: color-mix(in srgb, var(--v-kiosk-brand) 84%, #000);
  --v-accent: var(--v-kiosk-brand);
  --v-accent-soft: var(--v-kiosk-brand-soft);
  --v-accent-border: color-mix(in srgb, var(--v-kiosk-brand) 30%, #fff);
  --v-focus: var(--v-kiosk-brand);
  position: relative; display: flex; flex-direction: column; background: var(--v-kiosk-bg); color: var(--v-kiosk-ink); font-size: 18px; overflow: hidden;
}
.v-kiosk__top { display: flex; align-items: center; gap: var(--v-space-4); padding: var(--v-space-5) var(--v-space-8); }
.v-kiosk__main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--v-space-8); padding: 0 var(--v-space-8) var(--v-space-6); text-align: center; }
.v-kiosk__q { font-size: var(--v-text-5xl); font-weight: var(--v-weight-bold); letter-spacing: -0.02em; line-height: 1.1; }
.v-kiosk__sub { font-size: 20px; color: var(--v-kiosk-ink-2); }
.v-kiosk__foot { display: flex; align-items: center; gap: var(--v-space-4); padding: var(--v-space-4) var(--v-space-8); border-top: 1px solid rgba(28, 26, 23, 0.08); font-size: 15px; color: var(--v-kiosk-ink-2); background: rgba(255, 255, 255, 0.6); }
.v-faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--v-space-4); width: 100%; max-width: 1040px; }
.v-face { display: flex; flex-direction: column; align-items: center; gap: var(--v-space-3); padding: var(--v-space-6) var(--v-space-3) var(--v-space-5); border: 2px solid rgba(28, 26, 23, 0.08); border-radius: 20px; background: #fff; color: var(--v-kiosk-ink); font-size: 20px; font-weight: var(--v-weight-semibold); box-shadow: 0 1px 2px rgba(28, 26, 23, 0.05); }
.v-face svg { width: 112px; height: 112px; }
.v-face[aria-pressed="true"] { border-color: var(--v-kiosk-brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--v-kiosk-brand) 22%, transparent); transform: scale(1.03); }
.v-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--v-space-4); width: 100%; max-width: 1040px; }
.v-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--v-space-3); min-height: 160px; padding: var(--v-space-4); border: 2px solid rgba(28, 26, 23, 0.08); border-radius: 20px; background: #fff; color: var(--v-kiosk-ink); font-size: 19px; font-weight: var(--v-weight-semibold); line-height: 1.25; }
.v-tile .v-i { width: 56px; height: 56px; stroke-width: 1.5; color: var(--v-kiosk-brand); }
.v-tile[aria-pressed="true"] { border-color: var(--v-kiosk-brand); background: var(--v-kiosk-brand-soft); }
.v-kiosk-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--v-space-3); min-height: 72px; padding: 0 var(--v-space-10); border: 0; border-radius: var(--v-radius-xl); background: var(--v-kiosk-brand); color: #fff; font-size: 22px; font-weight: var(--v-weight-bold); }
.v-kiosk-btn--quiet { background: #fff; color: var(--v-kiosk-ink); border: 2px solid rgba(28, 26, 23, 0.12); }
.v-steps { display: flex; gap: 6px; }
.v-steps > span { width: 28px; height: 6px; border-radius: 3px; background: rgba(28, 26, 23, 0.12); }
.v-steps > span.is-done { background: var(--v-kiosk-brand); }

/* ── Charts (shared chrome; marks are drawn by charts.js) ─────────── */
.v-chart { position: relative; width: 100%; }
.v-chart svg { overflow: visible; }
.v-chart text { fill: var(--v-chart-label); font-size: 11px; font-family: var(--v-font-sans); font-variant-numeric: tabular-nums; }
.v-chart .grid { stroke: var(--v-chart-grid); stroke-width: 1; }
.v-chart .axis { stroke: var(--v-chart-axis); stroke-width: 1; }
.v-legend { display: flex; flex-wrap: wrap; gap: var(--v-space-2) var(--v-space-4); font-size: var(--v-text-xs); color: var(--v-text-2); }
.v-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.v-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--k, var(--v-c1)); display: inline-block; }
/* Legend with values: sits beside a donut or under a part-of-whole bar */
.v-keylist { display: flex; flex-direction: column; gap: var(--v-space-3); flex: 1 1 150px; min-width: 0; }
.v-keylist li { display: flex; align-items: center; gap: var(--v-space-2); font-size: var(--v-text-sm); color: var(--v-text-2); }
.v-keylist i { width: 10px; height: 10px; border-radius: 3px; background: var(--k, var(--v-c1)); flex: none; }
.v-keylist b { margin-left: auto; color: var(--v-text); font-weight: var(--v-weight-semibold); font-variant-numeric: tabular-nums; }
.v-keylist small { color: var(--v-text-3); font-size: var(--v-text-xs); min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.v-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 120px; padding: var(--v-space-2) var(--v-space-3); background: var(--v-surface); border: 1px solid var(--v-border); border-radius: var(--v-radius-md); box-shadow: var(--v-shadow-md); font-size: var(--v-text-xs); color: var(--v-text); white-space: nowrap; }
.v-tip b { display: block; font-size: var(--v-text-xs); color: var(--v-text-3); font-weight: var(--v-weight-semibold); margin-bottom: 2px; }
.v-hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--v-space-3); align-items: center; font-size: var(--v-text-sm); }
.v-hbar__track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--v-chart-muted); overflow: hidden; margin-bottom: var(--v-space-2); }
.v-hbar__track > span { display: block; height: 100%; border-radius: 4px; background: var(--k, var(--v-c1)); }

/* Stars (guest org-rating, response cards) */
.v-stars { display: inline-flex; gap: 1px; color: var(--v-amber); }
.v-stars .v-i { width: 14px; height: 14px; }
.v-stars .is-off { color: var(--v-border-strong); }
.v-rating { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 24px; padding: 0 6px; border-radius: var(--v-radius-sm); font-size: var(--v-text-xs); font-weight: var(--v-weight-bold); color: #fff; font-variant-numeric: tabular-nums; }
.v-rating[data-r="1"] { background: var(--v-rate-1); }
.v-rating[data-r="2"] { background: var(--v-rate-2); }
.v-rating[data-r="3"] { background: var(--v-rate-3); color: var(--v-text); }
.v-rating[data-r="4"] { background: var(--v-rate-4); }
.v-rating[data-r="5"] { background: var(--v-rate-5); }

/* ── Tones: last in the file so data-tone always beats a component default ── */
[data-tone="blue"]    { --t-fg: var(--v-blue-fg);    --t-bg: var(--v-blue-bg);    --t-line: var(--v-blue-line);    --t-solid: var(--v-blue); }
[data-tone="green"]   { --t-fg: var(--v-green-fg);   --t-bg: var(--v-green-bg);   --t-line: var(--v-green-line);   --t-solid: var(--v-green); }
[data-tone="amber"]   { --t-fg: var(--v-amber-fg);   --t-bg: var(--v-amber-bg);   --t-line: var(--v-amber-line);   --t-solid: var(--v-amber); }
[data-tone="red"]     { --t-fg: var(--v-red-fg);     --t-bg: var(--v-red-bg);     --t-line: var(--v-red-line);     --t-solid: var(--v-red); }
[data-tone="violet"]  { --t-fg: var(--v-violet-fg);  --t-bg: var(--v-violet-bg);  --t-line: var(--v-violet-line);  --t-solid: var(--v-violet); }
[data-tone="smoke"], [data-tone="slate"] { --t-fg: var(--v-smoke-fg); --t-bg: var(--v-smoke-bg); --t-line: var(--v-smoke-line); --t-solid: var(--v-smoke); }
[data-tone="neutral"] { --t-fg: var(--v-neutral-fg); --t-bg: var(--v-neutral-bg); --t-line: var(--v-neutral-line); --t-solid: var(--v-neutral); }
[data-tone="flame"]   { --t-fg: var(--v-flame-fg);   --t-bg: var(--v-flame-bg);   --t-line: var(--v-flame-line);   --t-solid: var(--v-flame); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
