/* R3 slice 14/14 (65-member-misc.css) — extracted VERBATIM from styles.css lines 7256-8321.
   theme buttons, user profile chip, calendar day states, QR welcome, member card, bundle picker, password strength, phone select, sdt timeline, users page cards, error/offline states.
   Link order in index.html is load-bearing: cascade tie-breaks depend on it. Do not reorder. */

/* Floating Theme Button */
.floating-theme-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: none;
  background: var(--card-start);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.35s, border-color 0.25s, box-shadow 0.25s;
}
.floating-theme-btn:hover {
  transform: scale(1.05);
}
body.auth-mode .floating-theme-btn {
  display: flex;
}

/* Auth Theme Button */
.auth-theme-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
}
.auth-theme-btn:hover {
  background: var(--hover-bg);
  border-color: var(--green);
  color: var(--green);
  transform: scale(1.05);
}
body.dark .auth-theme-btn {
  border-color: var(--hairline);
  color: var(--ink);
}
body.dark .auth-theme-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

/* User Profile Chip */
.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: transparent;
  border: 0;
}

.user-info {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-display-new);
  font-weight: 800;
  font-size: 13.5px;
  color: var(--ink);
  text-align: left;
  line-height: 1.1;
}

.user-info::after {
  content: attr(data-role);
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-top: 1px;
}

/* Custom calendar style additions */
.calendar-day.out-of-session {
  background: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.08) 6px, rgba(148, 163, 184, 0.15) 6px, rgba(148, 163, 184, 0.15) 12px) !important;
  border: 1px dashed rgba(148, 163, 184, 0.4) !important;
  color: var(--muted) !important;
  cursor: not-allowed !important;
  opacity: 0.65;
}
.calendar-day.out-of-session:hover {
  opacity: 0.8;
}
body.dark .calendar-day.out-of-session {
  background: repeating-linear-gradient(45deg, rgba(71, 85, 105, 0.12), rgba(71, 85, 105, 0.12) 6px, rgba(71, 85, 105, 0.22) 6px, rgba(71, 85, 105, 0.22) 12px) !important;
  border: 1px dashed rgba(71, 85, 105, 0.5) !important;
}

.calendar-day.holiday {
  background: rgba(139, 92, 246, 0.08) !important; /* purple background */
  border: 1px dashed rgba(217, 119, 6, 0.6) !important; /* orange dashed border */
  color: #7c3aed !important; /* purple text */
  cursor: not-allowed !important;
}
body.dark .calendar-day.holiday {
  background: rgba(167, 139, 250, 0.12) !important;
  color: #a78bfa !important;
}

.class-tab-btn.active {
  background: var(--green) !important;
  color: #ffffff !important;
  border-color: var(--green) !important;
  box-shadow: 0 4px 12px var(--green-dim) !important;
}

.qr-welcome-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(0, 162, 99, .22), rgba(12, 18, 14, .55));
  backdrop-filter: blur(10px);
  animation: qr-welcome-fade .25s ease;
}

@keyframes qr-welcome-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.qr-welcome-card {
  width: min(440px, 100%);
  padding: 36px 32px;
  text-align: center;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.qr-welcome-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px;
}

.qr-welcome-greeting {
  font-size: 16px;
  color: var(--muted);
}

.qr-welcome-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}

.qr-welcome-sub {
  font-size: 14px;
  color: var(--ink-mid);
  margin: 0 0 20px;
}

.qr-welcome-btn {
  width: 100%;
  justify-content: center;
}

.donor-qr-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
}

.donor-qr-canvas {
  display: grid;
  place-items: center;
  padding: 12px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--hairline);
}

.donor-qr-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.donor-qr-hint {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  margin: 0;
  max-width: 85%;
}

.qr-fallback-link {
  font-size: 12px;
  word-break: break-all;
  color: var(--green);
}

/* ── Post-signup member card ──────────────────────────────────────────────
   A fixed-geometry 940×592 brand card (matching the design reference) that is
   uniformly scaled to its container via --member-card-scale (set in JS). Every
   inner dimension is intentionally hard-coded in px so the scaled output is a
   pixel-faithful match for the downloadable PNG. Colors are brand literals — the
   card looks the same in light and dark mode. */
.member-card-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: min(940px, 100%);
}

.member-card-stage {
  position: relative;
  width: 100%;
  max-width: 940px;
  aspect-ratio: 940 / 592;
}

.member-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 940px;
  height: 592px;
  transform-origin: top left;
  transform: scale(var(--member-card-scale, 1));
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(10, 40, 24, 0.18);
  background: radial-gradient(125% 150% at 14% 8%, #1b6236 0%, #0f4226 52%, #0a3320 100%);
  font-family: 'Space Grotesk', sans-serif;
}

.member-card__border {
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(224, 169, 63, 0.30);
  border-radius: 16px;
  pointer-events: none;
}

.member-card__inner {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  padding: 48px;
  gap: 40px;
}

.member-card__left {
  flex: 1;
  position: relative;
  min-width: 0;
}

/* Vertically centered on the card midline, with the lockup directly above the
   member identity block. */
.member-card__left-block {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.member-card__lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.member-card__logo {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  display: block;
}
.member-card__logo svg { display: block; width: 100%; height: 100%; }

.member-card__wordmark {
  font: 800 24px 'Bricolage Grotesque', sans-serif;
  letter-spacing: 0.02em;
  color: #f3efe2;
  line-height: 1;
}

.member-card__tagline {
  font: 500 14px 'Space Grotesk', sans-serif;
  color: #9db89f;
  margin-top: 5px;
}

.member-card__id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: 100%;
}

.member-card__eyebrow {
  font: 500 12px 'JetBrains Mono', monospace;
  letter-spacing: 0.30em;
  color: #e0a93f;
  text-transform: uppercase;
}

.member-card__name {
  font: 800 52px 'Bricolage Grotesque', sans-serif;
  color: #f3efe2;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 8px 0 0;
  text-wrap: balance;
  /* Names wrap on spaces; pathologically long single tokens break rather than
     overflow into the QR column. */
  overflow-wrap: anywhere;
}

.member-card__since {
  font: 500 13px 'JetBrains Mono', monospace;
  color: #9db89f;
  letter-spacing: 0.08em;
  margin-top: 14px;
}

.member-card__right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.member-card__qr-panel {
  position: relative;
  padding: 18px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.member-card__qr {
  width: 240px;
  height: 240px;
}
.member-card__qr svg { display: block; width: 240px; height: 240px; }

.member-card__qr-logo {
  position: absolute;
  inset: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.member-card__qr-logo-disc {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.member-card__qr-logo-disc svg { display: block; width: 48px; height: 48px; }

.member-card__caption {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 18px;
  text-align: center;
  font: 500 11px 'JetBrains Mono', monospace;
  letter-spacing: 0.22em;
  color: #9db89f;
  text-transform: uppercase;
}

.member-card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 520px) {
  .member-card-actions {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }
  .member-card-actions button { width: 100%; }
}

.qr-signup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(246, 247, 242, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px;
  animation: qr-overlay-fade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qr-overlay-fade {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

body.dark .qr-signup-overlay {
  background: rgba(12, 18, 14, 0.6);
}

/* Distributor bundle picker (donor sponsor-school flow) */
.bundle-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.bundle-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--card-border, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  background: var(--card-start, #fff);
  color: var(--ink, #111);
}
.bundle-card.is-selected { outline: 2px solid var(--green, #2563eb); }
.bundle-card.is-unavailable { opacity: .45; pointer-events: none; }
.bundle-name { font-weight: 600; }
.bundle-contents { font-size: .85rem; color: var(--ink-mid, #555); }
.bundle-price { font-size: .8rem; color: var(--ink, #111); }
.bundle-oos { color: #b91c1c; font-size: .75rem; font-weight: 600; }

/* Taken/Sponsored days styling in calendar */
.calendar-day.taken {
  background: rgba(239, 68, 68, 0.08) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
  cursor: not-allowed !important;
}
.calendar-day.taken span {
  color: #ef4444 !important;
  font-weight: 600;
}
body.dark .calendar-day.taken {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}
body.dark .calendar-day.taken span {
  color: #f87171 !important;
}

/* Too soon: within the 5-day lead time (not yet open, NOT taken). Blue = opens later,
   deliberately distinct from red "Taken", purple "Holiday", and green "Available". */
.calendar-day.too-soon {
  background: rgba(59, 130, 246, 0.08) !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
  cursor: not-allowed !important;
}
.calendar-day.too-soon span {
  color: #2563eb !important;
  font-weight: 600;
}
body.dark .calendar-day.too-soon {
  background: rgba(59, 130, 246, 0.15) !important;
}
body.dark .calendar-day.too-soon span {
  color: #60a5fa !important;
}

/* Selectable days show a green "Available" tag (text only, so the selected/active
   state's green border still stands out). No pupil counts in the calendar. */
.calendar-day.available span {
  color: var(--green) !important;
  font-weight: 600;
}

/* ─── Password Strength and Confirm Checkers ─── */
.password-strength-checker {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 15px;
  margin-top: 11px;
}

.password-strength-checker ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.password-strength-checker li {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}

.password-strength-checker li .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.password-strength-checker li.met {
  color: var(--green);
  font-weight: 500;
}

.password-strength-checker li.met .dot {
  background: var(--green);
  transform: scale(1.2);
}

.password-feedback-text {
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
  transition: color 0.2s ease;
}

.password-feedback-text.mismatch {
  color: #b84432;
}

/* Flip the light-tuned red on dark surfaces (NIN card / strength card use
   --surface-2 #10180F, where #b84432 is only 3.37:1). */
body.dark .password-feedback-text.mismatch {
  color: #FF6B61;
}

.password-feedback-text.match {
  color: var(--green);
}

/* ─── Unified Phone Flag Input ─── */
.auth-phone-container {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
  border: 1px solid var(--border-color, rgba(0,0,0,0.15));
  border-radius: 8px;
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

body.dark .auth-phone-container {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.auth-phone-container:focus-within {
  border-color: var(--primary-color, #00c47a);
  box-shadow: 0 0 0 3px rgba(0, 196, 122, 0.15);
}

.auth-phone-select-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 12px;
  padding-right: 16px;
  border-right: 1px solid var(--border-color, rgba(0,0,0,0.15));
}

body.dark .auth-phone-select-box {
  border-right-color: rgba(255, 255, 255, 0.1);
}

.auth-phone-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 0;
  user-select: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink, #333);
}

body.dark .auth-phone-selected {
  color: var(--ink, #fff);
}

/* Custom drop arrow for phone select wrapper */
.auth-phone-select-box::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted, #888);
  pointer-events: none;
}

.auth-flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  object-fit: cover;
}

.auth-phone-dropdown-list {
  position: absolute;
  top: 100%;
  left: -14px;
  z-index: 100;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(0,0,0,0.15));
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 240px;
  overflow-y: auto;
  width: 240px;
  margin-top: 4px;
}

body.dark .auth-phone-dropdown-list {
  background: #18221c;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.auth-phone-dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink, #333);
  transition: background 0.15s ease;
  text-align: left;
}

body.dark .auth-phone-dropdown-option {
  color: var(--ink, #fff);
}

.auth-phone-dropdown-option:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
}

body.dark .auth-phone-dropdown-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.auth-phone-input-field {
  flex-grow: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--ink, #333);
  font-size: 14px;
  padding: 12px 0;
  outline: none;
}

body.dark .auth-phone-input-field {
  color: var(--ink, #fff);
}

.auth-phone-input-field::placeholder {
  color: var(--text-muted, #888);
}

/* Inactive States Styling */
.nigeria-map path.inactive {
  fill: #e2e8f0 !important;
  stroke: #cbd5e1 !important;
  cursor: not-allowed;
  opacity: 0.6;
}
.nigeria-map path.inactive:hover {
  fill: #cbd5e1 !important;
}
body.dark .nigeria-map path.inactive {
  fill: #1e293b !important;
  stroke: #334155 !important;
  opacity: 0.4;
}
body.dark .nigeria-map path.inactive:hover {
  fill: #334155 !important;
}

/* Geography View Tab Buttons Styling */
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.tab-btn:hover {
  background: var(--bg-card);
  color: var(--text-color);
}
.tab-btn.active {
  background: var(--green) !important;
  color: #ffffff !important;
  border-color: var(--green) !important;
  box-shadow: 0 4px 12px var(--green-dim) !important;
}

/* ─── Sponsorship Delivery Timeline (vibrant, connected) ──────────────────
   Each stage carries its own hex (from SPONSORSHIP_STATUS_MAP in app.js). A
   completed/active stage lights up node + icon + card accent + the connector
   into the next stage; the connector runs node-centre to node-centre (capped
   by the next node) so the line is continuous with no floating gaps.
   See openSponsorshipTimelineModal(). */
.sdt-item { text-align: left; }
.sdt-node {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-end);
  transition: background .25s ease, border-color .25s ease, transform .2s ease;
}
.sdt-node svg { width: 17px; height: 17px; }
/* Perf: pulse is a ::after disc animating transform/opacity on the compositor
   instead of a box-shadow spread repainting each frame. The disc is the same
   hex as the active node's inline background/border (openSponsorshipTimelineModal
   sets background:HEX; border-color:HEX; --sdt-hex:HEX together), so the part
   overlapping the node is invisible — only the expanding ring shows, exactly
   like the old spread. opacity .5 = the old color-mix(...hex 50%, transparent). */
.sdt-node--active::after {
  content: "";
  position: absolute;
  inset: -2px; /* border-box: 38px + 2px border each side = 42px disc */
  border-radius: 50%;
  background: var(--sdt-hex);
  opacity: 0.5;
  z-index: -1;
  animation: sdt-pulse 2s infinite;
}
@keyframes sdt-pulse {
  0%   { transform: scale(1);        opacity: 0.5; } /* = 0px spread @ 50% hex */
  70%  { transform: scale(1.47619);  opacity: 0; }   /* = 10px spread on the 42px disc */
  100% { transform: scale(1);        opacity: 0; }
}
.sdt-conn {
  position: absolute;
  left: 19px;
  top: 19px;
  width: 3px;
  height: 100%;
  transform: translateX(-50%);
  border-radius: 3px;
  z-index: 1;
}
.sdt-conn--flow { overflow: hidden; }
.sdt-conn--flow::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .9), transparent);
  animation: sdt-flow 1.4s linear infinite;
}
/* Perf: translateY (compositor) instead of animating `top` (layout every frame).
   Percentages are of the 45%-tall bar itself: -100% = old top:-45% of the
   track, 255.556% (= 115/45) = old top:115%. Same linear sweep, same overflow
   clipping by .sdt-conn--flow. */
@keyframes sdt-flow { 0% { transform: translateY(-100%); } 100% { transform: translateY(255.556%); } }
.sdt-card {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--hairline);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--card-start);
  transition: background .25s ease, border-color .25s ease;
}
.sdt-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 3px;
}
.sdt-card__title { font-size: 13.5px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.sdt-card--completed .sdt-card__title,
.sdt-card--active .sdt-card__title { color: var(--sdt-c-light); }
body.dark .sdt-card--completed .sdt-card__title,
body.dark .sdt-card--active .sdt-card__title { color: var(--sdt-c-dark); }
.sdt-card--pending .sdt-card__title { color: var(--muted); }
.sdt-card__date {
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
}
.sdt-card__desc { font-size: 12px; color: var(--muted); line-height: 1.45; }
@media (prefers-reduced-motion: reduce) {
  .sdt-node--active::after { animation: none; } /* static = scale(1): fully hidden behind the same-hex node */
  .sdt-conn--flow::after { display: none; }
}

/* Customized Manage State Pill Button */
.manage-state-btn-custom {
  background: transparent;
  color: var(--green, #00a263);
  border: 1px solid var(--green, #00a263);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  outline: none;
}
.manage-state-btn-custom:hover {
  background: var(--green, #00a263);
  color: #fff;
  box-shadow: 0 2px 8px var(--green-dim, rgba(0, 162, 99, 0.25));
}

/* Sponsorship Status Row Colors (Pronounced, using CSS custom properties) */
.sponsorship-row td {
  background: var(--row-bg) !important;
}
.sponsorship-row td:first-child {
  border-left: 10px solid var(--row-border) !important;
}
.sponsorship-row:hover td {
  background: var(--row-bg-hover) !important;
}

/* Custom Teal badge and timeline status styling */
.badge.teal { background: rgba(13, 148, 136, .14); color: #115E59; border-color: rgba(13, 148, 136, .40); }
body.dark .badge.teal { background: rgba(45, 212, 191, .18); color: #5EEAD4; border-color: rgba(45, 212, 191, .36); }

/* Suggested Subclass Card subtle pulse animation */
@keyframes subtle-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.6);
    border-color: rgba(13, 148, 136, 0.8);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(13, 148, 136, 0);
    border-color: rgba(13, 148, 136, 0.4);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
    border-color: rgba(13, 148, 136, 0.8);
  }
}
.suggested-pulse {
  animation: subtle-pulse 1.8s infinite ease-in-out;
  border: 2px solid #0d9488 !important;
  background: rgba(13, 148, 136, 0.03) !important;
}

.badge.violet { background: rgba(124, 58, 237, .14); color: #5B21B6; border-color: rgba(124, 58, 237, .40); }
body.dark .badge.violet { background: rgba(167, 139, 250, .18); color: #C4B5FD; border-color: rgba(167, 139, 250, .36); }


/* Lime green badge and timeline status styling (Feeding Period) */
.badge.lime { background: rgba(132, 204, 22, .16); color: #3F6212; border-color: rgba(132, 204, 22, .42); }
body.dark .badge.lime { background: rgba(132, 204, 22, .18); color: #BEF264; border-color: rgba(132, 204, 22, .38); }

/* -------------------------------------------------- Users page (region cards) */
.user-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin-top: 6px;
}
.user-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--region-color, var(--muted));
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s ease, border-color .2s ease;
}
.user-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -24px rgba(22, 32, 26, .55);
}
.user-card:focus-visible {
  outline: 2px solid var(--region-color, var(--green));
  outline-offset: 2px;
}
.user-card__head { display: flex; align-items: center; gap: 12px; }
.user-card__avatar {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #FBFAF6;
  font-family: var(--font-display-new);
  font-weight: 800; font-size: 14px; letter-spacing: .02em;
  line-height: 1;
}
.user-card__who { min-width: 0; flex: 1; }
.user-card__name {
  font-family: var(--font-display-new);
  font-weight: 800; font-size: 15px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-card__email {
  font-size: 12.5px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-card__status {
  flex-shrink: 0;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 9px; border-radius: 999px;
}
.user-card__status.is-active { background: rgba(0, 162, 75, .14); color: #018442; }
body.dark .user-card__status.is-active { color: #3FD489; }
.user-card__status.is-inactive { background: var(--hover-bg); color: var(--text-muted); }
.user-card__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.user-card .role-badge { font-size: 10.5px; }
.user-card__region-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
}
.user-card__region-tag::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--region-color, var(--muted));
}
.user-card__aff {
  font-size: 11.5px; color: var(--text-muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto;
}
.user-school-toggle { font-size: 12px; }
.user-school-toggle .chev { display: inline-block; transition: transform .2s ease; font-size: 10px; }
.user-school-toggle.is-open .chev { transform: rotate(180deg); }
.user-card__schools {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 12px; border-top: 1px dashed var(--hairline);
}
.user-school-chip {
  font-size: 11.5px; color: var(--ink-mid);
  background: var(--hover-bg); border: 1px solid var(--hairline);
  border-radius: 8px; padding: 4px 9px;
}
@media (max-width: 560px) {
  .user-card-grid { grid-template-columns: 1fr; }
}

/* Reusable error / empty state cards (error-handling rework Phase 2). */
.state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 24px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--card-start, var(--hover-bg));
  color: var(--ink);
}
.state-card .state-icon { font-size: 32px; line-height: 1; }
.state-card .state-title { font-size: 16px; font-weight: 700; }
.state-card .state-message { font-size: 13.5px; color: var(--muted); max-width: 38ch; line-height: 1.5; }
.state-card .primary-btn { margin-top: 8px; }
.error-state { border-color: var(--danger-border, var(--hairline)); }

/* Global offline banner (top of .main, outside #view). */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: 10px;
}
.offline-banner[hidden] { display: none; }

