/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Theme variables */
[data-theme="light"] {
  --bg:       #f7f0e8;
  --surface:  #ffffff;
  --surface2: #f2ece3;
  --border:   #e8ddd0;
  --text:     #1a1208;
  --text2:    #5a4a38;
  --text3:    #9a8a78;
  --red:      #d4000f;
  --red2:     #b8000d;
  --red-bg:   rgba(212,0,15,0.08);
  --green:    #1a6b3a;
  --green-bg: rgba(26,107,58,0.1);
  --blue:     #1a4a8a;
  --blue-bg:  rgba(26,74,138,0.1);
  --amber:    #b86a00;
  --amber-bg: rgba(184,106,0,0.1);
  --nav-bg:   #d4000f;
  --shadow:   0 4px 20px rgba(0,0,0,0.12);
  --shadow-sm:0 2px 8px rgba(0,0,0,0.07);
}

[data-theme="dark"] {
  --bg:       #0f0d0a;
  --surface:  #1a1510;
  --surface2: #231e18;
  --border:   #2e2820;
  --text:     #f0ebe3;
  --text2:    #b8a898;
  --text3:    #7a6a5a;
  --red:      #e83040;
  --red2:     #c82030;
  --red-bg:   rgba(232,48,64,0.12);
  --green:    #2a9b5a;
  --green-bg: rgba(42,155,90,0.12);
  --blue:     #3a7adf;
  --blue-bg:  rgba(58,122,223,0.12);
  --amber:    #df9a00;
  --amber-bg: rgba(223,154,0,0.12);
  --nav-bg:   #1a0808;
  --shadow:   0 4px 20px rgba(0,0,0,0.5);
  --shadow-sm:0 2px 8px rgba(0,0,0,0.3);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.25s, color 0.25s;
}

/* ── NAVBAR ──────────────────────────────────────────────── */

.navbar {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}

.brand-drop {
  display: inline-block;
  width: 16px;
  height: 20px;
  background: #fff;
  clip-path: polygon(50% 0%, 85% 25%, 100% 60%, 80% 100%, 20% 100%, 0% 60%, 15% 25%);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}

.nav-link {
  padding: 6px 14px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.15); color: #fff; }
.nav-admin { color: #ffd700 !important; }

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-search-wrap {
  display: flex;
  gap: 6px;
}

.nav-search-wrap input {
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  outline: none;
  width: 200px;
}

.nav-search-wrap input::placeholder { color: rgba(255,255,255,0.55); }
.nav-search-wrap input:focus { background: rgba(255,255,255,0.28); }

.nav-search-wrap button {
  height: 34px;
  padding: 0 14px;
  background: #fff;
  color: var(--red);
  border: none;
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.nav-username {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.theme-btn {
  height: 32px;
  padding: 0 12px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.theme-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }

.btn-signout-nav {
  height: 30px;
  padding: 0 11px;
  background: transparent;
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-signout-nav:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

.admin-chip {
  font-size: 0.62rem;
  font-weight: 900;
  background: #ffd700;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── PAGES ────────────────────────────────────────────────── */

.page { display: none; animation: fadein 0.22s ease; }
.page.active { display: block; }

@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── LANDING / HERO ──────────────────────────────────────── */

.hero {
  min-height: calc(100vh - 60px);
  background: #e8d5b8;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
}

[data-theme="dark"] .hero { background: #1a0f08; }

.hero-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  pointer-events: none;
}

.hero-shape-1 {
  width: 600px; height: 600px;
  background: var(--red);
  top: -200px; left: -150px;
}

.hero-shape-2 {
  width: 400px; height: 400px;
  background: var(--red);
  bottom: -100px; right: -80px;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 680px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--red);
  letter-spacing: -0.05em;
  margin-bottom: 14px;
  line-height: 1.1;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text2);
  margin-bottom: 56px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* The two big hero buttons matching the reference image exactly */
.hero-btn {
  width: 560px;
  max-width: 90vw;
  padding: 24px 40px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 24px rgba(212,0,15,0.35);
  letter-spacing: 0.01em;
}

.hero-btn:hover {
  background: var(--red2);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(212,0,15,0.45);
}

.hero-or {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--red);
  padding: 20px 0;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 40px;
  margin-top: 60px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stat { text-align: center; }
.hero-stat-num   { font-size: 2rem; font-weight: 900; color: var(--red); letter-spacing: -0.05em; }
.hero-stat-label { font-size: 0.78rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── INFO SECTION (landing page cards) ──────────────────── */

.info-section {
  padding: 72px 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s;
}

.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.info-card h3 { font-size: 1rem; font-weight: 800; margin: 12px 0 8px; }
.info-card p  { font-size: 0.82rem; color: var(--text2); line-height: 1.55; margin-bottom: 16px; }

.info-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 900;
}

.red-icon   { background: var(--red-bg);   color: var(--red); }
.green-icon { background: var(--green-bg); color: var(--green); }
.blue-icon  { background: var(--blue-bg);  color: var(--blue); }
.amber-icon { background: var(--amber-bg); color: var(--amber); }

.info-link {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--red);
  text-decoration: none;
}

.info-link:hover { text-decoration: underline; }

/* ── INNER PAGE HERO BANNER ─────────────────────────────── */

.inner-hero {
  padding: 48px 32px;
  text-align: center;
}

.red-hero  { background: var(--red); color: #fff; }
.dark-hero { background: #111; color: #fff; }

.inner-hero h1 { font-size: 1.9rem; font-weight: 900; margin-bottom: 8px; letter-spacing: -0.03em; }
.inner-hero p  { font-size: 0.92rem; opacity: 0.82; }

/* ── PAGE BODY ───────────────────────────────────────────── */

.page-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 56px;
}

/* ── PANELS ──────────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.mt { margin-top: 18px; }

/* ── STAT CARDS ──────────────────────────────────────────── */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.s-red  { background: var(--red);  border-color: var(--red);  color: #fff; }
.s-dark { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }

.stat-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; margin-bottom: 7px; }
.stat-num   { font-size: 2rem; font-weight: 900; letter-spacing: -1px; line-height: 1; color: var(--red); }
.s-red .stat-num, .s-dark .stat-num { color: #fff; }

/* ── FILTER PANEL ────────────────────────────────────────── */

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.f-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 130px;
}

.f-group label {
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.f-group select,
.f-group input {
  height: 38px;
  padding: 0 11px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.86rem;
  color: var(--text);
  background: var(--surface2);
  outline: none;
  appearance: none;
  transition: border 0.15s;
}

.f-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a8a78'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.f-group select:focus, .f-group input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-bg);
  background: var(--surface);
}

.f-search { flex: 1.5; }
.f-actions { display: flex; gap: 8px; align-items: flex-end; }

.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text3);
}

.sort-chip {
  padding: 4px 13px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}

.sort-chip:hover, .sort-chip.active { background: var(--red); border-color: var(--red); color: #fff; }
.results-count { margin-left: auto; font-size: 0.78rem; color: var(--text3); }

/* ── CARDS GRID ──────────────────────────────────────────── */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
}

/* ── DONOR CARD ──────────────────────────────────────────── */

.donor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s;
  animation: fadein 0.28s ease both;
  position: relative;
  overflow: hidden;
}

.donor-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
}

.donor-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.donor-card:hover::before { transform: scaleX(1); }

.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--red-bg);
  color: var(--red);
  font-weight: 900;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}

.blood-badge {
  font-size: 0.84rem;
  font-weight: 900;
  background: #1a1a1a;
  color: #fff;
  padding: 5px 11px;
  border-radius: 7px;
}

.donor-name   { font-size: 0.94rem; font-weight: 800; margin-bottom: 6px; }
.donor-detail { font-size: 0.79rem; color: var(--text2); margin-bottom: 3px; }

.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  margin: 10px 0 12px;
}

.avail-badge.yes { background: var(--green-bg); color: var(--green); }
.avail-badge.no  { background: var(--amber-bg); color: var(--amber); }
.avail-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.call-btn {
  display: block;
  text-align: center;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--red);
  text-decoration: none;
  transition: all 0.15s;
}

.call-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

.locked-phone {
  display: block;
  text-align: center;
  padding: 8px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s;
}

.locked-phone:hover { border-color: var(--red); color: var(--red); }

/* ── BLOOD REQUESTS ──────────────────────────────────────── */

.how-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.how-card {
  flex: 1; min-width: 180px;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.how-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.how-card h4 { font-size: 0.85rem; font-weight: 800; margin-bottom: 3px; }
.how-card p  { font-size: 0.77rem; color: var(--text2); line-height: 1.5; }
.how-arrow   { font-size: 1.3rem; color: var(--text3); flex-shrink: 0; }

.req-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  padding: 18px;
  animation: fadein 0.28s ease both;
  box-shadow: var(--shadow-sm);
}

.req-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.req-blood { font-size: 1.2rem; font-weight: 900; color: var(--red); }
.req-time  { font-size: 0.73rem; color: var(--text3); }
.req-patient { font-size: 0.92rem; font-weight: 800; margin-bottom: 7px; }
.req-detail  { font-size: 0.79rem; color: var(--text2); margin-bottom: 3px; }
.req-note    { font-size: 0.77rem; color: var(--text2); margin-top: 8px; font-style: italic; }

.req-call {
  display: block;
  margin-top: 12px;
  text-align: center;
  padding: 9px;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}

.req-call:hover { opacity: 0.86; }
.req-empty { text-align: center; padding: 32px; color: var(--text3); font-size: 0.87rem; }

/* ── REGISTER PAGE ───────────────────────────────────────── */

.register-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }

.why-side { display: flex; flex-direction: column; gap: 12px; }
.why-side h3 { font-size: 1.05rem; font-weight: 900; margin-bottom: 4px; }

.why-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.why-num { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 900; flex-shrink: 0; }
.why-num.r { background: var(--red-bg); color: var(--red); }
.why-num.g { background: var(--green-bg); color: var(--green); }
.why-num.b { background: var(--blue-bg); color: var(--blue); }
.why-item h4 { font-size: 0.85rem; font-weight: 800; margin-bottom: 3px; }
.why-item p  { font-size: 0.78rem; color: var(--text2); line-height: 1.5; }

/* ── MORE PAGE ───────────────────────────────────────────── */

.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.more-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}

.more-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--red); }

.more-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}

.more-card h3 { font-size: 1rem; font-weight: 900; margin-bottom: 8px; }
.more-card p  { font-size: 0.83rem; color: var(--text2); line-height: 1.55; margin-bottom: 14px; }
.more-link    { font-size: 0.82rem; font-weight: 800; color: var(--red); }

/* ── ELIGIBILITY ─────────────────────────────────────────── */

.elig-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }

.elig-q {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.elig-q.last { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.elig-q > label {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.elig-q input[type="number"] {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.87rem;
  color: var(--text);
  background: var(--surface2);
  outline: none;
  transition: border 0.15s;
}

.elig-q input[type="number"]:focus { border-color: var(--red); background: var(--surface); }

.radio-group { display: flex; flex-direction: column; gap: 7px; }

.radio-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text2);
  transition: all 0.15s;
}

.radio-opt:hover { border-color: var(--red); color: var(--text); }
.radio-opt input[type="radio"] { accent-color: var(--red); }

.result-box { text-align: center; padding: 8px 0; }
.result-box.ok .result-icon { color: var(--green); }
.result-box.no .result-icon { color: var(--red); }
.result-icon { font-size: 2.2rem; font-weight: 900; margin-bottom: 12px; }

#result-title { font-size: 1.05rem; font-weight: 900; margin-bottom: 10px; }
#result-title.ok { color: var(--green); }
#result-title.no { color: var(--red); }
#result-body { font-size: 0.84rem; color: var(--text2); margin-bottom: 14px; }

.result-reasons { list-style: none; text-align: left; margin-bottom: 14px; }
.result-reasons li { font-size: 0.81rem; color: var(--text2); padding: 4px 0 4px 13px; position: relative; }
.result-reasons li::before { content: ''; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

.result-note { font-size: 0.73rem; color: var(--text3); background: var(--surface2); padding: 9px 12px; border-radius: 8px; text-align: left; line-height: 1.5; }

/* ── TRACKER ─────────────────────────────────────────────── */

.tracker-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.tracker-right  { display: flex; flex-direction: column; gap: 18px; }

.eligible-box {
  background: #1a1a1a;
  color: #fff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}

.elig-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; opacity: 0.4; margin-bottom: 8px; }
.elig-date  { font-size: 1.2rem; font-weight: 900; margin-bottom: 4px; line-height: 1.25; }
.elig-sub   { font-size: 0.78rem; opacity: 0.5; margin-bottom: 18px; min-height: 18px; }

.prog-track { height: 5px; background: rgba(255,255,255,0.12); border-radius: 99px; margin-bottom: 7px; }
.prog-fill  { height: 100%; background: var(--red); border-radius: 99px; transition: width 0.8s ease; }
.prog-labels{ display: flex; justify-content: space-between; font-size: 0.67rem; opacity: 0.35; }

.history-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  background: var(--surface2);
  border-radius: 9px;
  margin-bottom: 8px;
  animation: fadein 0.25s ease both;
}

.h-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--red-bg); color: var(--red); font-weight: 900; font-size: 0.82rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.h-type   { font-size: 0.84rem; font-weight: 700; }
.h-loc    { font-size: 0.73rem; color: var(--text2); }
.h-date   { font-size: 0.78rem; font-weight: 600; color: var(--text3); margin-left: auto; }
.del-btn  { background: transparent; border: none; color: var(--text3); cursor: pointer; padding: 3px 6px; border-radius: 5px; font-size: 0.8rem; transition: all 0.15s; margin-left: 4px; }
.del-btn:hover { background: var(--red-bg); color: var(--red); }
.tracker-empty { font-size: 0.83rem; color: var(--text2); text-align: center; padding: 20px; }

/* ── FDA SECTION ─────────────────────────────────────────── */

.fda-search-row { display: flex; gap: 10px; margin-bottom: 10px; }

.fda-input {
  flex: 1;
  height: 40px;
  padding: 0 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.87rem;
  color: var(--text);
  background: var(--surface2);
  outline: none;
  transition: border 0.15s;
}

.fda-input:focus { border-color: var(--red); background: var(--surface); }
.fda-credit { font-size: 0.73rem; color: var(--text3); }
.fda-credit a { color: var(--red); }

.fda-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 12px;
  padding: 16px;
  animation: fadein 0.28s ease both;
  transition: all 0.15s;
}

.fda-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.fda-status { display: inline-block; font-size: 0.67rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; margin-bottom: 8px; background: var(--red-bg); color: var(--red); }
.fda-title  { font-size: 0.88rem; font-weight: 800; margin-bottom: 8px; line-height: 1.4; }
.fda-row    { font-size: 0.77rem; color: var(--text2); margin-bottom: 3px; }
.fda-reason { margin-top: 10px; font-size: 0.77rem; color: var(--text); background: var(--surface2); padding: 9px 11px; border-radius: 7px; line-height: 1.6; border: 1px solid var(--border); }

.err-panel { background: var(--red-bg); border-color: rgba(212,0,15,0.2); }
.err-panel p { font-size: 0.84rem; color: var(--red); }

/* ── COMPATIBILITY ───────────────────────────────────────── */

.compat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; transition: all 0.15s; box-shadow: var(--shadow-sm); }
.compat-card:hover { border-color: var(--red); transform: translateY(-2px); }
.compat-type { font-size: 1.55rem; font-weight: 900; color: var(--red); margin-bottom: 10px; }
.compat-lbl  { font-size: 0.67rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text3); margin-bottom: 3px; }
.compat-val  { font-size: 0.82rem; color: var(--text2); line-height: 1.5; }

/* ── ADMIN PANEL ─────────────────────────────────────────── */

.admin-tabs-bar { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 5px; margin-bottom: 18px; flex-wrap: wrap; }

.admin-tab { padding: 8px 16px; border: none; border-radius: 7px; background: transparent; font-family: 'Nunito', sans-serif; font-size: 0.83rem; font-weight: 700; color: var(--text2); cursor: pointer; transition: all 0.15s; }
.admin-tab:hover { background: var(--surface2); color: var(--text); }
.admin-tab.active { background: var(--red); color: #fff; }

.admin-section { display: none; }
.admin-section.active { display: block; }

.tbl-wrap { overflow-x: auto; border-radius: 8px; }

.rec-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.rec-table th { padding: 10px 13px; background: var(--surface2); color: var(--text2); font-size: 0.71rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rec-table td { padding: 11px 13px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.rec-table tr:last-child td { border-bottom: none; }
.rec-table tr:hover td { background: var(--surface2); }

.tbl-badge   { font-size: 0.75rem; font-weight: 800; color: var(--red); background: var(--red-bg); padding: 2px 8px; border-radius: 5px; }
.avail-pill  { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.avail-pill.yes { background: var(--green-bg); color: var(--green); }
.avail-pill.no  { background: var(--amber-bg); color: var(--amber); }

.tbl-actions { display: flex; gap: 6px; }
.tbl-edit    { padding: 4px 12px; background: var(--red); color: #fff; border: none; border-radius: 6px; font-family: 'Nunito', sans-serif; font-size: 0.74rem; font-weight: 700; cursor: pointer; transition: opacity 0.15s; }
.tbl-edit:hover { opacity: 0.82; }
.tbl-delete  { padding: 4px 12px; background: var(--red-bg); color: var(--red); border: 1px solid rgba(212,0,15,0.2); border-radius: 6px; font-family: 'Nunito', sans-serif; font-size: 0.74rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.tbl-delete:hover { background: var(--red); color: #fff; }
.tbl-empty   { text-align: center; color: var(--text3); padding: 24px; font-size: 0.83rem; }

/* ── FORMS ───────────────────────────────────────────────── */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field.field-full { grid-column: 1 / -1; }

.field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input, .field select {
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.87rem;
  color: var(--text);
  background: var(--surface2);
  outline: none;
  transition: border 0.15s;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a8a78'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.field input:focus, .field select:focus {
  border-color: var(--red);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--red-bg);
}

.field input.error { border-color: var(--red); }
.err { font-size: 0.72rem; color: var(--red); min-height: 14px; }

/* Toggle */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.87rem; color: var(--text2); user-select: none; }
.toggle input { display: none; }
.track { width: 42px; height: 24px; background: var(--border); border-radius: 99px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.toggle input:checked ~ .track        { background: var(--red); }
.toggle input:checked ~ .track .thumb { transform: translateX(18px); }

/* ── BUTTONS ─────────────────────────────────────────────── */

.btn-red {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(212,0,15,0.25);
  white-space: nowrap;
}

.btn-red:hover { background: var(--red2); transform: translateY(-1px); }
.btn-block { width: 100%; text-align: center; padding: 13px; font-size: 0.9rem; }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--text2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-outline:hover { border-color: var(--red); color: var(--red); }

/* ── AUTH MODAL ──────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  backdrop-filter: blur(3px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  animation: fadein 0.2s ease;
}

.modal-tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: 9px; padding: 4px; margin-bottom: 22px; }

.modal-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text2);
  font-family: 'Nunito', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-tab.active { background: var(--red); color: #fff; }

.modal-title { font-size: 1.25rem; font-weight: 900; margin-bottom: 5px; }
.modal-sub   { font-size: 0.82rem; color: var(--text2); margin-bottom: 18px; }

.m-field { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }

.m-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.m-field input {
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.87rem;
  color: var(--text);
  background: var(--surface2);
  outline: none;
  transition: border 0.15s;
}

.m-field input:focus { border-color: var(--red); background: var(--surface); }

.admin-hint { font-size: 0.74rem; color: var(--amber); background: var(--amber-bg); border-radius: 7px; padding: 7px 10px; margin-top: 10px; }
.auth-err   { display: block; font-size: 0.78rem; color: var(--red); margin-top: 8px; min-height: 16px; }

.modal-switch { font-size: 0.8rem; color: var(--text2); text-align: center; margin-top: 14px; }
.modal-switch a { color: var(--red); text-decoration: none; font-weight: 700; }

.modal-btns { display: flex; gap: 10px; margin-top: 20px; }

/* ── FEEDBACK ────────────────────────────────────────────── */

.feedback { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 0.83rem; font-weight: 600; }
.feedback.ok  { background: var(--green-bg); color: var(--green); border: 1px solid rgba(26,107,58,0.2); }
.feedback.err { background: var(--red-bg); color: var(--red); border: 1px solid rgba(212,0,15,0.2); }

/* ── STATE BOXES ─────────────────────────────────────────── */

.state-empty { text-align: center; padding: 56px 24px; color: var(--text3); font-size: 0.87rem; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ───────────────────────────────────────────────── */

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px); background: #1a1a1a; color: #fff; padding: 11px 22px; border-radius: 99px; font-size: 0.83rem; font-weight: 600; z-index: 9999; opacity: 0; transition: all 0.2s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── FOOTER ──────────────────────────────────────────────── */

.footer { background: #1a0808; color: rgba(255,255,255,0.7); margin-top: 60px; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 36px 32px 28px; display: grid; grid-template-columns: 180px 1fr 220px; gap: 32px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-brand { display: flex; align-items: center; gap: 9px; font-size: 1rem; font-weight: 900; color: #fff; }
.footer-mid { text-align: center; }
.footer-mid p { font-size: 0.8rem; line-height: 1.7; }
.footer-mid strong { color: #fff; }
.footer-links { text-align: right; }
.footer-links p { font-size: 0.76rem; margin-bottom: 4px; }
.footer-links a { color: rgba(255,255,255,0.55); text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-bottom { text-align: center; padding: 12px 32px; font-size: 0.72rem; color: rgba(255,255,255,0.25); }

/* ── UTILITY ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 1100px) {
  .info-grid  { grid-template-columns: repeat(2, 1fr); }
  .stat-row   { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-links { text-align: center; }
  .footer-brand { justify-content: center; }
}

@media (max-width: 900px) {
  .register-layout { grid-template-columns: 1fr; }
  .elig-layout     { grid-template-columns: 1fr; }
  .tracker-layout  { grid-template-columns: 1fr; }
  .more-grid       { grid-template-columns: 1fr; }
  .how-row         { flex-direction: column; }
  .how-arrow       { transform: rotate(90deg); }
  .page-body       { padding: 20px 16px 48px; }
}

@media (max-width: 768px) {
  .nav-inner  { padding: 0 16px; gap: 10px; }
  .nav-links  { display: none; }
  .nav-search-wrap input { width: 130px; }
  .hero-btn   { font-size: 1.1rem; padding: 20px 30px; }
  .info-grid  { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; }
  .f-group    { min-width: 100%; }
  .f-actions  { width: 100%; }
}

/* ── DARK MODE EXTRA FIXES ──────────────────────────────── */

/* Make sure all form inputs use theme variables */
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .m-field input,
[data-theme="dark"] .elig-q input[type="number"],
[data-theme="dark"] .fda-input,
[data-theme="dark"] .f-group select,
[data-theme="dark"] .f-group input {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--border);
}

[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field select:focus,
[data-theme="dark"] .m-field input:focus,
[data-theme="dark"] .fda-input:focus,
[data-theme="dark"] .f-group select:focus,
[data-theme="dark"] .f-group input:focus {
  background: var(--surface);
}

/* Panel backgrounds in dark mode */
[data-theme="dark"] .panel,
[data-theme="dark"] .filter-panel,
[data-theme="dark"] .donor-card,
[data-theme="dark"] .req-card,
[data-theme="dark"] .fda-card,
[data-theme="dark"] .compat-card,
[data-theme="dark"] .more-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .why-item,
[data-theme="dark"] .how-card,
[data-theme="dark"] .modal,
[data-theme="dark"] .stat-card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .radio-opt {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text2);
}

[data-theme="dark"] .eligible-box { background: #111; }

[data-theme="dark"] .result-note,
[data-theme="dark"] .history-row,
[data-theme="dark"] .fda-reason {
  background: var(--surface2);
}

/* Select dropdown arrow color for dark mode */
[data-theme="dark"] .field select,
[data-theme="dark"] .f-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a6a5a'/%3E%3C/svg%3E");
}

/* Admin table in dark mode */
[data-theme="dark"] .rec-table th { background: var(--surface2); color: var(--text2); }
[data-theme="dark"] .rec-table td { color: var(--text); border-color: var(--border); }
[data-theme="dark"] .rec-table tr:hover td { background: var(--surface2); }
[data-theme="dark"] .admin-tabs-bar { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .tbl-wrap { background: var(--surface); }

/* Footer always dark regardless of theme */
.footer { background: #0a0505; }