/* ══════════════════════════════════════════════════════════
   IITA Yam Breeding Unit — Attendance System
   Professional UI v2.0
   ══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── 1. Design Tokens ─────────────────────────────────────── */
:root {
  /* IITA brand orange — extracted from logo (#f26522) */
  --p:       #f26522;
  --p-dk:    #c04e0d;
  --p-mid:   #f47a3c;
  --p-lt:    #fef0e7;
  --p-xlt:   #fff8f4;

  /* keep green only for status indicators */
  --accent:  #0d6e3b;
  --acc-lt:  #e8f5ee;

  --white:   #ffffff;
  --surface: #f8f8f8;
  --border:  #e8e8e8;
  --border-dk: #d0d0d0;

  --text:    #1a1a1a;
  --body:    #3a3a3a;
  --muted:   #777777;
  --faint:   #b8b8b8;

  --ok:      #0d6e3b;
  --ok-lt:   #e8f5ee;
  --warn:    #d97706;
  --warn-lt: #fffbeb;
  --err:     #dc2626;
  --err-lt:  #fef2f2;

  --s-xs: 0 1px 2px rgba(0,0,0,.05);
  --s-sm: 0 2px 8px rgba(0,0,0,.07);
  --s-md: 0 6px 20px rgba(0,0,0,.09);
  --s-lg: 0 20px 50px rgba(0,0,0,.14);
  --s-grn: 0 8px 28px rgba(242,101,34,.28);

  --r-xs:   4px;
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   22px;
  --r-xl:   30px;
  --r-full: 9999px;

  --t-fast: .15s ease;
  --t-base: .25s ease;
  --t-slow: .4s cubic-bezier(.34,1.56,.64,1);

  --nav-h:  60px;
  --bnav-h: 66px;
  --max-w:  480px;
}

/* ── 2. Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: var(--p); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ── 3. Auth Page ─────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6vh 16px 40px;
  background: #ffffff;
  overflow-y: auto;
}

/* Orange branded header band */
.auth-page::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--p-dk), var(--p), var(--p-mid));
  z-index: 10;
}

.auth-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 6px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.10);
  border: 1px solid var(--border);
  position: relative;
}
@media (max-width: 460px) {
  .auth-card { padding: 32px 22px; border-radius: var(--r-lg); }
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
  margin: 0 auto 14px;
}
.auth-logo h1 { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.auth-unit {
  font-size: 12px; color: var(--muted); margin-top: 4px;
  font-weight: 500; text-transform: uppercase; letter-spacing: .8px;
}

/* Powered-by footer under the card */
.auth-brand-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  font-weight: 500;
}
.auth-brand-footer span { color: var(--p); font-weight: 700; }

.auth-tabs {
  display: flex;
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 4px;
  margin-bottom: 24px;
  gap: 3px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: calc(var(--r-sm) - 2px);
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-base);
  font-family: inherit;
}
.auth-tab.active { background: var(--white); color: var(--p); box-shadow: var(--s-xs); }
.auth-tab:hover:not(.active) { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.auth-footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-footer a { color: var(--p); font-weight: 600; }

/* ── 4. Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--body);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-dk);
  border-radius: var(--r-sm);
  font-size: 14.5px;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}
.form-group input::placeholder { color: var(--faint); }
.form-group input:focus,
.form-group select:focus {
  border-color: var(--p);
  box-shadow: 0 0 0 3.5px rgba(13,110,59,.12);
}
.input-eye { position: relative; }
.input-eye input { padding-right: 44px; }
.eye-btn {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px;
  color: var(--muted); padding: 4px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* ── 5. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .48; cursor: not-allowed; filter: none; transform: none; }

.btn-primary  { background: var(--p); color: var(--white); box-shadow: var(--s-grn); }
.btn-secondary { background: var(--p-lt); color: var(--p-dk); }
.btn-ghost    { background: transparent; border: 1.5px solid var(--border-dk); color: var(--body); }
.btn-danger   { background: var(--err); color: #fff; }

.btn-outline-sm {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.38);
  color: var(--white);
  padding: 6px 16px;
  font-size: 13px;
  border-radius: var(--r-sm);
  font-family: inherit;
  cursor: pointer;
}
.btn-outline-sm:hover { background: rgba(255,255,255,.12); text-decoration: none; }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: var(--r-md); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── 6. Alerts (forms) ────────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
}
.alert-danger  { background: var(--err-lt); color: #991b1b; border-left: 4px solid var(--err); }
.alert-success { background: var(--ok-lt);  color: var(--p-dk); border-left: 4px solid var(--p); }

/* ── 7. App Shell ─────────────────────────────────────────── */
.app-body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface);
  padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px));
}

/* App Bar */
.app-bar {
  background: var(--p);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 14px rgba(13,110,59,.28);
}
.app-bar-brand { display: flex; align-items: center; gap: 10px; color: var(--white); }
.app-bar-logo {
  height: 30px; width: auto;
  background: rgba(255,255,255,.95);
  border-radius: 6px; padding: 3px 7px;
  object-fit: contain;
}
.app-bar-title { font-size: 14.5px; font-weight: 600; color: rgba(255,255,255,.94); }
.app-bar-actions { display: flex; align-items: center; gap: 10px; }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.3);
  color: var(--white);
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── 8. Main content ──────────────────────────────────────── */
.app-main {
  max-width: var(--max-w);
  margin: 0 auto;
}
@media (min-width: 481px) {
  .app-main {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: calc(100vh - var(--nav-h));
  }
}

/* ── 9. Hero Banner ───────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(140deg, var(--p-dk) 0%, var(--p) 55%, var(--p-mid) 100%);
  color: var(--white);
  padding: 26px 20px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  right: -20px; top: -30px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  pointer-events: none;
}
.hero-banner::after {
  content: '';
  position: absolute;
  right: 50px; bottom: -40px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}

.hero-greeting { position: relative; z-index: 1; }
.hero-time-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: .72;
  display: block;
  margin-bottom: 4px;
}
.hero-name { font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.hero-meta { font-size: 12.5px; opacity: .68; margin-top: 5px; font-weight: 500; }

.hero-id-pill {
  background: rgba(255,255,255,.16);
  border: 1.5px solid rgba(255,255,255,.22);
  border-radius: var(--r-full);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 1.8px;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative; z-index: 1;
}

/* ── 10. Window Status Pill ───────────────────────────────── */
.window-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.window-pill.open { color: var(--p); }

.window-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.window-pill.open .window-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
  animation: dot-blink 2.2s ease infinite;
}
@keyframes dot-blink {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
  50% { box-shadow: 0 0 0 7px rgba(34,197,94,.08); }
}

/* ── 11. Attendance Hub ───────────────────────────────────── */
.attendance-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.attendance-hub-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 26px;
}

/* Pulse rings */
.action-ring-wrap {
  position: relative;
  width: 188px; height: 188px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.action-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid var(--p-mid);
  opacity: 0;
  animation: rpulse 2.6s ease-out infinite;
}
.action-pulse.delay { animation-delay: 1.3s; }
@keyframes rpulse {
  0%   { transform: scale(.88); opacity: .55; }
  100% { transform: scale(1.22); opacity: 0; }
}

/* The big circular button */
.action-btn {
  width: 158px; height: 158px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(150deg, var(--p-mid) 0%, var(--p-dk) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--s-grn), 0 0 0 7px var(--p-lt);
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base);
  position: relative; z-index: 1;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:hover:not(:disabled) {
  transform: scale(1.045);
  box-shadow: 0 14px 36px rgba(13,110,59,.42), 0 0 0 9px var(--p-lt);
}
.action-btn:active:not(:disabled) { transform: scale(.96); }
.action-btn:disabled {
  background: linear-gradient(150deg, #8fa89c, #5f7a6c);
  box-shadow: 0 4px 14px rgba(0,0,0,.14), 0 0 0 7px #ecf2ee;
  cursor: not-allowed;
}
.action-btn.state-marked {
  background: linear-gradient(150deg, #22c55e, #15803d);
  box-shadow: 0 8px 28px rgba(34,197,94,.35), 0 0 0 7px #dcfce7;
  cursor: default;
}
.action-btn.state-closed {
  background: linear-gradient(150deg, #94a3b8, #64748b);
  box-shadow: 0 4px 14px rgba(0,0,0,.12), 0 0 0 7px #f1f5f9;
  cursor: default;
  pointer-events: none;
}

.action-icon  { font-size: 36px; line-height: 1; }
.action-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  text-align: center;
  line-height: 1.35;
  white-space: pre-line;
}

.action-hint { font-size: 13px; color: var(--muted); text-align: center; }

/* ── 12. Already Marked / Closed States ──────────────────── */
.marked-state {
  padding: 28px 20px;
  text-align: center;
  width: 100%;
}
.marked-check {
  width: 82px; height: 82px;
  border-radius: 50%;
  background: var(--ok-lt);
  border: 3px solid #aadbbf;
  color: var(--p);
  font-size: 38px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.marked-title { font-size: 20px; font-weight: 800; color: var(--p-dk); margin-bottom: 6px; }
.marked-time  { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

.closed-state {
  padding: 36px 20px;
  text-align: center;
  width: 100%;
}
.closed-clock { font-size: 56px; margin-bottom: 16px; }
.closed-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.closed-sub   { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.closed-window-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border-dk);
  border-radius: var(--r-full);
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--body);
}

/* ── 13. Location Status ──────────────────────────────────── */
.loc-status-card {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 0;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}
.loc-status-card.visible { display: flex; }
.loc-loading { background: #f8faf9; color: var(--muted); border: 1.5px solid var(--border); }
.loc-ok      { background: var(--ok-lt); color: var(--p-dk); border: 1.5px solid #aadbbf; }
.loc-error   { background: var(--err-lt); color: #991b1b; border: 1.5px solid #fca5a5; }

.loc-status-icon { font-size: 20px; flex-shrink: 0; }
.loc-status-text { flex: 1; }
.loc-retry-btn {
  font-size: 12.5px; font-weight: 700;
  color: var(--p); background: var(--white);
  border: 1.5px solid var(--p);
  border-radius: var(--r-full);
  padding: 5px 13px;
  cursor: pointer; white-space: nowrap;
  flex-shrink: 0; font-family: inherit;
  transition: background var(--t-fast);
}
.loc-retry-btn:hover { background: var(--p-lt); }

/* ── 14. Selfie Card ──────────────────────────────────────── */
.selfie-card {
  margin: 14px 16px 0;
  background: var(--white);
  border-radius: var(--r-md);
  padding: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--s-sm);
  text-align: center;
}
.selfie-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.selfie-card video,
.selfie-card img#selfie-preview {
  width: 100%; max-width: 280px;
  border-radius: var(--r-sm);
  border: 2px solid var(--border);
  margin: 0 auto 14px;
}
.selfie-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Submit section */
.submit-section { padding: 14px 16px 0; display: none; }
.submit-section.visible { display: block; }

/* ── 15. Toast Message ────────────────────────────────────── */
.toast-msg {
  position: fixed;
  bottom: calc(var(--bnav-h) + 16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  background: var(--text);
  color: var(--white);
  padding: 13px 24px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  box-shadow: var(--s-lg);
  z-index: 500;
  transition: transform .3s var(--t-slow), opacity .3s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
  white-space: normal;
  display: block;
}
.toast-msg.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast-msg.toast-ok    { background: #14532d; }
.toast-msg.toast-error { background: #991b1b; }

/* ── 16. Stats Section ────────────────────────────────────── */
.stats-section { padding: 20px 16px 4px; }
.stats-section-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); margin-bottom: 12px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat-tile {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--s-xs);
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.stat-tile::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3.5px;
  background: var(--faint);
}
.stat-tile.tile-present::before { background: var(--p); }
.stat-tile.tile-late::before    { background: var(--warn); }

.stat-tile-num {
  font-size: 30px; font-weight: 800;
  color: var(--text); line-height: 1; letter-spacing: -1px;
}
.stat-tile.tile-present .stat-tile-num { color: var(--p); }
.stat-tile.tile-late    .stat-tile-num { color: var(--warn); }

.stat-tile-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin-top: 5px;
}

/* ── 17. History Panel ────────────────────────────────────── */
.history-panel {
  margin: 20px 16px 0;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--s-xs);
  border: 1px solid var(--border);
  overflow: hidden;
}
.history-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.history-panel-header h3 { font-size: 15px; font-weight: 700; }

.history-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--surface); }

.history-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.dot-present { background: var(--ok-lt); }
.dot-late    { background: var(--warn-lt); }
.dot-absent  { background: var(--err-lt); }

.history-info { flex: 1; min-width: 0; }
.history-date { font-size: 14px; font-weight: 600; color: var(--text); }
.history-time { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.history-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

/* ── 18. Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .2px; white-space: nowrap;
}
.badge-present { background: var(--ok-lt);   color: var(--p-dk); }
.badge-late    { background: var(--warn-lt);  color: #92400e; }
.badge-absent  { background: var(--err-lt);   color: #991b1b; }

/* ── 19. Pagination ───────────────────────────────────────── */
.pagination {
  display: flex; gap: 6px; justify-content: center;
  padding: 14px 18px; flex-wrap: wrap;
  border-top: 1px solid var(--border);
}
.page-btn {
  padding: 7px 13px;
  border: 1.5px solid var(--border-dk);
  border-radius: var(--r-sm);
  background: var(--white); color: var(--body);
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all var(--t-fast);
}
.page-btn:hover, .page-btn.active {
  background: var(--p); color: var(--white); border-color: var(--p);
}

/* ── 20. Spinner & Empty ──────────────────────────────────── */
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--p);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── 21. Bottom Navigation ────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 300;
  box-shadow: 0 -4px 18px rgba(0,0,0,.06);
}
@media (min-width: 481px) {
  .bottom-nav {
    max-width: var(--max-w);
    left: 50%; right: auto;
    transform: translateX(-50%);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  font-family: inherit;
  transition: color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .2px;
}
.bottom-nav-item svg { width: 22px; height: 22px; transition: transform var(--t-fast); }
.bottom-nav-item:hover svg { transform: scale(1.1); }
.bottom-nav-item:hover, .bottom-nav-item.active { color: var(--p); }
.bottom-nav-item.active svg { stroke: var(--p); }

/* ── 22. Install Banner ───────────────────────────────────── */
.install-banner {
  position: fixed;
  bottom: calc(var(--bnav-h) + 12px + env(safe-area-inset-bottom, 0px));
  left: 12px; right: 12px;
  background: var(--p-dk);
  color: var(--white);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--s-lg);
  z-index: 400;
  transform: translateY(130%);
  transition: transform var(--t-slow);
  max-width: calc(var(--max-w) - 24px);
}
@media (min-width: 481px) {
  .install-banner { left: 50%; right: auto; transform: translateX(-50%) translateY(130%); }
  .install-banner.show { transform: translateX(-50%) translateY(0); }
}
.install-banner.show { transform: translateY(0); }

.install-banner-icon { font-size: 28px; flex-shrink: 0; }
.install-banner-text { flex: 1; }
.install-banner-text strong { display: block; font-size: 14.5px; margin-bottom: 2px; }
.install-banner-text span { font-size: 12.5px; opacity: .8; }
.install-banner-btns { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

.btn-install {
  background: var(--white); color: var(--p-dk);
  font-size: 13px; font-weight: 700;
  padding: 7px 16px; border-radius: var(--r-sm);
  border: none; cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.btn-dismiss {
  font-size: 12px; color: rgba(255,255,255,.65);
  text-align: center; cursor: pointer;
  background: none; border: none; font-family: inherit;
}

/* ── 23. Admin Compat (keep admin pages working) ──────────── */
.app-page { min-height: 100vh; }

.topnav {
  background: var(--p);
  color: var(--white);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--s-md);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--white);
}
.nav-logo {
  height: 32px; width: auto; background: #fff;
  border-radius: 6px; padding: 3px 7px; object-fit: contain;
}
.nav-user  { display: flex; align-items: center; gap: 12px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: rgba(255,255,255,.8); padding: 6px 12px;
  border-radius: var(--r-xs); font-size: 14px; transition: background var(--t-fast);
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.15); color: var(--white); text-decoration: none;
}
.user-badge {
  font-size: 13px; color: rgba(255,255,255,.9);
  max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.container { max-width: 1000px; margin: 0 auto; padding: 24px 16px; }

.card {
  background: var(--white); border-radius: var(--r-md); box-shadow: var(--s-sm);
  margin-bottom: 20px; border: 1px solid var(--border); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 16px; font-weight: 700; }

.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 20px; }
.stats-row.four-col { grid-template-columns: repeat(4,1fr); }
@media (max-width: 600px) { .stats-row, .stats-row.four-col { grid-template-columns: repeat(2,1fr); } }

.stat-card {
  background: var(--white); border-radius: var(--r-md); padding: 18px;
  text-align: center; box-shadow: var(--s-sm);
  border: 1px solid var(--border); border-top: 3px solid var(--border);
}
.stat-card.present { border-top-color: var(--p); }
.stat-card.late    { border-top-color: var(--warn); }
.stat-card.absent  { border-top-color: var(--err); }
.stat-num   { font-size: 32px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  background: var(--surface); padding: 11px 14px; text-align: left;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--muted); border-bottom: 2px solid var(--border);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface); }
.row-disabled td { opacity: .5; }

code { background: var(--surface); padding: 2px 7px; border-radius: 4px; font-size: 12px; font-family: monospace; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h2 { font-size: 22px; font-weight: 800; }
.page-header p  { font-size: 13px; color: var(--muted); }

.filter-form {
  background: var(--white); padding: 18px 20px; border-radius: var(--r-md);
  box-shadow: var(--s-sm); margin-bottom: 16px; border: 1px solid var(--border);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-row .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }
.form-group-btn { display: flex; gap: 8px; }

.result-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; font-size: 13px; color: var(--muted);
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px;
}
.modal-box {
  background: var(--white); border-radius: var(--r-md); padding: 28px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--s-lg);
}
.modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.alert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  vertical-align: middle; margin-left: 3px;
}

.alerts-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.alert-item {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--white); border-radius: var(--r-md); padding: 16px 18px;
  box-shadow: var(--s-sm); border-left: 4px solid transparent;
  border: 1px solid var(--border);
}
.alert-unread { border-left-color: #ef4444; background: #fff8f8; }
.alert-read   { border-left-color: var(--border); opacity: .75; }
.alert-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.icon-location { background: #fee2e2; }
.icon-late     { background: var(--warn-lt); }
.alert-body { flex: 1; min-width: 0; }
.alert-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.alert-type-badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.badge-danger  { background: #fee2e2; color: var(--err); }
.badge-warning { background: var(--warn-lt); color: var(--warn); }
.alert-staff { font-size: 13px; color: #374151; font-weight: 600; }
.alert-time  { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.alert-message { font-size: 14px; color: #374151; line-height: 1.5; }
.alert-action { flex-shrink: 0; }
.btn-read {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--white); color: var(--p); font-size: 16px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--t-fast);
}
.btn-read:hover { background: var(--p); color: var(--white); border-color: var(--p); }
.alert-read-tick { color: var(--muted); font-size: 16px; padding: 6px; }
.btn-outline-dark {
  background: transparent; border: 1.5px solid var(--border-dk); color: var(--body);
  padding: 7px 16px; font-size: 13px; border-radius: var(--r-sm);
  cursor: pointer; font-weight: 600; transition: all var(--t-fast); font-family: inherit;
}
.btn-outline-dark:hover { background: var(--surface); }

.text-muted   { color: var(--muted); }
.selfie-link  { color: var(--p); font-size: 13px; font-weight: 600; }
.selfie-dot   { font-size: 16px; }

.loading-spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--p); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 30px auto;
}

@media (max-width: 680px) {
  .container { padding: 16px 12px; }
  .topnav { padding: 0 14px; }
  .nav-links { gap: 4px; }
  .nav-link { padding: 5px 8px; font-size: 13px; }
}
