﻿/* ============================================================
   EventOs UI — design tokens
   Light theme is the default; [data-bs-theme="dark"] overrides.
   ============================================================ */
:root {
  --es-bg: #eef2f7;
  --es-bg-gradient: radial-gradient(1200px 500px at 80% -10%, rgba(11, 110, 117, 0.08), transparent 60%);
  --es-surface: #ffffff;
  --es-surface-2: #f4f7fb;
  --es-border: #dbe3ee;
  --es-text: #0e1a2b;
  --es-muted: #52627b;
  --es-accent: #0b6e75;
  --es-accent-soft: rgba(11, 110, 117, 0.12);
  --es-accent-contrast: #ffffff;
  --es-success: #0d8a62;
  --es-success-soft: rgba(13, 138, 98, 0.12);
  --es-warning: #a86500;
  --es-warning-soft: rgba(239, 155, 15, 0.16);
  --es-danger: #c23b4b;
  --es-danger-soft: rgba(214, 76, 76, 0.12);
  --es-info: #2563ab;
  --es-info-soft: rgba(37, 99, 171, 0.12);
  --es-shadow: 0 8px 24px rgba(14, 26, 43, 0.07);
  --es-shadow-lg: 0 16px 40px rgba(14, 26, 43, 0.1);
  --es-radius: 16px;
}
[data-bs-theme="dark"] {
  --es-bg: #0b1220;
  --es-bg-gradient: radial-gradient(1200px 500px at 80% -10%, rgba(38, 191, 201, 0.08), transparent 60%);
  --es-surface: #141d30;
  --es-surface-2: #1b2740;
  --es-border: #26334e;
  --es-text: #e8eef8;
  --es-muted: #9aa9c1;
  --es-accent: #2fb9c2;
  --es-accent-soft: rgba(47, 185, 194, 0.14);
  --es-accent-contrast: #06282b;
  --es-success: #2fc08f;
  --es-success-soft: rgba(47, 192, 143, 0.14);
  --es-warning: #f0a832;
  --es-warning-soft: rgba(240, 168, 50, 0.15);
  --es-danger: #f0687a;
  --es-danger-soft: rgba(240, 104, 122, 0.14);
  --es-info: #6ea8e8;
  --es-info-soft: rgba(110, 168, 232, 0.14);
  --es-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --es-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   Base
   ============================================================ */
html,
body {
  min-height: 100%;
}
body {
  background-color: var(--es-bg);
  background-image: var(--es-bg-gradient);
  background-repeat: no-repeat;
  color: var(--es-text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main.container-fluid {
  max-width: 1600px;
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--es-accent);
  margin-bottom: 0.35rem;
}
.text-muted,
.form-text {
  color: var(--es-muted) !important;
}
.card {
  background: var(--es-surface);
  border: 1px solid var(--es-border);
  border-radius: var(--es-radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.card .card-header,
.card .card-footer {
  background: transparent;
  border-color: var(--es-border);
}
body {
  --bs-link-color: var(--es-accent);
  --bs-link-hover-color: var(--es-accent);
  --bs-link-color-rgb: 11, 110, 117;
  --bs-link-hover-color-rgb: 11, 110, 117;
}
[data-bs-theme="dark"] body {
  --bs-link-color-rgb: 47, 185, 194;
  --bs-link-hover-color-rgb: 47, 185, 194;
}
.btn {
  border-radius: 7px;
  font-weight: 600;
}
.btn-primary {
  --bs-btn-color: var(--es-accent-contrast);
  --bs-btn-bg: var(--es-accent);
  --bs-btn-border-color: var(--es-accent);
  --bs-btn-hover-color: var(--es-accent-contrast);
  --bs-btn-hover-bg: color-mix(in srgb, var(--es-accent) 85%, black);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--es-accent) 85%, black);
  --bs-btn-active-color: var(--es-accent-contrast);
  --bs-btn-active-bg: color-mix(in srgb, var(--es-accent) 75%, black);
  --bs-btn-active-border-color: color-mix(in srgb, var(--es-accent) 75%, black);
  --bs-btn-disabled-color: var(--es-accent-contrast);
  --bs-btn-disabled-bg: var(--es-accent);
  --bs-btn-disabled-border-color: var(--es-accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--es-accent);
  --bs-btn-border-color: var(--es-accent);
  --bs-btn-hover-color: var(--es-accent-contrast);
  --bs-btn-hover-bg: var(--es-accent);
  --bs-btn-hover-border-color: var(--es-accent);
  --bs-btn-active-color: var(--es-accent-contrast);
  --bs-btn-active-bg: var(--es-accent);
  --bs-btn-active-border-color: var(--es-accent);
  --bs-btn-disabled-color: var(--es-accent);
  --bs-btn-disabled-border-color: var(--es-accent);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--es-accent);
  box-shadow: 0 0 0 0.25rem var(--es-accent-soft);
}
.form-check-input:checked {
  background-color: var(--es-accent);
  border-color: var(--es-accent);
}
.form-check-input:focus {
  border-color: var(--es-accent);
  box-shadow: 0 0 0 0.25rem var(--es-accent-soft);
}

.registration-info-tip {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 1.2rem;
    height: 1.2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--bs-primary);
    font-size: .85rem;
    line-height: 1;
    cursor: help;
}

.registration-info-tip:hover,
.registration-info-tip:focus-visible {
    background: color-mix(in srgb, var(--bs-primary) 12%, transparent);
    outline: none;
}

.registration-info-tip:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-primary) 28%, transparent);
}

.registration-info-tip::after {
    position: absolute;
    right: 0;
    bottom: calc(100% + .55rem);
    z-index: 1080;
    width: max-content;
    max-width: min(340px, 75vw);
    padding: .65rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background: var(--bs-emphasis-color);
    color: var(--bs-body-bg);
    box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .18);
    content: attr(data-tooltip);
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translateY(.25rem);
    transition: opacity 120ms ease, transform 120ms ease;
}

.registration-info-tip:hover::after,
.registration-info-tip:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}
.modal-content {
  border-radius: var(--es-radius);
  border: 1px solid var(--es-border);
}

/* Soft status badges */
.badge.badge-soft-accent {
  background: var(--es-accent-soft);
  color: var(--es-accent);
}
.badge.badge-soft-success {
  background: var(--es-success-soft);
  color: var(--es-success);
}
.badge.badge-soft-warning {
  background: var(--es-warning-soft);
  color: var(--es-warning);
}
.badge.badge-soft-danger {
  background: var(--es-danger-soft);
  color: var(--es-danger);
}
.badge.badge-soft-muted {
  background: var(--es-surface-2);
  color: var(--es-muted);
  border: 1px solid var(--es-border);
}
/* MVC renders an empty red summary box even when there are no errors — hide it */
.validation-summary-valid {
  display: none !important;
}

/* Toggle pills — checkbox styled as a selectable chip (used by Custom fields) */
.toggle-chip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  margin: 0;
}
.toggle-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-chip .chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--es-border);
  background: var(--es-surface-2);
  color: var(--es-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.toggle-chip .chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--es-muted);
  opacity: 0.35;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.toggle-chip input:checked ~ .chip {
  background: var(--es-accent-soft);
  border-color: var(--es-accent);
  color: var(--es-accent);
}
.toggle-chip input:checked ~ .chip::before {
  background: var(--es-accent);
  opacity: 1;
}
.toggle-chip input:focus-visible ~ .chip {
  box-shadow: 0 0 0 0.25rem var(--es-accent-soft);
}

@media (min-width: 992px) {
  .role-access-panel {
    position: sticky;
    top: 5.5rem;
  }
}

.role-permission-list {
  display: grid;
  gap: 0.65rem;
}
.role-permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--es-border);
  font-size: 0.875rem;
}
.role-permission-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.role-permission-badge {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.role-permission-badge.is-write {
  background: rgba(var(--bs-success-rgb), 0.12);
  color: var(--bs-success-text-emphasis);
}
.role-permission-badge.is-read {
  background: var(--es-accent-soft);
  color: var(--es-accent);
}
.role-permission-badge.is-none {
  background: var(--bs-tertiary-bg);
  color: var(--bs-secondary-color);
}

/* Choice cards — checkbox styled as a selectable card (used by Desktop scan display) */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.choice-card {
  position: relative;
  display: block;
  cursor: pointer;
  margin: 0;
}
.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-card .choice-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--es-border);
  background: var(--es-surface);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  height: 100%;
}
.choice-card .choice-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--es-border);
  color: transparent;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.choice-card .choice-text strong {
  display: block;
  font-size: 0.95rem;
}
.choice-card .choice-text small {
  color: var(--es-muted);
}
.choice-card input:checked ~ .choice-inner {
  border-color: var(--es-accent);
  background: var(--es-accent-soft);
}
.choice-card input:checked ~ .choice-inner .choice-check {
  background: var(--es-accent);
  border-color: var(--es-accent);
  color: var(--es-accent-contrast);
}
.choice-card input:focus-visible ~ .choice-inner {
  box-shadow: 0 0 0 0.25rem var(--es-accent-soft);
}

/* Keyboard hint chip */
.key-hint {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  border: 1px solid var(--es-border);
  background: var(--es-surface);
  font-family: Consolas, monospace;
  font-size: 0.8rem;
  color: var(--es-muted);
}

/* Custom-fields row */
.field-row .field-name {
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}
.field-row .field-row-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Legacy badge class emitted by scanner scripts — keep theme-aware */
.badge.text-bg-light {
  background-color: var(--es-surface-2) !important;
  color: var(--es-muted) !important;
  border: 1px solid var(--es-border);
}

/* Shared page furniture */
.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
  color: var(--es-muted);
  margin-bottom: 0.75rem;
}
.back-link:hover {
  color: var(--es-accent);
}
.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--es-accent-soft);
  color: var(--es-accent);
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-circle.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.4rem;
}
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--es-muted);
}
.empty-state .bi {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 12px;
  opacity: 0.6;
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.stat-tile {
  background: var(--es-surface-2);
  border: 1px solid var(--es-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat-tile span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--es-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-tile strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.upload-zone {
  border: 2px dashed var(--es-border);
  border-radius: var(--es-radius);
  padding: 32px;
  text-align: center;
  background: var(--es-surface-2);
  transition: border-color 0.15s ease;
}
.upload-zone:hover,
.upload-zone:focus-within {
  border-color: var(--es-accent);
}
.upload-zone .bi {
  font-size: 2rem;
  color: var(--es-accent);
}
.settings-list .settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--es-border);
}
.settings-list .settings-row:last-child {
  border-bottom: 0;
}
.settings-row .settings-text {
  flex: 1;
  min-width: 0;
}
.settings-row .settings-text strong {
  display: block;
}
.settings-row .settings-text small {
  color: var(--es-muted);
}
.card .table > :not(caption) > * > :first-child {
  padding-left: 0.85rem;
}
.card .table > :not(caption) > * > :last-child {
  padding-right: 0.85rem;
}
.card .table tbody td {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.ticket-type-row + .ticket-type-row {
  margin-top: 0.85rem;
}

.ticket-type-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.ticket-type-summary span {
  color: #8297bb;
  font-size: 0.82rem;
  white-space: nowrap;
}

.ticket-type-card .progress {
  height: 0.55rem;
}

.ticket-type-card .progress-bar {
  background-color: #2fb9c2;
}

.card-body.p-4 {
  padding: 1.1rem !important;
}

.card-header.p-3,
.card-footer.p-3 {
  padding: 0.75rem 1rem !important;
}

/* ============================================================
   Navbar
   ============================================================ */
.app-navbar {
  position: relative;
  isolation: isolate;
  border-bottom: 1px solid var(--es-border);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
/* Blur lives on a pseudo-element, not on .app-navbar itself, so the nav
   doesn't become a position:fixed containing block for the offcanvas menu.
   z-index:-1 (scoped by isolation:isolate above) keeps it behind the real
   nav content while still layering over page content scrolling underneath. */
.app-navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--es-surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.app-navbar .navbar-brand {
  color: var(--es-text);
  letter-spacing: -0.02em;
}
.brand-logo {
  height: 32px;
  width: auto;
}
.brand-logo-lg {
  height: 44px;
}
.brand-logo-dark {
  display: none;
}
[data-bs-theme="dark"] .brand-logo-light {
  display: none;
}
[data-bs-theme="dark"] .brand-logo-dark {
  display: inline-block;
}
.app-navbar .nav-link {
  color: var(--es-muted);
  font-weight: 600;
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
  color: var(--es-text);
  background: var(--es-surface-2);
}
.app-navbar .nav-link.active {
  color: var(--es-accent);
  background: var(--es-accent-soft);
}
.app-navbar .dropdown-menu {
  border: 1px solid var(--es-border);
  border-radius: 12px;
  box-shadow: var(--es-shadow-lg);
  padding: 0.4rem;
}
.app-navbar .dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
}
.offcanvas {
  background: var(--es-surface);
  color: var(--es-text);
  border-color: var(--es-border);
}
.offcanvas-header {
  border-bottom: 1px solid var(--es-border);
}
.offcanvas-body #primary-navigation {
  gap: 0.25rem;
}
.offcanvas-body #primary-navigation > .nav-item {
  width: 100%;
}
.offcanvas-body form.d-flex {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--es-border);
}
.offcanvas-body form.d-flex .btn {
  width: 100%;
}
/* offcanvas-lg turns the drawer into a normal inline navbar section at
   >=992px, so the "expand dropdown inline" styling below must stay scoped
   to the actual off-canvas (mobile) presentation, or it also clobbers the
   floating desktop dropdowns (Scan/Reports/Administration). */
@media (max-width: 991.98px) {
  .offcanvas-body .dropdown-menu {
    position: static !important;
    width: 100%;
    margin: 0.25rem 0 !important;
    box-shadow: none;
    background: var(--es-surface-2);
    transform: none !important;
  }
}
/* Administration menu: the groups sit in column wrappers for the desktop
   layout. On mobile the wrappers are flattened (display: contents) and the
   groups are put back into their original order with CSS order, separated
   by a divider line just like the previous single-column list. */
.admin-menu-column {
  list-style: none;
}
@media (max-width: 991.98px) {
  .app-navbar .admin-mega-menu.show {
    display: flex;
    flex-direction: column;
  }
  .admin-menu-column {
    display: contents;
  }
  .admin-menu-group:not(.admin-menu-group-first) {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bs-dropdown-divider-bg);
  }
  .admin-menu-group-access { order: 1; }
  .admin-menu-group-event-setup { order: 2; }
  .admin-menu-group-display { order: 3; }
  .admin-menu-group-communication { order: 4; }
  .admin-menu-group-system { order: 5; }
}
@media (min-width: 992px) {
  .app-navbar .admin-mega-menu.show {
    display: flex;
    align-items: stretch;
    padding: 0.5rem;
  }
  .admin-menu-column {
    min-width: 14.5rem;
    padding: 0 0.35rem;
  }
  .admin-menu-column + .admin-menu-column {
    border-left: 1px solid var(--es-border);
  }
  .admin-menu-group + .admin-menu-group {
    margin-top: 0.75rem;
  }
  .offcanvas-body #primary-navigation > .nav-item {
    width: auto;
  }
  .offcanvas-body form.d-flex {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .offcanvas-body form.d-flex .btn {
    width: auto;
  }
}
.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--es-border);
  background: var(--es-surface);
  color: var(--es-text);
  font-size: 1.05rem;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover {
  background: var(--es-surface-2);
  transform: translateY(-1px);
}
.theme-icon-light {
  display: none;
}
[data-bs-theme="dark"] .theme-icon-light {
  display: inline;
}
[data-bs-theme="dark"] .theme-icon-dark {
  display: none;
}
.app-footer {
  border-top: 1px solid var(--es-border);
  color: var(--es-muted);
}

/* ============================================================
   Login
   ============================================================ */
.login-shell {
  min-height: 75vh;
  display: grid;
  place-items: center;
}
.login-shell .card {
  width: min(100%, 440px);
}
.login-shell .brand-logo {
  height: 40px;
}

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--es-surface);
  border: 1px solid var(--es-border);
  color: var(--es-muted);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--es-shadow);
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--es-muted);
  flex-shrink: 0;
}
.live-pill.is-live .live-dot {
  background: var(--es-success);
  animation: es-pulse 2s ease-out infinite;
}
@keyframes es-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--es-success-soft);
  }
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* Hero attendance card */
.hero-card {
  background: var(--es-surface);
  border: 1px solid var(--es-border);
  border-radius: var(--es-radius);
  box-shadow: var(--es-shadow-lg);
  padding: 28px;
  height: 100%;
}

/* Attendance donut gauge */
.donut-wrap {
  position: relative;
  width: min(250px, 68vw);
}
.donut {
  width: 100%;
  height: auto;
  transform: rotate(-90deg);
}
.donut-track {
  fill: none;
  stroke: var(--es-surface-2);
  stroke-width: 18;
}
.donut-value {
  fill: none;
  stroke: url(#donutGrad);
  stroke-width: 18;
  stroke-linecap: round;
  stroke-dasharray: 527.79;
  stroke-dashoffset: 527.79;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 0.8, 0.36, 1);
}
.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.donut-percent {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.donut-percent small {
  font-size: 0.45em;
  font-weight: 700;
  color: var(--es-muted);
}
.donut-caption {
  color: var(--es-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* Live check-in pulse chart */
.pulse-stage {
  position: relative;
  min-height: 150px;
}
.pulse-chart {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
.pulse-bar {
  flex: 1;
  min-width: 4px;
  background: linear-gradient(180deg, var(--es-accent), var(--es-success));
  border-radius: 4px 4px 2px 2px;
  transition: height 0.4s ease;
}
.pulse-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
}
.scan-activity-stage {
  min-height: 250px;
  overflow-x: auto;
  overflow-y: hidden;
}
.scan-activity-chart {
  height: 250px;
  min-width: 760px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-top: 12px;
}
.scan-activity-column {
  flex: 1;
  min-width: 44px;
  display: grid;
  grid-template-rows: 22px 1fr 48px;
  gap: 6px;
  text-align: center;
}
.scan-activity-column strong {
  font-size: 0.78rem;
  color: #8fa8ce;
}
.scan-activity-track {
  position: relative;
  min-height: 150px;
  border-bottom: 1px solid #30415e;
}
.scan-activity-bar {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #21c1c9, #2fc49d);
  transition: height 700ms cubic-bezier(0.22, 0.8, 0.36, 1);
}
.scan-activity-column small {
  font-size: 0.62rem;
  line-height: 1.15;
  color: #8fa8ce;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  justify-self: center;
}
.hero-split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.hero-split .stat {
  background: var(--es-surface-2);
  border: 1px solid var(--es-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.hero-split .stat span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--es-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hero-split .stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.hero-split .stat.success strong {
  color: var(--es-success);
}

/* KPI cards */
.metric-card {
  height: 100%;
  background: var(--es-surface);
  border: 1px solid var(--es-border);
  border-radius: var(--es-radius);
  padding: 20px;
  box-shadow: var(--es-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--es-shadow-lg);
}
.metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.25rem;
  background: var(--es-surface-2);
  color: var(--es-muted);
  flex-shrink: 0;
}
.metric-card span.metric-label {
  display: block;
  color: var(--es-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.metric-card strong {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.metric-card .metric-caption {
  color: var(--es-muted);
  font-size: 0.8rem;
  margin-top: auto;
}
.metric-card.accent .metric-icon {
  background: var(--es-accent-soft);
  color: var(--es-accent);
}
.metric-card.success .metric-icon {
  background: var(--es-success-soft);
  color: var(--es-success);
}
.metric-card.success strong {
  color: var(--es-success);
}
.metric-card.warning .metric-icon {
  background: var(--es-warning-soft);
  color: var(--es-warning);
}
.metric-card.warning strong {
  color: var(--es-warning);
}
.metric-card.danger .metric-icon {
  background: var(--es-danger-soft);
  color: var(--es-danger);
}
.metric-card.danger strong {
  color: var(--es-danger);
}
.metric-card.info .metric-icon {
  background: var(--es-info-soft);
  color: var(--es-info);
}
.section-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--es-muted);
  margin: 1.75rem 0 0.9rem;
}

/* ============================================================
   Scanner / shared modules
   ============================================================ */
.scanner-shell {
  max-width: 1200px;
  margin: auto;
}
.scan-input {
  font-size: 1.3rem;
  padding: 0.8rem 1rem;
  border: 2px solid var(--es-accent);
  border-radius: 12px;
  background: var(--es-surface);
  color: var(--es-text);
}
.station-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--es-border);
}
.station-row .form-label {
  color: var(--es-muted);
}
.station-row .form-control,
.station-row .form-select {
  max-width: 260px;
  flex: 1 1 160px;
}
.scanner-inline-result {
  min-height: 120px;
}
.badge-preview-body {
  min-height: 235px;
  height: 235px;
  display: grid;
  place-items: center;
  background: #e9ecef;
  overflow: hidden;
}
.badge-preview-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}
.result-panel {
  position: relative;
  min-height: 330px;
  border-radius: var(--es-radius);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  background: var(--es-surface-2);
  border: 1px solid var(--es-border);
  color: var(--es-muted);
}
.result-state-marker {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #9f1d2b;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mobile-result-state-marker {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #b83c48;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.result-panel.success {
  background: #09795c;
  border-color: #09795c;
  color: #fff;
}
.result-panel.warning {
  background: #b26b00;
  border-color: #b26b00;
  color: #fff;
}
.result-panel.danger {
  background: #b83c48;
  border-color: #b83c48;
  color: #fff;
}
.result-status {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}
.result-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
  opacity: 0.7;
}
.result-badge {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 10px;
}
.result-panel .result-fields {
  max-width: 460px;
  margin: 16px auto 0;
  width: 100%;
}
.result-field,
.mobile-field {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  text-align: left;
}
.camera-frame {
  position: relative;
  background: #101820;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 3/4;
  max-height: 48vh;
}
.camera-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.camera-guide {
  position: absolute;
  inset: 20%;
  border: 3px solid #fff;
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25);
}
.mobile-scanner {
  max-width: 560px;
  margin: auto;
}
.mobile-search {
  height: 85vh !important;
  max-height: 85dvh;
  border-radius: 20px 20px 0 0;
}
.mobile-status {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: auto;
  color: white;
  font-size: 4rem;
  font-weight: 900;
}
.mobile-status.success {
  background: #15946c;
}
.mobile-status.warning {
  background: #ef9b0f;
}
.mobile-status.danger {
  background: #d64c4c;
}
.mobile-field {
  border-color: var(--es-border);
}
.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 40px;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}
.bar-row div {
  height: 18px;
  background: var(--es-surface-2);
  border-radius: 9px;
  overflow: hidden;
}
.bar-row i {
  display: block;
  height: 100%;
  background: var(--es-accent);
}
.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--es-muted);
}
.registrant-directory .table-responsive {
  min-height: 260px;
}
.registrant-directory td {
  vertical-align: middle;
}
.registrant-directory .card-footer {
  min-height: 58px;
}

/* Badge management */
.badge-section-icon,
.badge-file-icon {
  display: grid;
  place-items: center;
  color: var(--es-accent);
  background: var(--es-accent-soft);
  border-radius: 12px;
}
.badge-section-icon { width: 44px; height: 44px; font-size: 1.35rem; }
.badge-file-icon { width: 42px; height: 42px; flex: 0 0 42px; font-size: 1.2rem; }
.badge-template-row { transition: background-color 140ms ease; }
.badge-template-row:hover { background: var(--bs-tertiary-bg); }
.badge-mapping-list { max-height: calc(100vh - 330px); overflow-y: auto; }
.badge-mapping-row + .badge-mapping-row { border-top: 1px solid var(--es-border); }
.badge-mapping-controls .select2-container { display: block; }
.badge-editor .select2-container--default .select2-selection--single {
  height: 38px;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
}
.badge-editor .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--bs-body-color);
  line-height: 36px;
  padding-left: 12px;
  padding-right: 34px;
}
.badge-editor .select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; right: 6px; }
.badge-editor .select2-container--default.select2-container--focus .select2-selection--single,
.badge-editor .select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--es-accent);
  box-shadow: 0 0 0 0.25rem var(--es-accent-soft);
}
.select2-dropdown {
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
  background: var(--bs-body-bg);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
  border-radius: var(--bs-border-radius-sm);
  background: var(--bs-body-bg);
}
.select2-container--default .select2-results__option--selected { background: var(--bs-tertiary-bg); }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--es-accent); }
.select2-container--default .select2-selection--single .select2-selection__clear {
  color: var(--bs-secondary-color);
  height: 36px;
  margin-right: 24px;
}
.configuration-tooltip { --bs-tooltip-max-width: 380px; }
.configuration-tooltip .tooltip-inner { text-align: left; line-height: 1.45; padding: 0.75rem 0.875rem; }
.badge-management-preview iframe { display: block; width: 100%; height: calc(100vh - 255px); min-height: 520px; border: 0; background: #e9ecef; }
.badge-preview-column { position: sticky; top: 88px; }
@media (max-width: 1199.98px) {
  .badge-preview-column { position: static; }
  .badge-mapping-list { max-height: none; }
  .badge-management-preview iframe { height: 620px; min-height: 0; }
}

/* ============================================================
   Responsive & print
   ============================================================ */
@media (max-width: 991px) {
  .hero-split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 767px) {
  main.container-fluid {
    padding-left: 16px;
    padding-right: 16px;
  }
  .metric-card {
    padding: 15px;
  }
  .metric-card strong {
    font-size: 1.55rem;
  }
  .hero-card {
    padding: 20px;
  }
  .scanner-shell h1,
  .mobile-scanner h1 {
    font-size: 2rem;
  }
  .bar-row {
    grid-template-columns: 100px 1fr 30px;
    font-size: 0.75rem;
  }
  .detail-subtitle {
    font-size: 1rem;
  }
  .page-header,
  .dashboard-header {
    align-items: flex-start;
  }
  .page-header .d-flex.gap-2,
  .page-header .d-flex.flex-wrap.gap-2 {
    width: 100%;
  }
  .page-header .btn,
  .dashboard-header .btn {
    flex: 1 1 auto;
  }
}
@media (max-width: 575px) {
  .card-body.p-4 {
    padding: 1rem !important;
  }
  .settings-list .settings-row {
    flex-wrap: wrap;
    padding: 14px 16px;
  }
  .hero-split {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-split .stat:last-child {
    grid-column: 1 / -1;
  }
}
@media print {
  nav,
  footer,
  .scanner-shell > .row > .col-lg-5 {
    display: none !important;
  }
  .result-panel {
    color: #000 !important;
    background: #fff !important;
  }
}

/* ============================================================
   Password reveal toggle
   The wrapper and the button are injected by password-toggle.js.
   ============================================================ */
.password-field {
  position: relative;
}
.password-field > .form-control {
  padding-right: 2.75rem;
}
.password-toggle {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--es-muted);
  cursor: pointer;
  display: flex;
  height: 2rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  background-color: var(--es-accent-soft);
  color: var(--es-accent);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--es-accent);
  outline-offset: 1px;
}
/* Face enrolment */
.face-enrollment { border: 1px solid var(--bs-border-color); border-radius: 1rem; padding: 1.5rem; background: color-mix(in srgb, var(--bs-body-bg) 92%, var(--bs-primary) 8%); }
.face-preview { min-height: 19rem; border: 1px dashed var(--bs-border-color); border-radius: .875rem; overflow: hidden; background: rgba(127,127,127,.06); display: grid; place-items: center; }
.face-preview video, .face-preview img { width: 100%; height: 19rem; object-fit: cover; }
/* The capture dialog's viewport. Fixed height so swapping between the live feed and the
   still it produced does not make the dialog jump. */
.face-stage { position: relative; border-radius: .875rem; overflow: hidden; background: #000; display: grid; place-items: center; }
.face-stage video, .face-stage img { width: 100%; height: 26rem; object-fit: contain; display: block; }
@media (max-width: 575.98px) { .face-stage video, .face-stage img { height: 18rem; } }
.face-enrollment .btn:focus-visible, .face-enrollment .form-control:focus-visible, .face-enrollment .form-select:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
@media (max-width: 575.98px) { .face-enrollment { padding: 1rem; } .face-preview, .face-preview video, .face-preview img { min-height: 15rem; height: 15rem; } }

/* Face enrolment audit dialog */
.face-status-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  transition: box-shadow 150ms ease, transform 100ms ease;
}
.face-status-trigger:hover .badge { filter: brightness(.95); }
.face-status-trigger:active { transform: scale(.97); }
.face-status-trigger:focus-visible { outline: 2px solid var(--es-accent); outline-offset: 3px; }
.face-history-dialog { max-width: 58rem; }
.face-history-modal { border: 1px solid var(--bs-border-color); border-radius: 1rem; box-shadow: 0 24px 56px rgba(15, 23, 42, .2); overflow: hidden; }
.face-history-modal .modal-header { align-items: flex-start; padding: 1.25rem 1.5rem; }
.face-history-modal .modal-body { background: color-mix(in srgb, var(--bs-body-bg) 96%, var(--bs-primary) 4%); padding: 1.5rem; }
.face-history-modal .modal-footer { padding: .875rem 1.5rem; }
.face-history-summary { align-items: center; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .875rem; display: flex; gap: 1.5rem; justify-content: space-between; padding: 1.25rem; }
.face-history-kicker { color: var(--es-muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; margin: 0 0 .5rem; text-transform: uppercase; }
.face-history-retry { align-items: center; display: flex; flex-wrap: wrap; gap: .625rem; margin-top: .875rem; }
.face-history-retry .btn { min-height: 36px; }
.face-history-retry .btn:focus-visible { outline: 2px solid var(--es-accent); outline-offset: 2px; }
.face-history-facts { display: grid; gap: .5rem; grid-template-columns: repeat(3, minmax(7rem, 1fr)); }
.face-history-facts div { border-left: 1px solid var(--bs-border-color); padding-left: 1rem; }
.face-history-facts dt, .face-history-meta dt { color: var(--es-muted); font-size: .72rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.face-history-facts dd { font-size: .9rem; font-weight: 700; margin: .125rem 0 0; }
.face-history-section { margin-top: 1.5rem; }
.face-history-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: .75rem; }
.face-history-heading h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.face-history-heading p { color: var(--es-muted); font-size: .82rem; margin: .2rem 0 0; }
.face-history-count { align-items: center; background: var(--es-accent-soft); border-radius: 999px; color: var(--es-accent); display: inline-flex; font-size: .75rem; font-weight: 700; height: 1.75rem; justify-content: center; min-width: 1.75rem; padding: 0 .5rem; }
.face-history-timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; position: relative; }
.face-history-timeline::before { background: var(--bs-border-color); bottom: 1.25rem; content: ""; left: .3rem; position: absolute; top: 1.25rem; width: 1px; }
.face-history-event { padding: 0 0 .75rem 1.25rem; position: relative; }
.face-history-event:last-child { padding-bottom: 0; }
.face-history-marker { background: var(--bs-secondary); border: 3px solid var(--bs-body-bg); border-radius: 50%; height: .75rem; left: -.05rem; position: absolute; top: 1.15rem; width: .75rem; z-index: 1; }
.face-history-marker--success { background: var(--bs-success); }
.face-history-marker--danger { background: var(--bs-danger); }
.face-history-marker--accent { background: var(--es-accent); }
.face-history-event-card, .face-template-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: 1rem; }
.face-history-event-top { align-items: center; display: flex; gap: 1rem; justify-content: space-between; }
.face-history-meta { display: grid; gap: .75rem 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .875rem; }
.face-history-meta dd { font-size: .84rem; margin: .15rem 0 0; overflow-wrap: anywhere; }
.face-history-error, .face-history-load-error { align-items: flex-start; background: color-mix(in srgb, var(--bs-danger-bg-subtle) 88%, transparent); border: 1px solid var(--bs-danger-border-subtle); border-radius: .625rem; color: var(--bs-danger-text-emphasis); display: flex; gap: .625rem; margin-top: .875rem; padding: .75rem; }
.face-history-id { color: var(--es-muted); display: block; font-size: .68rem; margin-top: .75rem; overflow-wrap: anywhere; }
.face-template-list { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.face-history-empty, .face-history-loading { align-items: center; background: var(--bs-body-bg); border: 1px dashed var(--bs-border-color); border-radius: .75rem; color: var(--es-muted); display: flex; gap: .625rem; justify-content: center; min-height: 5rem; padding: 1rem; text-align: center; }
.face-history-note { align-items: flex-start; color: var(--es-muted); display: flex; font-size: .8rem; gap: .625rem; margin-top: 1.25rem; }
.face-history-note p { margin: 0; }
@media (max-width: 767.98px) {
  .face-history-modal .modal-body { padding: 1rem; }
  .face-history-summary { align-items: stretch; flex-direction: column; }
  .face-history-facts { grid-template-columns: 1fr; }
  .face-history-facts div { border-left: 0; border-top: 1px solid var(--bs-border-color); padding-left: 0; padding-top: .5rem; }
  .face-history-meta, .face-template-list { grid-template-columns: 1fr; }
}
/* Read-only authorization state */
.admin-read-only-notice {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border: 1px solid rgba(var(--bs-info-rgb), .35);
    border-radius: .75rem;
    background: rgba(var(--bs-info-rgb), .08);
    color: var(--bs-body-color);
}
.admin-read-only-notice small { display: block; margin-top: .125rem; color: var(--bs-secondary-color); }
.admin-read-only-icon { display: grid; flex: 0 0 2.25rem; width: 2.25rem; height: 2.25rem; place-items: center; border-radius: 50%; background: rgba(var(--bs-info-rgb), .16); color: var(--bs-info); }
main[data-admin-read-only="true"] form[aria-disabled="true"] { opacity: .72; }
main[data-admin-read-only="true"] form[aria-disabled="true"] :disabled { cursor: not-allowed; }

/* Info tip opening to the right, for tips near the left edge of a card */
.registration-info-tip--start::after {
  left: 0;
  right: auto;
}

/* Kiosk full screen and staff password under the Kiosk Scan option in Administration settings */
.kiosk-reset-setting {
  margin: 0.875rem 0 0 2.25rem;
  padding: 0.875rem 1rem 1rem;
  max-width: 36rem;
  border: 1px solid var(--es-border);
  border-radius: 12px;
  background: var(--es-surface-2);
}
.kiosk-setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.kiosk-setting-row__text {
  min-width: 0;
}
.kiosk-setting-row .form-switch .form-check-input {
  width: 2.5em;
  height: 1.35em;
  margin: 0.1rem 0 0;
  cursor: pointer;
}
.kiosk-setting-divider {
  margin: 0.875rem 0;
  border-color: var(--es-border);
  opacity: 1;
}
@media (max-width: 575.98px) {
  .kiosk-reset-setting {
    margin-left: 0;
  }
}

/* ============================================================
   Registration form (create and edit)
   Two columns on large screens: grouped sections on the left,
   a sticky summary, section navigation and actions on the right.
   ============================================================ */
.registration-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 992px) {
  .registration-layout {
    grid-template-columns: minmax(0, 1fr) 18.5rem;
  }
}
.registration-main {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

/* Section cards */
.form-section {
  box-shadow: var(--es-shadow);
  scroll-margin-top: 6rem;
}
.form-section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--es-border);
}
.form-section-icon {
  display: grid;
  place-items: center;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--es-accent-soft);
  color: var(--es-accent);
  font-size: 1.05rem;
}
.form-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--es-text);
}
.form-section-description {
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0.2rem 0 0;
  color: var(--es-muted);
  max-width: 60ch;
}
.form-section-body {
  padding: 1.25rem 1.5rem 1.5rem;
  margin: 0;
}
.form-section-body.row {
  --bs-gutter-x: 1rem;
}
.registration-form .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--es-text);
  margin-bottom: 0.35rem;
}
.registration-form .form-control,
.registration-form .form-select {
  min-height: 2.625rem;
  border-color: var(--es-border);
  border-radius: 10px;
}
.registration-form .form-control[readonly] {
  background-color: var(--es-surface-2);
  color: var(--es-muted);
}
.registration-form .form-control[aria-invalid="true"],
.registration-form .form-select[aria-invalid="true"] {
  border-color: var(--es-danger);
}
.registration-form .form-text {
  font-size: 0.78rem;
  margin-top: 0.3rem;
}
.required-mark {
  color: var(--es-danger);
  margin-left: 0.2rem;
}

/* Label and description on the left, switch on the right */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--es-border);
  border-radius: 12px;
  background: var(--es-surface-2);
}
.setting-row-text {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  cursor: pointer;
}
.setting-row-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--es-text);
}
.setting-row-description {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--es-muted);
}
.setting-row .form-check-input {
  width: 2.5rem;
  height: 1.35rem;
  margin: 0;
  cursor: pointer;
}

/* Session checkboxes as selectable cards */
.session-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.625rem;
}
.session-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--es-border);
  border-radius: 12px;
  background: var(--es-surface);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.session-option:hover {
  border-color: color-mix(in srgb, var(--es-accent) 45%, var(--es-border));
}
.session-option:has(.form-check-input:checked) {
  border-color: var(--es-accent);
  background: var(--es-accent-soft);
}
.session-option:has(.form-check-input:focus-visible) {
  outline: 2px solid var(--es-accent);
  outline-offset: 2px;
}
.session-option .form-check-input {
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.session-option-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.session-option-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--es-text);
}
.session-option-description {
  font-size: 0.78rem;
  color: var(--es-muted);
}

/* Ticket payment details */
.ticket-payment-panel {
  --bs-gutter-x: 1rem;
  margin: 0;
  padding: 1rem 1rem 1.125rem;
  border: 1px dashed var(--es-border);
  border-radius: 12px;
  background: var(--es-surface-2);
}
.ticket-payment-panel .form-control,
.ticket-payment-panel .form-select {
  background-color: var(--es-surface);
}

/* Face enrolment inside the section card */
.face-status-note {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  background: var(--es-info-soft);
  color: var(--es-text);
  font-size: 0.85rem;
}
.face-status-note > .bi {
  color: var(--es-info);
  margin-top: 0.1rem;
}
.face-status-note.is-warning {
  background: var(--es-warning-soft);
}
.face-status-note.is-warning > .bi {
  color: var(--es-warning);
}
.registration-form .face-preview {
  border-color: var(--es-border);
  background: var(--es-surface-2);
}
.face-tips {
  list-style: none;
  margin: 0.875rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--es-muted);
}
.face-tips .bi {
  color: var(--es-success);
  margin-right: 0.4rem;
}

/* Sidebar */
.registration-aside-inner {
  display: grid;
  gap: 1rem;
}
@media (min-width: 992px) {
  .registration-aside-inner {
    position: sticky;
    top: 6rem;
  }
}
.registration-summary {
  padding: 1.125rem;
  box-shadow: var(--es-shadow);
}
.registration-summary-identity {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.registration-summary-text {
  min-width: 0;
}
.registration-summary-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.registration-summary-serial {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0.15rem 0 0;
  color: var(--es-accent);
}
.registration-summary-facts {
  display: grid;
  gap: 0.625rem;
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--es-border);
}
.registration-summary-facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.registration-summary-facts dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--es-muted);
}
.registration-summary-facts dd {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  text-align: right;
}
.section-nav {
  display: grid;
  gap: 0.125rem;
  padding: 0.75rem;
  box-shadow: var(--es-shadow);
}
.section-nav-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--es-muted);
  margin: 0.25rem 0.5rem 0.5rem;
}
.section-nav a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--es-muted);
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.section-nav a:hover {
  background: var(--es-surface-2);
  color: var(--es-text);
}
.section-nav a.active {
  background: var(--es-accent-soft);
  color: var(--es-accent);
  font-weight: 600;
}
.section-nav a:focus-visible {
  outline: 2px solid var(--es-accent);
  outline-offset: 1px;
}
.registration-actions {
  display: grid;
  gap: 0.5rem;
}
.registration-actions .btn-lg {
  font-size: 1rem;
  padding-block: 0.7rem;
}
@media (max-width: 991.98px) {
  /* Let the action bar stick against the whole form, not just the sidebar box. */
  .registration-aside,
  .registration-aside-inner {
    display: contents;
  }
  .registration-summary,
  .section-nav {
    display: none;
  }
  .registration-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    grid-template-columns: 1fr auto;
    padding: 0.75rem;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    background: var(--es-surface);
    box-shadow: var(--es-shadow-lg);
  }
}
@media (max-width: 575.98px) {
  .form-section-header {
    padding: 1rem 1rem 0.875rem;
  }
  .form-section-body {
    padding: 1rem 1rem 1.25rem;
  }
  .form-section-description {
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .session-option,
  .section-nav a {
    transition: none;
  }
}
