/* ============================================================
   SAADHYA SMART ID — SHARED STYLESHEET
   ------------------------------------------------------------
   Design intent: calm, predictable, non-overstimulating.
   Neurodivergent-friendly rules we follow throughout:
     - No flashing/auto-playing animation
     - Big, obvious tap targets (min 56px tall)
     - High contrast text, generous spacing
     - Motion only on hover/focus, and only a gentle fade
   Every page on the site links this ONE file, so if you want
   to change a color or button style, you only edit it here.
   ============================================================ */

:root {
  /* ---- Color tokens (soft blue & white palette) ---- */
  --bg: #F4F9FD;              /* page background — very soft blue-white */
  --surface: #FFFFFF;         /* card background */
  --surface-soft: #EAF3FB;    /* tinted panel background */
  --primary: #4E86B5;         /* soft, calm blue — main brand color */
  --primary-dark: #34618A;    /* pressed / hover state */
  --primary-contrast: #FFFFFF;
  --accent: #7FB9A2;          /* muted green — used sparingly for "safe/help" */
  --alert: #E2726B;           /* soft coral red — emergency actions only */
  --alert-dark: #C15850;
  --text: #24374A;            /* main body text */
  --text-muted: #5B7186;      /* secondary text */
  --border: #DCEAF4;
  --focus-ring: #F7B733;      /* warm, high-visibility focus outline */

  /* ---- Layout tokens ---- */
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 18px rgba(52, 97, 138, 0.10);
  --max-width: 480px; /* mobile-first: content column, centers nicely on desktop too */
}

/* ---- Reset & base ---- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px; /* comfortably readable minimum */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Nunito', 'Inter', sans-serif; /* rounded, friendly display face */
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px 0;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p  { margin: 0 0 12px 0; color: var(--text-muted); }

a { color: var(--primary); }

img { max-width: 100%; display: block; }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Visible keyboard focus everywhere — important for accessibility */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---- Page shell ---- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 40px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
}

/* ---- Top bar / branding ---- */
.topbar {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 18px;
  text-align: center;
}

.topbar .school-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary-dark);
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  overflow-wrap: anywhere; /* safety net: any long unbroken text (emails,
    URLs, IDs) wraps inside the card instead of forcing horizontal
    overflow and pushing content off-screen on mobile */
}

/* html/body themselves should never allow sideways scroll from a
   stray overflow anywhere on the page */
html, body { overflow-x: hidden; }

.card-soft {
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}

/* ---- Profile photo ---- */
.profile-photo-wrap {
  display: flex;
  justify-content: center;
  margin: 6px 0 18px;
}

.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface-soft);
  box-shadow: var(--shadow-card);
  background: var(--surface-soft);
}

/* ---- Info rows (label/value pairs) ---- */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }

.info-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.info-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ---- Buttons ---- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }

.btn-icon { font-size: 1.3rem; line-height: 1; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
}
.btn-primary:hover, .btn-primary:focus-visible { filter: brightness(1.08); }

.btn-alert {
  background: var(--alert);
  color: #fff;
}
.btn-alert:hover, .btn-alert:focus-visible { filter: brightness(1.06); }

.btn-secondary {
  background: var(--surface-soft);
  color: var(--primary-dark);
  border: 2px solid var(--border);
}
.btn-secondary:hover, .btn-secondary:focus-visible { background: #DEEDF8; }

.btn-outline {
  background: transparent;
  color: var(--primary-dark);
  border: 2px solid var(--primary);
}

.btn-block-group { margin-top: 6px; }

/* Big emergency button on the profile page */
.btn-sos {
  background: var(--alert);
  color: #fff;
  font-size: 1.2rem;
  min-height: 72px;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(226, 114, 107, 0.35);
}

/* ---- Nav back link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 0.95rem;
}

/* ---- Chips / tags (medical conditions, allergies) ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  background: var(--surface-soft);
  color: var(--primary-dark);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
}
.chip-alert { background: #FBE7E5; color: var(--alert-dark); }

/* ---- How-to-help guidance list ---- */
.help-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.help-item:last-child { border-bottom: none; }
.help-item .emoji { font-size: 1.8rem; line-height: 1; }
.help-item h3 { margin: 0 0 2px 0; font-size: 1.02rem; }
.help-item p { margin: 0; font-size: 0.95rem; }

/* ---- Forms (admin) ---- */
label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin: 14px 0 6px;
}
input, select, textarea {
  width: 100%;
  padding: 13px 14px;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  outline: none;
}
textarea { min-height: 90px; resize: vertical; }
.field-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Status / loading / error states ---- */
.status-box {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.status-box .emoji { font-size: 2.4rem; display: block; margin-bottom: 10px; }

.badge-error {
  background: #FBE7E5;
  color: var(--alert-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.badge-success {
  background: #E5F3EC;
  color: #2E6B4F;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ---- Admin table (student list) ---- */
.student-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
}
.student-list-item img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  background: var(--surface-soft);
}
.student-list-item .avatar {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  flex-shrink: 0; border-radius: 50%;
  background: var(--surface-soft); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; line-height: 1;
  overflow: hidden;
}
.student-list-item .meta { flex: 1; min-width: 0; }
.student-list-item .meta strong { display: block; font-size: 1rem; overflow-wrap: anywhere; }
.student-list-item .meta span { font-size: 0.85rem; color: var(--text-muted); overflow-wrap: anywhere; }
.student-list-item { flex-wrap: wrap; }
.student-list-item > *:not(.avatar):not(.meta) { flex-shrink: 0; }

/* ---- Footer note ---- */
.footer-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 20px;
}

/* Slightly wider column on larger screens, still centered & simple */
@media (min-width: 640px) {
  .page { padding-top: 40px; }
}

/* ============================================================
   V2 ADDITIONS — beautify pass + new component classes
   (Appended so the original rules above stay untouched/easy to diff)
   ============================================================ */

body {
  background: linear-gradient(160deg, #F4F9FD 0%, #EAF3FB 60%, #E6F1FA 100%);
  min-height: 100vh;
}

/* Small circular icon badge shown above a card's <h1> */
.title-icon-circle {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--surface-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; margin: 0 auto 12px;
  box-shadow: inset 0 0 0 1px var(--border);
}

/* Small uppercase eyebrow label used above a group of buttons,
   e.g. "📞 CONTACTS" — this is what declutters Emergency Help */
.section-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 22px 4px 10px;
  display: flex; align-items: center; gap: 6px;
}
.section-label:first-of-type { margin-top: 6px; }

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.section-label-row .section-label { margin: 0; }

.btn-danger-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: auto;
  min-height: 0;
  padding: 8px 14px;
  margin: 0;
  background: transparent;
  border: 2px solid var(--alert);
  border-radius: var(--radius-md);
  color: var(--alert);
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.08s ease;
}
.btn-danger-sm:hover, .btn-danger-sm:focus-visible { background: rgba(193, 88, 80, 0.08); }
.btn-danger-sm:active { transform: scale(0.98); }

/* Icon circle sitting inside a full-width button, left side */
.btn-icon-badge {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
  background: rgba(255,255,255,0.28);
}
.btn-secondary .btn-icon-badge, .btn-outline .btn-icon-badge {
  background: var(--surface); box-shadow: 0 1px 4px rgba(52,97,138,0.12);
}

/* 2-up compact grid for calls / navigation — cuts vertical clutter */
.btn-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 12px;
}
.btn-compact {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 78px; padding: 12px 10px;
  border: none; border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.88rem;
  cursor: pointer; text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn-compact:active { transform: scale(0.97); }
.btn-compact .btn-icon-badge { width: 38px; height: 38px; font-size: 1.25rem; }

/* WhatsApp green — used only for WhatsApp actions, everywhere */
.btn-whatsapp {
  background: #25D366; color: #fff;
}
.btn-whatsapp:hover, .btn-whatsapp:focus-visible { filter: brightness(1.05); }

/* Softer, slightly deeper card shadow + gentle hover lift on tappable cards */
.card { box-shadow: 0 6px 22px rgba(52, 97, 138, 0.09); }
.student-list-item, .card.tappable { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.student-list-item:hover, .card.tappable:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(52,97,138,0.14);
}

/* Divider used between grouped sections on busy pages */
.soft-divider { height: 1px; background: var(--border); margin: 18px 4px; border: none; }

/* Small pill badge for showing a count/status inline with a heading */
.pill-count {
  display: inline-block; background: var(--surface-soft); color: var(--primary-dark);
  font-size: 0.75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; margin-left: 8px;
}

/* Table used on the bulk upload results page */
.result-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.result-table th, .result-table td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border);
}
.result-table th { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.result-table td.url-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-copy-btn {
  background: var(--surface-soft); color: var(--primary-dark); border: none;
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
  flex-shrink: 0; white-space: nowrap;
}

/* Drag-and-drop zone for bulk upload */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 30px 16px; text-align: center; color: var(--text-muted);
  background: var(--surface); margin-bottom: 16px; cursor: pointer;
}
.dropzone.dragover { border-color: var(--primary); background: var(--surface-soft); }

/* ============================================================
   V3 ADDITIONS — responsive layout (mobile/tablet/desktop) +
   subtle motion. Purely additive: nothing above is removed, so
   this is safe to append. All animation respects the existing
   prefers-reduced-motion rule already defined near the top of
   this file (it force-disables *all* animation/transition for
   people who've asked for that at the OS level).
   ============================================================ */

/* ---- Soft decorative backdrop (fixed, non-interactive, subtle) ---- */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}
body::before {
  width: 340px; height: 340px;
  background: #CFE4F3;
  top: -120px; right: -100px;
}
body::after {
  width: 300px; height: 300px;
  background: #DCEFE6;
  bottom: -100px; left: -110px;
}

/* ---- Entrance animation for cards — gentle, one-time, no loop ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .card-soft {
  animation: fadeInUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* NOTE: intentionally NOT animating .student-list-item — animating
   transform on individual CSS Grid items causes a known Safari
   rendering bug where the item visually detaches from its grid
   cell during/after the animation. The parent .card fade-in above
   is enough motion; list rows just appear directly, which also
   avoids any layout flash when there are many students. */

/* ---- Hover polish (mouse/trackpad only — skipped on touch so
   nothing feels laggy or "stuck" on a phone tap) ---- */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover, .btn-alert:hover, .btn-whatsapp:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(52, 97, 138, 0.22);
  }
  .btn-secondary:hover, .btn-outline:hover {
    transform: translateY(-1px);
  }
  .btn-compact:hover { transform: translateY(-2px); }
  .card.tappable:hover, .student-list-item:hover {
    transform: translateY(-2px);
  }
}

/* ---- Tablet (≥700px): breathing room, wider column, 2-up grids ---- */
@media (min-width: 700px) {
  :root { --max-width: 560px; }
  .page { padding-top: 48px; }
  h1 { font-size: 1.8rem; }
  body { font-size: 17.5px; }

  /* Action button groups (dashboard shortcuts, etc.) go 2-up */
  .btn-grid-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  }
  .btn-grid-actions .btn { margin-bottom: 0; }

  /* List containers (student lists, access lists) go 2-up */
  .list-container {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  }
  .list-container .student-list-item { margin-bottom: 0; }
}

/* ---- Desktop (≥1000px): wider canvas, richer spacing, 3-up grids ---- */
@media (min-width: 1000px) {
  :root { --max-width: 680px; }
  .page { padding-top: 60px; padding-bottom: 60px; }

  .list-container {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .card { padding: 26px 28px; }
  .card-soft { padding: 20px 24px; }
}

/* Donor "Voices" story cards look better in a multi-column layout
   on bigger screens — scoped to .voices-grid specifically (see
   donor-portal.html) so it never affects single-student pages
   like profile.html/parent-portal.html that also use #content. */
@media (min-width: 900px) {
  .voices-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start;
  }
}

/* ============================================================
   V4 ADDITIONS — app shell (sidebar + bottom nav), stat cards,
   donut charts, search bar, pills/badges, quick-action tiles.
   Scoped under .shell-* / .stat-* / .pill-* classes so none of
   this touches the public safety-card pages (profile/emergency/
   medical/etc.) or the parent/donor portals — those keep their
   existing simple mobile-first design on purpose.
   ============================================================ */

/* ---- Shell layout wrapper ---- */
.shell {
  display: flex;
  min-height: 100vh;
  max-width: none;
}
.shell-main {
  flex: 1;
  min-width: 0;
  padding: 20px 16px 90px; /* bottom padding clears the mobile bottom nav */
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Sidebar (desktop) ---- */
.shell-sidebar {
  display: none;
}
@media (min-width: 900px) {
  .shell-sidebar {
    display: flex; flex-direction: column;
    width: 232px; flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 22px 16px;
    position: sticky; top: 0; height: 100vh;
  }
  .shell-main { padding: 28px 32px 40px; }
}
.shell-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.05rem;
  color: var(--primary-dark); margin-bottom: 26px; padding: 0 6px;
}
.shell-logo .emoji { font-size: 1.5rem; }
.shell-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.shell-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
  font-weight: 700; font-size: 0.92rem;
}
.shell-nav a .icon { font-size: 1.1rem; width: 22px; text-align: center; }
.shell-nav a:hover { background: var(--surface-soft); color: var(--primary-dark); }
.shell-nav a.active { background: var(--surface-soft); color: var(--primary-dark); }
.shell-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-top: 1px solid var(--border); margin-top: 10px;
}
.shell-user .avatar-chip {
  width: 34px; height: 34px; border-radius: 50%; background: var(--surface-soft);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--primary-dark); flex-shrink: 0;
}
.shell-user .meta { flex: 1; min-width: 0; }
.shell-user .meta strong { display: block; font-size: 0.85rem; overflow-wrap: anywhere; }
.shell-user .meta span { font-size: 0.75rem; color: var(--text-muted); }
.shell-user button {
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.95rem;
}

/* ---- Top bar (search + bell + avatar) ---- */
.shell-topbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.shell-topbar .greeting { flex: 1; min-width: 200px; }
.shell-topbar h1 { font-size: 1.3rem; margin-bottom: 2px; }
.shell-topbar p { margin: 0; font-size: 0.88rem; }
.shell-search {
  flex: 1; min-width: 180px; max-width: 320px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 999px; padding: 8px 14px;
}
.shell-search input {
  border: none; padding: 0; font-size: 0.9rem; background: transparent;
}
.shell-search input:focus { outline: none; }
.shell-bell {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0; cursor: default;
}

/* ---- Bottom nav (mobile) ---- */
.shell-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(52,97,138,0.08);
}
@media (min-width: 900px) { .shell-bottomnav { display: none; } }
.shell-bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--text-muted); font-size: 0.68rem; font-weight: 700;
  flex: 1; padding: 4px 2px;
}
.shell-bottomnav a .icon { font-size: 1.25rem; }
.shell-bottomnav a.active { color: var(--primary-dark); }
.shell-bottomnav a.scan-btn .icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-top: -22px;
  box-shadow: 0 4px 14px rgba(78,134,181,0.4);
}

/* ---- Stat cards ---- */
.stat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px;
}
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; display: flex; align-items: center; gap: 12px;
}
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.stat-card .stat-value { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.35rem; line-height: 1.1; color: var(--text); }
.stat-card .stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.stat-icon.tone-blue  { background: #E7F1FA; color: var(--primary-dark); }
.stat-icon.tone-green { background: #E5F3EC; color: #2E6B4F; }
.stat-icon.tone-red   { background: #FBE7E5; color: var(--alert-dark); }
.stat-icon.tone-amber { background: #FCF1DC; color: #8A6416; }
.stat-icon.tone-purple{ background: #EDE9FB; color: #5B4B9E; }

/* ---- Quick action tiles ---- */
.action-tile-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px;
}
@media (min-width: 700px) { .action-tile-grid { grid-template-columns: repeat(3, 1fr); } }
.action-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
}
.action-tile .tile-icon {
  width: 38px; height: 38px; border-radius: 11px; background: var(--surface-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.action-tile strong { color: var(--text); font-size: 0.92rem; }
.action-tile span { color: var(--text-muted); font-size: 0.78rem; }

/* ---- Status pills ---- */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px; font-size: 0.76rem; font-weight: 800;
}
.status-pill.tone-green { background: #E5F3EC; color: #2E6B4F; }
.status-pill.tone-red   { background: #FBE7E5; color: var(--alert-dark); }
.status-pill.tone-amber { background: #FCF1DC; color: #8A6416; }
.status-pill.tone-blue  { background: #E7F1FA; color: var(--primary-dark); }
.status-pill.tone-grey  { background: #F0F0F0; color: #666; }

/* ---- Donut chart card wrapper ---- */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.donut-canvas-box { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut-center-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; pointer-events: none;
}
.donut-center-label strong { font-family: 'Nunito', sans-serif; font-size: 1.4rem; color: var(--text); }
.donut-center-label span { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-legend .row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ---- Login role select cards (landing page) ---- */
.role-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; text-decoration: none; margin-bottom: 10px;
}
.role-card .role-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--surface-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.role-card strong { color: var(--text); display: block; font-size: 0.98rem; }
.role-card span { color: var(--text-muted); font-size: 0.8rem; }
.role-card .arrow { margin-left: auto; color: var(--primary); font-weight: 800; }

/* ---- NFC scan pulse (respects reduced-motion via the global rule) ---- */
.scan-circle {
  width: 160px; height: 160px; border-radius: 50%; margin: 30px auto;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
  position: relative;
}
.scan-circle::before, .scan-circle::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--primary); opacity: 0; animation: scanPulse 2.2s ease-out infinite;
}
.scan-circle::after { animation-delay: 1.1s; }
@keyframes scanPulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---- Two-column panel layout (Manage Access, etc.) ---- */
.two-col-panel {
  display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start;
}
@media (min-width: 900px) {
  .two-col-panel { grid-template-columns: 1fr 1.3fr; }
}
/* .list-container defaults to 2-3 columns at tablet/desktop widths (see
   above), which is right for a full-width list (Dashboard, Attendance) but
   far too cramped when the list lives inside one half of a two-col-panel
   (Manage Access) — that's what was squeezing each card down to a sliver
   and wrapping emails one character per line. Force single column here
   regardless of viewport width; this selector's extra specificity always
   wins over the plain .list-container media-query rules. */
.two-col-panel .list-container {
  grid-template-columns: 1fr !important;
}

/* ---- Role toggle tabs (Parent / Donor) ---- */
.role-tabs { display: flex; gap: 8px; margin-bottom: 6px; }
.role-tab {
  flex: 1; text-align: center; padding: 10px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--surface); color: var(--text-muted);
  font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.role-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Landing page hero layout ---- */
.landing-shell { max-width: 1000px; margin: 0 auto; padding: 30px 16px 50px; }
.landing-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
@media (min-width: 900px) { .landing-grid { grid-template-columns: 1.1fr 0.9fr; gap: 40px; } }
.landing-brand { display: flex; align-items: center; gap: 10px; font-family: 'Nunito',sans-serif; font-weight: 800; color: var(--primary-dark); margin-bottom: 24px; }
.landing-hero h1 { font-size: 2.1rem; line-height: 1.15; }
.landing-hero .highlight { color: var(--primary); }
.landing-feature { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--text); font-size: 0.92rem; font-weight: 600; }
.landing-illustration { display: flex; justify-content: center; margin: 20px 0; }
