/* ============================================================
   BloodLink — Professional UI Design System
   Inspired by Figma / Google Stitch: clean surfaces,
   refined typography, subtle depth, purposeful color.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  /* Brand */
  --red-primary: #E11D48;
  --red-dark: #BE123C;
  --red-light: #FB7185;
  --red-soft: #FFF1F2;
  --red-glow: rgba(225, 29, 72, 0.12);

  /* Neutrals */
  --navy: #0F172A;
  --navy-light: #1E293B;
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  --gold: #F59E0B;
  --green: #10B981;
  --text-dark: var(--slate-900);
  --text-muted: var(--slate-500);
  --bg-light: var(--slate-50);
  --surface: #FFFFFF;
  --border: var(--slate-200);
  --border-subtle: rgba(15, 23, 42, 0.06);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --card-shadow: var(--shadow-sm);
  --card-shadow-hover: var(--shadow-lg);

  /* Layout */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --sidebar-width: 268px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-light);
  color: var(--text-dark);
  font-size: 0.9375rem;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--slate-900);
}

.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

::selection {
  background: var(--red-soft);
  color: var(--red-dark);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-light);
}
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ── Navbar (landing) ─────────────────────────────────────── */
.navbar {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-xs) !important;
  padding: 0.65rem 0;
  transition: var(--transition);
}

.navbar-brand .brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--slate-900) !important;
  letter-spacing: -0.03em;
}

.navbar-brand .brand-sub {
  font-size: 0.65rem;
  color: var(--slate-500) !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.navbar .nav-link {
  color: var(--slate-600) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.45rem 0.85rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--red-primary) !important;
  background: var(--red-soft);
}

.navbar-toggler {
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm) !important;
}

.navbar-toggler:focus { box-shadow: 0 0 0 3px var(--red-glow); }

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 4px;
  animation: pulse-anim 1.4s ease-in-out infinite;
}

@keyframes pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero-section {
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(251, 113, 133, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 80%, rgba(225, 29, 72, 0.1) 0%, transparent 50%),
    linear-gradient(165deg, #FFFFFF 0%, var(--slate-50) 45%, #FFF1F2 100%);
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23E11D48' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-700);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
  animation: fadeInDown 0.6s ease;
}

.hero-badge i { color: var(--red-primary); }

.hero-title {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.08;
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.7s ease;
  letter-spacing: -0.04em;
}

.hero-title span {
  background: linear-gradient(135deg, var(--red-primary), var(--red-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--slate-600);
  line-height: 1.75;
  max-width: 32rem;
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.9s ease;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  animation: fadeInUp 1s ease;
}

.stat-item { text-align: left; }

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 0.15rem;
}

/* Blood drop visual */
.blood-drop-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blood-drop {
  width: 240px;
  height: 240px;
  background: linear-gradient(145deg, #FB7185 0%, var(--red-primary) 50%, var(--red-dark) 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow:
    0 24px 48px rgba(225, 29, 72, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  animation: dropFloat 4s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.blood-drop::after {
  content: '';
  position: absolute;
  top: 18%;
  left: 22%;
  width: 28%;
  height: 28%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  transform: rotate(-25deg);
}

@keyframes dropFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}

.drop-icon {
  font-size: 4.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
  animation: heartbeat 1.4s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: translate(-50%, -52%) scale(1); }
  50% { transform: translate(-50%, -52%) scale(1.06); }
}

.particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--red-primary);
  opacity: 0.15;
  border-radius: 50%;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.2; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-blood {
  background: var(--red-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.5rem;
  border: 1px solid transparent;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(225, 29, 72, 0.2), 0 4px 12px rgba(225, 29, 72, 0.2);
}

.btn-blood:hover {
  background: var(--red-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.35);
}

.btn-blood:active { transform: translateY(0); }

.btn-blood-outline {
  background: var(--surface);
  color: var(--slate-800);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--border);
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.btn-blood-outline:hover {
  background: var(--slate-50);
  color: var(--red-primary);
  border-color: var(--red-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary-red {
  background: var(--red-primary);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(225, 29, 72, 0.15);
}

.btn-primary-red:hover {
  background: var(--red-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

/* ── Cards ────────────────────────────────────────────────── */
.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: var(--transition-slow);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red-primary), var(--red-light));
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(225, 29, 72, 0.2);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 52px;
  height: 52px;
  background: var(--red-soft);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.15rem;
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  background: var(--red-primary);
  transform: scale(1.05);
}

.feature-card:hover .feature-icon i { color: #fff !important; }

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.stat-card .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--red-primary);
  letter-spacing: -0.03em;
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.request-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.35rem;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  cursor: pointer;
}

.request-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(225, 29, 72, 0.15);
}

.blood-type-badge {
  font-size: 1rem;
  font-weight: 800;
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  letter-spacing: -0.02em;
}

/* ── Urgency Badges ───────────────────────────────────────── */
.urgency-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.urgency-badge.critical,
.urgency-critical { background: #FEE2E2; color: #B91C1C; }
.urgency-badge.high,
.urgency-high { background: #FFEDD5; color: #C2410C; }
.urgency-badge.medium,
.urgency-medium { background: #FEF3C7; color: #B45309; }
.urgency-badge.low,
.urgency-low { background: #D1FAE5; color: #047857; }

.urgency-badge.critical { animation: urgencyPulse 1.2s ease-in-out infinite; }

@keyframes urgencyPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* ── Section Headings ─────────────────────────────────────── */
.section-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red-primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.section-line {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--red-primary), var(--red-light));
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

/* Section backgrounds */
#about { background: var(--surface); }
#requests-section { background: var(--slate-50); }
#find-donors { background: var(--surface); }

/* CTA band */
.cta-section {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--navy-light) 50%, #1a2744 100%);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(225, 29, 72, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.cta-section .btn-blood {
  background: var(--red-primary);
  border-color: transparent;
}

.cta-section .btn-blood-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.cta-section .btn-blood-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  background: var(--slate-100);
  display: flex;
  align-items: stretch;
}

.auth-split-panel {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(251, 113, 133, 0.25) 0%, transparent 50%),
    linear-gradient(160deg, var(--slate-900) 0%, var(--navy-light) 55%, #1e3a5f 100%);
  min-height: 100vh;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  animation: slideInUp 0.45s ease;
}

.auth-logo { text-align: center; margin-bottom: 1.75rem; }

.auth-logo .drop { font-size: 2.75rem; }

.auth-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  transition: var(--transition);
  background: var(--surface);
  color: var(--slate-800);
}

.form-control::placeholder { color: var(--slate-400); }

.form-control:focus,
.form-select:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px var(--red-glow);
  outline: none;
}

.input-group-text {
  border-color: var(--border);
  background: var(--slate-50);
  color: var(--slate-500);
}

.btn-auth {
  background: var(--red-primary);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  width: 100%;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(225, 29, 72, 0.2);
}

.btn-auth:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3);
  color: #fff;
}

.auth-link {
  color: var(--red-primary);
  font-weight: 600;
}

.auth-link:hover { color: var(--red-dark); }

.otp-inputs { display: flex; gap: 0.5rem; justify-content: center; }

.otp-inputs input {
  width: 48px;
  height: 52px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  background: var(--surface);
}

.otp-inputs input:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px var(--red-glow);
  outline: none;
}

/* Register role pills */
.btn-check:checked + .btn-outline-danger {
  background: var(--red-soft) !important;
  border-color: var(--red-primary) !important;
  color: var(--red-dark) !important;
}

.btn-outline-danger {
  border-radius: var(--radius-sm) !important;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 0.5rem;
  border-color: var(--border) !important;
  color: var(--slate-600) !important;
}

.btn-outline-danger:hover {
  background: var(--slate-50) !important;
  border-color: var(--slate-300) !important;
}

/* ── Dashboard Layout ─────────────────────────────────────── */
.sidebar {
  background: var(--slate-900);
  width: var(--sidebar-width);
  min-height: 100vh;
  max-height: 100vh;
  height: 100dvh;
  box-shadow: var(--shadow-lg);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  touch-action: auto;
}

.sidebar-brand {
  background: transparent;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border) !important;
  background: var(--surface);
  color: var(--slate-700);
}

.sidebar-toggle-btn:hover {
  background: var(--red-soft);
  border-color: var(--red-light) !important;
  color: var(--red-primary);
}

.sidebar-brand h5 {
  color: #fff;
  font-weight: 800;
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.sidebar-brand p {
  color: var(--slate-400);
  font-size: 0.75rem;
  margin: 0.2rem 0 0;
  font-weight: 500;
}

.sidebar-nav {
  padding: 0.85rem 0.75rem 1.25rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}

.sidebar-section {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-500);
  padding: 0.75rem 0.85rem 0.35rem;
}

.sidebar-nav .nav-link {
  color: var(--slate-400);
  font-weight: 500;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2px;
  border-left: none;
}

.sidebar-nav .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
  opacity: 0.85;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: rgba(225, 29, 72, 0.15);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--red-primary);
}

.sidebar-nav .nav-link.text-danger { color: #FB7185 !important; }
.sidebar-nav .nav-link.text-danger:hover { background: rgba(251, 113, 133, 0.12); }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-light);
  padding-bottom: 2rem;
}

.top-bar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}

body.sidebar-open {
  overflow: hidden;
  touch-action: none;
}

.profile-photo-wrap {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.profile-photo-wrap .overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.profile-photo-wrap:hover .overlay { opacity: 1; }

.dash-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red-primary);
  font-weight: 700;
  flex-shrink: 0;
}

/* Full-width dashboard banners (edge-to-edge in main content column) */
.banner-zone {
  --banner-pad: 1.5rem;
  width: calc(100% + (var(--banner-pad) * 2));
  max-width: none;
  margin-left: calc(var(--banner-pad) * -1);
  margin-right: calc(var(--banner-pad) * -1);
  margin-bottom: 1rem;
}

@media (max-width: 991.98px) {
  .banner-zone { --banner-pad: 1rem; }
}

@media (max-width: 575.98px) {
  .banner-zone { --banner-pad: 0.75rem; }
}

.banner-slider {
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 0;
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.banner-slider .carousel-inner,
.banner-slider .carousel-item {
  min-height: clamp(160px, 22vw, 360px);
}

.banner-slider img {
  width: 100%;
  height: clamp(160px, 22vw, 360px);
  object-fit: cover;
  object-position: center;
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  image-rendering: auto;
  display: block;
}

.banner-slide-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(160px, 22vw, 360px);
  background: var(--red-soft);
  padding: 1rem;
  text-align: center;
}

.top-bar h6 {
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.page-content { padding: 1.5rem; }

.dashboard-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--slate-300);
}

.stat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* ── Blood Type Badges ────────────────────────────────────── */
.bt {
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  letter-spacing: -0.02em;
}

.bt-Apos { background: #FFE4E6; color: #BE123C; }
.bt-Aneg { background: #FFE4E6; color: #9F1239; }
.bt-Bpos { background: #DBEAFE; color: #1D4ED8; }
.bt-Bneg { background: #DBEAFE; color: #1E40AF; }
.bt-ABpos { background: #D1FAE5; color: #047857; }
.bt-ABneg { background: #D1FAE5; color: #065F46; }
.bt-Opos { background: #FFEDD5; color: #C2410C; }
.bt-Oneg { background: #FFEDD5; color: #9A3412; }

/* ── Table ────────────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
}

.table thead th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
}

.table tbody td {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  color: var(--slate-700);
  vertical-align: middle;
  border-color: var(--border-subtle);
}

.table tbody tr { transition: background var(--transition); }

.table tbody tr:hover { background: var(--red-soft); }

/* ── Modals ───────────────────────────────────────────────── */
.modal-content {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  background: var(--surface);
  color: var(--slate-900);
  border-bottom: 1px solid var(--border);
  padding: 1.15rem 1.35rem;
}

.modal-header .modal-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.modal-header .btn-close { filter: none; opacity: 0.5; }
.modal-header .btn-close:hover { opacity: 1; }

.modal-body { padding: 1.35rem; }

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.35rem;
  background: var(--slate-50);
}

/* ── Chat ─────────────────────────────────────────────────── */
.chat-wrap {
  height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
}

.chat-header {
  padding: 1rem 1.2rem;
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--slate-50);
}

.msg {
  max-width: 72%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  animation: msgIn 0.25s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.msg-sent {
  background: var(--red-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.2);
}

.msg-recv {
  background: var(--surface);
  color: var(--text-dark);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.chat-input-wrap {
  padding: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
}

.chat-input {
  flex: 1;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  transition: var(--transition);
  background: var(--slate-50);
}

.chat-input:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px var(--red-glow);
  background: var(--surface);
}

/* ── Toast Notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-msg {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid var(--green);
  color: var(--slate-800);
}

.toast-msg.error { border-left-color: var(--red-primary); }
.toast-msg.warn { border-left-color: var(--gold); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(24px) scale(0.96); }
}

/* ── Loaders ──────────────────────────────────────────────── */
.spinner-blood {
  width: 40px;
  height: 40px;
  border: 2.5px solid var(--red-soft);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader span {
  color: var(--slate-600) !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: none; }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}

.animate-fadeup { animation: fadeInUp 0.55s ease both; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

[data-anim] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

[data-anim].visible {
  opacity: 1;
  transform: none;
}

/* ── Status Pills ─────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pending { background: #FEF3C7; color: #B45309; }
.status-confirmed { background: #DBEAFE; color: #1D4ED8; }
.status-completed { background: #D1FAE5; color: #047857; }
.status-rejected { background: #FEE2E2; color: #B91C1C; }
.status-active { background: #D1FAE5; color: #047857; }
.status-inactive { background: var(--slate-100); color: var(--slate-600); }

/* ── Map ──────────────────────────────────────────────────── */
#map,
.mini-map,
.map-pick,
.map-picker,
.service-map {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

#map { height: 300px; }

/* ── Progress ─────────────────────────────────────────────── */
.progress {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--slate-200);
}

.progress-bar {
  background: linear-gradient(90deg, var(--red-primary), var(--red-light));
  border-radius: var(--radius-full);
}

/* ── Availability Toggle ──────────────────────────────────── */
.avail-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.avail-toggle input { opacity: 0; width: 0; height: 0; }

.avail-slider {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.avail-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  bottom: 3px;
  left: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

input:checked + .avail-slider { background: var(--red-primary); }
input:checked + .avail-slider::before { transform: translateX(22px); }

/* ── Notification Bell ────────────────────────────────────── */
.notif-bell {
  position: relative;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.notif-bell:hover { background: var(--slate-100); }

.notif-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--red-primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  animation: bounce 0.4s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ── Banner Carousel ──────────────────────────────────────── */
#banners-section { background: var(--surface) !important; }

.banner-img {
  height: clamp(150px, 26vw, 320px);
  object-fit: contain;
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.carousel-control-prev,
.carousel-control-next {
  width: 40px;
  height: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border-radius: var(--radius-full);
  opacity: 1;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin: 0 0.5rem;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: invert(0.4);
  width: 1rem;
  height: 1rem;
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 3.5rem 0 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

footer h6 {
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

footer a {
  color: var(--slate-400);
  font-size: 0.875rem;
  transition: color var(--transition);
}

footer a:hover { color: #fff; }

.footer-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

footer code {
  font-size: 0.78rem;
  color: #86EFAC !important;
}

footer .bg-dark {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm) !important;
}

.social-icons a {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--slate-400);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-icons a:hover {
  background: var(--red-primary);
  color: #fff;
  border-color: var(--red-primary);
  transform: translateY(-2px);
}

/* ── Volunteer-Specific ───────────────────────────────────── */
.city-banner {
  background: linear-gradient(135deg, var(--slate-900), var(--navy-light));
  color: #fff;
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.25rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 0.75rem;
  color: var(--slate-400);
}

.tracking-id {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  background: var(--slate-100);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--slate-700);
  font-weight: 600;
  border: 1px solid var(--border);
}

.map-picker { height: 260px; }
.service-map { height: 350px; }

/* ── Utility: search panel on landing ─────────────────────── */
.search-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--card-shadow);
}

.form-range::-webkit-slider-thumb {
  background: var(--red-primary);
}

.form-range::-moz-range-thumb {
  background: var(--red-primary);
}

/* Dropdown polish */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
}

.dropdown-item {
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
}

.dropdown-item:hover {
  background: var(--red-soft);
  color: var(--red-dark);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(300px, 88vw);
  }

  .sidebar.open {
    transform: none;
    box-shadow: var(--shadow-xl);
  }

  .sidebar-close-btn { display: inline-flex; }

  .main-content { margin-left: 0; }

  .top-bar-actions .dropdown-toggle span,
  .top-bar-actions .btn-outline-secondary .bi-shuffle + * {
    display: none;
  }

  .top-bar-actions .dropdown-toggle::after {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .navbar .navbar-collapse {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  #navAuth {
    flex-direction: column;
    width: 100%;
  }

  #navAuth .btn { width: 100%; }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn { width: 100%; justify-content: center; }

  .blood-drop {
    width: 180px;
    height: 180px;
  }

  .page-content { padding: 1rem; }

  .top-bar { padding: 0.75rem 1rem; }

  .dashboard-card { padding: 1rem; }

  .table thead th {
    font-size: 0.68rem;
    padding: 0.5rem 0.65rem;
  }

  .table tbody td {
    font-size: 0.8rem;
    padding: 0.55rem 0.65rem;
  }

  .request-card { padding: 1rem; }

  .chat-wrap { height: calc(100vh - 200px); }

  .stat-icon-wrap {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .fw-800.fs-3 { font-size: 1.5rem !important; }
}

@media (max-width: 480px) {
  .top-bar {
    gap: 0.35rem;
    padding: 0.65rem 0.75rem;
  }

  .top-bar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .page-content { padding: 0.75rem; }

  .mini-map,
  .map-pick { height: 220px; }

  .auth-card {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius);
  }

  .table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
}

.sidebar-overlay.show { display: block; }

/* ═══ Dashboard premium polish (sidebar layouts: donor / recipient / volunteer / admin) ═══ */
body:has(.sidebar) {
  background: linear-gradient(165deg, var(--slate-100) 0%, #eef2f7 42%, var(--slate-50) 100%);
  min-height: 100vh;
}

body:has(.sidebar) > .sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, #121a2e 48%, var(--navy-light) 100%);
  box-shadow: 6px 0 28px rgba(15, 23, 42, 0.14);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

body:has(.sidebar) > .sidebar .sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body:has(.sidebar) .main-content > .top-bar,
.main-content > .top-bar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

[data-bs-theme="dark"] body:has(.sidebar) .main-content > .top-bar {
  background: rgba(30, 41, 59, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

body:has(.sidebar) .page-content {
  padding-bottom: 2rem;
}

body:has(.sidebar) .dashboard-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

body:has(.sidebar) .dashboard-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.dashboard-card-premium {
  border-radius: var(--radius) !important;
  overflow: hidden;
}

.banner-zone .banner-slider {
  border-radius: 0 !important;
  overflow: hidden;
  box-shadow: none;
}

.banner-slider .carousel-inner,
.banner-slider .carousel-item {
  border-radius: inherit;
}

.city-banner-premium {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #1e293b 0%, #334155 52%, #0f172a 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.city-banner-premium .btn-light {
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.4rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.city-banner--gps {
  background: linear-gradient(120deg, #0f766e 0%, #14b8a6 42%, #115e59 100%) !important;
}

.city-banner--warn {
  background: linear-gradient(120deg, #9f1239 0%, #e11d48 48%, #881337 100%) !important;
}

.city-banner-premium strong {
  font-weight: 700;
  color: #fff;
}

.dash-header-avatar-wrap {
  position: relative;
  cursor: pointer;
}

.dash-header-avatar-wrap:hover .dash-header-camera-badge {
  transform: scale(1.08);
}

.dash-header-camera-badge {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red-primary);
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  pointer-events: none;
  transition: transform var(--transition);
  box-shadow: var(--shadow-xs);
}

.banner-admin-thumb {
  background: linear-gradient(135deg, var(--slate-100), var(--slate-50));
}

.dash-volunteer-header-photo .overlay {
  border-radius: 50% !important;
}

.top-bar-actions .profile-photo-wrap,
.profile-photo-wrap {
  transition: transform var(--transition);
}

.top-bar-actions .profile-photo-wrap:active,
.profile-photo-wrap:active {
  transform: scale(0.97);
}

/* ============================================================
   RESPONSIVE DESIGN - Mobile, Tablet, Desktop
   ============================================================ */

/* ── GLOBAL RESPONSIVE BASE ──────────────────────────────── */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

img, video, svg, iframe {
  max-width: 100%;
  height: auto;
}

table {
  width: 100%;
  table-layout: auto;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.text-truncate-mobile {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── MOBILE (≤ 480px) ─────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --sidebar-width: 0;
    --radius: 12px;
    --radius-sm: 8px;
  }

  body {
    font-size: 0.875rem;
  }

  .sidebar {
    width: 100%;
    z-index: 1100;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: none;
    box-shadow: var(--shadow-xl);
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1090;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 1rem;
  }

  .top-bar {
    padding: 0.5rem 0.75rem;
    min-height: 56px;
    gap: 0.25rem;
  }

  .top-bar-actions {
    gap: 0.5rem;
  }

  .dashboard-card {
    padding: 1rem;
    border-radius: var(--radius);
  }

  .stat-box {
    padding: 1rem;
  }

  .table-responsive {
    font-size: 0.8rem;
  }

  .btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .form-control,
  .form-select {
    font-size: 16px;
    padding: 0.5rem 0.75rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-content {
    border-radius: var(--radius);
  }

  .col-sm-6,
  .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .map-picker,
  .service-map {
    height: 200px;
  }

  h1, h2, h3 {
    font-size: 1.25rem;
  }

  .empty-state {
    padding: 1.5rem 0.5rem;
  }

  .sidebar-nav {
    padding: 0.75rem 0.5rem;
  }

  .sidebar-section {
    padding: 0.6rem 0.5rem 0.2rem;
  }

  .sidebar-nav .nav-link {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .sidebar-nav .nav-link i {
    width: 18px;
    font-size: 1rem;
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .hero-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .stat-num {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .feature-card {
    padding: 1.25rem;
  }

  .search-panel {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius);
    max-width: 100% !important;
  }

  .auth-title {
    font-size: 1.35rem;
  }

  .otp-inputs input {
    width: 40px;
    height: 44px;
    font-size: 1.1rem;
  }

  .footer-brand {
    font-size: 1rem;
  }

  footer {
    padding: 2rem 0 1.25rem;
  }

  .social-icons a {
    width: 34px;
    height: 34px;
  }

  .chat-wrap {
    height: calc(100vh - 180px);
  }

  .chat-messages {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .msg {
    max-width: 85%;
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
  }

  .chat-input-wrap {
    padding: 0.65rem;
    gap: 0.4rem;
  }

  .chat-input {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
  }

  .banner-slider .carousel-inner,
  .banner-slider .carousel-item {
    min-height: clamp(120px, 30vw, 200px);
  }

  .banner-slider img {
    height: clamp(120px, 30vw, 200px);
  }

  .notification-item {
    padding: 0.6rem 0.75rem;
  }

  .dropdown-menu {
    max-width: calc(100vw - 2rem);
    min-width: 180px;
  }

  .btn-group-sm .btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
  }

  .nav-pills .nav-link {
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
  }

  .form-label {
    font-size: 0.78rem;
  }

  .blood-type-badge {
    min-width: 40px;
    height: 40px;
    font-size: 0.85rem;
  }

  .stock-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .stock-card {
    padding: 0.75rem 0.35rem;
  }

  .stock-card .bt-label {
    font-size: 0.9rem;
  }

  .stock-card .units {
    font-size: 1.2rem;
  }

  .verify-card {
    border-radius: 12px;
  }

  .verify-header {
    padding: 1.5rem 1rem;
  }

  .verify-header h1 {
    font-size: 1.1rem;
  }

  .verify-frame {
    min-height: 350px;
  }

  .tracking-info-card {
    padding: 12px;
  }

  .tracking-info-card .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .banner-zone {
    --banner-pad: 0.75rem;
  }

  .city-banner,
  .city-banner-premium {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 1rem;
  }

  .cert-actions {
    min-width: auto;
  }

  .cert-actions .btn {
    padding: 0.3rem 0.4rem;
  }

  .dr-filter-bar .btn {
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
  }
}

/* ── TABLET (481px - 768px) ───────────────────────────────── */
@media (min-width: 481px) and (max-width: 768px) {
  :root {
    --sidebar-width: 0;
    --radius: 14px;
    --radius-sm: 9px;
  }

  body {
    font-size: 0.9rem;
  }

  .sidebar {
    width: min(260px, 80vw);
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: none;
    box-shadow: var(--shadow-xl);
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 1.15rem;
  }

  .top-bar {
    padding: 0.6rem 0.9rem;
    min-height: 58px;
    gap: 0.4rem;
  }

  .dashboard-card {
    padding: 1.15rem;
  }

  .stat-box {
    padding: 1.1rem;
  }

  .table-responsive {
    font-size: 0.85rem;
  }

  .map-picker,
  .service-map {
    height: 250px;
  }

  h1, h2, h3 {
    font-size: 1.35rem;
  }

  .sidebar-nav {
    padding: 1rem 0.7rem;
  }

  .sidebar-section {
    padding: 0.7rem 0.7rem 0.3rem;
    font-size: 0.6rem;
  }

  .sidebar-nav .nav-link {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    gap: 0.6rem;
  }

  .modal-dialog {
    margin: 1rem auto;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-badge {
    font-size: 0.75rem;
  }

  .stat-num {
    font-size: 1.8rem;
  }

  .feature-card {
    padding: 1.4rem;
  }

  .auth-card {
    padding: 2rem 1.75rem;
  }

  .chat-wrap {
    height: calc(100vh - 190px);
  }

  .verify-frame {
    min-height: 450px;
  }

  .banner-zone {
    --banner-pad: 0.85rem;
  }

  .top-bar-actions .dropdown-toggle span,
  .top-bar-actions .btn-outline-secondary .bi-shuffle + * {
    display: none;
  }
}

/* ── DESKTOP (769px+) ────────────────────────────────────── */
@media (min-width: 769px) {
  :root {
    --sidebar-width: 268px;
    --radius: 16px;
    --radius-sm: 10px;
  }

  body {
    font-size: 0.9375rem;
  }

  .sidebar {
    width: 268px;
  }

  .main-content {
    margin-left: 268px;
  }

  .page-content {
    padding: 1.5rem;
  }

  .top-bar {
    padding: 0.75rem 1rem;
    min-height: 64px;
  }

  .dashboard-card {
    padding: 1.4rem;
  }

  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-lg-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }

  .col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }

  .col-lg-2 {
    flex: 0 0 16.666%;
    max-width: 16.666%;
  }

  .col-lg-5 {
    flex: 0 0 41.666%;
    max-width: 41.666%;
  }

  .col-lg-7 {
    flex: 0 0 58.333%;
    max-width: 58.333%;
  }

  .col-lg-8 {
    flex: 0 0 66.666%;
    max-width: 66.666%;
  }

  .map-picker,
  .service-map {
    height: 350px;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── LARGE DESKTOP / ULTRAWIDE (1440px+) ─────────────────── */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  .page-content {
    padding: 2rem;
  }

  .hero-section {
    min-height: 85vh;
  }

  .hero-title {
    font-size: 3.75rem;
  }

  .blood-drop {
    width: 280px;
    height: 280px;
  }

  .map-picker,
  .service-map {
    height: 420px;
  }
}

/* ── LANDSCAPE MOBILE (≤ 480px height) ──────────────────── */
@media (max-width: 480px) and (max-height: 600px) {
  .page-content {
    padding: 0.75rem;
  }

  .top-bar {
    min-height: 48px;
    padding: 0.4rem 0.65rem;
  }

  .sidebar-nav {
    max-height: 70vh;
    overflow-y: auto;
  }

  .modal-body {
    max-height: 60vh;
    overflow-y: auto;
  }

  .hero-section {
    min-height: auto;
    padding: 2rem 0;
  }

  .hero-actions .btn {
    padding: 0.5rem 1rem;
  }
}

/* ── UTILITY: Hide/Show on different screens ────────────── */
.d-mobile {
  display: none;
}

.d-tablet {
  display: none;
}

.d-desktop {
  display: none;
}

@media (max-width: 480px) {
  .d-mobile {
    display: block !important;
  }
  .d-mobile-flex {
    display: flex !important;
  }
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .d-tablet {
    display: block !important;
  }
  .hide-tablet {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .d-desktop {
    display: block !important;
  }
  .hide-desktop {
    display: none !important;
  }
}

/* ── TOUCH DEVICES ──────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  button,
  .btn,
  .nav-link,
  a {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }

  .btn-sm {
    padding: 0.5rem 0.75rem;
  }

  .sidebar-nav .nav-link {
    min-height: 40px;
  }
}

/* ── HIGH DPI / RETINA SCREENS ──────────────────────────── */
@media (min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .sidebar,
  .top-bar {
    border: 1px solid var(--border);
  }
}

/* ── PRINT STYLES ───────────────────────────────────────── */
@media print {
  .sidebar, .top-bar, .sidebar-overlay, .page-loader,
  .toast-container, .scroll-top-btn, .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .page-content {
    padding: 0 !important;
  }

  body {
    background: #fff !important;
  }
}
