/* ASH-ARI Attendance — institutional theme on Bootstrap 5 */
:root {
  --brand: #0f4c5c;
  --brand-2: #1b7f8c;
  --brand-soft: #e7f2f3;
  --accent: #e3a33b;
  --bs-primary: #0f4c5c;
  --bs-primary-rgb: 15, 76, 92;
  --bs-link-color: #0f5f70;
  --bs-link-color-rgb: 15, 95, 112;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: #0b3a47; --bs-btn-hover-border-color: #0b3a47; --bs-btn-active-bg: #082c36; --bs-btn-disabled-bg: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.form-control:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 .2rem rgba(27, 127, 140, .25); }
.skip-link { position: absolute; left: .5rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; }

.app-body { background: #f4f7f8; }
.app-nav { background: var(--brand); }
.app-nav .nav-link.active { color: #fff; font-weight: 600; border-bottom: 2px solid var(--accent); }
.demo-banner { background: var(--accent); color: #2b1d00; text-align: center; font-weight: 600; font-size: .85rem; padding: .25rem; }
.brand-title { color: var(--brand); font-weight: 700; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.stat-card { border: 0; border-left: 4px solid var(--brand-2); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat-card.present { border-left-color: #198754; }
.stat-card.late { border-left-color: #e3a33b; }
.stat-card.absent { border-left-color: #dc3545; }
.stat-card.flagged { border-left-color: #fd7e14; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; color: #55666b; white-space: nowrap; }
.table-sm td, .table-sm th { vertical-align: middle; }
.chart-box { position: relative; height: 260px; }
.empty-state { text-align: center; color: #6c7a7e; padding: 2.5rem 1rem; }
.filters .form-label { font-size: .8rem; margin-bottom: .15rem; color: #55666b; }
.evidence-img { max-width: 140px; max-height: 180px; width: auto; height: auto; object-fit: contain; border-radius: .5rem; border: 1px solid #ccd; }
.qr-box { width: 220px; max-width: 100%; }
.qr-box svg { width: 100%; height: auto; display: block; }
.code-input { letter-spacing: .3em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Guest pages */
.guest-body { background: linear-gradient(160deg, var(--brand-soft), #fff 60%); min-height: 100vh; }
.guest-wrap { max-width: 420px; margin: 0 auto; padding: 3rem 1rem; }

/* Student mobile flow */
.mobile-body { background: #f4f7f8; min-height: 100vh; }
.mobile-header { background: var(--brand); color: #fff; display: flex; gap: .6rem; align-items: center; padding: .75rem 1rem; padding-top: max(.75rem, env(safe-area-inset-top)); }
.mobile-main { max-width: 480px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.stepper { display: flex; list-style: none; padding: 0; margin: 0 0 1rem; gap: .25rem; }
.stepper li { flex: 1; text-align: center; font-size: .72rem; color: #7a8a8e; }
.stepper li span { display: block; width: 1.8rem; height: 1.8rem; line-height: 1.8rem; border-radius: 50%; background: #dfe7e9; margin: 0 auto .2rem; font-weight: 700; color: #5a6b70; }
.stepper li.active { color: var(--brand); font-weight: 600; }
.stepper li.active span { background: var(--brand); color: #fff; }
.stepper li.complete span { background: #198754; color: #fff; }
.session-card { background: #fff; border-left: 4px solid var(--brand-2); border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.ticket-timer { color: #8a5a00; }
.step { background: #fff; border-radius: .75rem; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.btn-lg { min-height: 3.2rem; }
.id-input { font-size: 1.6rem; letter-spacing: .15em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.scanner { position: relative; background: #111; border-radius: .75rem; overflow: hidden; aspect-ratio: 1 / 1; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.85); border-radius: 1rem; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.selfie-wrap { position: relative; background: #111; border-radius: .75rem; overflow: hidden; aspect-ratio: 3 / 4; margin-bottom: .5rem; }
.selfie-wrap video, .selfie-wrap img { width: 100%; height: 100%; object-fit: cover; }
.selfie-wrap video { transform: scaleX(-1); }
.face-guide { position: absolute; left: 50%; top: 45%; width: 58%; height: 58%; transform: translate(-50%, -50%); border: 3px dashed rgba(255,255,255,.9); border-radius: 50%; pointer-events: none; }
.selfie-wrap img:not(.d-none) ~ .face-guide { display: none; }
.busy { position: fixed; inset: 0; background: rgba(255,255,255,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1050; color: var(--brand); }
.result-icon { width: 5rem; height: 5rem; border-radius: 50%; margin: .5rem auto 0; font-size: 2.8rem; line-height: 5rem; color: #fff; font-weight: 700; }
.result-icon.ok { background: #198754; }
.result-icon.pending { background: #e3a33b; }
.receipt { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; background: #f6f9fa; border-radius: .5rem; padding: 1rem; }
.receipt dt { color: #6c7a7e; font-weight: 500; }
.receipt dd { margin: 0; font-weight: 600; word-break: break-word; }

/* Classroom QR display */
.display-body { background: #fff; min-height: 100vh; }
.qr-stage { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; min-height: 100vh; padding: 2rem; align-items: center; }
.qr-stage .qr-big { width: min(70vh, 100%); margin: 0 auto; }
.qr-stage .qr-big svg { width: 100%; height: auto; }
.qr-inactive .qr-big { opacity: .15; }
.qr-title { font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 700; color: var(--brand); }
.qr-count { font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 800; line-height: 1; color: #198754; }
.qr-countdown { font-size: 1.2rem; color: #55666b; }
.qr-state { font-size: 1.6rem; font-weight: 600; }
#recent { list-style: none; padding: 0; font-size: 1rem; color: #333; max-height: 30vh; overflow: hidden; }
@media (max-width: 900px) { .qr-stage { grid-template-columns: 1fr; } }

@media print {
  .app-nav, footer, .no-print, .btn, form.filters { display: none !important; }
  .app-body { background: #fff; }
}
