/* ============ RESET & TOKENS ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Dark, warm palette */
  --rose-50: rgba(244, 63, 94, 0.08);
  --rose-100: rgba(244, 63, 94, 0.12);
  --rose-200: rgba(244, 63, 94, 0.2);
  --rose-400: #e8607a;
  --rose-500: #e44b6a;
  --rose-600: #d63d5c;
  --rose-700: #c0354f;

  --purple-50: rgba(168, 85, 247, 0.08);
  --purple-100: rgba(168, 85, 247, 0.12);
  --purple-200: rgba(168, 85, 247, 0.2);
  --purple-400: #b07ce8;
  --purple-500: #9b6ad6;
  --purple-600: #7c4dbd;

  --sky-100: rgba(56, 189, 248, 0.1);
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;

  --amber-50: rgba(245, 158, 11, 0.08);
  --amber-100: rgba(245, 158, 11, 0.12);
  --amber-400: #f5b942;
  --amber-500: #e8a317;

  --emerald-50: rgba(16, 185, 129, 0.08);
  --emerald-100: rgba(16, 185, 129, 0.12);
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #0d9669;

  --gray-50: #1a1d23;
  --gray-100: #22262e;
  --gray-200: #2d323c;
  --gray-300: #3d4350;
  --gray-400: #6b7280;
  --gray-500: #9ca3af;
  --gray-600: #bfc6d2;
  --gray-700: #d1d5db;
  --gray-800: #e5e7eb;
  --gray-900: #f1f3f5;

  --white: #161920;
  --bg: #0f1117;
  --card-bg: #161920;
  --card-border: #22262e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--gray-700);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  width: 100%;
}

a { color: var(--rose-400); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--rose-500); }

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

/* ============ HEADER ============ */
header {
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(15, 17, 23, 0.85);
}

nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -1px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.logo-icon {
  width: 2.8rem;
  height: auto;
  display: inline-block;
}

.logo-text span { color: var(--rose-400); }
.logo:hover { color: var(--gray-900); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--gray-900); }
.nav-links .nav-admin { color: var(--rose-400); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gray-600);
  border-radius: 1px;
  transition: 0.2s;
}

/* ============ HERO ============ */
.hero {
  background: linear-gradient(135deg, rgba(214, 61, 92, 0.12) 0%, rgba(124, 77, 189, 0.1) 50%, rgba(14, 165, 233, 0.08) 100%);
  margin: 0 -1.25rem;
  padding: 3rem 1.25rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
}

.hero-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rose-400);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
}

.hero h1 strong {
  color: var(--rose-400);
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--gray-500);
  font-weight: 400;
  margin-bottom: 2rem;
}

.stat-cards {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 700px;
  margin: 0 auto;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  min-width: 140px;
  flex: 1;
  border: 1px solid var(--card-border);
}

.stat-number {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.stat-number small {
  font-size: 0.6em;
  font-weight: 500;
  color: var(--gray-400);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

/* ============ SECTIONS ============ */
.section {
  margin-top: 2.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.25rem;
}

.page-header {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.page-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.4rem;
}

.page-header .subtitle {
  color: var(--gray-500);
  font-size: 1rem;
}

/* ============ VITALS CARDS ============ */
.vitals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.vital-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--card-border);
}

.vital-card.wide {
  grid-column: span 2;
}

.vital-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--bg);
  background: var(--gray-400);
  flex-shrink: 0;
}

.vital-icon.heart { background: var(--rose-400); }
.vital-icon.o2 { background: var(--sky-500); }
.vital-icon.temp { background: var(--amber-400); }
.vital-icon.resp { background: var(--purple-500); }

.vital-icon-emoji {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  line-height: 1;
}

.vital-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.vital-value.text {
  font-size: 1rem;
}

.vital-value small {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--gray-400);
  margin-left: 2px;
}

.vital-label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* ============ CHARTS ============ */
.chart-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
  margin-top: 1.25rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
}

/* ============ EKG TIMELINE ============ */
.ekg-section {
  margin-top: 2.5rem;
}

.ekg-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
}

.ekg-svg {
  display: block;
  width: 100%;
  min-width: 400px;
  height: 180px;
}

.ekg-line {
  fill: none;
  stroke: var(--rose-400);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(228, 75, 106, 0.4));
}

.ekg-glow {
  fill: none;
  stroke: var(--rose-400);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.15;
}

.ekg-area {
  opacity: 0.06;
}

.ekg-point {
  cursor: pointer;
  transition: r 0.15s, opacity 0.15s;
}

.ekg-point:hover {
  r: 7;
}

.ekg-grid-line {
  stroke: var(--gray-200);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.ekg-label {
  fill: var(--gray-400);
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
}

.ekg-tooltip {
  position: fixed;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xs);
  padding: 0.6rem 0.85rem;
  max-width: 260px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}

.ekg-tooltip.visible {
  opacity: 1;
}

.ekg-tooltip-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gray-900);
  margin-bottom: 0.15rem;
}

.ekg-tooltip-date {
  font-size: 0.7rem;
  color: var(--gray-400);
  margin-bottom: 0.35rem;
}

.ekg-tooltip-excerpt {
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.ekg-milestone-line {
  stroke: var(--amber-400, #fbbf24);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.5;
}

.ekg-milestone-diamond {
  fill: var(--amber-400, #fbbf24);
  stroke: var(--gray-100);
  stroke-width: 1.5;
  cursor: pointer;
  filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.5));
  transition: transform 0.15s;
}

.ekg-milestone-diamond:hover {
  fill: var(--amber-300, #fcd34d);
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.7));
}

/* ============ MILESTONES (public) ============ */
.milestone-progress-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.milestone-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose-400), var(--purple-400));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.milestone-progress-text {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.recent-milestones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.milestone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-600);
}

.milestone-chip.achieved {
  background: var(--emerald-50);
  color: var(--emerald-400);
}

.milestone-chip .check {
  color: var(--emerald-400);
  font-weight: 700;
}

/* Milestones page */
.milestones-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.category-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--rose-100);
}

.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all 0.2s;
}

.milestone-item.achieved {
  background: var(--emerald-50);
  border-color: rgba(16, 185, 129, 0.2);
}

.milestone-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 2px;
}

.milestone-item.achieved .milestone-check {
  background: var(--emerald-500);
  border-color: var(--emerald-500);
  color: var(--bg);
  font-weight: 700;
}

.milestone-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
}

.milestone-info p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 0.15rem;
}

.milestone-date {
  display: block;
  font-size: 0.75rem;
  color: var(--emerald-400);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ============ SYSTEMS DASHBOARD ============ */
.systems-dashboard {
  margin-bottom: 2.5rem;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
}

.system-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.system-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(52,211,153,0.0) 0%, transparent 70%);
  transition: background 0.3s;
  pointer-events: none;
}

.system-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.system-card:hover::before {
  background: radial-gradient(circle at 50% 30%, rgba(52,211,153,0.04) 0%, transparent 70%);
}

.system-card.system-active {
  border-color: rgba(52,211,153,0.15);
}

.system-card.system-active::before {
  background: radial-gradient(circle at 50% 30%, rgba(52,211,153,0.04) 0%, transparent 70%);
}

.system-card.system-complete {
  border-color: rgba(52,211,153,0.25);
}

.system-card.system-complete::before {
  background: radial-gradient(circle at 50% 30%, rgba(52,211,153,0.08) 0%, transparent 70%);
}

/* Ring + Icon */
.system-ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.system-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ring-progress {
  transition: stroke-dashoffset 0.6s ease, stroke 0.3s;
}

.system-card:hover .ring-progress {
  stroke: var(--emerald-400) !important;
  filter: drop-shadow(0 0 6px rgba(52,211,153,0.35));
}

.system-icon {
  font-size: 1.75rem;
  line-height: 1;
  z-index: 1;
}

.system-complete-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: var(--emerald-500);
  color: var(--bg);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(52,211,153,0.4);
  z-index: 2;
}

/* Info */
.system-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.system-label {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gray-700);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.system-sub {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 500;
}

.system-count {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-top: 0.2rem;
}

.system-card.system-active .system-count {
  color: rgba(52,211,153,0.7);
}

.system-card.system-complete .system-count {
  color: var(--emerald-400);
}

.system-count-sep {
  font-weight: 400;
  color: var(--gray-400);
  margin: 0 1px;
}

/* Mini ticks — one per milestone */
.system-ticks {
  display: flex;
  gap: 3px;
  margin-top: 0.25rem;
}

.system-tick {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: background 0.3s, box-shadow 0.3s;
}

.system-tick.tick-done {
  background: var(--emerald-400);
  box-shadow: 0 0 5px rgba(52,211,153,0.3);
}

@media (max-width: 768px) {
  .systems-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .systems-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .system-card {
    padding: 1rem 0.5rem 0.75rem;
  }

  .system-ring-wrap {
    width: 60px;
    height: 60px;
  }

  .system-icon {
    font-size: 1.4rem;
  }

  .system-label {
    font-size: 0.6rem;
  }
}

/* ============ MOOD BADGES ============ */
.mood {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.mood-great { background: var(--emerald-50); color: var(--emerald-400); }
.mood-good { background: var(--purple-50); color: var(--purple-400); }
.mood-tough { background: var(--amber-50); color: var(--amber-400); }

/* ============ PINNED UPDATE ============ */
.pinned-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--rose-400);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.update-card.featured {
  border-left: 4px solid var(--rose-400);
}

/* ============ UPDATES ============ */
.updates-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.update-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
  transition: box-shadow 0.2s, transform 0.2s;
}

.update-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.update-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.update-meta time {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 500;
}

.update-card h2, .update-card h3 { margin-bottom: 0.4rem; }

.update-card h2 a, .update-card h3 a {
  color: var(--gray-900);
  font-weight: 700;
}

.update-card h2 a:hover, .update-card h3 a:hover { color: var(--rose-400); }

.update-photo {
  margin: 1rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.update-photo img {
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.update-preview {
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.7;
}

.read-more {
  display: inline-block;
  margin-top: 0.65rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gray-400);
  font-size: 1rem;
}

/* ============ UPDATES PAGE & CATCH-UP ============ */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.view-all-link {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--rose-400);
}

.view-all-link:hover {
  text-decoration: underline;
}

.section-subtitle {
  color: var(--gray-400);
  font-size: 0.9rem;
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

.catch-up-banner {
  text-align: center;
  padding: 1.25rem;
  margin-top: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.catch-up-link {
  display: inline-block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--rose-400);
}

.catch-up-link:hover {
  text-decoration: underline;
}

.catch-up-desc {
  display: block;
  color: var(--gray-400);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.pagination-info {
  color: var(--gray-400);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.updates-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.pagination-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--rose-400);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: background 0.15s;
}

.pagination-link:hover:not(.disabled) {
  background: var(--rose-50);
}

.pagination-link.disabled {
  color: var(--gray-600);
  cursor: default;
  opacity: 0.4;
}

.pagination-pages {
  display: flex;
  gap: 0.25rem;
}

.pagination-num, .pagination-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.pagination-num {
  color: var(--gray-300);
}

.pagination-num:hover {
  background: var(--glass-bg);
  color: var(--rose-400);
}

.pagination-current {
  background: var(--rose-400);
  color: #fff;
}

/* ============ SINGLE UPDATE ============ */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-400);
}

.back-link:hover { color: var(--rose-400); }

.single-update {
  padding-top: 2rem;
}

.single-update h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.update-photos-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.single-update .update-photo.full {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.update-photos-gallery .update-photo.full:first-child {
  margin-top: 1.5rem;
}

.update-photos-gallery .update-photo.full:last-child {
  margin-bottom: 1.5rem;
}

.update-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--gray-700);
}

.update-content p { margin-bottom: 1rem; }

/* Update navigation */
.update-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.update-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xs);
  text-decoration: none;
  transition: background 0.15s;
  max-width: 50%;
}

.update-nav-link.prev { align-items: flex-start; }
.update-nav-link.next { align-items: flex-end; margin-left: auto; }
.update-nav-link.disabled { visibility: hidden; }

.update-nav-link:hover { background: var(--rose-50); }

.update-nav-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rose-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.update-nav-title {
  font-size: 0.95rem;
  color: var(--gray-700);
  line-height: 1.3;
}

.update-nav-link:hover .update-nav-title { color: var(--gray-900); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--rose-600);
  color: #fff;
}

.btn-primary:hover { background: var(--rose-700); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
}

.btn-outline:hover { border-color: var(--rose-400); color: var(--rose-400); }

.btn-danger { background: var(--rose-50); color: var(--rose-400); }
.btn-danger:hover { background: var(--rose-100); }

.btn-small { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 1.15rem; }

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--gray-50);
  color: var(--gray-800);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--rose-400);
  box-shadow: 0 0 0 3px var(--rose-100);
}

.form-group input[type="file"] {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.current-photo { margin-top: 0.75rem; }
.current-photo p { font-size: 0.8rem; color: var(--gray-400); margin-bottom: 0.4rem; }

/* ============ AUTH ============ */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}

.auth-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  text-align: center;
  border: 1px solid var(--card-border);
}

.auth-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.auth-card p {
  color: var(--gray-400);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.auth-card .form-group { text-align: left; }

.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-xs);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.alert-error { background: var(--rose-50); color: var(--rose-400); }

/* ============ ADMIN ============ */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-top: 1.5rem;
}

.admin-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  color: var(--gray-900);
}

.admin-quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.quick-link-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.quick-link-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--rose-200);
  color: var(--rose-400);
}

.ql-label { font-weight: 600; font-size: 0.9rem; }

.admin-summary {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.admin-summary h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.admin-vitals-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--gray-700);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.admin-item-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.admin-item-top time { font-size: 0.75rem; color: var(--gray-400); }

.pinned-indicator {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--rose-400);
  background: var(--rose-50);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.admin-item h3 { font-size: 0.95rem; margin-bottom: 0.15rem; color: var(--gray-800); }
.admin-item p { font-size: 0.8rem; color: var(--gray-400); }

.admin-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  align-items: flex-start;
}

.editor-form {
  background: var(--card-bg);
  padding: 1.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
}

.admin-editor {
  padding-top: 1.5rem;
}

.admin-editor h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  color: var(--gray-900);
}

.milestone-admin-section {
  margin-bottom: 2rem;
}

.milestone-admin-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--rose-100);
  color: var(--gray-800);
}

.milestone-admin-item.milestone-achieved {
  background: var(--emerald-50);
  border-color: rgba(16, 185, 129, 0.2);
}

/* ============ VITALS TABLE ============ */
.vitals-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.vitals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.vitals-table th {
  background: var(--gray-50);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-500);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--card-border);
}

.vitals-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--gray-50);
  color: var(--gray-700);
}

.vitals-table tbody tr:hover { background: var(--gray-50); }

/* ============ ERROR PAGE ============ */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.error-page p { color: var(--gray-400); margin-bottom: 1.5rem; }

/* ============ FOOTER ============ */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--gray-400);
  font-size: 0.8rem;
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
}

footer strong { color: var(--rose-400); font-weight: 700; }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .hero h1 { font-size: 2.2rem; }

  .stat-cards { gap: 0.5rem; }
  .stat-card { min-width: 0; padding: 0.75rem 1rem; }
  .stat-number { font-size: 1.4rem; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    box-shadow: var(--shadow-md);
    gap: 0.75rem;
  }

  .nav-toggle { display: flex; }

  .vital-card.wide { grid-column: span 1; }

  .form-row { grid-template-columns: 1fr; }

  .admin-item { flex-direction: column; }
  .admin-item-actions { width: 100%; }

  .admin-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }

  .admin-quick-links { grid-template-columns: 1fr; }

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

  .ekg-container { padding: 1rem; }
}

/* ============ NOTIFICATION TOGGLE (NAV) ============ */
.notif-toggle {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: color 0.15s;
  border-radius: 6px;
}

.notif-toggle:hover {
  color: var(--gray-700);
  background: var(--gray-100);
}

.notif-toggle.subscribed {
  color: var(--rose-400);
}

.notif-toggle.subscribed:hover {
  color: var(--rose-500);
}

.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

/* ============ NOTIFICATION BANNER ============ */
.notif-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(to top, rgba(15, 17, 23, 0.95), rgba(15, 17, 23, 0.85));
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  animation: notifSlideUp 0.4s ease;
}

@keyframes notifSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.notif-banner-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 600px;
  width: 100%;
}

.notif-banner-inner p {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  flex: 1;
}

.notif-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .notif-banner-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}

/* ============ THEME OVERRIDES ============ */

/* Ocean theme - blue/cyan accents */
[data-theme="ocean"] {
  --rose-50: rgba(14, 165, 233, 0.08);
  --rose-100: rgba(14, 165, 233, 0.12);
  --rose-200: rgba(14, 165, 233, 0.2);
  --rose-400: #38bdf8;
  --rose-500: #0ea5e9;
  --rose-600: #0284c7;
  --rose-700: #0369a1;
}

/* Lavender theme - purple accents */
[data-theme="lavender"] {
  --rose-50: rgba(168, 85, 247, 0.08);
  --rose-100: rgba(168, 85, 247, 0.12);
  --rose-200: rgba(168, 85, 247, 0.2);
  --rose-400: #c084fc;
  --rose-500: #a855f7;
  --rose-600: #9333ea;
  --rose-700: #7e22ce;
}

/* Sunset theme - warm orange accents */
[data-theme="sunset"] {
  --rose-50: rgba(249, 115, 22, 0.08);
  --rose-100: rgba(249, 115, 22, 0.12);
  --rose-200: rgba(249, 115, 22, 0.2);
  --rose-400: #fb923c;
  --rose-500: #f97316;
  --rose-600: #ea580c;
  --rose-700: #c2410c;
}

/* Forest theme - green accents */
[data-theme="forest"] {
  --rose-50: rgba(16, 185, 129, 0.08);
  --rose-100: rgba(16, 185, 129, 0.12);
  --rose-200: rgba(16, 185, 129, 0.2);
  --rose-400: #34d399;
  --rose-500: #10b981;
  --rose-600: #059669;
  --rose-700: #047857;
}

/* Light mode themes */
[data-theme="rose-light"],
[data-theme="ocean-light"],
[data-theme="lavender-light"],
[data-theme="sunset-light"],
[data-theme="forest-light"] {
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #adb5bd;
  --gray-500: #6c757d;
  --gray-600: #495057;
  --gray-700: #343a40;
  --gray-800: #212529;
  --gray-900: #111318;
  --white: #ffffff;
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --card-border: #e2e5e9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);
}

[data-theme="rose-light"] {
  --rose-50: rgba(244, 63, 94, 0.06);
  --rose-100: rgba(244, 63, 94, 0.1);
  --rose-200: rgba(244, 63, 94, 0.16);
  --rose-400: #e8607a;
  --rose-500: #e44b6a;
  --rose-600: #d63d5c;
  --rose-700: #c0354f;
}

[data-theme="ocean-light"] {
  --rose-50: rgba(14, 165, 233, 0.06);
  --rose-100: rgba(14, 165, 233, 0.1);
  --rose-200: rgba(14, 165, 233, 0.16);
  --rose-400: #0ea5e9;
  --rose-500: #0284c7;
  --rose-600: #0369a1;
  --rose-700: #075985;
}

[data-theme="lavender-light"] {
  --rose-50: rgba(168, 85, 247, 0.06);
  --rose-100: rgba(168, 85, 247, 0.1);
  --rose-200: rgba(168, 85, 247, 0.16);
  --rose-400: #a855f7;
  --rose-500: #9333ea;
  --rose-600: #7e22ce;
  --rose-700: #6b21a8;
}

[data-theme="sunset-light"] {
  --rose-50: rgba(249, 115, 22, 0.06);
  --rose-100: rgba(249, 115, 22, 0.1);
  --rose-200: rgba(249, 115, 22, 0.16);
  --rose-400: #f97316;
  --rose-500: #ea580c;
  --rose-600: #c2410c;
  --rose-700: #9a3412;
}

[data-theme="forest-light"] {
  --rose-50: rgba(16, 185, 129, 0.06);
  --rose-100: rgba(16, 185, 129, 0.1);
  --rose-200: rgba(16, 185, 129, 0.16);
  --rose-400: #10b981;
  --rose-500: #059669;
  --rose-600: #047857;
  --rose-700: #065f46;
}

/* Fix light mode header backdrop */
[data-theme="rose-light"] header,
[data-theme="ocean-light"] header,
[data-theme="lavender-light"] header,
[data-theme="sunset-light"] header,
[data-theme="forest-light"] header {
  background: rgba(245, 245, 247, 0.85);
}

/* Fix light mode hero gradient */
[data-theme="rose-light"] .hero { background: linear-gradient(135deg, rgba(214, 61, 92, 0.06) 0%, rgba(124, 77, 189, 0.05) 50%, rgba(14, 165, 233, 0.04) 100%); }
[data-theme="ocean-light"] .hero { background: linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, rgba(56, 189, 248, 0.05) 50%, rgba(14, 165, 233, 0.04) 100%); }
[data-theme="lavender-light"] .hero { background: linear-gradient(135deg, rgba(168, 85, 247, 0.06) 0%, rgba(192, 132, 252, 0.05) 50%, rgba(168, 85, 247, 0.04) 100%); }
[data-theme="sunset-light"] .hero { background: linear-gradient(135deg, rgba(249, 115, 22, 0.06) 0%, rgba(251, 146, 60, 0.05) 50%, rgba(249, 115, 22, 0.04) 100%); }
[data-theme="forest-light"] .hero { background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(52, 211, 153, 0.05) 50%, rgba(16, 185, 129, 0.04) 100%); }

/* Fix light mode notification banner */
[data-theme="rose-light"] .notif-banner,
[data-theme="ocean-light"] .notif-banner,
[data-theme="lavender-light"] .notif-banner,
[data-theme="sunset-light"] .notif-banner,
[data-theme="forest-light"] .notif-banner {
  background: linear-gradient(to top, rgba(245, 245, 247, 0.95), rgba(245, 245, 247, 0.85));
}

/* Dark mode hero gradients for non-rose themes */
[data-theme="ocean"] .hero { background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(56, 189, 248, 0.08) 50%, rgba(14, 165, 233, 0.06) 100%); }
[data-theme="lavender"] .hero { background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(192, 132, 252, 0.08) 50%, rgba(168, 85, 247, 0.06) 100%); }
[data-theme="sunset"] .hero { background: linear-gradient(135deg, rgba(249, 115, 22, 0.12) 0%, rgba(251, 146, 60, 0.08) 50%, rgba(249, 115, 22, 0.06) 100%); }
[data-theme="forest"] .hero { background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(52, 211, 153, 0.08) 50%, rgba(16, 185, 129, 0.06) 100%); }

/* ============ THEME PICKER ============ */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.theme-option {
  position: relative;
  cursor: pointer;
}

.theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.theme-option input:checked + .theme-swatch {
  border-color: var(--rose-500);
  box-shadow: 0 0 0 1px var(--rose-500);
}

.theme-swatch-colors {
  display: flex;
  gap: 4px;
}

.theme-swatch-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
}

.theme-swatch-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600);
}

/* Logo preview in settings */
.logo-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.logo-preview img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  background: var(--gray-50);
  padding: 0.25rem;
}

.logo-preview .current-label {
  font-size: 0.85rem;
  color: var(--gray-500);
}
