/* ============================================================
   Vodegero — Component layer.
   CSS port of the design system's React primitives
   (components/{forms,data,surfaces,navigation,feedback}).
   Values mirror the .jsx sources; keep them in sync when the
   design system is re-synced. Everything is prefixed `vg-`.
   ============================================================ */

/* ------------------------------------------------------------
   Icon — rendered by <vg-icon> tag helper. Lucide, 24x24 stroke.
   ------------------------------------------------------------ */
.vg-icon {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}

/* ------------------------------------------------------------
   Button
   ------------------------------------------------------------ */
.vg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--text-base);
  line-height: 1;
  padding: 11px 20px;
  min-height: 42px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}
.vg-btn:hover { text-decoration: none; }
.vg-btn:active:not(:disabled) { transform: var(--press-scale); }

.vg-btn--sm { font-size: var(--text-sm); padding: 8px 14px; min-height: 34px; gap: 6px; }
.vg-btn--lg { font-size: var(--text-md); padding: 14px 26px; min-height: 50px; gap: 10px; }
.vg-btn--block { display: flex; width: 100%; }

.vg-btn--primary {
  background: var(--brand-primary);
  color: var(--brand-primary-ink);
  box-shadow: var(--shadow-blue);
}
.vg-btn--primary:hover:not(:disabled) {
  background: var(--brand-primary-hover);
  color: var(--brand-primary-ink);
  transform: translateY(-1px);
}
.vg-btn--primary:active:not(:disabled) { transform: var(--press-scale); }

.vg-btn--accent {
  background: var(--brand-accent);
  color: var(--brand-accent-ink);
  box-shadow: var(--shadow-gold);
}
.vg-btn--accent:hover:not(:disabled) {
  background: var(--brand-accent-hover);
  color: var(--brand-accent-ink);
  transform: translateY(-1px);
}
.vg-btn--accent:active:not(:disabled) { transform: var(--press-scale); }

.vg-btn--secondary {
  background: var(--surface-card);
  color: var(--text-body);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.vg-btn--secondary:hover:not(:disabled) { background: var(--sand-100); color: var(--text-body); }

.vg-btn--ghost {
  background: transparent;
  color: var(--brand-primary);
  box-shadow: none;
}
.vg-btn--ghost:hover:not(:disabled) { background: var(--blue-50); color: var(--brand-primary); }

.vg-btn--danger {
  background: var(--danger-500);
  color: #fff;
  box-shadow: none;
}
.vg-btn--danger:hover:not(:disabled) { background: var(--danger-700); color: #fff; transform: translateY(-1px); }

.vg-btn:disabled,
.vg-btn.is-disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.vg-btn__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  display: inline-block;
  flex: none;
  animation: vg-spin 0.6s linear infinite;
}
@keyframes vg-spin { to { transform: rotate(360deg); } }

/* htmx: swap label for spinner while a request is in flight */
.vg-btn .vg-btn__spinner { display: none; }
.vg-btn.htmx-request .vg-btn__spinner { display: inline-block; }
.vg-btn.htmx-request { pointer-events: none; opacity: 0.75; }

/* ------------------------------------------------------------
   IconButton
   ------------------------------------------------------------ */
.vg-icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-base);
  flex: none;
  padding: 0;
  background: var(--surface-card);
  color: var(--text-body);
  border-color: var(--border-cool);
}
.vg-icon-btn--sm { width: 32px; height: 32px; }
.vg-icon-btn--lg { width: 48px; height: 48px; }

.vg-icon-btn--solid { background: var(--brand-primary); color: #fff; border-color: transparent; }
.vg-icon-btn--solid:hover:not(:disabled) { background: var(--brand-primary-hover); }

.vg-icon-btn--secondary { background: var(--surface-card); color: var(--text-body); border-color: var(--border-cool); }
.vg-icon-btn--secondary:hover:not(:disabled) { background: var(--sand-100); }

.vg-icon-btn--ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.vg-icon-btn--ghost:hover:not(:disabled) { background: var(--sand-100); }

.vg-icon-btn--accent { background: var(--brand-accent); color: var(--brand-accent-ink); border-color: transparent; }
.vg-icon-btn--accent:hover:not(:disabled) { background: var(--brand-accent-hover); }

.vg-icon-btn.is-active {
  background: var(--blue-50);
  color: var(--brand-primary);
  border-color: var(--blue-200);
}
.vg-icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ------------------------------------------------------------
   Card
   ------------------------------------------------------------ */
.vg-card {
  background: var(--surface-card);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-card);
  padding: var(--pad-card);
  box-shadow: var(--shadow-xs);
  transition: var(--transition-base);
}
.vg-card--pad-none { padding: 0; }
.vg-card--pad-sm { padding: var(--space-4); }
.vg-card--pad-lg { padding: var(--space-7); }

.vg-card--warm { background: var(--surface-warm); border-color: var(--border-warm); }
.vg-card--sunken { background: var(--surface-sunken); border-color: var(--border-cool); }

.vg-card--interactive { cursor: pointer; }
.vg-card--interactive:hover { box-shadow: var(--shadow-md); transform: var(--hover-lift); }

.vg-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.vg-card__header-text { display: flex; flex-direction: column; gap: 2px; }
.vg-card__title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--text-lg);
  color: var(--text-heading);
}
.vg-card__subtitle { font-size: var(--text-sm); color: var(--text-muted); }
.vg-card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-cool);
}

/* ------------------------------------------------------------
   ListingCard — the signature marketplace object
   ------------------------------------------------------------ */
.vg-listing-card {
  background: var(--surface-card);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
}
.vg-listing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.vg-listing-card__media {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
  flex: none;
}
.vg-listing-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vg-listing-card__media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.25;
  color: #fff;
}
.vg-listing-card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.vg-listing-card__badges .vg-badge { box-shadow: var(--shadow-sm); }
.vg-listing-card__save {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
}

.vg-listing-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.vg-listing-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.vg-listing-card__title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--text-lg);
  color: var(--text-heading);
  line-height: 1.2;
  letter-spacing: var(--tracking-snug);
}
.vg-listing-card__title a { color: inherit; text-decoration: none; }
.vg-listing-card__title a:hover { color: inherit; text-decoration: none; }
.vg-listing-card__verified { display: inline-flex; color: var(--brand-primary); flex: none; margin-top: 2px; }
.vg-listing-card__location {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.vg-listing-card__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vg-listing-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-cool);
}
.vg-listing-card__price { display: flex; align-items: baseline; gap: 3px; }
.vg-listing-card__price-value {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: var(--text-2xl);
  color: var(--text-heading);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}
.vg-listing-card__price-unit {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Whole-card link target (replaces Bootstrap .stretched-link) */
.vg-stretch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ------------------------------------------------------------
   Input / Select / Textarea
   ------------------------------------------------------------ */
.vg-field { display: flex; flex-direction: column; gap: 6px; }

.vg-label {
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  color: var(--text-body);
}
.vg-label__required { color: var(--danger-500); margin-left: 2px; }

.vg-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-input);
  padding: 11px 14px;
  transition: var(--transition-color);
  cursor: text;
}
.vg-input-wrap--sm { padding: 8px 12px; }
.vg-input-wrap--lg { padding: 14px 16px; }
.vg-input-wrap:focus-within { border-color: var(--border-focus); box-shadow: var(--ring); }
.vg-input-wrap.is-invalid { border-color: var(--danger-500); }
.vg-input-wrap__icon { color: var(--text-muted); flex: none; }
.vg-input-wrap__suffix {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  flex: none;
}
/* Trailing affordance inside a wrap — the password show/hide toggle.
   Sized by its glyph so the field keeps the standard control height. */
.vg-input-wrap__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-color);
}
.vg-input-wrap__toggle:hover { color: var(--text-body); }

.vg-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-body);
  min-width: 0;
  padding: 0;
}
.vg-input-wrap--lg .vg-input { font-size: var(--text-md); }
.vg-input::placeholder { color: var(--text-muted); }
.vg-input:disabled { cursor: not-allowed; }
.vg-input-wrap:has(.vg-input:disabled) { background: var(--ink-50); opacity: 0.6; cursor: not-allowed; }

/* Bare input (no wrapper) — same skin, used where a wrapper adds nothing.
   Form controls don't inherit type from the page, so restate it here the way
   .vg-input does; without this a bare input falls back to the UA font. */
.vg-input--bare {
  background: var(--surface-card);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-input);
  padding: 11px 14px;
  width: 100%;
  transition: var(--transition-color);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-body);
}
.vg-input--bare::placeholder { color: var(--text-muted); }
.vg-input--bare:disabled { background: var(--ink-50); opacity: 0.6; cursor: not-allowed; }
.vg-input--bare:focus { border-color: var(--border-focus); box-shadow: var(--ring); outline: none; }
.vg-input--bare.is-invalid { border-color: var(--danger-500); }

textarea.vg-input--bare { resize: vertical; min-height: 96px; line-height: var(--leading-normal); }

.vg-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-card);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-input);
  transition: var(--transition-color);
}
.vg-select-wrap:focus-within { border-color: var(--border-focus); box-shadow: var(--ring); }
.vg-select-wrap.is-invalid { border-color: var(--danger-500); }
.vg-select-wrap__caret {
  position: absolute;
  right: 12px;
  pointer-events: none;
  display: flex;
  color: var(--text-muted);
}
.vg-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  padding: 11px 38px 11px 14px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-body);
  cursor: pointer;
}
.vg-select-wrap--sm .vg-select { padding: 8px 38px 8px 12px; }
.vg-select-wrap--lg .vg-select { padding: 14px 38px 14px 16px; font-size: var(--text-md); }
.vg-select:disabled { cursor: not-allowed; }

.vg-hint {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.vg-error {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--danger-500);
  display: flex;
  align-items: center;
  gap: 5px;
}
.vg-error:empty { display: none; }

/* ------------------------------------------------------------
   Checkbox / Radio — CSS-only, native input visually hidden
   ------------------------------------------------------------ */
.vg-check {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.vg-check--with-desc { align-items: flex-start; }
.vg-check__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.vg-check__box {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border-cool);
  background: var(--surface-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  color: #fff;
}
.vg-check--radio .vg-check__box { border-radius: 50%; }
.vg-check:hover .vg-check__box { border-color: var(--border-strong); }
.vg-check__box .vg-icon { opacity: 0; transition: var(--transition-fast, 120ms) ease-out; }
/* `~` rather than `+`: asp-for on a bool injects a hidden fallback input
   directly after the checkbox, which would break an adjacent-sibling match.
   The box always follows the input, so the general sibling combinator is
   equivalent everywhere else. */
.vg-check__input:checked ~ .vg-check__box {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}
.vg-check__input:checked ~ .vg-check__box .vg-icon { opacity: 1; }
.vg-check__input:focus-visible ~ .vg-check__box { box-shadow: var(--ring); }
.vg-check__input:disabled ~ * { opacity: 0.55; }
.vg-check__text { display: flex; flex-direction: column; gap: 2px; }
.vg-check__label {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  color: var(--text-body);
}
.vg-check__desc { font-size: var(--text-xs); color: var(--text-muted); }

/* Radio dot */
.vg-check--radio .vg-check__box::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: var(--transition-base);
}
.vg-check--radio .vg-check__input:checked ~ .vg-check__box::after { opacity: 1; }

/* ------------------------------------------------------------
   Switch
   ------------------------------------------------------------ */
.vg-switch {
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.vg-switch__input { position: absolute; opacity: 0; width: 0; height: 0; }
.vg-switch__track {
  width: 40px;
  height: 24px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--ink-200);
  transition: var(--transition-base);
  position: relative;
}
.vg-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateX(0);
  transition: var(--transition-base);
}
/* General sibling (~), not adjacent (+): asp-for on a bool emits a hidden
   fallback input right after the checkbox, which would break an adjacent match. */
.vg-switch__input:checked ~ .vg-switch__track { background: var(--brand-primary); }
.vg-switch__input:checked ~ .vg-switch__track::after { transform: translateX(16px); }
.vg-switch__input:focus-visible ~ .vg-switch__track { box-shadow: var(--ring); }
.vg-switch__input:disabled ~ * { opacity: 0.55; }

/* ------------------------------------------------------------
   Badge
   ------------------------------------------------------------ */
.vg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--text-xs);
  line-height: 1;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.vg-badge--sm { gap: 4px; font-size: var(--text-2xs); padding: 4px 8px; }
.vg-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.vg-badge--neutral { background: var(--ink-100); color: var(--ink-700); }
.vg-badge--brand   { background: var(--blue-50); color: var(--blue-700); }
.vg-badge--accent  { background: var(--gold-100); color: var(--gold-900); }
.vg-badge--success { background: var(--success-100); color: var(--success-700); }
.vg-badge--warning { background: var(--warning-100); color: var(--warning-700); }
.vg-badge--danger  { background: var(--danger-100); color: var(--danger-700); }
.vg-badge--solid   { background: var(--brand-primary); color: #fff; }

/* ------------------------------------------------------------
   Tag — spec pill / filter chip
   ------------------------------------------------------------ */
.vg-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--text-xs);
  line-height: 1;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  border: 1px solid var(--border-warm);
  background: var(--surface-warm);
  color: var(--ink-700);
  transition: var(--transition-base);
  text-decoration: none;
}
.vg-tag .vg-icon { color: var(--ink-500); }
a.vg-tag, button.vg-tag, .vg-tag--interactive { cursor: pointer; }
a.vg-tag:hover, button.vg-tag:hover, .vg-tag--interactive:hover {
  background: var(--sand-100);
  color: var(--ink-700);
  text-decoration: none;
}
.vg-tag.is-selected {
  border-color: var(--brand-primary);
  background: var(--blue-50);
  color: var(--brand-primary);
}
.vg-tag.is-selected .vg-icon { color: var(--brand-primary); }
.vg-tag__remove {
  display: inline-flex;
  border: none;
  background: transparent;
  padding: 0;
  margin-left: 1px;
  cursor: pointer;
  color: inherit;
}

/* ------------------------------------------------------------
   Stat
   ------------------------------------------------------------ */
.vg-stat { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.vg-stat--center { align-items: center; }
.vg-stat__icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  color: var(--brand-primary);
  margin-bottom: 2px;
  flex: none;
}
.vg-stat__value-row { display: flex; align-items: baseline; gap: 4px; }
.vg-stat__value {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-tight);
  color: var(--text-heading);
  font-variant-numeric: tabular-nums;
}
.vg-stat__unit {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}
.vg-stat__meta { display: flex; align-items: center; gap: 8px; }
.vg-stat__label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}
.vg-stat__trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
}
.vg-stat__trend--up { color: var(--success-500); }
.vg-stat__trend--down { color: var(--danger-500); }
.vg-stat__trend--down .vg-icon { transform: scaleY(-1); }

/* ------------------------------------------------------------
   Avatar
   ------------------------------------------------------------ */
.vg-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sand-100);
  color: var(--ink-700);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 15px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  text-decoration: none;
}
.vg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vg-avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.vg-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.vg-avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.vg-avatar--xl { width: 72px; height: 72px; font-size: 26px; }
.vg-avatar--square { border-radius: var(--radius-md); }

/* Name-derived palettes (mirrors Avatar.jsx charCode % 4) */
.vg-avatar--p0 { background: var(--blue-100); color: var(--blue-700); }
.vg-avatar--p1 { background: var(--gold-100); color: var(--gold-900); }
.vg-avatar--p2 { background: var(--success-100); color: var(--success-700); }
.vg-avatar--p3 { background: var(--sand-100); color: var(--ink-700); }

/* ------------------------------------------------------------
   RatingStars
   ------------------------------------------------------------ */
.vg-rating { display: inline-flex; align-items: center; gap: 6px; }
.vg-rating__stars { display: inline-flex; gap: 1px; }
.vg-rating__star { color: var(--ink-300); }
.vg-rating__star.is-on { color: var(--gold-400); }
.vg-rating__value {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--text-sm);
  color: var(--text-body);
}
.vg-rating__count { font-family: var(--font-body); font-size: var(--text-xs); color: var(--text-muted); }

/* ------------------------------------------------------------
   Tabs
   ------------------------------------------------------------ */
.vg-tabs {
  display: inline-flex;
  gap: 24px;
  border-bottom: 1px solid var(--border-cool);
}
.vg-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--text-base);
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition-color);
  text-decoration: none;
}
.vg-tabs__tab:hover { color: var(--text-secondary); text-decoration: none; }
.vg-tabs__tab.is-active {
  font-weight: var(--fw-bold);
  color: var(--text-heading);
  border-bottom-color: var(--brand-primary);
}
.vg-tabs__count {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  background: var(--ink-100);
  color: var(--ink-600);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}
.vg-tabs__tab.is-active .vg-tabs__count { background: var(--blue-100); color: var(--blue-700); }

.vg-tabs--pill {
  gap: 4px;
  border-bottom: none;
  background: var(--surface-sunken);
  padding: 4px;
  border-radius: var(--radius-md);
}
.vg-tabs--pill .vg-tabs__tab {
  border-bottom: none;
  margin-bottom: 0;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}
.vg-tabs--pill .vg-tabs__tab.is-active {
  color: var(--brand-primary);
  background: var(--surface-card);
  box-shadow: var(--shadow-xs);
}

/* ------------------------------------------------------------
   Dialog
   ------------------------------------------------------------ */
.vg-dialog[open],
.vg-dialog.is-open { display: flex; }
.vg-dialog {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: rgba(21, 26, 36, 0.45);
  backdrop-filter: blur(3px);
  padding: var(--space-6);
  animation: vg-fade var(--dur-base) var(--ease-out);
  border: none;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
}
.vg-dialog::backdrop { background: transparent; }
.vg-dialog__panel {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-xl);
  animation: vg-pop 0.24s var(--ease-out);
  overflow: hidden;
  max-height: calc(100vh - var(--space-12));
  display: flex;
  flex-direction: column;
}
.vg-dialog__panel--sm { max-width: 380px; }
.vg-dialog__panel--lg { max-width: 720px; }
.vg-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 22px 24px 0;
  flex: none;
}
.vg-dialog__title {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: var(--text-xl);
  color: var(--text-heading);
}
.vg-dialog__desc { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 4px; }
.vg-dialog__body {
  padding: 18px 24px;
  color: var(--text-body);
  font-size: var(--text-base);
  overflow-y: auto;
}
.vg-dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border-cool);
  background: var(--surface-sunken);
  flex: none;
}
@keyframes vg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vg-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */
.vg-toast-region {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast, 1080);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.vg-toast-region > * { pointer-events: auto; }

.vg-toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 360px;
  max-width: 90vw;
  background: var(--surface-card);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  animation: vg-toast-in 0.28s var(--ease-out);
}
.vg-toast__icon {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
  color: var(--brand-primary);
}
.vg-toast--info .vg-toast__icon { background: var(--blue-50); color: var(--brand-primary); }
.vg-toast--success .vg-toast__icon { background: var(--success-100); color: var(--success-500); }
.vg-toast--warning .vg-toast__icon { background: var(--warning-100); color: var(--warning-700); }
.vg-toast--danger .vg-toast__icon { background: var(--danger-100); color: var(--danger-500); }
.vg-toast__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vg-toast__title {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--text-sm);
  color: var(--text-heading);
}
.vg-toast__message { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.45; }
.vg-toast__close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  flex: none;
  display: inline-flex;
}
@keyframes vg-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.vg-toast.is-leaving { opacity: 0; transform: translateY(10px); transition: var(--transition-base); }

/* ------------------------------------------------------------
   Tooltip — CSS-only, data-vg-tip on the trigger
   ------------------------------------------------------------ */
.vg-tip { position: relative; }
.vg-tip::after {
  content: attr(data-vg-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface-inverse);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-base);
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.vg-tip:hover::after,
.vg-tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------
   Alert — inline message block (feedback surface)
   ------------------------------------------------------------ */
.vg-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.vg-alert__icon { flex: none; margin-top: 1px; }
.vg-alert__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* asp-validation-summary emits a <ul>; drop the browser's list chrome so the
   messages read as alert body copy. */
.vg-alert__summary ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.vg-alert__title { font-weight: var(--fw-bold); color: var(--text-heading); }
.vg-alert__close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 2px;
  flex: none;
  display: inline-flex;
}
.vg-alert__close:hover { opacity: 1; }

.vg-alert.is-leaving { opacity: 0; transform: translateY(-4px); transition: var(--transition-base); }

.vg-alert--info    { background: var(--info-bg); color: var(--info-fg); border-color: var(--blue-200); }
.vg-alert--success { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-500); }
.vg-alert--warning { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-500); }
.vg-alert--danger  { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-500); }

/* ------------------------------------------------------------
   Skeleton
   ------------------------------------------------------------ */
.vg-skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: vg-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.vg-skeleton--text { height: 12px; border-radius: var(--radius-xs); }
.vg-skeleton--title { height: 20px; border-radius: var(--radius-xs); }
.vg-skeleton--card { height: 180px; border-radius: var(--radius-card); }
.vg-skeleton--circle { border-radius: 50%; }
@keyframes vg-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ------------------------------------------------------------
   Table
   ------------------------------------------------------------ */
.vg-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-card);
  background: var(--surface-card);
}
.vg-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); }
.vg-table thead th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: 12px 16px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-cool);
  white-space: nowrap;
}
.vg-table tbody td {
  padding: 14px 16px;
  font-size: var(--text-base);
  color: var(--text-body);
  border-bottom: 1px solid var(--border-cool);
  vertical-align: middle;
}
.vg-table tbody tr:last-child td { border-bottom: none; }
.vg-table tbody tr { transition: var(--transition-color); }
.vg-table tbody tr:hover { background: var(--sand-50); }
.vg-table__num { font-variant-numeric: tabular-nums; text-align: right; }
.vg-table__actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.vg-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-11) var(--space-6);
  text-align: center;
}
.vg-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-warm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-1);
}
.vg-empty__title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--text-lg);
  color: var(--text-heading);
}
.vg-empty__body { font-size: var(--text-sm); color: var(--text-secondary); max-width: 44ch; }

/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */
.vg-pagination { display: flex; align-items: center; gap: 4px; }
.vg-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-color);
  border: 1px solid transparent;
}
.vg-pagination__link:hover { background: var(--sand-100); color: var(--text-heading); text-decoration: none; }
.vg-pagination__link.is-active {
  background: var(--brand-primary);
  color: #fff;
  border-color: transparent;
}
.vg-pagination__link.is-disabled { opacity: 0.4; pointer-events: none; }

/* ------------------------------------------------------------
   Blueprint grid — recurring motif for media/map placeholders
   ------------------------------------------------------------ */
.vg-blueprint {
  background-color: var(--blue-800);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
}
.vg-blueprint--light {
  background-color: var(--sand-100);
  background-image:
    linear-gradient(rgba(0, 74, 171, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 74, 171, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* Branded media placeholder (no photography supplied) */
.vg-media-placeholder {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.vg-media-placeholder .vg-icon { opacity: 0.25; }
