﻿/* ============================================================
   LCBA User Health Portal â€“ Stylesheet
   Responsive: desktop sidebar + mobile bottom-nav / drawer
   ============================================================ */

/* â”€â”€ Variables â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
  --navy:         #07105f;
  --navy-mid:     #091580;
  --navy-light:   #1f3fb7;
  --navy-bright:  #3554d1;
  --gold:         #ffcc00;
  --gold-soft:    #fff0a0;
  --white:        #ffffff;
  --bg:           #f0f4fb;
  --card:         #ffffff;
  --border:       rgba(9, 21, 128, 0.10);
  --text:         #172033;
  --muted:        #5a6882;
  --success:      #15803d;
  --success-bg:   #dcfce7;
  --warning:      #b45309;
  --warning-bg:   #fef3c7;
  --danger:       #dc2626;
  --danger-bg:    #fee2e2;
  --info:         #0369a1;
  --info-bg:      #e0f2fe;
  --shadow-sm:    0 2px 8px  rgba(5,12,60,.08);
  --shadow:       0 6px 24px rgba(5,12,60,.12);
  --shadow-lg:    0 16px 48px rgba(5,12,60,.18);
  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    6px;
  --sidebar-w:    260px;
  --header-h:     64px;
  --nav-h:        62px;       /* mobile bottom nav height */
  --transition:   0.22s ease;
}

/* â”€â”€ Reset â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--navy-light); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }

/* â”€â”€ Scrollbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(9,21,128,.2); border-radius: 99px; }

/* ======================================================
   AUTH PAGES  (login + signup)
   ====================================================== */

/* Full-screen blurred background */
body.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--navy);
  overflow-x: hidden;
}

/* Background image layer */
body.auth-page::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  background: url('/up-images/background.png') no-repeat center center / cover;
  filter: blur(5px) saturate(0.75) brightness(0.7);
  transform: scale(1.06);
}

/* Dark gradient overlay for readability */
body.auth-page::after {
  content: "";
  position: fixed; inset: 0; z-index: 1;
  background:
    linear-gradient(160deg,
      rgba(7, 16, 95, 0.82) 0%,
      rgba(9, 21, 128, 0.70) 45%,
      rgba(20, 40, 160, 0.60) 100%);
}

/* â”€â”€ Auth shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.auth-shell {
  position: relative; z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 44px;
}

/* â”€â”€ Floating card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.auth-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 22px;
  box-shadow:
    0 32px 80px rgba(5, 12, 60, 0.50),
    0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: cardRise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Wider card for signup (more fields) */
.auth-card.signup-card { max-width: 600px; }

@keyframes cardRise {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* â”€â”€ Card hero banner (logo + school name) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.auth-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1836c8 60%, #2545d8 100%);
  padding: 32px 36px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--gold);
}

/* Decorative circle blobs behind the hero content */
.auth-hero::before {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  top: -80px; right: -60px;
  pointer-events: none;
}
.auth-hero::after {
  content: "";
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.07);
  bottom: -50px; left: -30px;
  pointer-events: none;
}

/* Glow ring around logo */
.auth-logo-ring {
  position: relative; z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--gold);
  box-shadow:
    0 0 0 8px rgba(255, 204, 0, 0.18),
    0 12px 32px rgba(5, 12, 60, 0.45);
  overflow: hidden;
  margin: 0 auto 16px;
  animation: logoPop 0.55s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes logoPop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1);   }
}

.auth-logo-ring img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

/* Fallback icon when image missing */
.auth-logo-ring .logo-fallback {
  font-size: 2.2rem;
  color: var(--navy);
}

.auth-school-name {
  position: relative; z-index: 1;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
  margin-bottom: 4px;
}

.auth-school-full {
  position: relative; z-index: 1;
  font-size: .82rem;
  color: rgba(255,255,255,.78);
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-portal-badge {
  position: relative; z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 204, 0, 0.18);
  border: 1px solid rgba(255, 204, 0, 0.4);
  color: var(--gold-soft);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 99px;
  margin-top: 8px;
}
.auth-portal-badge i { font-size: .7rem; }

/* â”€â”€ Card body (form area) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.auth-body {
  padding: 30px 36px 28px;
}

.auth-body .auth-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}
.auth-body .auth-subtitle {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 22px;
}

.auth-body .switch-link {
  margin-top: 18px;
  font-size: .875rem;
  color: var(--muted);
  text-align: center;
}
.auth-body .switch-link a {
  font-weight: 700;
  color: var(--navy-light);
}

/* â”€â”€ Section dividers inside forms â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.form-section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy-light);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Legacy selectors kept for dashboard compatibility */
.auth-form-panel .eyebrow,
.auth-form-panel h1,
.auth-form-panel .switch-link,
.auth-form-panel .switch-link a,
.auth-brand { display: none; }

/* â”€â”€ Form elements â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.form-grid { display: grid; gap: 14px; }
.form-grid.two-col { grid-template-columns: 1fr 1fr; }
.form-grid.two-col .full { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}
.field input, .field select {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.field input:focus, .field select:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(31,63,183,.12);
  background: var(--white);
}
.field-hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
.otp-input {
  text-align: center;
  letter-spacing: .28em;
  font-size: 1.35rem !important;
  font-weight: 900;
  color: var(--navy);
}
.otp-form {
  gap: 16px;
}

/* â”€â”€ Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-xs);
  font-size: .9rem;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  border: none;
  line-height: 1;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--navy-mid);
  color: var(--white);
  width: 100%;
  padding: 12px;
  font-size: .95rem;
  margin-top: 6px;
}
.btn-primary:hover {
  background: var(--navy-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg);
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #e2e8f8; }
.btn-danger { background: var(--danger); color: var(--white); }

/* â”€â”€ Alert banner â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-xs);
  font-size: .875rem;
  margin-bottom: 16px;
}
.alert-error  { background: var(--danger-bg);  color: var(--danger);  }
.alert-success{ background: var(--success-bg); color: var(--success); }
.alert-info   { background: var(--info-bg);    color: var(--info);    }
.alert i { margin-top: 1px; flex-shrink: 0; }

/* ======================================================
   DASHBOARD APP SHELL
   ====================================================== */

/* â”€â”€ Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition), box-shadow var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-brand .s-logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.sidebar-brand .s-logo img { width: 80%; }
.sidebar-brand .s-title  { font-size: .95rem; font-weight: 800; color: var(--gold); line-height: 1.15; }
.sidebar-brand .s-sub    { font-size: .72rem; opacity: .65; letter-spacing: .06em; text-transform: uppercase; }

/* Nav items */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.72);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item i {
  width: 22px;
  font-size: 1rem;
  text-align: center;
  flex-shrink: 0;
  opacity: .85;
}
.nav-item:hover {
  background: rgba(255,255,255,.1);
  color: var(--white);
  text-decoration: none;
}
.nav-item.active {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255,204,0,.25);
}
.nav-item.active i { opacity: 1; }

/* Section label in nav */
.nav-label {
  padding: 16px 14px 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}

/* Logout at bottom */
.sidebar-footer {
  padding: 12px 12px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.logout-btn:hover {
  background: rgba(220,38,38,.2);
  color: #fca5a5;
  text-decoration: none;
}
.logout-btn i { width: 22px; text-align: center; flex-shrink: 0; }

/* Overlay backdrop (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(7,16,95,.45);
  z-index: 190;
}
.sidebar-overlay.visible { display: block; }

/* â”€â”€ Mobile/top header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.app-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--navy);
  color: var(--white);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 180;
  box-shadow: 0 2px 12px rgba(5,12,60,.25);
  border-bottom: 3px solid var(--gold);
}
.app-header .hdr-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; color: var(--gold); font-size: .95rem;
}
.hdr-hamburger {
  width: 40px; height: 40px;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,.1);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.hdr-user {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: .78rem; line-height: 1.2;
}
.hdr-user strong { color: var(--gold); font-size: .85rem; }
.hdr-user span   { opacity: .7; }

/* â”€â”€ Main content â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 32px 28px 48px;
  max-width: none;
  width: 100%;
}

/* Page header (section title area) */
.page-hdr {
  margin-bottom: 26px;
}
.page-hdr .eyebrow {
  font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--navy-light); margin-bottom: 4px;
}
.page-hdr h2 {
  font-size: 1.65rem; font-weight: 800;
  color: var(--navy);
}
.page-hdr .sub {
  margin-top: 4px; font-size: .9rem; color: var(--muted);
}
.page-hdr .dashboard-greeting {
  margin-top: 8px;
  font-size: 1.08rem;
  font-weight: 500;
  color: #35415d;
}
.page-hdr .dashboard-greeting strong {
  color: var(--navy);
  font-weight: 800;
}
/* â”€â”€ Section visibility â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.section { display: none; }
.section.active { display: block; }
.main-content:has(.section:target) .section {
  display: none;
}
.main-content:has(.section:target) .section:target {
  display: block;
}

/* ======================================================
   DASHBOARD SECTION
   ====================================================== */

/* Summary stat bar */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-box .stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.stat-box .stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-box .stat-icon.green  { background: #dcfce7; color: #15803d; }
.stat-box .stat-icon.red    { background: #fee2e2; color: #dc2626; }
.stat-box .stat-icon.amber  { background: #fef3c7; color: #b45309; }
.stat-box .stat-icon.purple { background: #ede9fe; color: #6d28d9; }
.stat-box .stat-icon.teal   { background: #ccfbf1; color: #0f766e; }
.stat-box .stat-val  { font-size: 1.45rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-box .stat-lbl  { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.stat-box .stat-badge {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
  margin-top: 4px;
}

/* Score card */
.score-showcase {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.score-ring-wrap {
  flex-shrink: 0;
}
.score-ring {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  text-align: center;
  background: rgba(255,255,255,.08);
}
.score-ring .score-num  { font-size: 1.5rem; font-weight: 900; color: var(--gold); line-height: 1; }
.score-ring .score-den  { font-size: .72rem; opacity: .6; }
.score-info .score-title { font-size: .78rem; opacity: .65; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.score-info .score-label { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.score-info .score-sub   { font-size: .85rem; opacity: .75; margin-top: 4px; }
.score-info .score-meta  { margin-top: 10px; display: flex; gap: 18px; flex-wrap: wrap; }
.score-meta-item  { font-size: .82rem; opacity: .75; }
.score-meta-item strong { color: var(--gold-soft); opacity: 1; margin-right: 3px; }

/* Charts grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}
.chart-full { grid-column: 1 / -1; }

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.chart-card .chart-title {
  font-size: .9rem; font-weight: 700;
  color: var(--navy); margin-bottom: 4px;
}
.chart-card .chart-sub {
  font-size: .78rem; color: var(--muted); margin-bottom: 14px;
}
.chart-canvas-wrap { position: relative; }

/* No-data state */
.no-data-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.no-data-state i { font-size: 2.5rem; opacity: .35; margin-bottom: 12px; }
.no-data-state p { font-size: .9rem; }

/* ======================================================
   LATEST MEASUREMENT SECTION
   ====================================================== */

.latest-timestamp {
  font-size: .85rem; color: var(--muted);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.latest-timestamp i { color: var(--navy-light); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.metric-header {
  display: flex; align-items: center; justify-content: space-between;
}
.metric-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
}
.metric-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.metric-icon.red    { background: #fee2e2; color: #dc2626; }
.metric-icon.green  { background: #dcfce7; color: #15803d; }
.metric-icon.purple { background: #ede9fe; color: #6d28d9; }
.metric-icon.amber  { background: #fef3c7; color: #b45309; }
.metric-icon.teal   { background: #ccfbf1; color: #0f766e; }

.metric-label  { font-size: .8rem; color: var(--muted); font-weight: 600; }
.metric-value  { font-size: 2rem; font-weight: 900; color: var(--navy); line-height: 1; }
.metric-unit   { font-size: .9rem; color: var(--muted); font-weight: 400; margin-left: 4px; }
.metric-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
}
.status-normal  { background: var(--success-bg); color: var(--success); }
.status-high    { background: var(--danger-bg);  color: var(--danger);  }
.status-low     { background: var(--info-bg);    color: var(--info);    }
.status-elevated{ background: var(--warning-bg); color: var(--warning); }
.status-nodata  { background: var(--bg);         color: var(--muted);   }

/* ======================================================
   HISTORY SECTION
   ====================================================== */

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.history-search {
  position: relative;
  flex: 1; min-width: 200px; max-width: 320px;
}
.history-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--white);
  font-size: .875rem;
  outline: none;
  transition: border-color var(--transition);
}
.history-search input:focus { border-color: var(--navy-light); }
.history-search i {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: .85rem;
}
.history-count {
  font-size: .85rem; color: var(--muted);
  white-space: nowrap;
}

.table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  white-space: nowrap;
}
thead th {
  background: var(--navy);
  color: rgba(255,255,255,.85);
  padding: 13px 16px;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
thead th:first-child { border-radius: 0; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f5f8ff; }
tbody td { padding: 12px 16px; color: var(--text); }
tbody td.no-data { text-align: center; color: var(--muted); padding: 32px; font-style: italic; }

/* Row badge chips */
.chip {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  padding: 2px 9px; border-radius: 99px;
}
.chip-normal   { background: var(--success-bg); color: var(--success); }
.chip-high     { background: var(--danger-bg);  color: var(--danger);  }
.chip-low      { background: var(--info-bg);    color: var(--info);    }
.chip-elevated { background: var(--warning-bg); color: var(--warning); }

/* ======================================================
   SETTINGS SECTION
   ====================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.settings-card.full { grid-column: 1 / -1; }
.settings-card-hdr {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.settings-card-hdr i {
  width: 38px; height: 38px;
  background: #dbeafe; color: #1d4ed8;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.settings-card-hdr .s-card-title { font-size: .95rem; font-weight: 700; color: var(--navy); }
.settings-card-hdr .s-card-sub   { font-size: .8rem; color: var(--muted); margin-top: 1px; }

.settings-form { display: flex; flex-direction: column; gap: 14px; }

#settings-toast {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ======================================================
   MOBILE BOTTOM NAV
   ====================================================== */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--navy);
  border-top: 2px solid var(--gold);
  z-index: 180;
  padding: 0 4px;
}
.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(255,255,255,.6);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
  border: none;
  background: none;
  transition: color var(--transition);
}
.bn-item i { font-size: 1.15rem; }
.bn-item.active { color: var(--gold); }
.bn-item:hover  { color: var(--white); }

/* ======================================================
   RESPONSIVE
   ====================================================== */

/* â”€â”€ Tablet â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1024px) {
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-full  { grid-column: 1 / -1; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

/* â”€â”€ Mobile (sidebar becomes overlay drawer) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(5,12,60,.28);
  }
  .main-wrap {
    margin-left: 0;
    padding-top: var(--header-h);
    padding-bottom: var(--nav-h);
  }
  .app-header  { display: flex; }
  .bottom-nav  { display: flex; }
  .main-content { padding: 20px 16px 32px; }

  .auth-card { max-width: 480px; }
  .auth-body  { padding: 24px 24px 22px; }
  .auth-hero  { padding: 26px 24px 22px; }
  .auth-logo-ring { width: 80px; height: 80px; }
  .auth-school-name { font-size: 1.3rem; }

  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
  .score-showcase { flex-direction: column; text-align: center; }
  .score-info .score-meta { justify-content: center; }
}

@media (max-width: 480px) {
  .auth-body  { padding: 20px 18px 18px; }
  .auth-hero  { padding: 22px 18px 18px; }
  .auth-logo-ring { width: 72px; height: 72px; }
  .form-grid.two-col { grid-template-columns: 1fr; }
  .form-grid.two-col .full { grid-column: 1 / -1; }
}




