/* ==========================================================================
   Egerton University Cyclists Association (EUCA)
   Professional Institutional Design System & Fully Mobile-Responsive Layout
   Breakpoints: Desktop (>1024px), Tablet (768px - 1024px), Mobile (<768px), Small (<480px)
   ========================================================================== */

:root {
  /* Brand Palette (Egerton Forest & Emerald) */
  --brand-primary: #065f46;
  --brand-primary-hover: #044e3a;
  --brand-primary-active: #023829;
  --brand-light: #ecfdf5;
  --brand-border: #a7f3d0;
  --brand-text: #064e3b;

  /* Neutral Base */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;

  /* Typography Colors (High Contrast) */
  --text-primary: #0f172a;       /* Slate 900 */
  --text-secondary: #334155;     /* Slate 700 */
  --text-muted: #64748b;         /* Slate 500 */
  --text-light: #94a3b8;         /* Slate 400 */
  --text-white: #ffffff;

  /* Semantic Palettes */
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  --success-solid: #059669;

  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --warning-solid: #d97706;

  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  --danger-solid: #dc2626;

  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  --info-text: #0369a1;
  --info-solid: #0284c7;

  /* Sidebar Tokens */
  --sidebar-bg: #0d1f15;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: #059669;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-width: 250px;

  /* Elevation & Borders */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-main);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   RESET & GLOBAL BASE
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Master Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================
   SIDEBAR & MOBILE BACKDROP
   ========================================== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  border-right: 1px solid var(--sidebar-border);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: #059669;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.15rem;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
  flex-shrink: 0;
}

.sidebar-brand-text h1 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar-brand-text span {
  display: block;
  font-size: 0.66rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-role-indicator {
  padding: 10px 14px;
  margin: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border);
}

.sidebar-role-indicator .role-label {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.role-tag.admin { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.role-tag.moderator { background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.4); color: #fde68a; }
.role-tag.staff { background: rgba(2, 132, 199, 0.2); border-color: rgba(2, 132, 199, 0.4); color: #bae6fd; }
.role-tag.cyclist { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4); color: #a7f3d0; }
.role-tag.guest { background: rgba(148, 163, 184, 0.15); border-color: rgba(148, 163, 184, 0.3); color: #e2e8f0; }

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 10px 6px;
}

.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-nav a.nav-btn,
.sidebar-nav button.nav-btn {
  width: 100%;
  background: transparent;
  border: none;
  padding: 9px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  text-decoration: none;
}

.sidebar-nav a.nav-btn i,
.sidebar-nav button.nav-btn i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  color: #94a3b8;
  flex-shrink: 0;
}

.sidebar-nav a.nav-btn:hover,
.sidebar-nav button.nav-btn:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-nav a.nav-btn:hover i,
.sidebar-nav button.nav-btn:hover i {
  color: #ffffff;
}

.sidebar-nav a.nav-btn.active,
.sidebar-nav button.nav-btn.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-nav a.nav-btn.active i,
.sidebar-nav button.nav-btn.active i {
  color: #ffffff;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(0, 0, 0, 0.25);
}

.sidebar-user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================
   APP CONTENT & TOPBAR
   ========================================== */
.app-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
}

.app-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: var(--shadow-xs);
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-toggle-btn:hover {
  background: var(--bg-subtle);
}

.topbar-location-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-location-text .loc-short {
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-search {
  position: relative;
  width: 240px;
}

.topbar-search input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.topbar-search input:focus {
  background: var(--bg-surface);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.topbar-search i {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Main Content Wrapper */
.main-wrapper {
  padding: 24px;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* Section Header Typography */
.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin: 0;
}

/* ==========================================
   RESPONSIVE GRIDS & LAYOUTS
   ========================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  position: relative;
}

.card-header-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-header-title h3,
.card-header-title h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* Standard Responsive Layout Grids */
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.grid-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.process-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.grid-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.status-details-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: start;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.btn-outline-white,
.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline-white:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-solid);
  color: #ffffff;
  border-color: var(--danger-solid);
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 0.92rem;
}

/* ==========================================
   FORM CONTROLS
   ========================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.form-group label span.req {
  color: var(--danger-solid);
  font-weight: 700;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  transition: var(--transition);
  background-color: #ffffff;
  color: var(--text-primary);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.form-control::placeholder {
  color: var(--text-light);
}

/* Photo Uploader */
.photo-uploader-box {
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  background-color: var(--bg-app);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.photo-uploader-box:hover {
  border-color: var(--brand-primary);
  background-color: var(--brand-light);
}

.photo-uploader-box input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Passport Photo Cropper & Adjustment Frame (Fully Responsive) */
.cropper-viewport-wrapper {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 300 / 380;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  background: #090d16;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.cropper-viewport-wrapper:active {
  cursor: grabbing;
}

#cropper-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.cropper-guide-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-sizing: border-box;
}

.guide-oval-head {
  position: absolute;
  top: 9%;
  left: 20%;
  width: 60%;
  height: 58%;
  border-radius: 50% 50% 45% 45%;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
}

.guide-line-eyes {
  position: absolute;
  top: 34%;
  left: 26%;
  width: 48%;
  height: 1px;
  border-top: 1px dotted rgba(255, 255, 255, 0.65);
}

.guide-line-shoulders {
  position: absolute;
  top: 72%;
  left: 13%;
  width: 74%;
  height: 1px;
  border-top: 1px dotted rgba(255, 255, 255, 0.55);
}

.cropper-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Optional Accordion */
.optional-accordion {
  grid-column: 1 / -1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  overflow: hidden;
}

.optional-accordion summary {
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brand-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.optional-accordion summary:hover {
  background: var(--brand-light);
}

.optional-content-grid {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  background: #ffffff;
}

/* ==========================================
   STATUS PILLS & BADGES
   ========================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.status-pill.active {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.status-pill.suspended,
.status-pill.pending {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.status-pill.revoked {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

/* ==========================================
   TABLES & DATA GRIDS
   ========================================== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
  min-width: 650px;
}

.data-table th {
  background: var(--bg-subtle);
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-primary);
}

.data-table tr:hover {
  background-color: var(--bg-app);
}

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

.data-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

/* ==========================================
   BATCH TOOLBAR & ACTION BARS
   ========================================== */
.batch-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.batch-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.batch-count-badge {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
}

/* ==========================================
   STEPPER TIMELINE (STATUS TRACKER)
   ========================================== */
.status-tracker-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.stepper-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 18px 8px 6px;
}

.stepper-timeline::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid #cbd5e1;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin: 0 auto 6px;
  font-weight: 700;
  transition: var(--transition);
}

.step-item.completed .step-icon {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.step-item.current .step-icon {
  background: var(--warning-bg);
  border-color: var(--warning-solid);
  color: var(--warning-text);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.step-item.rejected .step-icon {
  background: var(--danger-bg);
  border-color: var(--danger-solid);
  color: var(--danger-text);
}

.step-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.step-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-md);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.modal-header {
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.modal-body {
  padding: 18px;
}

.modal-footer {
  padding: 12px 18px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Auth Tabs */
.auth-tab-container {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 18px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--brand-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* ==========================================
   NOTICE CARDS & RIDE CARDS
   ========================================== */
.notice-card {
  border-left: 3px solid var(--brand-primary);
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
}

.notice-card.priority-High {
  border-left-color: var(--danger-solid);
  background: #fffafa;
}

.rides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.ride-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.ride-card-header {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 12px 14px;
}

.ride-card-body {
  padding: 14px;
}

/* ==========================================
   POWERPOINT TEMPLATE ID CARD LIVE PREVIEW
   ========================================== */
.euca-template-card {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1.586;
  min-height: 235px;
  background: linear-gradient(135deg, #d3ecd4 0%, #def4df 50%, #cbe5cd 100%);
  border: 2px solid #143e26;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(20, 62, 38, 0.15);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
  margin: 0 auto;
}

.euca-template-card::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 70%;
  background-image: url('/public/images/cyclist-watermark.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.12;
  pointer-events: none;
  z-index: 1;
}

.euca-template-card .card-inner-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-header-front {
  text-align: center;
  padding-bottom: 2px;
}

.card-header-front h3 {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 800;
  color: #123822;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
  margin: 0;
}

.card-header-front .card-sub-brand {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: #16532d;
  letter-spacing: 0.1em;
  display: block;
}

.card-body-front {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 10px;
  align-items: center;
  margin: 4px 0;
}

.card-photo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.card-photo-frame {
  width: 78px;
  height: 96px;
  border-radius: 4px;
  border: 1px solid rgba(20, 62, 38, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  background: #f1f5f9;
  padding: 0;
  margin: 0;
}

.card-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border: none;
  margin: 0;
  padding: 0;
}

.card-id-number-pill {
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 800;
  color: #ffffff;
  background: #143e26;
  padding: 1px 6px;
  border-radius: 10px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.card-details-front {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card-student-name {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f2d1b;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-data-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.72rem;
  line-height: 1.3;
}

.card-data-label {
  font-weight: 700;
  color: #334155;
  min-width: 58px;
  flex-shrink: 0;
}

.card-data-val {
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-data-val.reg-highlight {
  font-family: var(--font-display);
  font-weight: 800;
  color: #065f46;
  font-size: 0.78rem;
}

.card-footer-front {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed rgba(20, 62, 38, 0.25);
  padding-top: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

.card-valid-badge {
  color: #143e26;
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-blood-badge {
  color: #dc2626;
  font-weight: 800;
}

/* ==========================================
   VERIFICATION & SCANNER BOXES
   ========================================== */
.verification-result-box {
  border-radius: var(--radius-md);
  padding: 16px;
}

.verification-result-box.status-active {
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
}

.verification-result-box.status-revoked {
  background: var(--danger-bg);
  border: 1.5px solid var(--danger-border);
}

.verification-result-box.status-suspended {
  background: var(--warning-bg);
  border: 1.5px solid var(--warning-border);
}

.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.verify-badge.badge-active { background: var(--success-solid); color: #fff; }
.verify-badge.badge-revoked { background: var(--danger-solid); color: #fff; }
.verify-badge.badge-suspended { background: var(--warning-solid); color: #fff; }

.verify-details-grid {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 12px;
}

.verify-photo-box img {
  width: 85px;
  height: 105px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE)
   ========================================================================== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-filters {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile & Tablet Portrait (max-width: 860px) */
@media (max-width: 860px) {
  .app-layout {
    overflow-x: hidden;
  }

  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .app-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar-toggle-btn {
    display: inline-flex;
  }

  .app-topbar {
    padding: 8px 12px;
  }

  .topbar-location-text .loc-full {
    display: none;
  }

  .topbar-location-text .loc-short {
    display: inline;
  }

  .topbar-search {
    width: 150px;
  }

  .main-wrapper {
    padding: 14px 10px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Force 1-Column Responsive Grids */
  .grid-2-col,
  .grid-split,
  .process-steps-grid,
  .status-details-grid,
  .form-grid,
  .optional-content-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .grid-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Responsive Table Container */
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive table {
    min-width: 620px;
  }

  /* Stepper on Mobile (Vertical) */
  .stepper-timeline {
    flex-direction: column;
    gap: 12px;
    margin: 14px 4px 4px;
  }

  .stepper-timeline::before {
    display: none;
  }

  .step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
  }

  .step-icon {
    margin: 0;
    flex-shrink: 0;
  }

  .step-item .step-desc {
    margin-top: 0;
  }

  /* Batch Toolbar */
  .batch-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .batch-toolbar-left {
    justify-content: space-between;
  }

  .batch-toolbar button {
    width: 100%;
  }

  /* Modal on Mobile */
  .modal-overlay {
    padding: 8px;
  }

  .modal-content {
    max-height: 94vh;
    width: 100%;
    margin: auto;
  }

  .modal-body {
    padding: 14px 12px;
  }
}

/* Small Phones & Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  html {
    font-size: 13.5px;
  }

  body {
    overflow-x: hidden;
  }

  .app-topbar {
    padding: 8px 10px;
  }

  .topbar-search {
    display: none;
  }

  .topbar-location-text {
    font-size: 0.76rem;
  }

  .section-header {
    margin-bottom: 12px;
  }

  .section-header h2 {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .section-header p {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .card {
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
  }

  .btn {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .btn-sm {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 0.76rem;
  }

  /* Auth Tabs on Small Phone */
  .auth-tab-container {
    display: flex;
    gap: 4px;
  }

  .auth-tab-btn {
    flex: 1;
    padding: 7px 4px;
    font-size: 0.76rem;
    text-align: center;
    justify-content: center;
  }

  .auth-tab-btn i {
    margin-right: 2px;
  }

  /* Form Elements & Inputs */
  .form-control, input, select, textarea {
    font-size: 15px; /* Prevents auto-zoom on mobile Safari */
  }

  .verify-details-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .verify-photo-box img {
    margin: 0 auto;
  }

  /* Cropper controls on mobile */
  .cropper-viewport-wrapper {
    max-width: 260px;
  }

  .cropper-controls-bar {
    gap: 8px;
  }

  /* Compact ID Card Preview for Small Screens */
  .euca-template-card {
    padding: 8px 10px;
    min-height: 195px;
    border-radius: 10px;
  }

  .card-header-front h3 {
    font-size: 0.72rem;
  }

  .card-header-front .card-sub-brand {
    font-size: 0.68rem;
  }

  .card-body-front {
    grid-template-columns: 68px 1fr;
    gap: 8px;
  }

  .card-photo-frame {
    width: 62px;
    height: 76px;
  }

  .card-student-name {
    font-size: 0.78rem;
  }

  .card-data-row {
    font-size: 0.65rem;
    gap: 2px;
  }

  .card-data-label {
    min-width: 48px;
  }

  .card-data-val.reg-highlight {
    font-size: 0.7rem;
  }

  .card-footer-front {
    font-size: 0.6rem;
  }

  .card-id-number-pill {
    font-size: 0.58rem;
    padding: 1px 4px;
  }

  .card-valid-badge,
  .card-blood-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
  }
}

/* Micro Devices (max-width: 360px) */
@media (max-width: 360px) {
  .cropper-viewport-wrapper {
    max-width: 230px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MULTI-STEP APPLICATION WIZARD & REVIEW UI
   ========================================================================== */
.apply-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
}

.apply-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  flex: 1;
}

.step-node-bubble {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  border: 2.5px solid var(--border-color);
  transition: var(--transition);
}

.apply-step-node.active .step-node-bubble {
  background: #ea580c;
  color: #fff;
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.2);
}

.apply-step-node.completed .step-node-bubble {
  background: #059669;
  color: #fff;
  border-color: #10b981;
}

.step-node-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.apply-step-node.active .step-node-label {
  color: #ea580c;
}

.apply-step-node.completed .step-node-label {
  color: #059669;
}

.apply-step-line {
  position: absolute;
  top: 19px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--border-color);
  z-index: 1;
}

.apply-step-progress {
  height: 100%;
  background: linear-gradient(90deg, #059669, #ea580c);
  transition: width 0.3s ease;
  width: 0%;
}

.apply-step-panel {
  display: none;
  animation: fadeInStep 0.25s ease-out;
}

.apply-step-panel.active {
  display: block;
}

@keyframes fadeInStep {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Review Summary Card */
.apply-review-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

.review-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.review-section-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.review-edit-btn {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ea580c;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.review-edit-btn:hover {
  text-decoration: underline;
}

.review-data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  font-size: 0.84rem;
}

.review-item {
  display: flex;
  flex-direction: column;
}

.review-item .r-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.review-item .r-val {
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

/* ==========================================================================
   ORANGE CELEBRATION SUCCESS ANIMATION
   ========================================================================== */
.orange-success-badge {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 16px;
  box-shadow: 0 10px 25px -4px rgba(234, 88, 12, 0.45);
  animation: orangePopPulse 1.2s infinite alternate ease-in-out;
}

@keyframes orangePopPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.5); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(234, 88, 12, 0); }
  100% { transform: scale(1.05); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

.btn-orange {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.btn-orange:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #fff;
}

.orange-tracking-box {
  background: #fff7ed;
  border: 2px dashed #f97316;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 18px;
}

/* Rejection / Revocation Notice Banner */
.reason-notice-card {
  background: #fef2f2;
  border: 1.5px solid #f87171;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.reason-notice-card.warning-variant {
  background: #fffbeb;
  border-color: #fde68a;
}

/* ==========================================================================
   PASSWORD VISIBILITY TOGGLE (EYE ICON)
   ========================================================================== */
.password-toggle-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-toggle-wrapper input {
  padding-right: 40px !important;
  width: 100%;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 0.95rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
  z-index: 2;
}

.btn-toggle-password:hover {
  color: var(--brand-primary);
  background-color: rgba(6, 95, 70, 0.08);
}

.btn-toggle-password:focus {
  outline: none;
  color: var(--brand-primary);
}

/* ==========================================================================
   MODERATOR & ADMIN LOCKED QUEUE (Awaiting Treasurer Clearance)
   ========================================================================== */
tr.locked-unverified-row {
  background-color: #fafbfc !important;
  opacity: 0.85;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

tr.locked-unverified-row td.cell-blurred {
  filter: blur(0.5px);
  user-select: none;
  transition: filter 0.2s ease;
}

tr.locked-unverified-row:hover td.cell-blurred {
  filter: blur(0.2px);
}

.locked-pending-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #c2410c;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  line-height: 1.25;
  white-space: normal;
  text-align: left;
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.06);
}

.locked-pending-pill i {
  color: #ea580c;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* ==========================================================================
   BATCH ID PRINTING TABS & STATUS BADGES
   ========================================================================== */
.batch-tab-active {
  background: var(--brand-primary) !important;
  color: #ffffff !important;
  border-color: var(--brand-primary) !important;
}

/* ==========================================================================
   LOST CARD & REPLACEMENT TIMELINE STYLING
   ========================================================================== */
.replacement-alert-banner {
  background: #fff7ed;
  border: 1.5px solid #fdba74;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

/* ==========================================================================
   CRITICAL GATE REVOCATION ALERT BOX
   ========================================================================== */
.verification-result-box.alert-lost-card {
  background: #fef2f2 !important;
  border: 2.5px solid #dc2626 !important;
  border-radius: var(--radius-sm) !important;
  padding: 20px !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.2) !important;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS ENHANCEMENTS ACROSS ALL ROLES
   ========================================================================== */
@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: flex !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 16px 12px !important;
    width: 100% !important;
  }
  .topbar {
    padding: 10px 14px !important;
  }
  .grid-2-col, .grid-3-col, .grid-split, .metrics-grid, .status-details-grid {
    grid-template-columns: 1fr !important;
  }
  .batch-toolbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .modal-content {
    width: 92% !important;
    margin: 20px auto !important;
    padding: 18px !important;
  }
  .stepper-timeline {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .step-item::after {
    display: none !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px !important;
  }
  .section-header h2 {
    font-size: 1.25rem !important;
  }
  .btn {
    padding: 8px 14px !important;
    font-size: 0.82rem !important;
  }
  .card {
    padding: 14px !important;
  }
}


