/* ══════════════════════════════════════════════
   V4U DESIGN SYSTEM
   Vodacom4U / ChatzConnect Incentive Tracker
   Brand red taken from /assets/img/4ULogo.svg (#ED1C24 / #E8262A)
   Loads after style.css / style2.css — overrides NiceAdmin defaults
   with the platform's own identity instead of the stock template look.
   ══════════════════════════════════════════════ */

/* Batica Sans — titles/display only. Commercial-use font, licensed. */
@font-face {
  font-family: 'Batica';
  src:
    url('/assets/fonts/batica/baticasans-regular.otf') format('opentype'),
    url('/assets/fonts/batica/baticasans-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Batica';
  src:
    url('/assets/fonts/batica/baticasans-italic.otf') format('opentype'),
    url('/assets/fonts/batica/baticasans-italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Batica';
  src:
    url('/assets/fonts/batica/baticasans-bold.otf') format('opentype'),
    url('/assets/fonts/batica/baticasans-bold.ttf') format('truetype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Batica';
  src:
    url('/assets/fonts/batica/baticasans-bolditalic.otf') format('opentype'),
    url('/assets/fonts/batica/baticasans-bolditalic.ttf') format('truetype');
  font-weight: 700 900;
  font-style: italic;
  font-display: swap;
}

:root,
[data-theme="light"] {
  --v4u-red: #ED1C24;
  --v4u-red-dim: #C81319;
  --v4u-red-glow: rgba(237, 28, 36, 0.10);
  --v4u-red-strong: rgba(237, 28, 36, 0.22);
  --v4u-red-mark: #E8262A;

  --v4u-green: #1E9E5A;
  --v4u-green-glow: rgba(30, 158, 90, 0.12);
  --v4u-amber: #B8860B;
  --v4u-amber-glow: rgba(184, 134, 11, 0.12);
  --v4u-blue: #2563EB;
  --v4u-blue-glow: rgba(37, 99, 235, 0.10);

  --v4u-bg: #FFFFFF;
  --v4u-bg-elevated: #FFFFFF;
  --v4u-surface: #F0F2F7;
  --v4u-surface-2: #E6E9F1;
  --v4u-border: rgba(16, 24, 40, 0.08);
  --v4u-border-hover: rgba(16, 24, 40, 0.16);

  --v4u-text: #1F2430;
  --v4u-text-secondary: #5A6478;
  --v4u-text-muted: #9AA3B5;
  --v4u-heading: #454B57;
  --v4u-on-brand: #FFFFFF;

  --v4u-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
  --v4u-shadow-md: 0 6px 20px rgba(16, 24, 40, 0.10);
  --v4u-shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.14);

  --v4u-radius-xs: 6px;
  --v4u-radius-sm: 8px;
  --v4u-radius: 12px;
  --v4u-radius-lg: 16px;

  --v4u-font: "Poppins", "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --v4u-font-display: "Batica", "Poppins", sans-serif;
  --v4u-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --v4u-transition: 0.2s var(--v4u-ease);
}

[data-theme="dark"] {
  --v4u-bg: #14161C;
  --v4u-bg-elevated: #1B1E26;
  --v4u-surface: #20232D;
  --v4u-surface-2: #2A2E3A;
  --v4u-border: rgba(255, 255, 255, 0.08);
  --v4u-border-hover: rgba(255, 255, 255, 0.16);

  --v4u-text: #E8EAF0;
  --v4u-text-secondary: #A3ABBD;
  --v4u-text-muted: #6B7387;
  --v4u-heading: #F5F6FA;

  --v4u-red-glow: rgba(237, 28, 36, 0.16);
  --v4u-green-glow: rgba(30, 158, 90, 0.18);
  --v4u-amber-glow: rgba(184, 134, 11, 0.18);
  --v4u-blue-glow: rgba(37, 99, 235, 0.18);

  --v4u-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --v4u-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  --v4u-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* ── Base ─────────────────────────────────────── */
body {
  background: var(--v4u-bg);
  color: var(--v4u-text);
  font-family: var(--v4u-font);
  transition: background var(--v4u-transition), color var(--v4u-transition);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--v4u-font-display);
  color: var(--v4u-heading);
}

a {
  color: var(--v4u-red);
}

a:hover {
  color: var(--v4u-red-dim);
}

::-webkit-scrollbar-thumb {
  background-color: var(--v4u-border-hover);
}

/* ── Bootstrap primitive overrides (ripple to every view) ───────
   These re-point the same .btn-primary / .badge / focus-ring
   classes every view already uses — no per-view markup changes. */
.btn-primary {
  background-color: var(--v4u-red);
  border-color: var(--v4u-red);
  color: var(--v4u-on-brand);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--v4u-red-dim) !important;
  border-color: var(--v4u-red-dim) !important;
}

.btn-outline-primary {
  color: var(--v4u-red);
  border-color: var(--v4u-red);
}

.btn-outline-primary:hover {
  background-color: var(--v4u-red);
  border-color: var(--v4u-red);
}

.badge.bg-primary {
  background-color: var(--v4u-red) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--v4u-red);
  box-shadow: 0 0 0 3px var(--v4u-red-glow);
}

.form-check-input:checked {
  background-color: var(--v4u-red);
  border-color: var(--v4u-red);
}

.nav-tabs-bordered .nav-link.active {
  color: var(--v4u-red);
  border-bottom: 2px solid var(--v4u-red);
}

.page-link,
.text-primary {
  color: var(--v4u-red) !important;
}

/* ── Shell: topbar ────────────────────────────── */
#header {
  background: var(--v4u-bg-elevated);
  border-bottom: 1px solid var(--v4u-border);
  box-shadow: none;
}

#header .logo img {
  filter: none;
}

#header .logo #brandLogo {
  width: auto;
  max-width: 166px;
  max-height: 30px;
  object-fit: contain;
}

#header .toggle-sidebar-btn,
#header .search-bar-toggle {
  color: var(--v4u-text-secondary);
}

.header-nav .nav-icon {
  color: var(--v4u-text-secondary);
}

.header-nav .nav-icon:hover {
  color: var(--v4u-red);
}

.header-nav .badge-number {
  background: var(--v4u-red) !important;
}

.header-nav .nav-profile .card-icon,
.header-nav .nav-profile img {
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
}

.header-nav .profile,
.header-nav .notifications {
  background: var(--v4u-bg-elevated);
  border: 1px solid var(--v4u-border);
  box-shadow: var(--v4u-shadow-lg);
}

.header-nav .profile .dropdown-header h6 {
  color: var(--v4u-heading);
}

.header-nav .profile .dropdown-item:hover,
.header-nav .messages .message-item:hover {
  background-color: var(--v4u-red-glow);
}

/* Theme toggle button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--v4u-radius-sm);
  border: 1px solid var(--v4u-border);
  background: transparent;
  color: var(--v4u-text-secondary);
  cursor: pointer;
  transition: var(--v4u-transition);
  margin-right: 0.5rem;
}

.theme-toggle-btn:hover {
  color: var(--v4u-red);
  border-color: var(--v4u-border-hover);
}

/* ── Shell: sidebar ───────────────────────────── */
.sidebar {
  background-color: var(--v4u-bg-elevated) !important;
  border-right: 1px solid var(--v4u-border);
  box-shadow: none;
}

.sidebar-nav .nav-heading {
  color: var(--v4u-text-muted);
}

.sidebar-nav .nav-link {
  font-family: var(--v4u-font-display);
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  color: var(--v4u-text-secondary) !important;
  background: transparent;
  border-left: 2px solid transparent;
  border-radius: var(--v4u-radius-xs);
}

.sidebar-nav .nav-link i {
  font-size: 0.95rem;
  width: 18px;
  color: var(--v4u-red) !important;
}

/* At-a-glance "N due"/"N late" count next to a nav item — currently used by
   the TurnOver Declaration link for store/ops-manager accounts, who land on
   that page after every login and have no dashboard reminder card reaching
   them (see turnoverRoutes.js's homeLinkFor/turnoverBadgeCount). Pinned to
   the far right since .sidebar-nav .nav-link is display:flex (style.css). */
.nav-link-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--v4u-amber);
  color: #1a1200;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.nav-link-badge--danger {
  background: var(--v4u-red);
  color: #fff;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:not(.collapsed) {
  color: var(--v4u-red) !important;
  background: var(--v4u-red-glow);
  border-left-color: var(--v4u-red);
}

.sidebar-nav .nav-content a {
  color: var(--v4u-text-secondary);
}

.sidebar-nav .nav-content a.active,
.sidebar-nav .nav-content a:hover {
  color: var(--v4u-red);
}

/* ── Shell: sidebar — collapsible sections ───────────────────
   Each nav-heading becomes a toggle button for the <ul> of
   nav-items that follows it (nested inside the same <li>, see
   sidemenuAdmin.ejs). Self-contained: the .nav-item/.nav-link
   children are untouched, still styled by the rules above. */
.nav-acc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 15px 5px 15px;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.nav-acc-toggle .nav-acc-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--v4u-text-muted);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.nav-acc-chev {
  font-size: 0.65rem;
  color: var(--v4u-text-muted);
  transition: transform 0.22s ease;
  flex-shrink: 0;
  margin-left: 8px;
  pointer-events: none;
}

.nav-acc.is-open > .nav-acc-toggle .nav-acc-chev {
  transform: rotate(180deg);
}

.nav-acc-toggle:hover .nav-acc-label,
.nav-acc-toggle:hover .nav-acc-chev {
  color: var(--v4u-red);
}

.nav-acc-body {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.26s ease;
}

.nav-acc.is-open > .nav-acc-body {
  max-height: none;
}

/* ── Shell: footer ────────────────────────────── */
#footer {
  color: var(--v4u-text-muted);
}

.back-to-top {
  background: var(--v4u-red);
}

.back-to-top:hover {
  background: var(--v4u-red-dim);
}

/* ── Cards, tables, dropdowns (used on nearly every page) ─────── */
.card {
  background: var(--v4u-bg-elevated);
  border: 1px solid var(--v4u-border);
  box-shadow: var(--v4u-shadow);
}

[data-theme="dark"] table,
[data-theme="dark"] .table {
  color: var(--v4u-text);
}

[data-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent;
  border-color: var(--v4u-border);
}

[data-theme="dark"] .dropdown-menu {
  background-color: var(--v4u-bg-elevated);
  border-color: var(--v4u-border);
}

[data-theme="dark"] .dropdown-item {
  color: var(--v4u-text);
}

[data-theme="dark"] .dropdown-item:hover {
  background-color: var(--v4u-surface);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: var(--v4u-surface);
  border-color: var(--v4u-border);
  color: var(--v4u-text);
}

[data-theme="dark"] .modal-content {
  background-color: var(--v4u-bg-elevated);
  color: var(--v4u-text);
}

/* Shared Bootstrap/NiceAdmin primitives — dark-mode gaps. Bootstrap scopes
   most of these via component-local custom properties (--bs-list-group-bg
   etc.) with hardcoded light-only fallbacks; re-declaring those properties
   here (loaded after bootstrap.min.css) wins the cascade without touching
   the vendor file. */
[data-theme="dark"] #main {
  color: var(--v4u-text);
}

[data-theme="dark"] .pagetitle h1 {
  color: var(--v4u-heading);
}

[data-theme="dark"] .alert {
  --bs-alert-border-color: var(--v4u-border);
}

[data-theme="dark"] .list-group,
[data-theme="dark"] .list-group-item {
  --bs-list-group-color: var(--v4u-text);
  --bs-list-group-bg: var(--v4u-bg-elevated);
  --bs-list-group-border-color: var(--v4u-border);
  --bs-list-group-action-color: var(--v4u-text-secondary);
  --bs-list-group-action-hover-color: var(--v4u-text);
  --bs-list-group-action-hover-bg: var(--v4u-surface);
  --bs-list-group-active-color: #fff;
  --bs-list-group-active-bg: var(--v4u-red);
  --bs-list-group-active-border-color: var(--v4u-red);
  --bs-list-group-disabled-color: var(--v4u-text-muted);
  --bs-list-group-disabled-bg: var(--v4u-surface);
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-striped-bg: rgba(255, 255, 255, 0.045);
}

[data-theme="dark"] .input-group-text {
  background-color: var(--v4u-surface);
  border-color: var(--v4u-border);
  color: var(--v4u-text);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  --bs-modal-header-border-color: var(--v4u-border);
  --bs-modal-footer-border-color: var(--v4u-border);
}

/* DataTables (simple-datatables) controls — no CSS variables here, the
   vendor stylesheet (public/assets/vendor/simple-datatables/style.css)
   hardcodes light-only colors directly on each selector. */
[data-theme="dark"] .dataTable-wrapper .dataTable-container,
[data-theme="dark"] .dataTable-top,
[data-theme="dark"] .dataTable-bottom {
  border-color: var(--v4u-border);
}

[data-theme="dark"] .dataTable-table > thead > tr > th,
[data-theme="dark"] .dataTable-table > tfoot > tr > th {
  border-color: var(--v4u-border);
  color: var(--v4u-heading);
}

[data-theme="dark"] .dataTable-input,
[data-theme="dark"] .dataTable-selector {
  background-color: var(--v4u-surface);
  border-color: var(--v4u-border);
  color: var(--v4u-text);
}

[data-theme="dark"] .dataTable-info {
  color: var(--v4u-text-secondary);
}

[data-theme="dark"] .dataTable-pagination a {
  color: var(--v4u-text-secondary);
}

[data-theme="dark"] .dataTable-pagination a:hover,
[data-theme="dark"] .dataTable-pagination .active a,
[data-theme="dark"] .dataTable-pagination .active a:focus,
[data-theme="dark"] .dataTable-pagination .active a:hover {
  background-color: var(--v4u-surface);
  color: var(--v4u-heading);
}

[data-theme="dark"] .dataTable-sorter::before {
  border-top-color: var(--v4u-text-muted);
}

[data-theme="dark"] .dataTable-sorter::after {
  border-bottom-color: var(--v4u-text-muted);
}

/* Shared app shell feedback */
.v4u-toast-region {
  position: fixed;
  top: 74px;
  right: 18px;
  z-index: 2200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.v4u-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--v4u-border);
  border-left: 3px solid var(--v4u-blue);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow-lg);
  color: var(--v4u-text);
  pointer-events: auto;
}

.v4u-toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--v4u-blue-glow);
  color: var(--v4u-blue);
}

.v4u-toast__title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--v4u-heading);
}

.v4u-toast__message {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--v4u-text-secondary);
}

.v4u-toast__action {
  display: inline-flex;
  margin-top: 7px;
  font-size: 0.76rem;
  font-weight: 700;
}

.v4u-toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--v4u-radius-xs);
  background: transparent;
  color: var(--v4u-text-muted);
  cursor: pointer;
}

.v4u-toast__close:hover {
  background: var(--v4u-surface);
  color: var(--v4u-heading);
}

.v4u-toast--success {
  border-left-color: var(--v4u-green);
}

.v4u-toast--success .v4u-toast__icon {
  background: var(--v4u-green-glow);
  color: var(--v4u-green);
}

.v4u-toast--warning {
  border-left-color: var(--v4u-amber);
}

.v4u-toast--warning .v4u-toast__icon {
  background: var(--v4u-amber-glow);
  color: var(--v4u-amber);
}

.v4u-toast--error {
  border-left-color: var(--v4u-red);
}

.v4u-toast--error .v4u-toast__icon {
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
}

.v4u-activity-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 12, 18, 0.54);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.v4u-activity-backdrop.is-open {
  display: flex;
}

.v4u-activity-card {
  width: min(430px, 100%);
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-lg);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow-lg);
  color: var(--v4u-text);
  padding: 18px;
}

.v4u-activity-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.v4u-activity-orbit {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--v4u-red-glow);
}

.v4u-activity-orbit::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--v4u-red);
  animation: v4u-spin 0.8s linear infinite;
}

.v4u-activity-orbit span {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: var(--v4u-red);
  box-shadow: 0 0 0 6px var(--v4u-red-glow);
}

.v4u-activity-kicker {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--v4u-red);
}

.v4u-activity-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--v4u-heading);
}

.v4u-activity-detail {
  margin: 4px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--v4u-text-secondary);
}

.v4u-activity-steps {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.v4u-activity-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--v4u-text-muted);
}

.v4u-activity-step::before {
  content: "";
  width: 8px;
  height: 8px;
  justify-self: center;
  border-radius: 50%;
  background: var(--v4u-surface-2);
  box-shadow: 0 0 0 3px var(--v4u-surface);
}

.v4u-activity-step.is-active {
  color: var(--v4u-heading);
  font-weight: 700;
}

.v4u-activity-step.is-active::before {
  background: var(--v4u-red);
  box-shadow: 0 0 0 4px var(--v4u-red-glow);
}

.v4u-activity-step.is-done::before {
  background: var(--v4u-green);
  box-shadow: 0 0 0 4px var(--v4u-green-glow);
}

.v4u-pressing {
  transform: translateY(1px) scale(0.985);
}

.v4u-css-animate-in {
  animation: v4u-enter 0.34s var(--v4u-ease) both;
}

@keyframes v4u-spin {
  to { transform: rotate(360deg); }
}

.v4u-loading-spinner {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid var(--v4u-red-glow);
  border-top-color: var(--v4u-red);
  animation: v4u-spin 0.8s linear infinite;
}

/* ── FilePond theme — pinned to the classic v4 (CDN filepond@4) build,
   plain CSS classes, no shadow DOM/web-component. Selectors verified
   against the real filepond@4 dist CSS, not guessed. Loaded after
   FilePond's own stylesheet on every page that uses it; !important is
   used only where FilePond's own state-modifier selectors
   (e.g. [data-filepond-item-state=...] .filepond--item-panel) would
   otherwise out-specificity a plain class override. ────────────────── */
.filepond--root {
  font-family: var(--v4u-font);
  margin-bottom: 0;
}

.filepond--panel-root {
  background-color: var(--v4u-surface);
  border: 1px dashed var(--v4u-border-hover);
  border-radius: var(--v4u-radius-sm);
}

.filepond--drop-label {
  color: var(--v4u-text-secondary);
}

.filepond--label-action {
  color: var(--v4u-red);
  text-decoration-color: var(--v4u-red);
}

/* Item chips keep a fixed dark background regardless of page theme —
   same reasoning FilePond's own defaults use: white file-name text
   needs a background that's reliably dark, not one that flips light
   in light mode the way page surfaces do. */
.filepond--item-panel {
  background-color: #3A4150 !important;
}

[data-filepond-item-state=processing-complete] .filepond--item-panel {
  background-color: var(--v4u-green) !important;
}

[data-filepond-item-state*=error] .filepond--item-panel,
[data-filepond-item-state*=invalid] .filepond--item-panel {
  background-color: var(--v4u-red) !important;
}

@keyframes v4u-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .v4u-activity-orbit::before,
  .v4u-css-animate-in {
    animation: none;
  }
}

@media (max-width: 768px) {
  .v4u-toast-region {
    top: 64px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .v4u-toast {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .v4u-activity-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .v4u-activity-card {
    width: 100%;
    max-height: 88vh;
    overflow: auto;
    border-radius: var(--v4u-radius-lg) var(--v4u-radius-lg) 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .header .logo {
    min-width: 0;
  }

  #header .logo #brandLogo {
    max-width: 144px;
  }
}

/* Dashboard experience — structure follows pivot22's dash-header /
   dash-metrics / dash-grid anatomy: a single-line header, one lean
   metrics row, then a 1.4fr/1fr grid where wide panels span both
   columns and everything else pairs up two-at-a-time. */
/* Universal page shell — every page under the sidebar layout uses this,
   not just the dashboard. Accounts for the fixed topbar/sidebar offset. */
.v4u-page {
  min-height: calc(100vh - 60px);
  padding: 84px 22px 28px;
}

.v4u-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}

.v4u-dash-title {
  margin: 0;
  font-family: var(--v4u-font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--v4u-heading);
}

.v4u-dash-subtitle {
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: var(--v4u-text-secondary);
}

.v4u-dash-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.v4u-eyebrow,
.v4u-panel-kicker {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--v4u-red);
}

.v4u-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-bg-elevated);
  color: var(--v4u-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.v4u-chip i {
  color: var(--v4u-red);
}

.v4u-chip--soft {
  background: var(--v4u-blue-glow);
  border-color: color-mix(in srgb, var(--v4u-blue) 24%, transparent);
  color: var(--v4u-blue);
}

.v4u-chip--danger {
  background: var(--v4u-red-glow);
  border-color: var(--v4u-red-strong);
  color: var(--v4u-red);
}

.v4u-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: var(--v4u-radius-xs);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--v4u-transition), border-color var(--v4u-transition), background var(--v4u-transition), color var(--v4u-transition), box-shadow var(--v4u-transition);
}

.v4u-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.v4u-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.v4u-btn--sm {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.74rem;
}

.v4u-btn--primary {
  background: var(--v4u-red);
  color: var(--v4u-on-brand);
  border-color: var(--v4u-red);
  box-shadow: 0 8px 22px var(--v4u-red-glow);
}

.v4u-btn--primary:hover,
.v4u-btn--primary:focus {
  color: var(--v4u-on-brand);
  background: var(--v4u-red-dim);
  border-color: var(--v4u-red-dim);
}

.v4u-btn--ghost,
.v4u-btn--light {
  background: var(--v4u-bg-elevated);
  color: var(--v4u-text-secondary);
  border-color: var(--v4u-border);
}

.v4u-btn--ghost:hover,
.v4u-btn--light:hover {
  color: var(--v4u-red);
  border-color: var(--v4u-border-hover);
  background: var(--v4u-surface);
}

.v4u-btn--success {
  background: var(--v4u-green);
  border-color: var(--v4u-green);
  color: var(--v4u-on-brand);
}

.v4u-btn--success:hover {
  color: var(--v4u-on-brand);
  filter: brightness(0.95);
}

.v4u-btn--danger {
  background: var(--v4u-red-glow);
  border-color: var(--v4u-red-strong);
  color: var(--v4u-red);
}

.v4u-btn--danger:hover {
  background: var(--v4u-red);
  border-color: var(--v4u-red);
  color: var(--v4u-on-brand);
}

.v4u-dashboard-content {
  display: grid;
  gap: 16px;
}

.v4u-dashboard-container {
  padding: 0;
}

.v4u-command-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.v4u-metric-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow);
}

.v4u-metric-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v4u-metric-card__icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
  font-size: 0.85rem;
}

.v4u-metric-card--blue .v4u-metric-card__icon {
  background: var(--v4u-blue-glow);
  color: var(--v4u-blue);
}

.v4u-metric-card--green .v4u-metric-card__icon {
  background: var(--v4u-green-glow);
  color: var(--v4u-green);
}

.v4u-metric-card--amber .v4u-metric-card__icon {
  background: var(--v4u-amber-glow);
  color: var(--v4u-amber);
}

.v4u-metric-card__body p {
  margin: 0 0 3px;
  color: var(--v4u-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.v4u-metric-card__body strong {
  display: block;
  font-family: var(--v4u-font-display);
  color: var(--v4u-heading);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.v4u-metric-card__body small {
  display: block;
  margin-top: 3px;
  color: var(--v4u-text-secondary);
  font-size: 0.72rem;
  line-height: 1.35;
}

.v4u-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--v4u-text-muted);
}

.v4u-trend--up {
  color: var(--v4u-green);
}

.v4u-trend--down {
  color: var(--v4u-red);
}

.v4u-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--v4u-surface-2);
  overflow: hidden;
}

.v4u-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--v4u-red);
}

.v4u-metric-card--blue .v4u-progress span { background: var(--v4u-blue); }
.v4u-metric-card--green .v4u-progress span { background: var(--v4u-green); }
.v4u-metric-card--amber .v4u-progress span { background: var(--v4u-amber); }

.v4u-sparkline {
  display: grid;
  height: 32px;
  grid-template-columns: repeat(12, minmax(3px, 1fr));
  align-items: end;
  gap: 3px;
}

.v4u-sparkline span {
  display: block;
  min-height: 3px;
  border-radius: 2px 2px 0 0;
  background: color-mix(in srgb, var(--v4u-red) 55%, var(--v4u-surface-2));
}

.v4u-metric-card--blue .v4u-sparkline span {
  background: color-mix(in srgb, var(--v4u-blue) 55%, var(--v4u-surface-2));
}

.v4u-metric-card--green .v4u-sparkline span {
  background: color-mix(in srgb, var(--v4u-green) 55%, var(--v4u-surface-2));
}

.v4u-metric-card--amber .v4u-sparkline span {
  background: color-mix(in srgb, var(--v4u-amber) 55%, var(--v4u-surface-2));
}

/* Kept for cards with no numeric progress/sparkline to show */
.v4u-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v4u-text-muted);
}

.v4u-status-dot--complete,
.v4u-status-dot--healthy,
.v4u-status-dot--success {
  background: var(--v4u-green);
}

.v4u-status-dot--watch,
.v4u-status-dot--warning {
  background: var(--v4u-amber);
}

.v4u-status-dot--attention {
  background: var(--v4u-red);
}

.v4u-status-dot--info {
  background: var(--v4u-blue);
}

/* Last 2 of the 6 metric cards — solid brand colour, white text */
.v4u-metric-card[data-v4u-live-card="coverage"],
.v4u-metric-card[data-v4u-live-card="connectivity"] {
  border-color: transparent;
}

.v4u-metric-card[data-v4u-live-card="coverage"] {
  background: #0072CE;
}

.v4u-metric-card[data-v4u-live-card="connectivity"] {
  background: var(--v4u-red);
}

.v4u-metric-card[data-v4u-live-card="coverage"] .v4u-metric-card__icon,
.v4u-metric-card[data-v4u-live-card="connectivity"] .v4u-metric-card__icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.v4u-metric-card[data-v4u-live-card="coverage"] .v4u-trend,
.v4u-metric-card[data-v4u-live-card="connectivity"] .v4u-trend {
  color: rgba(255, 255, 255, 0.85);
}

.v4u-metric-card[data-v4u-live-card="coverage"] .v4u-metric-card__body p,
.v4u-metric-card[data-v4u-live-card="connectivity"] .v4u-metric-card__body p {
  color: rgba(255, 255, 255, 0.78);
}

.v4u-metric-card[data-v4u-live-card="coverage"] .v4u-metric-card__body strong,
.v4u-metric-card[data-v4u-live-card="connectivity"] .v4u-metric-card__body strong {
  color: #fff;
}

.v4u-metric-card[data-v4u-live-card="coverage"] .v4u-metric-card__body small,
.v4u-metric-card[data-v4u-live-card="connectivity"] .v4u-metric-card__body small {
  color: rgba(255, 255, 255, 0.78);
}

.v4u-metric-card[data-v4u-live-card="coverage"] .v4u-progress,
.v4u-metric-card[data-v4u-live-card="connectivity"] .v4u-progress {
  background: rgba(255, 255, 255, 0.28);
}

.v4u-metric-card[data-v4u-live-card="coverage"] .v4u-progress span,
.v4u-metric-card[data-v4u-live-card="connectivity"] .v4u-progress span {
  background: #fff;
}

.v4u-metric-card[data-v4u-live-card="coverage"] .v4u-sparkline span,
.v4u-metric-card[data-v4u-live-card="connectivity"] .v4u-sparkline span {
  background: rgba(255, 255, 255, 0.55);
}

/* ── Main grid: pivot22-style — wide panels span both columns,
   everything else pairs two-at-a-time in source order ────────── */
.v4u-dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: stretch;
  gap: 14px;
}

.v4u-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--v4u-border) !important;
  border-radius: var(--v4u-radius-sm) !important;
  background: var(--v4u-bg-elevated) !important;
  box-shadow: var(--v4u-shadow) !important;
  overflow: hidden;
}

.v4u-panel--wide {
  grid-column: 1 / -1;
}

/* Slim list rows — Action Queue / Live Activity, no per-row card/box */
.v4u-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--v4u-border);
  transition: background var(--v4u-transition);
}

a.v4u-list-row:hover {
  color: inherit;
  text-decoration: none;
  background: var(--v4u-surface);
}

.v4u-list-row:last-child {
  border-bottom: 0;
}

.v4u-list-row__icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-blue-glow);
  color: var(--v4u-blue);
  font-size: 0.8rem;
}

.v4u-list-row--warning .v4u-list-row__icon { background: var(--v4u-amber-glow); color: var(--v4u-amber); }
.v4u-list-row--success .v4u-list-row__icon { background: var(--v4u-green-glow); color: var(--v4u-green); }

.v4u-list-row__body {
  flex: 1;
  min-width: 0;
}

.v4u-list-row__body strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--v4u-heading);
}

.v4u-list-row__body small {
  display: block;
  margin-top: 1px;
  font-size: 0.72rem;
  color: var(--v4u-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4u-list-row__cta {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--v4u-red);
  white-space: nowrap;
}

.v4u-list-row time {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--v4u-text-muted);
  white-space: nowrap;
}

.v4u-list-empty {
  padding: 20px 16px;
  font-size: 0.78rem;
  color: var(--v4u-text-muted);
  text-align: center;
}

/* Quick action tiles — icon + single label, no description copy */
.v4u-quick-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 14px 16px;
}

.v4u-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-surface);
  color: var(--v4u-text);
  text-align: center;
  text-decoration: none;
  transition: transform var(--v4u-transition), border-color var(--v4u-transition), background var(--v4u-transition);
}

.v4u-quick-action:hover {
  color: var(--v4u-text);
  text-decoration: none;
  transform: translateY(-1px);
  border-color: var(--v4u-border-hover);
  background: var(--v4u-bg-elevated);
}

.v4u-quick-action i {
  font-size: 1rem;
  color: var(--v4u-red);
}

.v4u-quick-action strong {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.v4u-panel-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 16px !important;
}

.v4u-panel-body--flush-bottom {
  padding-bottom: 0 !important;
}

.v4u-panel-header {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--v4u-border);
}

.v4u-panel-header h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--v4u-heading);
}

.v4u-panel-header--compact {
  align-items: center;
}

.v4u-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.v4u-panel--notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: var(--v4u-heading);
}

.v4u-panel--notice > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
}

.v4u-category-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--v4u-amber) 28%, var(--v4u-border));
  border-left: 3px solid var(--v4u-amber);
  border-radius: var(--v4u-radius-sm);
  background:
    linear-gradient(135deg, var(--v4u-amber-glow), transparent 58%),
    var(--v4u-bg-elevated);
  color: var(--v4u-heading);
  box-shadow: var(--v4u-shadow-sm);
}

.v4u-category-warning > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-amber-glow);
  color: var(--v4u-amber);
}

.v4u-category-warning__content {
  min-width: 0;
}

.v4u-category-warning__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.v4u-category-warning h2 {
  margin: 0;
  color: var(--v4u-heading);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}

.v4u-category-warning p:not(.v4u-panel-kicker) {
  margin: 4px 0 0;
  color: var(--v4u-text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.v4u-category-warning__list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.v4u-category-warning__tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--v4u-amber) 28%, transparent);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-surface);
  color: var(--v4u-heading);
  font-size: 0.75rem;
  font-weight: 800;
}

.v4u-category-warning__tag small {
  overflow: hidden;
  color: var(--v4u-amber);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4u-category-warning__tag--more {
  background: var(--v4u-amber-glow);
  color: var(--v4u-amber);
}

.v4u-admin-page {
  display: grid;
  gap: 16px;
}

.v4u-admin-page .v4u-panel {
  overflow: hidden;
}

.v4u-admin-split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

.v4u-admin-form .form-label {
  margin-bottom: 4px;
  color: var(--v4u-text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v4u-admin-form .form-control,
.v4u-admin-form .form-select {
  min-height: 38px;
  border-color: var(--v4u-border);
  border-radius: var(--v4u-radius-xs);
  background-color: var(--v4u-bg-elevated);
  color: var(--v4u-text);
  font-family: var(--v4u-font);
  font-size: 0.82rem;
}

.v4u-admin-form textarea.form-control {
  min-height: 76px;
  resize: vertical;
}

.v4u-admin-form .input-group-text {
  border-color: var(--v4u-border);
  background: var(--v4u-surface);
  color: var(--v4u-text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.v4u-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.v4u-form-note {
  margin: 5px 0 0;
  color: var(--v4u-text-muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.v4u-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--v4u-border);
  border-left: 3px solid var(--v4u-blue);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  color: var(--v4u-text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}

.v4u-alert i {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--v4u-blue);
}

.v4u-alert--success { border-left-color: var(--v4u-green); }
.v4u-alert--success i { color: var(--v4u-green); }
.v4u-alert--warning { border-left-color: var(--v4u-amber); }
.v4u-alert--warning i { color: var(--v4u-amber); }
.v4u-alert--danger { border-left-color: var(--v4u-red); }
.v4u-alert--danger i { color: var(--v4u-red); }

.v4u-alert__close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--v4u-text-muted);
  cursor: pointer;
}

.v4u-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--v4u-surface-2);
  color: var(--v4u-text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.v4u-status-pill--success,
.v4u-status-pill--complete,
.v4u-status-pill--good {
  background: var(--v4u-green-glow);
  color: var(--v4u-green);
}

.v4u-status-pill--warning,
.v4u-status-pill--watch {
  background: var(--v4u-amber-glow);
  color: var(--v4u-amber);
}

.v4u-status-pill--danger,
.v4u-status-pill--attention,
.v4u-status-pill--error {
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
}

.v4u-status-pill--info {
  background: var(--v4u-blue-glow);
  color: var(--v4u-blue);
}

.v4u-status-pill--neutral {
  background: var(--v4u-surface-2);
  color: var(--v4u-text-secondary);
}

.v4u-presence-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.v4u-presence-meta {
  color: var(--v4u-text-secondary);
  font-size: 0.72rem;
  line-height: 1.35;
}

.v4u-table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.v4u-table-actions form {
  margin: 0;
}

.v4u-table-select {
  width: 42px;
  min-width: 42px;
}

.v4u-profile-strip,
.v4u-result-grid,
.v4u-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.v4u-profile-item,
.v4u-result-box,
.v4u-preview-box {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-surface);
}

.v4u-profile-item span,
.v4u-result-box span,
.v4u-preview-box label {
  display: block;
  color: var(--v4u-text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v4u-profile-item strong,
.v4u-result-box strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 3px;
  color: var(--v4u-heading);
  font-size: 0.86rem;
}

.v4u-preview-box input {
  width: 100%;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: var(--v4u-heading);
  font-size: 0.82rem;
  font-weight: 700;
}

.v4u-target-list {
  display: grid;
  gap: 10px;
}

.v4u-target-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.65fr) repeat(3, minmax(110px, 1fr)) minmax(110px, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-surface);
}

.v4u-log-message {
  max-width: 620px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.v4u-loading-spinner--inline {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.v4u-year-menu {
  position: relative;
}

.v4u-year-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--v4u-amber) 34%, transparent);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-amber-glow);
  color: var(--v4u-amber);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.v4u-year-menu .dropdown-menu {
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow-lg);
}

.v4u-year-menu .dropdown-item {
  color: var(--v4u-text-secondary);
  font-size: 0.8rem;
}

.v4u-chart {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  height: 360px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
}

.v4u-chart--donut {
  height: 360px;
}

/* ECharts tooltips/legend-hover are appended to <body> (tooltip.appendToBody: true
   in dashboard.ejs) precisely so they can't be clipped by an ancestor panel's
   overflow/z-index — this is the belt-and-suspenders z-index floor for that layer. */
.echarts-tooltip {
  z-index: 99999 !important;
}

.v4u-panel--table .table-responsive {
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  overflow: auto;
}

.v4u-data-table {
  width: 100%;
  margin: 0 !important;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--v4u-text);
}

.v4u-data-table thead th {
  border: 0 !important;
  border-bottom: 1px solid var(--v4u-border) !important;
  padding: 12px 14px !important;
  background: var(--v4u-surface);
  color: var(--v4u-text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.v4u-data-table thead th:first-child { border-radius: var(--v4u-radius-xs) 0 0 0; }
.v4u-data-table thead th:last-child { border-radius: 0 var(--v4u-radius-xs) 0 0; }

.v4u-data-table tbody tr {
  border-top: 1px solid var(--v4u-border);
  transition: background var(--v4u-transition);
}

.v4u-data-table tbody tr:hover {
  background: var(--v4u-red-glow);
}

.v4u-data-table tbody th,
.v4u-data-table tbody td {
  border: 0 !important;
  padding: 12px 14px !important;
  color: var(--v4u-text);
  font-size: 0.82rem;
  vertical-align: middle;
}

.v4u-data-table tbody th a {
  font-weight: 800;
  color: var(--v4u-heading);
}

.v4u-data-table tbody th a:hover {
  color: var(--v4u-red);
}

.v4u-table-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px 14px;
}

.v4u-table-search {
  position: relative;
  flex: 1 1 240px;
  max-width: 320px;
}

.v4u-table-search i {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  font-size: 0.82rem;
  color: var(--v4u-text-muted);
  pointer-events: none;
}

.v4u-table-search input {
  width: 100%;
  padding: 0.44rem 0.7rem 0.44rem 2rem;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  color: var(--v4u-text);
  font-family: var(--v4u-font);
  font-size: 0.82rem;
}

.v4u-table-search input:focus {
  outline: none;
  border-color: var(--v4u-red);
  box-shadow: 0 0 0 3px var(--v4u-red-glow);
}

.v4u-table-result-count {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--v4u-text-muted);
  white-space: nowrap;
}

/* Multiselect column + bulk action bar, shared across any v4u-data-table
   that opts in via data-v4u-select-all / data-v4u-user-checkbox (see
   admin-pages.js) — currently only the Users table, written generically
   enough to reuse on another table without new CSS. */
.v4u-table-check-col {
  width: 36px;
  text-align: center;
}

.v4u-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 16px 14px;
  padding: 10px 14px;
  background: var(--v4u-red-glow);
  border: 1px solid var(--v4u-red);
  border-radius: var(--v4u-radius-sm);
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--v4u-text);
}

.v4u-bulk-actions[hidden] {
  display: none;
}

.v4u-bulk-actions-buttons {
  display: flex;
  gap: 8px;
}

.v4u-table-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--v4u-text-muted);
}

.v4u-table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 16px 0;
}

.v4u-table-page-status {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--v4u-text-secondary);
  white-space: nowrap;
}

/* Achievement-percentage pill — semantic tone tokens instead of inline hex */
.v4u-pct-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fff;
}

.v4u-pct-badge--good { background: var(--v4u-green); }
.v4u-pct-badge--watch { background: var(--v4u-amber); }
.v4u-pct-badge--mid { background: var(--v4u-blue); }
.v4u-pct-badge--attention { background: var(--v4u-red); }
.v4u-pct-badge--na { background: var(--v4u-text-muted); }

/* Plain colour fills (progress-bar segments) — a separate set from the
   badge component above since badges set `color` (text), fills need
   `background` only, on a bare span with no text of its own. */
.v4u-fill--good { display: block; height: 100%; border-radius: inherit; background: var(--v4u-green); }
.v4u-fill--watch { display: block; height: 100%; border-radius: inherit; background: var(--v4u-amber); }
.v4u-fill--mid { display: block; height: 100%; border-radius: inherit; background: var(--v4u-blue); }
.v4u-fill--attention { display: block; height: 100%; border-radius: inherit; background: var(--v4u-red); }
.v4u-fill--na { display: block; height: 100%; border-radius: inherit; background: var(--v4u-text-muted); }

/* Stacked value list inside a table cell (franchises / dealer IDs / emails) */
/* ── Filter bar (Year/Category/Focus + actions) ─────────────── */
.v4u-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.v4u-filter-field {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  overflow: hidden;
  background: var(--v4u-bg-elevated);
}

.v4u-filter-field label {
  padding: 0 10px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  background: var(--v4u-surface);
  color: var(--v4u-text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.v4u-filter-field select {
  height: 34px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--v4u-text);
  font-family: var(--v4u-font);
  font-size: 0.8rem;
  min-width: 110px;
}

.v4u-filter-field select:focus {
  outline: none;
}

/* ── Legend ───────────────────────────────────────────────── */
.v4u-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--v4u-text-secondary);
}

.v4u-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v4u-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.v4u-legend-dot--good { background: var(--v4u-green); }
.v4u-legend-dot--watch { background: var(--v4u-amber); }
.v4u-legend-dot--mid { background: var(--v4u-blue); }
.v4u-legend-dot--attention { background: var(--v4u-red); }
.v4u-legend-dot--na { background: var(--v4u-text-muted); }

/* ── Small stat tiles (summary strip) ────────────────────────── */
.v4u-stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.v4u-stat-tile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow);
}

.v4u-stat-tile__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--v4u-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.v4u-stat-tile__value {
  margin-top: 4px;
  font-family: var(--v4u-font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--v4u-heading);
}

.v4u-stat-tile__icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
  font-size: 1rem;
}

.v4u-stat-tile__bar {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 10px;
}

/* ── Leaderboard table extras ─────────────────────────────────── */
.v4u-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-surface-2);
  color: var(--v4u-text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
}

.v4u-metric-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}

.v4u-metric-cell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v4u-metric-cell__nums {
  font-size: 0.72rem;
  color: var(--v4u-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.v4u-detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.v4u-detail-toggle i {
  transition: transform 0.2s ease;
}

.v4u-detail-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.v4u-detail-row-highlight {
  background: var(--v4u-red-glow) !important;
}

/* ── Expandable detail cards ───────────────────────────────── */
.v4u-detail-wrap {
  padding: 16px;
  background: var(--v4u-surface);
}

.v4u-detail-card {
  height: 100%;
  border: 1px solid var(--v4u-border);
  border-top: 3px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow);
  overflow: hidden;
}

.v4u-detail-card--contracts { border-top-color: var(--v4u-blue); }
.v4u-detail-card--upgrades { border-top-color: var(--v4u-amber); }
.v4u-detail-card--prepaid { border-top-color: var(--v4u-green); }

.v4u-detail-card__body {
  padding: 14px;
}

.v4u-detail-card__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--v4u-heading);
}

.v4u-detail-card__title i {
  font-size: 0.82rem;
  color: var(--v4u-text-muted);
  cursor: help;
}

.v4u-package-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.v4u-package-box {
  padding: 10px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-surface);
}

.v4u-package-box__label {
  font-size: 0.7rem;
  color: var(--v4u-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.v4u-package-box__name {
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--v4u-heading);
}

.v4u-package-box__code {
  font-size: 0.7rem;
  color: var(--v4u-text-muted);
}

.v4u-package-box__value {
  margin-top: 4px;
  font-family: var(--v4u-font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--v4u-heading);
}

.v4u-package-box__sub {
  font-size: 0.7rem;
  color: var(--v4u-text-muted);
}

.v4u-mini-table {
  width: 100%;
  max-height: 210px;
  overflow: auto;
}

.v4u-mini-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.v4u-mini-table th {
  position: sticky;
  top: 0;
  padding: 6px 8px;
  background: var(--v4u-surface);
  color: var(--v4u-text-muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}

.v4u-mini-table th:last-child, .v4u-mini-table td:last-child { text-align: right; }

.v4u-mini-table td {
  padding: 6px 8px;
  border-top: 1px solid var(--v4u-border);
  color: var(--v4u-text);
  vertical-align: middle;
}

.v4u-mini-table .v4u-store-name {
  font-weight: 700;
  color: var(--v4u-heading);
}

.v4u-mini-table .v4u-store-id {
  font-size: 0.68rem;
  color: var(--v4u-text-muted);
}

/* ── Group performance cards (Package Performance page) ─────── */
.v4u-perf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 16px;
}

.v4u-perf-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--v4u-border);
}

.v4u-perf-card-header__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v4u-perf-card-header__title h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--v4u-heading);
}

.v4u-perf-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.v4u-insight-box {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-surface);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--v4u-text-secondary);
}

.v4u-insight-box b { color: var(--v4u-heading); }
.v4u-insight-box code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--v4u-surface-2);
  color: var(--v4u-text-secondary);
  font-size: 0.72rem;
}

.v4u-subcard {
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  overflow: hidden;
}

.v4u-subcard + .v4u-subcard { margin-top: 12px; }

.v4u-subcard__title {
  display: block;
  padding: 10px 12px 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--v4u-text-muted);
}

.v4u-subcard__body { padding: 10px 12px 12px; }

.v4u-mini-list {
  display: grid;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.v4u-mini-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--v4u-border);
  font-size: 0.78rem;
  color: var(--v4u-text);
}

.v4u-mini-list-item:last-child { border-bottom: 0; }

.v4u-mini-list-item small { color: var(--v4u-text-muted); }

.v4u-mini-list-item .v4u-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
  font-size: 0.7rem;
  font-weight: 800;
}

.v4u-max-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 700;
}

.v4u-max-badge--peak {
  background: var(--v4u-green-glow);
  color: var(--v4u-green);
}

.v4u-max-badge--flat {
  background: var(--v4u-surface-2);
  color: var(--v4u-text-secondary);
}

.v4u-insight-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-bg-elevated);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--v4u-text-secondary);
}

.v4u-insight-note i {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--v4u-amber);
}

.v4u-cell-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.v4u-cell-list li {
  font-size: 0.8rem;
  color: var(--v4u-text);
  line-height: 1.4;
}

.v4u-cell-list li a {
  color: var(--v4u-text);
}

.v4u-cell-list li a:hover {
  color: var(--v4u-red);
}

/* Group-name dropdown (franchise list under a group) */
.v4u-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  color: var(--v4u-heading);
  cursor: pointer;
}

.v4u-group-toggle:hover {
  color: var(--v4u-red);
}

.v4u-group-toggle i {
  font-size: 0.68rem;
  color: var(--v4u-text-muted);
}

.v4u-group-menu {
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow-lg);
}

.v4u-group-menu .dropdown-item {
  border-radius: var(--v4u-radius-xs);
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--v4u-text);
}

.v4u-group-menu .dropdown-item:hover {
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
}

/* Colour-coded metric columns (Contracts/Upgrades/Prepaid) */
.v4u-data-table thead th.v4u-col-contracts,
.v4u-data-table thead th.v4u-col-upgrades,
.v4u-data-table thead th.v4u-col-prepaid {
  color: #fff;
}

.v4u-data-table thead th.v4u-col-contracts { background: var(--v4u-blue); }
.v4u-data-table thead th.v4u-col-upgrades { background: var(--v4u-amber); }
.v4u-data-table thead th.v4u-col-prepaid { background: var(--v4u-green); }

.v4u-data-table tbody td.v4u-col-contracts { background: var(--v4u-blue-glow); }
.v4u-data-table tbody td.v4u-col-upgrades { background: var(--v4u-amber-glow); }
.v4u-data-table tbody td.v4u-col-prepaid { background: var(--v4u-green-glow); }

/* Sortable column headers */
.v4u-data-table thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.v4u-data-table thead th[data-sort]:hover {
  color: var(--v4u-red);
}

.v4u-data-table thead th.v4u-col-contracts[data-sort]:hover,
.v4u-data-table thead th.v4u-col-upgrades[data-sort]:hover,
.v4u-data-table thead th.v4u-col-prepaid[data-sort]:hover {
  color: #fff;
  opacity: 0.85;
}

.v4u-sort-icon {
  display: inline-flex;
  margin-left: 4px;
  font-size: 0.62rem;
  opacity: 0.45;
  vertical-align: middle;
}

.v4u-data-table thead th[data-sort].is-sorted .v4u-sort-icon {
  opacity: 1;
}

.v4u-metric-trio {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.v4u-metric-trio__nums {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--v4u-text-secondary);
  white-space: nowrap;
}

.v4u-table-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--v4u-surface);
  border: 1px solid var(--v4u-border);
  color: var(--v4u-text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.v4u-table-figure {
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  color: var(--v4u-heading);
}

.v4u-table-figure--empty {
  color: var(--v4u-text-muted);
  font-weight: 500;
}

.v4u-panel .dataTable-top,
.v4u-panel .dataTable-bottom {
  padding: 10px 0;
  color: var(--v4u-text-secondary);
}

.v4u-panel .dataTable-input,
.v4u-panel .dataTable-selector {
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-bg-elevated);
  color: var(--v4u-text);
  min-height: 34px;
}

@media (max-width: 1200px) {
  .v4u-command-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .v4u-quick-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .v4u-page {
    padding: 78px 14px 22px;
  }

  .v4u-dash-header,
  .v4u-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .v4u-dash-header-actions,
  .v4u-panel-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .v4u-dash-grid {
    grid-template-columns: 1fr;
  }

  .v4u-command-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .v4u-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .v4u-page {
    padding: 72px 10px 18px;
  }

  .v4u-dash-title {
    font-size: 1.3rem;
  }

  .v4u-command-grid {
    grid-template-columns: 1fr;
  }

  .v4u-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .v4u-list-row {
    flex-wrap: wrap;
  }

  .v4u-list-row__cta {
    white-space: normal;
  }

  .v4u-chip,
  .v4u-btn,
  .v4u-year-button {
    width: 100%;
  }

  .v4u-panel-body {
    padding: 12px !important;
  }

  .v4u-chart {
    height: 260px;
  }

  .v4u-chart--donut {
    height: 260px;
  }

  .v4u-category-warning {
    flex-direction: column;
  }

  .v4u-category-warning__tag {
    width: 100%;
    justify-content: space-between;
  }

  .v4u-admin-split,
  .v4u-target-row {
    grid-template-columns: 1fr;
  }

  .v4u-form-actions,
  .v4u-table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .v4u-panel--table .table-responsive {
    border: 0;
    overflow: visible;
  }

  .v4u-data-table {
    min-width: 0;
  }

  .v4u-data-table thead {
    display: none;
  }

  .v4u-data-table,
  .v4u-data-table tbody,
  .v4u-data-table tr,
  .v4u-data-table th,
  .v4u-data-table td {
    display: block;
    width: 100%;
  }

  .v4u-data-table tbody tr {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--v4u-border);
    border-radius: var(--v4u-radius-sm);
    background: var(--v4u-surface);
  }

  .v4u-data-table tbody th,
  .v4u-data-table tbody td {
    display: grid;
    grid-template-columns: minmax(110px, 42%) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0 !important;
    font-size: 0.8rem;
  }

  .v4u-data-table tbody th::before,
  .v4u-data-table tbody td::before {
    content: attr(data-label);
    color: var(--v4u-text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }
}

/* ── Detail/edit form section dividers (view*/add* record pages) ─────────
   Bootstrap's grid/form-control classes stay as-is throughout these forms
   (v4u is a theme layer over Bootstrap, not a replacement for it) — this
   just replaces the old bare <h5> section headings inside those forms.
   Kept deliberately small/quiet (same scale as .v4u-panel-kicker) — a
   bold display-font heading here reads as shouty next to compact form
   fields; this is a subtle divider, not a page heading. */
.v4u-form-section-title {
  border-top: 1px solid var(--v4u-border);
  color: var(--v4u-text-secondary);
  font-family: var(--v4u-font);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 20px 0 6px;
  padding-top: 16px;
}

.v4u-form-section-title:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

/* ── Category accent ───────────────────────────────────────────────────
   A page opts in by setting --v4u-category-accent in its own local
   <style> block (on .v4u-page[data-v4u-page="…"]). These are pure
   consumers — undecorated pages fall back to the normal red kicker /
   plain border, so this never needs touching for pages that don't use
   it. Kept deliberately separate from the good/watch/attention/na
   status tones (never reuses their exact hex) so a page's identity
   colour can never be misread as a status signal on its own table. */
.v4u-page[data-v4u-page] .v4u-panel--table {
  border-top: 3px solid var(--v4u-category-accent, var(--v4u-border));
}

.v4u-page[data-v4u-page] .v4u-panel-kicker {
  color: var(--v4u-category-accent, var(--v4u-red));
}

/* Navigation selection */
.sidebar-nav .nav-link.is-active {
  color: var(--v4u-red) !important;
  background: var(--v4u-red-glow);
  border-left-color: var(--v4u-red);
  box-shadow: inset 0 0 0 1px var(--v4u-red-strong);
}

.sidebar-nav .nav-link.is-active i {
  color: var(--v4u-red) !important;
}

.sidebar-nav .nav-link--action {
  margin: 4px 0;
}

.nav-acc[data-nav-active="true"] > .nav-acc-toggle {
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-red-glow);
}

.nav-acc[data-nav-active="true"] > .nav-acc-toggle .nav-acc-label,
.nav-acc[data-nav-active="true"] > .nav-acc-toggle .nav-acc-chev {
  color: var(--v4u-red);
}

/* Profile controls */
.v4u-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--v4u-red-strong);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
  font-family: var(--v4u-font-display);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
}

.v4u-profile-avatar--large {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 1rem;
}

.header-nav .profile.v4u-profile-menu {
  width: min(330px, calc(100vw - 24px));
  padding: 8px;
}

.v4u-profile-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 8px 8px 10px !important;
}

.v4u-profile-summary__copy {
  display: grid;
  min-width: 0;
}

.v4u-profile-summary__copy h6 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4u-profile-summary__copy .text-sm {
  color: var(--v4u-text-secondary);
  font-size: 0.74rem;
  line-height: 1.35;
}

.v4u-session-pill {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--v4u-green);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-green-glow);
  color: var(--v4u-green);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
}

.v4u-session-pill[data-session-tone="warning"] {
  border-color: var(--v4u-amber);
  background: var(--v4u-amber-glow);
  color: var(--v4u-amber);
}

.v4u-session-pill[data-session-tone="expired"] {
  border-color: var(--v4u-red);
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
}

.v4u-profile-control {
  padding: 6px 8px;
}

.header-nav .profile.v4u-profile-menu .dropdown-item {
  gap: 9px;
  min-height: 34px;
  border-radius: var(--v4u-radius-xs);
  color: var(--v4u-text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
}

.header-nav .profile.v4u-profile-menu .dropdown-item i {
  color: var(--v4u-red);
}

/* Session countdown */
.v4u-session-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 12, 18, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.v4u-session-backdrop.is-open {
  display: flex;
}

.v4u-session-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  width: min(480px, 100%);
  padding: 18px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow-lg);
  color: var(--v4u-text);
}

.v4u-session-meter {
  --v4u-session-progress: 1;
  position: relative;
  display: grid;
  place-items: center;
  /* place-items only centers each row's content horizontally — with two
     implicit rows (span + small) the row *set* still defaults to
     align-content: start, so it hugs the top of the circle instead of
     sitting in the true center. Centering the content box fixes that. */
  align-content: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(var(--v4u-red) calc(var(--v4u-session-progress) * 1turn), var(--v4u-surface-2) 0);
}

.v4u-session-meter::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--v4u-bg-elevated);
}

.v4u-session-meter span,
.v4u-session-meter small {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.v4u-session-meter span {
  color: var(--v4u-heading);
  font-family: var(--v4u-font-display);
  font-size: 1.42rem;
  font-weight: 800;
}

.v4u-session-meter small {
  color: var(--v4u-text-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.v4u-session-copy h2 {
  margin: 0;
  font-size: 1.08rem;
}

.v4u-session-detail {
  margin: 5px 0 0;
  color: var(--v4u-text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.v4u-session-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.v4u-session-actions .v4u-btn {
  min-width: 142px;
}

.v4u-session-backdrop.is-expired .v4u-session-meter {
  background: conic-gradient(var(--v4u-red) 1turn, var(--v4u-surface-2) 0);
}

/* Confirm modal — built lazily by admin-pages.js, replaces window.confirm() for
   every existing data-v4u-confirm form and any data-v4u-delete-url action. */
.v4u-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2450;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 12, 18, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.v4u-confirm-backdrop.is-open {
  display: flex;
}

.v4u-confirm-card {
  width: min(400px, 100%);
  padding: 22px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow-lg);
  color: var(--v4u-text);
  text-align: center;
}

.v4u-confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
  font-size: 1.2rem;
}

.v4u-confirm-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.v4u-confirm-card p {
  margin: 0;
  color: var(--v4u-text-secondary);
  font-size: 0.84rem;
  line-height: 1.5;
}

.v4u-confirm-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/* Cookie notice — global, fixed bottom banner (see partials/cookie-banner.ejs) */
.v4u-cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 2300;
  width: calc(100% - 32px);
  max-width: 720px;
  animation: v4u-fade-rise 0.32s ease both;
}

.v4u-cookie-banner.is-dismissing {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.v4u-cookie-banner__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow-lg);
}

.v4u-cookie-banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
  font-size: 1rem;
}

.v4u-cookie-banner__text {
  flex: 1 1 220px;
  min-width: 200px;
}

.v4u-cookie-banner__title {
  margin: 0 0 2px;
  color: var(--v4u-heading);
  font-family: var(--v4u-font-display);
  font-size: 0.86rem;
  font-weight: 700;
}

.v4u-cookie-banner__desc {
  margin: 0;
  color: var(--v4u-text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.v4u-cookie-banner__actions {
  flex-shrink: 0;
}

.v4u-cookie-banner__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-start;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--v4u-radius-xs);
  background: transparent;
  color: var(--v4u-text-muted);
  cursor: pointer;
}

.v4u-cookie-banner__close:hover {
  color: var(--v4u-red);
  background: var(--v4u-red-glow);
}

@media (max-width: 640px) {
  .v4u-cookie-banner {
    left: 16px;
    right: 16px;
    bottom: 12px;
    width: auto;
    transform: none;
  }

  .v4u-cookie-banner.is-dismissing {
    transform: translateY(10px);
  }
}

/* Account settings — theme picker */
.v4u-theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.v4u-theme-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: var(--v4u-transition);
}

.v4u-theme-option:hover {
  border-color: var(--v4u-border-hover);
}

.v4u-theme-option--active {
  border-color: var(--v4u-red);
  box-shadow: 0 0 0 1px var(--v4u-red);
}

.v4u-theme-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: var(--v4u-radius-xs);
  font-size: 1.15rem;
}

.v4u-theme-swatch--light {
  background: #F4F6FA;
  color: #17181C;
  border: 1px solid #E2E5EC;
}

.v4u-theme-swatch--dark {
  background: #14161C;
  color: #F5F6F8;
  border: 1px solid #2A2D36;
}

.v4u-theme-option-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--v4u-heading);
}

.v4u-theme-option-check {
  display: none;
  color: var(--v4u-red);
  font-size: 1rem;
}

.v4u-theme-option--active .v4u-theme-option-check {
  display: inline-flex;
}

/* Auth flow — full-bleed split screen (ported from pivot22's auth-page
   pattern: dark illustrated brand pane + light form pane, no shared card
   boundary between them — the color contrast alone separates them, at any
   site-wide light/dark theme, since the brand pane is intentionally NOT
   theme-reactive, same as pivot22's own always-dark brand panel). */
.v4u-auth-page {
  min-height: 100vh;
  background: var(--v4u-bg);
}

.v4u-auth-shell {
  --auth-brand-bg: #12141c;
  --auth-brand-ink: #f5f6fa;
  --auth-brand-muted: rgba(245, 246, 250, 0.68);
  --auth-brand-line: rgba(255, 255, 255, 0.07);
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr);
}

.v4u-auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 56px);
  background: var(--auth-brand-bg);
  color: var(--auth-brand-ink);
}

.v4u-auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--auth-brand-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--auth-brand-line) 1px, transparent 1px);
  background-size: 42px 42px;
}

.v4u-auth-brand-orb {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.v4u-auth-brand-orb--1 { width: 320px; height: 320px; top: -90px; right: -70px; background: var(--v4u-red-glow); }
.v4u-auth-brand-orb--2 { width: 220px; height: 220px; bottom: -60px; left: -50px; background: var(--v4u-blue-glow); }

.v4u-auth-brand > * {
  position: relative;
  z-index: 1;
}

.v4u-auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.v4u-auth-logo img {
  display: block;
  max-height: 34px;
  object-fit: contain;
}

.v4u-auth-logo-secondary {
  max-width: 120px;
}

.v4u-auth-brand h1 {
  max-width: 460px;
  margin: 20px 0 8px;
  color: var(--auth-brand-ink);
  font-size: 1.75rem;
  line-height: 1.14;
}

.v4u-auth-brand-subtext {
  max-width: 480px;
  margin: 0;
  color: var(--auth-brand-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.v4u-auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.v4u-auth-proof span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--auth-brand-line);
  border-radius: var(--v4u-radius-xs);
  background: rgba(255, 255, 255, 0.05);
  color: var(--auth-brand-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.v4u-auth-proof i {
  color: var(--v4u-red);
}

/* Illustrated feature slider — ported from pivot22's auth-brand slide deck
   (grid-stacked slides in one cell so container height = tallest slide, no
   fixed px needed), restyled with v4u tokens instead of AdmicoHub's neon
   green, with content specific to this app instead of general accounting
   copy. Markup/animation driven by public/assets/js/auth-experience.js. */
.v4u-auth-slider {
  display: grid;
  grid-template-areas: "slide";
  width: 100%;
  max-width: 380px;
}

.v4u-auth-slide {
  grid-area: slide;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.v4u-auth-slide-quote {
  margin-bottom: 10px;
  color: var(--auth-brand-ink);
  font-size: 1.1rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.24;
}

.v4u-auth-slide-ans {
  margin-bottom: 18px;
  color: var(--auth-brand-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.v4u-auth-slide-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 4px 11px;
  border: 1px solid rgba(237, 28, 36, 0.35);
  border-radius: 999px;
  color: #ff8890;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v4u-auth-mc-card {
  padding: 15px 17px;
  border: 1px solid var(--auth-brand-line);
  border-radius: var(--v4u-radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.v4u-auth-mc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.v4u-auth-mc-label {
  color: var(--auth-brand-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v4u-auth-mc-val {
  margin: 3px 0;
  color: var(--auth-brand-ink);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.v4u-auth-mc-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--v4u-green-glow);
  color: #6be08b;
  font-size: 0.66rem;
  font-weight: 700;
}

.v4u-auth-mc-bar-track {
  height: 4px;
  margin: 5px 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.v4u-auth-mc-bar-fill {
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--v4u-red);
}

.v4u-auth-mc-note {
  margin-top: 6px;
  color: var(--auth-brand-muted);
  font-size: 0.72rem;
}

.v4u-auth-mc-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.v4u-auth-mc-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--auth-brand-muted);
  font-size: 0.76rem;
}

.v4u-auth-mc-list-row strong {
  color: var(--auth-brand-ink);
  font-weight: 700;
}

.v4u-auth-mc-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 12px 0;
}

.v4u-auth-mc-tl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.v4u-auth-mc-tl-step span {
  color: var(--auth-brand-muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.v4u-auth-mc-tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.v4u-auth-mc-tl-step.is-done .v4u-auth-mc-tl-dot {
  background: var(--v4u-green);
  border-color: var(--v4u-green);
  box-shadow: 0 0 6px var(--v4u-green-glow);
}

.v4u-auth-mc-tl-line {
  position: relative;
  flex: 1;
  min-width: 26px;
  height: 2px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.v4u-auth-mc-tl-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--v4u-green);
}

.v4u-auth-slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.v4u-auth-sdot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: width var(--v4u-transition), background var(--v4u-transition);
}

.v4u-auth-sdot.is-active {
  width: 20px;
  background: var(--v4u-red);
}

.v4u-auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 48px 24px;
  background: var(--v4u-bg);
}

.v4u-auth-result {
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  box-shadow: var(--v4u-shadow);
}

.v4u-auth-panel h2,
.v4u-auth-result h1 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  line-height: 1.22;
}

.v4u-auth-copy {
  margin: 0 0 18px;
  color: var(--v4u-text-secondary);
  font-size: 0.84rem;
  line-height: 1.5;
}

.v4u-auth-form {
  display: grid;
  gap: 13px;
}

.v4u-auth-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.v4u-auth-field > span {
  color: var(--v4u-heading);
  font-size: 0.76rem;
  font-weight: 800;
}

.v4u-auth-input {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-surface);
  transition: border-color var(--v4u-transition), box-shadow var(--v4u-transition), background var(--v4u-transition);
}

.v4u-auth-input:focus-within {
  border-color: var(--v4u-red);
  background: var(--v4u-bg-elevated);
  box-shadow: 0 0 0 3px var(--v4u-red-glow);
}

.v4u-auth-input i {
  color: var(--v4u-red);
  font-size: 0.92rem;
}

.v4u-auth-input input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--v4u-text);
  font: inherit;
  outline: 0;
}

.v4u-auth-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
}

.v4u-auth-help,
.v4u-auth-note {
  margin: 0;
  color: var(--v4u-text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.v4u-auth-state {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--v4u-amber);
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-amber-glow);
}

.v4u-auth-state--danger {
  border-color: var(--v4u-red);
  background: var(--v4u-red-glow);
}

.v4u-auth-state h2,
.v4u-auth-state p {
  margin: 0;
}

.v4u-auth-invalid {
  min-height: 18px;
  color: var(--v4u-red);
  font-size: 0.72rem;
  font-weight: 700;
}

.v4u-password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--v4u-radius-xs);
  background: transparent;
  color: var(--v4u-text-secondary);
  cursor: pointer;
}

.v4u-password-toggle:hover {
  color: var(--v4u-red);
  background: var(--v4u-red-glow);
}

.v4u-auth-result {
  width: min(520px, 100%);
  padding: 26px;
  text-align: center;
}

.v4u-auth-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: var(--v4u-radius-xs);
  background: var(--v4u-red-glow);
  color: var(--v4u-red);
  font-size: 1.24rem;
}

.v4u-auth-result p {
  color: var(--v4u-text-secondary);
  font-size: 0.84rem;
  line-height: 1.5;
}

.v4u-auth-result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* .v4u-auth-page--compact / .v4u-animate-in — already referenced by every
   auth-result page (session-expired, Usernotfound, register-result, …) as
   markup hooks, but neither ever had a CSS rule backing it; closing that
   gap here instead of on one page so every existing user picks it up.
   Centering (display:flex/align/justify) used to live on the base
   .v4u-auth-page rule above, shared with the split-screen shell pages — now
   that .v4u-auth-page is a plain full-bleed grid host for those, the compact
   variant needs its own centering so result pages (session-expired, etc.)
   still center their card instead of collapsing to the top-left. */
.v4u-auth-page--compact {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 18px 24px;
}

.v4u-animate-in {
  animation: v4u-fade-rise 0.32s ease both;
}

@keyframes v4u-fade-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .v4u-animate-in {
    animation: none;
  }
}

@media (max-width: 900px) {
  .v4u-auth-shell {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .v4u-auth-brand {
    gap: 16px;
    padding: 28px 24px;
  }

  .v4u-auth-brand h1 {
    margin-top: 12px;
    font-size: 1.5rem;
  }

  .v4u-auth-panel {
    padding: 36px 24px 44px;
  }
}

/* Below this, the illustrated slider doesn't have room to breathe next to a
   still-usable form — keep the logo/heading (brand identity), drop the
   slider entirely rather than cramming it in, matching pivot22's own
   mobile behaviour of hiding its slide deck below its narrowest breakpoint. */
@media (max-width: 600px) {
  .v4u-auth-slider,
  .v4u-auth-proof {
    display: none;
  }
}

@media (max-width: 640px) {
  .v4u-session-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .v4u-session-card {
    grid-template-columns: 1fr;
    width: 100%;
    border-radius: var(--v4u-radius-sm) var(--v4u-radius-sm) 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .v4u-session-meter {
    width: 66px;
    height: 66px;
  }

  .v4u-session-actions {
    justify-content: stretch;
  }

  .v4u-session-actions .v4u-btn {
    width: 100%;
  }

  /* .v4u-auth-page's own centering (flex/align/justify) now lives only on
     the --compact variant, above — shell pages (login/landing/etc.) are a
     full-bleed grid instead, so there's nothing to override here for them. */
  .v4u-auth-page--compact {
    padding: 68px 12px 22px;
  }

  .v4u-auth-brand,
  .v4u-auth-panel {
    padding: 20px;
  }

  .v4u-auth-result {
    padding: 18px;
  }

  .v4u-auth-brand h1 {
    font-size: 1.42rem;
  }
}

/* Guided system tour */
.v4u-tour-layer {
  position: fixed;
  inset: 0;
  z-index: 2450;
  display: none;
  pointer-events: none;
}

.v4u-tour-layer.is-open {
  display: block;
}

.v4u-tour-highlight {
  position: fixed;
  border: 2px solid var(--v4u-red);
  border-radius: var(--v4u-radius-sm);
  box-shadow:
    0 0 0 9999px rgba(10, 12, 18, 0.56),
    0 0 0 7px var(--v4u-red-glow),
    0 14px 42px rgba(16, 24, 40, 0.22);
  transition: top 0.2s var(--v4u-ease), left 0.2s var(--v4u-ease), width 0.2s var(--v4u-ease), height 0.2s var(--v4u-ease);
  pointer-events: none;
}

.v4u-tour-target-active {
  position: relative;
  z-index: 2451 !important;
}

.v4u-tour-card {
  position: fixed;
  z-index: 2452;
  width: min(360px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--v4u-border);
  border-radius: var(--v4u-radius-sm);
  background: var(--v4u-bg-elevated);
  color: var(--v4u-text);
  box-shadow: var(--v4u-shadow-lg);
  pointer-events: auto;
}

.v4u-tour-card::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-left: 1px solid var(--v4u-border);
  border-top: 1px solid var(--v4u-border);
  background: var(--v4u-bg-elevated);
  transform: rotate(45deg);
}

.v4u-tour-card[data-placement="right"]::before {
  left: -7px;
  top: 22px;
}

.v4u-tour-card[data-placement="left"]::before {
  right: -7px;
  top: 22px;
  transform: rotate(225deg);
}

.v4u-tour-card[data-placement="top"]::before {
  left: 28px;
  bottom: -7px;
  transform: rotate(225deg);
}

.v4u-tour-card[data-placement="bottom"]::before,
.v4u-tour-card[data-placement="auto"]::before {
  left: 28px;
  top: -7px;
}

.v4u-tour-kicker {
  margin: 0 0 5px;
  color: var(--v4u-red);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.v4u-tour-card h2 {
  margin: 0;
  color: var(--v4u-heading);
  font-size: 1.05rem;
  line-height: 1.25;
}

.v4u-tour-card p#v4uTourBody {
  margin: 7px 0 0;
  color: var(--v4u-text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.v4u-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.v4u-tour-count {
  color: var(--v4u-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.v4u-tour-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.v4u-tour-link,
.v4u-tour-skip {
  border: 0;
  background: transparent;
  color: var(--v4u-text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.v4u-tour-link:hover,
.v4u-tour-skip:hover {
  color: var(--v4u-red);
}

.v4u-tour-skip {
  position: absolute;
  top: 10px;
  right: 12px;
}

.v4u-tour-card .v4u-btn:disabled {
  opacity: 0.38;
}

@media (prefers-reduced-motion: reduce) {
  .v4u-tour-highlight {
    transition: none;
  }
}

@media (max-width: 680px) {
  .v4u-tour-card {
    border-radius: var(--v4u-radius-sm);
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  }

  .v4u-tour-card::before {
    display: none;
  }

  .v4u-tour-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .v4u-tour-actions {
    justify-content: stretch;
  }

  .v4u-tour-actions .v4u-btn,
  .v4u-tour-actions .v4u-tour-link {
    flex: 1 1 100%;
  }
}
