/* ============================================================
   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);
}
.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;
  }
}

/* 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-light {
  display: none;
}
[data-bs-theme="dark"] .brand-logo-light {
  display: inline-block;
}
[data-bs-theme="dark"] .brand-logo-dark {
  display: none;
}
.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;
  }
}
@media (min-width: 992px) {
  .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);
}
/* ============================================================
   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: 205px;
}
.badge-preview-body {
  min-height: min(500px, 60vh);
  display: grid;
  place-items: center;
  background: #e9ecef;
}
.badge-preview-body iframe {
  width: 100%;
  height: min(500px, 60vh);
  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;
}

/* ============================================================
   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;
}
