/* ============================================================
   ScholarSafe — Global Stylesheet
   File: assets/css/style.css
   Brand: Black + MTN Yellow (#FFCB00) + White + Success Green
   Audience: Low-tech users on entry-level Android / PWA
   Philosophy: High contrast, large touch targets, zero clutter
   ============================================================ */

/* ============================================================
   SECTION 1 — CSS VARIABLES & THEME
   Shared across ALL interfaces (parent, driver, entity, admin)
   ============================================================ */
:root {
  /* Brand colours */
  --yellow:        #FFCB00;
  --yellow-dark:   #E0B300;
  --yellow-light:  #FFF3B0;
  --black:         #0D0D0D;
  --black-soft:    #1A1A1A;
  --black-card:    #222222;
  --black-border:  #333333;
  --white:         #FFFFFF;
  --white-soft:    #F5F5F5;
  --white-muted:   #CCCCCC;

  /* Semantic colours */
  --success:       #2ECC71;
  --success-bg:    #0D3320;
  --success-light: #D4F7E4;
  --danger:        #E74C3C;
  --danger-bg:     #3A0E0E;
  --danger-light:  #FDECEA;
  --warning:       #F39C12;
  --warning-bg:    #3A2800;
  --info:          #3498DB;
  --info-bg:       #0A2540;

  /* Text */
  --text-primary:   #FFFFFF;
  --text-secondary: #AAAAAA;
  --text-muted:     #666666;
  --text-on-yellow: #0D0D0D;

  /* Surfaces */
  --bg-page:    #0D0D0D;
  --bg-card:    #1A1A1A;
  --bg-input:   #222222;
  --bg-hover:   #2A2A2A;
  --border:     #333333;
  --border-focus: #FFCB00;

  /* Typography */
  --font-main:    'Nunito', 'Segoe UI', sans-serif;
  --font-display: 'Nunito', sans-serif;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card:   0 2px 16px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 0 3px rgba(255,203,0,0.25);
  --shadow-btn:    0 4px 12px rgba(255,203,0,0.3);

  /* Transitions */
  --transition: 0.2s ease;

  /* Touch targets — minimum 48px for low-tech users */
  --touch-min: 48px;
}

/* ============================================================
   SECTION 2 — RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--yellow);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { opacity: 0.8; }

img {
  max-width: 100%;
  display: block;
}

/* ============================================================
   SECTION 3 — TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(24px, 5vw, 36px); }
h2 { font-size: clamp(20px, 4vw, 28px); }
h3 { font-size: clamp(18px, 3vw, 22px); }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.text-yellow   { color: var(--yellow); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-muted    { color: var(--text-muted); }
.text-white    { color: var(--white); }
.text-center   { text-align: center; }
.text-sm       { font-size: 13px; }
.text-lg       { font-size: 18px; }
.font-bold     { font-weight: 700; }

/* ============================================================
   SECTION 4 — LAYOUT & CONTAINERS
   ============================================================ */
.container {
  width: 100%;
  max-width: 480px;       /* Mobile-first — most users on phones */
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-wide {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
}

.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-gap-sm { gap: var(--space-sm); }
.flex-gap-md { gap: var(--space-md); }
.gap-sm      { gap: var(--space-sm); }
.gap-md      { gap: var(--space-md); }
.gap-lg      { gap: var(--space-lg); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ============================================================
   SECTION 5 — CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.card-sm {
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

.card-yellow {
  border-color: var(--yellow);
  background: linear-gradient(135deg, #1a1600 0%, var(--bg-card) 100%);
}

.card-success {
  border-color: var(--success);
  background: var(--success-bg);
}

.card-danger {
  border-color: var(--danger);
  background: var(--danger-bg);
}

/* ============================================================
   SECTION 6 — BUTTONS
   All buttons meet 48px minimum touch target
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--touch-min);
  padding: 12px var(--space-lg);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  width: 100%;               /* Full-width by default for mobile */
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Primary — Yellow (main CTA) */
.btn-primary {
  background: var(--yellow);
  color: var(--text-on-yellow);
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover:not(:disabled) {
  background: var(--yellow-dark);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* Secondary — Outlined */
.btn-secondary {
  background: transparent;
  color: var(--yellow);
  border: 2px solid var(--yellow);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255,203,0,0.08);
}

/* Ghost — subtle */
.btn-ghost {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--yellow);
  color: var(--yellow);
}

/* Success */
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  background: #27ae60;
  transform: translateY(-1px);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* Google sign-in */
.btn-google {
  background: var(--white);
  color: #333;
  border: 1px solid #ddd;
  font-weight: 600;
}
.btn-google:hover:not(:disabled) { background: #f0f0f0; }
.btn-google img {
  width: 20px;
  height: 20px;
}

/* Size modifiers */
.btn-sm {
  min-height: 40px;
  padding: 8px var(--space-md);
  font-size: 14px;
  width: auto;
}

.btn-inline {
  width: auto;
}

/* ============================================================
   SECTION 7 — FORMS & INPUTS
   Large, clear inputs for low-tech users
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.form-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-label .required {
  color: var(--yellow);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: var(--touch-min);
  padding: 12px var(--space-md);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 16px;          /* Prevents iOS zoom */
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: var(--shadow-glow);
}

.form-input:disabled,
.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input.is-error { border-color: var(--danger); }
.form-input.is-success { border-color: var(--success); }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FFCB00' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.form-error {
  font-size: 13px;
  color: var(--danger);
  font-weight: 600;
}

/* Checkbox & Radio — large touch targets */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  cursor: pointer;
  padding: var(--space-sm) 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  accent-color: var(--yellow);
  cursor: pointer;
  margin-top: 2px;
}

.form-check-label {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* File upload */
.form-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
}
.form-upload:hover {
  border-color: var(--yellow);
  background: rgba(255,203,0,0.04);
}
.form-upload input[type="file"] { display: none; }
.form-upload-icon { font-size: 32px; color: var(--yellow); }
.form-upload-text { font-size: 14px; color: var(--text-secondary); }
.form-upload-hint { font-size: 12px; color: var(--text-muted); }

/* OTP input row */
.otp-row {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin: var(--space-md) 0;
}
.otp-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.otp-input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: var(--shadow-glow);
}

/* ============================================================
   SECTION 8 — AUTH PAGES
   Used by: auth/register.php, auth/login.php, auth/otp_verify.php
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
  background: var(--bg-page);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.auth-logo img {
  height: 60px;
  width: auto;
}

.auth-logo-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: -0.5px;
}

.auth-logo-tagline {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.auth-divider span {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 14px;
  color: var(--text-muted);
}

/* Role selector — registration step 1 */
.role-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.role-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  min-height: var(--touch-min);
}

.role-card:hover {
  border-color: var(--yellow);
  background: rgba(255,203,0,0.05);
}

.role-card.selected {
  border-color: var(--yellow);
  background: rgba(255,203,0,0.08);
}

.role-card input[type="radio"] { display: none; }

.role-icon {
  font-size: 28px;
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.role-info { flex: 1; }
.role-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.role-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.role-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.role-card.selected .role-check {
  background: var(--yellow);
  border-color: var(--yellow);
}

.role-card.selected .role-check::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--black);
}

/* Step progress bar */
.step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: all var(--transition);
}

.step-dot.active {
  background: var(--yellow);
  width: 28px;
  border-radius: var(--radius-pill);
}

.step-dot.done { background: var(--success); }

/* ============================================================
   SECTION 9 — TOP NAVIGATION BAR
   Used by: parent dashboard, driver dashboard, entity dashboard
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: var(--black-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 18px;
  font-weight: 800;
  color: var(--yellow);
}

.topbar-brand img {
  height: 32px;
  width: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.topbar-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  position: relative;
}
.topbar-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--yellow);
}

.notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--black-soft);
}

/* ============================================================
   SECTION 10 — BOTTOM NAVIGATION
   Used by: ALL role dashboards (parent, driver, entity)
   Primary navigation for mobile PWA
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 68px;
  background: var(--black-soft);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-sm);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-height: var(--touch-min);
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 6px var(--space-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-muted);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--yellow);
}

.bottom-nav-item .nav-icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav-item .nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Big centre action button (Start Trip for driver) */
.bottom-nav-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--text-on-yellow);
  border: none;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-btn);
  transition: all var(--transition);
  margin-top: -16px;
}
.bottom-nav-fab:hover {
  background: var(--yellow-dark);
  transform: scale(1.05);
}

/* Page body offset so content isn't hidden behind bottom nav */
.has-bottom-nav {
  padding-bottom: calc(68px + env(safe-area-inset-bottom) + var(--space-md));
}

/* ============================================================
   SECTION 11 — DASHBOARD HEADER
   Used by: parent/dashboard.php, driver/dashboard.php, entity/dashboard.php
   ============================================================ */
.dash-header {
  background: linear-gradient(135deg, #1a1600 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border);
  padding: var(--space-lg) var(--space-md);
}

.dash-greeting {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.dash-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.dash-name span { color: var(--yellow); }

/* ============================================================
   SECTION 12 — STAT / INFO CARDS
   Used by: ALL dashboards
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat-card.highlight {
  border-color: var(--yellow);
  background: rgba(255,203,0,0.05);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--yellow);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   SECTION 13 — LIST ITEMS
   Used by: students list, notifications, trip history, requests
   ============================================================ */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: border-color var(--transition);
  cursor: pointer;
  min-height: var(--touch-min);
}
.list-item:hover { border-color: var(--yellow); }

.list-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--yellow);
  flex-shrink: 0;
  overflow: hidden;
}
.list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-info { flex: 1; min-width: 0; }
.list-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.list-meta {
  text-align: right;
  flex-shrink: 0;
}

/* ============================================================
   SECTION 14 — STATUS BADGES & PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-yellow   { background: rgba(255,203,0,0.15);  color: var(--yellow); }
.badge-success  { background: rgba(46,204,113,0.15); color: var(--success); }
.badge-danger   { background: rgba(231,76,60,0.15);  color: var(--danger); }
.badge-warning  { background: rgba(243,156,18,0.15); color: var(--warning); }
.badge-info     { background: rgba(52,152,219,0.15); color: var(--info); }
.badge-muted    { background: var(--bg-hover);       color: var(--text-muted); }

/* ============================================================
   SECTION 15 — NOTIFICATIONS
   Used by: parent/notifications.php, topbar dropdown
   ============================================================ */
.notif-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: var(--space-sm);
  transition: border-color var(--transition);
}

.notif-item.unread {
  border-color: var(--yellow);
  background: rgba(255,203,0,0.04);
}

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notif-icon.tap-in  { background: var(--success-bg);  color: var(--success); }
.notif-icon.tap-out { background: var(--info-bg);      color: var(--info); }
.notif-icon.alert   { background: var(--danger-bg);    color: var(--danger); }

.notif-body { flex: 1; }
.notif-msg  {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}
.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   SECTION 16 — TRIP / NFC TAP SCREEN
   Used by: driver/trip_active.php
   ============================================================ */
.trip-status-bar {
  background: var(--success);
  color: #fff;
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.trip-status-bar.waiting {
  background: var(--yellow);
  color: var(--text-on-yellow);
}

.nfc-tap-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
}

.nfc-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: pulse-ring 2s ease-in-out infinite;
}

.nfc-ring::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(255,203,0,0.3);
  animation: pulse-ring 2s ease-in-out infinite 0.3s;
}

.nfc-ring-icon {
  font-size: 64px;
  color: var(--yellow);
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.04); opacity: 0.8; }
}

.nfc-tap-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.nfc-tap-hint {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 260px;
}

/* Tap confirmation popup */
.tap-confirm {
  background: var(--bg-card);
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-md);
  animation: slide-up 0.3s ease;
}

.tap-confirm.tap-out {
  border-color: var(--info);
}

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.tap-confirm-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.tap-confirm-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.tap-confirm-detail {
  font-size: 13px;
  color: var(--text-muted);
}

/* Occupancy counter */
.occupancy-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.occupancy-count {
  font-size: 28px;
  font-weight: 800;
  color: var(--yellow);
}

.occupancy-count.over-capacity { color: var(--danger); }

.occupancy-label {
  font-size: 12px;
  color: var(--text-muted);
}

.occupancy-max {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   SECTION 17 — RATING STARS
   Used by: parent/rate_driver.php, transport_profile.php
   ============================================================ */
.star-row {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin: var(--space-md) 0;
}

.star-btn {
  font-size: 36px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--border);
  transition: color var(--transition), transform var(--transition);
  line-height: 1;
  padding: var(--space-sm);
}

.star-btn.active,
.star-btn:hover { color: var(--yellow); }

.star-btn:hover { transform: scale(1.15); }

.rating-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.rating-stars { color: var(--yellow); font-size: 14px; }
.rating-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.rating-count { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   SECTION 18 — COMPLIANCE / DOCUMENT UPLOAD
   Used by: driver/profile.php, driver/vehicle.php
   ============================================================ */
.doc-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.doc-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--yellow);
  flex-shrink: 0;
}

.doc-info { flex: 1; }
.doc-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.doc-status { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.doc-item.doc-ok     { border-color: var(--success); }
.doc-item.doc-expiry { border-color: var(--warning); }
.doc-item.doc-missing{ border-color: var(--danger);  }

/* ============================================================
   SECTION 19 — ROUTE / PICKUP POINT MAP CARD
   Used by: driver/routes.php, parent/find_transport.php
   ============================================================ */
.route-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.route-header {
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.route-school-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.route-area {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.pickup-list {
  padding: var(--space-md);
}

.pickup-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}
.pickup-item:last-child { border-bottom: none; }

.pickup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}

.pickup-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================================
   SECTION 20 — ALERTS & BANNERS
   ============================================================ */
.alert {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 14px;
  line-height: 1.5;
}

.alert-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.alert-body { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 2px; }

.alert-success { background: var(--success-bg);  border: 1px solid var(--success); color: var(--success);  }
.alert-danger  { background: var(--danger-bg);   border: 1px solid var(--danger);  color: var(--danger);   }
.alert-warning { background: var(--warning-bg);  border: 1px solid var(--warning); color: var(--warning);  }
.alert-info    { background: var(--info-bg);     border: 1px solid var(--info);    color: var(--info);     }
.alert-yellow  { background: rgba(255,203,0,0.08); border: 1px solid var(--yellow); color: var(--yellow); }

/* ============================================================
   SECTION 21 — PWA INSTALL PROMPTS
   Used by: includes/footer.php — shown on first load
   ============================================================ */
.pwa-banner {
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom) + 8px);
  left: var(--space-md);
  right: var(--space-md);
  background: var(--black-card);
  border: 1px solid var(--yellow);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-card);
  z-index: 200;
  animation: slide-up 0.4s ease;
}

.pwa-banner-text { flex: 1; font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.pwa-banner-text strong { color: var(--text-primary); display: block; font-size: 14px; }
.pwa-banner-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: var(--space-xs);
}

/* ============================================================
   SECTION 22 — LOADING & EMPTY STATES
   ============================================================ */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
}

.empty-icon { font-size: 56px; opacity: 0.4; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text-secondary); }
.empty-text  { font-size: 14px; color: var(--text-muted); max-width: 260px; }

/* ============================================================
   SECTION 23 — SECTION TITLES
   ============================================================ */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-md) var(--space-md) var(--space-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-md) var(--space-sm);
}

/* ============================================================
   SECTION 24 — UTILITY CLASSES
   ============================================================ */
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.p-md   { padding: var(--space-md); }
.p-lg   { padding: var(--space-lg); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ============================================================
   SECTION 25 — RESPONSIVE
   Tablet and up — dashboard gets a sidebar layout
   ============================================================ */
@media (min-width: 768px) {
  .auth-card { padding: var(--space-2xl); }

  .stat-grid { grid-template-columns: repeat(4, 1fr); }

  .grid-2 { grid-template-columns: 1fr 1fr; }

  /* Wider screens — sidebar nav replaces bottom nav */
  .sidebar-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
  }

  .sidebar {
    background: var(--black-soft);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: var(--space-lg) 0;
    display: flex;
    flex-direction: column;
  }

  .sidebar-logo {
    padding: 0 var(--space-lg) var(--space-lg);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-md);
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    min-height: var(--touch-min);
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
  }

  .sidebar-nav-item:hover,
  .sidebar-nav-item.active {
    color: var(--yellow);
    background: rgba(255,203,0,0.05);
    border-left-color: var(--yellow);
  }

  .sidebar-nav-item .nav-icon { font-size: 20px; }

  .bottom-nav { display: none; }
  .has-bottom-nav { padding-bottom: var(--space-md); }
}

/* ============================================================
   SECTION 26 — PRINT (minimal, for compliance docs)
   ============================================================ */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .bottom-nav, .sidebar, .pwa-banner { display: none; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}