/**
 * BHSST E-OFFICE — COMPONENT STYLES (components.css) [S2 — Enterprise Edition]
 * Reusable UI components: Buttons, inputs, cards, tables, badges, modals, PIN dialogs, toasts, stage trackers.
 */

@import "./office-mode.css";

/* ============================================================
   1. ENTERPRISE HEADER & NAVIGATION BAR
   ============================================================ */

/* Government Utility Banner — Hidden as commanded to maximize vertical viewport */
.gov-banner {
  display: none !important;
}

/* Main Application Header — Ultra-Sleek Enterprise Control Bar */
.app-header {
  background-color: var(--color-header-bg);
  border-bottom: 1.5px solid var(--color-header-border);
  box-shadow: 0 2px 10px var(--color-header-accent-glow), 0 2px 6px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Global Institutional Footer */
.app-footer {
  background-color: var(--color-header-bg);
  color: #cbd5e1;
  padding: var(--space-4) 0;
  font-size: 0.78rem;
  border-top: 2px solid var(--color-header-border);
  box-shadow: 0 -4px 20px var(--color-header-accent-glow);
  margin-top: auto;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.app-footer .footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.app-footer .footer-highlight {
  color: var(--color-header-accent);
  font-weight: var(--font-weight-semibold);
}

.navbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  width: 100%;
  padding: 0 var(--space-3);
}

/* Brand */
.brand-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.brand-crest {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: brightness(1.1) drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

.hero-official-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto var(--space-4);
  filter: drop-shadow(0 2px 8px rgba(15, 23, 42, 0.2));
}

.cert-header-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.1));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: var(--font-weight-bold);
  color: #f1f5f9;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item a:not(.nav-public-btn):not(.btn) {
  color: var(--color-header-text-muted);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-item a:not(.nav-public-btn):not(.btn):hover,
.nav-item a:not(.nav-public-btn):not(.btn).active {
  color: #f1f5f9;
  background-color: rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

/* Active standard nav item */
.nav-item a:not(.nav-public-btn):not(.btn).active {
  font-weight: var(--font-weight-semibold);
  color: #e0e7ff;
  box-shadow: inset 0 -2px 0 var(--color-secondary);
}

/* ==========================================================================
   Uniform Public Navigation Buttons (Enterprise Header)
   ========================================================================== */
.nav-public-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 6px 14px !important;
  font-family: var(--font-sans) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  border-radius: var(--radius-md) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  letter-spacing: 0.01em !important;
}

.nav-public-btn .nav-btn-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.nav-public-btn .nav-btn-caret {
  font-size: 0.6rem;
  margin-left: 2px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

/* Hover state */
.nav-public-btn:hover {
  background-color: rgba(79, 70, 229, 0.18) !important;
  color: #e0e7ff !important;
  border-color: rgba(79, 70, 229, 0.4) !important;
  text-decoration: none !important;
}

.nav-public-btn:hover .nav-btn-caret {
  transform: translateY(1px);
  opacity: 1;
}

/* Active state */
.nav-public-btn.active {
  background-color: var(--color-secondary) !important;
  color: #ffffff !important;
  border-color: var(--color-secondary-dark) !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.35) !important;
}

.nav-public-btn.active .nav-btn-caret {
  color: rgba(255,255,255,0.8) !important;
  opacity: 0.9;
}

.nav-public-btn.active:hover {
  background-color: var(--color-secondary-light) !important;
  color: #ffffff !important;
  border-color: var(--color-secondary-light) !important;
}

/* Dropdown styling */
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: #1e293b;
  border: 1px solid rgba(79, 70, 229, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(79,70,229,0.1);
  z-index: 1000;
  padding: 4px;
  list-style: none;
  margin: 0;
  animation: navDropdownFade 0.15s ease-out;
}

@keyframes navDropdownFade {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-dropdown-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 12px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: #cbd5e1 !important;
  text-decoration: none !important;
  border-radius: var(--radius-md) !important;
  transition: all 0.12s ease !important;
  letter-spacing: 0.01em !important;
}

.nav-dropdown-item:hover {
  background-color: rgba(79, 70, 229, 0.2) !important;
  color: #e0e7ff !important;
}

.dropdown-item-icon {
  font-size: 1rem;
  line-height: 1;
}

.user-nav-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-4);
  border-left: 1px solid rgba(255,255,255,0.08);
}

/* Top-Right Dropdown Bar & Header Controls (S2 High-End) */
.header-top-right-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.font-size-dropdown-wrapper,
.nav-menu-dropdown-wrapper {
  position: relative;
}

.top-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.top-control-btn:hover,
.top-control-btn[aria-expanded="true"] {
  background: var(--color-secondary-surface);
  border-color: var(--color-header-accent);
  color: var(--color-primary-dark);
  box-shadow: 0 0 16px var(--color-header-accent-glow);
  text-decoration: none;
}

.top-control-caret {
  font-size: 0.65rem;
  transition: transform var(--transition-fast);
  opacity: 0.8;
}

.top-control-btn[aria-expanded="true"] .top-control-caret {
  transform: rotate(180deg);
}

.top-control-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 270px;
  background: var(--color-header-bg);
  border: 1.5px solid var(--color-header-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--color-header-accent-glow);
  padding: 6px;
  z-index: 1000;
  display: none;
  backdrop-filter: blur(16px);
  animation: topDropdownFade 0.15s ease-out;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

@keyframes topDropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.top-control-menu.show {
  display: block;
}

.top-control-menu-header {
  padding: 6px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-control-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  color: #cbd5e1;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.top-control-item:hover {
  background: var(--color-secondary);
  color: #ffffff;
  text-decoration: none;
}

.top-control-item.active {
  background: var(--color-secondary-dark);
  color: #ffffff;
  font-weight: var(--font-weight-bold);
}

.top-control-subitem {
  padding-left: 28px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.top-control-subitem:hover {
  color: #ffffff;
  background: var(--color-secondary);
}

/* ── Sprouting Look & Feel Menu Classes ────────────────────────── */
.sprout-category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  color: #f1f5f9;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  margin-bottom: 4px;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.sprout-category-btn:hover {
  background: rgba(79, 70, 229, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.sprout-category-btn.open {
  background: rgba(79, 70, 229, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
}

.sprout-chevron {
  font-size: 0.72rem;
  transition: transform var(--transition-fast);
  opacity: 0.8;
}

.sprout-category-btn.open .sprout-chevron {
  transform: rotate(90deg);
}

.sprout-sub-menu {
  display: none;
  padding: 4px 0 6px 8px;
  border-left: 2px solid rgba(79, 70, 229, 0.35);
  margin-left: 10px;
  margin-bottom: 6px;
  animation: sproutFade 0.18s ease-out;
}

@keyframes sproutFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.sprout-sub-menu.open {
  display: block;
}

/* Palette Swatch Dot Indicator */
.theme-swatch-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 6px;
}

.theme-swatch-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.theme-swatch-theme-1 .dot-1 { background: #0f172a; }
.theme-swatch-theme-1 .dot-2 { background: #4f46e5; }
.theme-swatch-theme-1 .dot-3 { background: #818cf8; }

.theme-swatch-theme-2 .dot-1 { background: #0b2d59; }
.theme-swatch-theme-2 .dot-2 { background: #0284c7; }
.theme-swatch-theme-2 .dot-3 { background: #38bdf8; }

.theme-swatch-theme-3 .dot-1 { background: #063c2e; }
.theme-swatch-theme-3 .dot-2 { background: #059669; }
.theme-swatch-theme-3 .dot-3 { background: #34d399; }

.theme-swatch-theme-4 .dot-1 { background: #241a12; }
.theme-swatch-theme-4 .dot-2 { background: #d97706; }
.theme-swatch-theme-4 .dot-3 { background: #fbbf24; }

/* ============================================================
   2. BUTTONS — Enterprise Flat System
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.5rem 1.125rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
}

.btn:hover {
  text-decoration: none;
}

/* Primary: Indigo enterprise */
.btn-primary {
  background-color: var(--color-secondary);
  color: #ffffff;
  border-color: var(--color-secondary-dark);
}

.btn-primary:hover {
  background-color: var(--color-secondary-light);
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18), 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* Secondary: Graphite accent */
.btn-secondary {
  background-color: var(--color-primary);
  color: #f8fafc;
  border-color: var(--color-primary-light);
}

.btn-secondary:hover {
  background-color: var(--color-primary-light);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

/* Outline: Clean enterprise ghost */
.btn-outline {
  background-color: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
  background-color: var(--color-surface);
}

.btn-outline:hover {
  background-color: var(--color-surface-alt);
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}

/* Danger: Precise red */
.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #b91c1c;
}

.btn-danger:hover {
  background-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

/* Sizes */
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}

.btn:disabled, .btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Press feedback */
.btn:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: none;
}

/* Loading state */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

/* ============================================================
   3. CARDS & PANELS — Enterprise Precision & High-End Widgets
   ============================================================ */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow-enterprise);
  overflow: hidden;
  margin-bottom: var(--space-5);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: #cbd5e1;
}

.card-header {
  padding: var(--space-4) var(--space-5);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-dark);
  margin: 0;
  letter-spacing: -0.01em;
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-3) var(--space-5);
  background-color: #fafbfc;
  border-top: 1px solid var(--color-border);
}

/* ── Institutional Hero Banner Widget (Executive Header Card) ── */
.widget-hero-card {
  background: var(--hero-card-bg, linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%));
  border: 1.5px solid var(--color-header-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 30px -4px rgba(15, 23, 42, 0.07), 0 0 0 1px var(--color-header-accent-glow);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-4);
  transition: all 0.25s ease;
}

.widget-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--hero-accent-gradient);
}

.widget-hero-card .hero-body {
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.widget-hero-logo {
  height: 66px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.12));
}

.widget-hero-info {
  text-align: left;
}

.widget-hero-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--color-secondary-surface);
  border: 1.5px solid var(--color-secondary);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-secondary-dark);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  transition: all 0.25s ease;
}

.widget-hero-title {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.widget-hero-sub {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin: 3px 0 0 0;
}

/* ── Primary Action Gateway Cards ── */
.gateway-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow-enterprise);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  position: relative;
  overflow: visible;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.gateway-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--color-secondary);
}

.gateway-card-header {
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--card-header-bg, #fafbfc);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  transition: background-color 0.25s ease;
}

.gateway-header-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gateway-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.gateway-student .gateway-icon-badge {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--color-header-accent-glow);
}

.gateway-officer .gateway-icon-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  color: #ffffff;
}

.gateway-admin .gateway-icon-badge {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
  color: #ffffff;
}

.gateway-verify .gateway-icon-badge {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
}

.gateway-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0;
  letter-spacing: -0.01em;
}

.gateway-card-body {
  padding: var(--space-3) var(--space-4);
  font-size: 0.82rem;
  flex: 1;
}

/* Feature Checklist with Custom Micro-Markers */
.widget-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.widget-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  line-height: 1.4;
  font-size: 0.81rem;
}

.widget-checklist-bullet {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
  background: var(--color-secondary-surface);
  color: var(--color-secondary);
  font-weight: 700;
  border: 1px solid var(--color-secondary-light);
  transition: all 0.25s ease;
}

.gateway-card-footer {
  padding: var(--space-3) var(--space-4);
  background: var(--card-header-bg, #fafbfc);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  position: relative;
  overflow: visible;
  transition: background-color 0.25s ease;
}

/* High-End Gateway Action Buttons */
.gateway-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  box-sizing: border-box;
}

.gateway-action-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
  color: #ffffff;
}

.gateway-student .gateway-action-btn {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  box-shadow: 0 4px 12px var(--color-header-accent-glow);
}
.gateway-student .gateway-action-btn:hover {
  box-shadow: 0 6px 18px var(--color-header-accent-glow);
}

.gateway-officer .gateway-action-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
}
.gateway-officer .gateway-action-btn:hover {
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.42);
}

.gateway-admin .gateway-action-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
}
.gateway-admin .gateway-action-btn:hover {
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.42);
}

.gateway-verify .gateway-action-btn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.28);
}
.gateway-verify .gateway-action-btn:hover {
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.42);
}

/* ── Streams Catalog Strip Widget ── */
.streams-strip-widget {
  background: var(--color-surface);
  border: 1.5px solid var(--color-header-border);
  border-left: 5px solid var(--color-secondary);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 4px 16px var(--color-header-accent-glow);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, border-left-color 0.25s ease, background-color 0.25s ease;
}

.stream-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.stream-badge-medical {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.stream-badge-nonmed {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.stream-badge-arts {
  background: #fdf4ff;
  color: #86198f;
  border-color: #f5d0fe;
}

/* ============================================================
   4. FORM CONTROLS — Enterprise Precision
   ============================================================ */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-main);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}

.form-label .required {
  color: #e11d48;
  margin-left: 2px;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-main);
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 1.5;
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-ring);
  outline: none;
}

.form-control:disabled, .form-select:disabled {
  background-color: var(--color-surface-alt);
  cursor: not-allowed;
  opacity: 0.65;
}

.form-text {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin-top: 4px;
  line-height: 1.4;
}

.form-error {
  font-size: var(--text-xs);
  color: #dc2626;
  margin-top: 4px;
}

/* ============================================================
   5. STATUS BADGES — Enterprise Chip Style
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-sm);
  line-height: 1.3;
  border: 1px solid transparent;
  letter-spacing: 0.015em;
  font-family: var(--font-sans);
}

/* Status dot before content */
.badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
  border-color: var(--status-pending-border);
}
.badge-pending::before { background-color: var(--status-pending-dot); }

.badge-verification {
  background-color: var(--status-verification-bg);
  color: var(--status-verification-text);
  border-color: var(--status-verification-border);
}
.badge-verification::before { background-color: var(--status-verification-dot); }

.badge-verified {
  background-color: var(--status-verified-bg);
  color: var(--status-verified-text);
  border-color: var(--status-verified-border);
}
.badge-verified::before { background-color: var(--status-verified-dot); }

.badge-rejected {
  background-color: var(--status-rejected-bg);
  color: var(--status-rejected-text);
  border-color: var(--status-rejected-border);
}
.badge-rejected::before { background-color: var(--status-rejected-dot); }

.badge-blocked {
  background-color: var(--status-blocked-bg);
  color: var(--status-blocked-text);
  border-color: var(--status-blocked-border);
}
.badge-blocked::before { background-color: var(--status-blocked-dot); }

.badge-active {
  background-color: var(--status-active-bg);
  color: var(--status-active-text);
  border-color: var(--status-active-border);
}
.badge-active::before { background-color: var(--status-active-dot); }

/* ============================================================
   6. INSTITUTIONAL TABLES — Enterprise Data Grid
   ============================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  text-align: left;
}

.table th {
  background-color: #f8fafc;
  color: var(--color-text-subtle);
  font-weight: var(--font-weight-semibold);
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.table td {
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-main);
  vertical-align: middle;
  font-size: var(--text-sm);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: #f5f7fa;
  transition: background-color var(--transition-fast);
}

/* Left-border accent on hover row */
.table tbody tr:hover td:first-child {
  border-left: 3px solid var(--color-secondary);
  padding-left: calc(var(--space-4) - 3px);
}

/* Striped rows option */
.table-striped tbody tr:nth-child(even) td {
  background-color: #fafbfc;
}

/* Empty state */
.table td.empty-state {
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}

.empty-state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4);
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  opacity: 0.4;
  color: var(--color-primary-light);
}

.empty-state-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.empty-state-desc {
  max-width: 300px;
  margin: 0 auto;
}

/* ============================================================
   7. STAGE PROGRESS TRACKER
   ============================================================ */
.stage-tracker {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: var(--space-8);
  padding: var(--space-4) 0;
}

.stage-tracker::before {
  content: '';
  position: absolute;
  top: 34px;
  left: 30px;
  right: 30px;
  height: 2px;
  background-color: var(--color-border);
  z-index: 1;
}

.stage-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  flex: 1;
}

.stage-circle {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  transition: all var(--transition-fast);
  font-family: var(--font-mono);
}

.stage-step.active .stage-circle {
  border-color: var(--color-secondary);
  background-color: var(--color-secondary);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.stage-step.completed .stage-circle {
  border-color: #16a34a;
  background-color: #16a34a;
  color: #ffffff;
}

.stage-label {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-subtle);
  letter-spacing: 0.01em;
}

.stage-step.active .stage-label {
  color: var(--color-secondary);
  font-weight: var(--font-weight-semibold);
}

/* ============================================================
   8. MODALS & PIN STEP-UP DIALOG
   ============================================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

#officer-pin-modal {
  z-index: 100000 !important;
}

#officer-pin-modal .modal-container {
  z-index: 100001 !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

#credential-modal {
  z-index: 99999 !important;
}

#credential-modal.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.05);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  transform: translateY(16px) scale(0.99);
  transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  border-bottom: 1px solid rgba(79, 70, 229, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  color: #f1f5f9;
  margin: 0;
  letter-spacing: -0.01em;
}

.modal-close {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: var(--text-base);
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255,255,255,0.18);
  color: #f1f5f9;
}

.modal-body {
  padding: var(--space-5);
}

.modal-footer {
  padding: var(--space-4) var(--space-5);
  background-color: #fafbfc;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* PIN Step-Up Specific Styling */
.pin-input-group {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.pin-digit {
  width: 46px;
  height: 52px;
  text-align: center;
  font-size: var(--text-2xl);
  font-family: var(--font-mono);
  font-weight: var(--font-weight-bold);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-alt);
  transition: all var(--transition-fast);
  color: var(--color-primary-dark);
}

.pin-digit:focus {
  border-color: var(--color-secondary);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-ring-indigo);
  outline: none;
}

.officer-badge-highlight {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background-color: #eef2ff;
  border: 1px solid #c7d2fe;
  border-left: 3px solid var(--color-secondary);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

/* ============================================================
   9. TOASTS — Enterprise Dark Glass
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 60;
}

.toast {
  background-color: #1e293b;
  color: #e2e8f0;
  padding: 12px var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(255,255,255,0.06);
  border-left: 3px solid var(--color-secondary);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 420px;
  animation: slideIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

.toast-success { border-left-color: #22c55e; }
.toast-error { border-left-color: #f43f5e; }
.toast-warning { border-left-color: #f59e0b; }

@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   10. METRIC STAT CARDS — Enterprise Inline Metric
   ============================================================ */
.stat-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: var(--accent-strip-width) solid var(--color-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--color-accent);
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
  font-weight: var(--font-weight-semibold);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-dark);
  font-family: var(--font-mono);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-hint {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}
