@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --red: #c41e3a;
  --red-dark: #9e1830;
  --red-light: #f5e6e9;
  --green: #165b33;
  --green-dark: #0f3f23;
  --green-light: #e6f0ea;
  --gold: #d4a017;
  --gold-light: #fdf6e3;
  --bg: #faf9f7;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ── */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 480px; margin: 0 auto; }

/* ── Header ── */
.site-header {
  background: #ffffff;
  color: var(--text);
  padding: 0.75rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-bottom: 3px solid var(--red);
}
.site-header .page-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.site-logo img { height: 80px; width: auto; }
.site-logo .emoji { font-size: 1.5rem; }
.header-nav { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.header-nav a {
  color: var(--green);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.header-nav a:hover, .header-nav a.active { background: var(--green-light); color: var(--green-dark); }
.header-nav .btn-header {
  background: var(--red);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.header-nav .btn-header:hover { background: var(--red-dark); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: white;
  text-align: center;
  padding: 4rem 1rem 3rem;
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; margin-bottom: 0.75rem; }
.hero p { font-size: 1.15rem; opacity: 0.9; max-width: 560px; margin: 0 auto 2rem; }
.hero-emoji { font-size: 3rem; margin-bottom: 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-secondary { background: white; color: var(--green); border: 2px solid var(--green); }
.btn-secondary:hover { background: var(--green-light); }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: var(--green-dark); }
.btn-gold { background: var(--gold); color: white; }
.btn-outline { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ── Form ── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,91,51,0.1); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Alerts ── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: var(--gold-light); color: #92400e; border: 1px solid #fcd34d; }

/* ── Timeline / Steps ── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 1rem;
  position: relative;
  padding-bottom: 1.25rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 2.2rem;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-dot {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 1;
}
.dot-done { background: var(--green); color: white; }
.dot-current { background: var(--red); color: white; box-shadow: 0 0 0 4px var(--red-light); }
.dot-future { background: var(--border); color: var(--text-muted); }
.timeline-content { padding-top: 0.2rem; }
.timeline-label { font-weight: 700; font-size: 0.95rem; }
.timeline-date { font-size: 0.82rem; color: var(--text-muted); }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stat-number { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-green .stat-number { color: var(--green); }
.stat-red .stat-number { color: var(--red); }
.stat-gold .stat-number { color: var(--gold); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: #f9fafb;
  border-bottom: 2px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gold { background: var(--gold-light); color: #92400e; }
.badge-gray { background: #f3f4f6; color: var(--text-muted); }

/* ── Wishlist cards ── */
.wishlist-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: white;
}
.wishlist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.wishlist-kid-label { font-weight: 700; font-size: 1rem; }
.wishlist-meta { font-size: 0.82rem; color: var(--text-muted); }
.wish-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.wish-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.wish-list li::before { content: '🎁'; flex-shrink: 0; }

/* ── Page section ── */
.page-section { padding: 2rem 0; }
.section-header { margin-bottom: 1.5rem; }
.section-title { font-size: 1.3rem; font-weight: 800; }
.section-sub { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: none; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); padding: 0.2rem; }

/* ── Loading ── */
.spinner {
  width: 1.2rem; height: 1.2rem;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
.spinner-dark {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--green);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { text-align: center; padding: 2rem; color: var(--text-muted); }

/* ── Misc ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }

/* ── Admin sidebar ── */
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--green-dark);
  padding: 1.5rem 0;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}
.admin-sidebar .sidebar-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  padding: 1rem 1.25rem 0.3rem;
}
.admin-main { flex: 1; padding: 2rem; overflow: auto; }

@media (max-width: 700px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; flex-wrap: wrap; padding: 0.5rem; gap: 0.25rem; }
  .admin-sidebar .sidebar-section { display: none; }
  .admin-sidebar a { padding: 0.5rem 0.75rem; font-size: 0.82rem; border-radius: var(--radius-sm); }
  .admin-main { padding: 1rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
}

/* ── Christmas decorations ── */
.christmas-banner {
  background: linear-gradient(90deg, var(--red) 0%, var(--green) 100%);
  color: white;
  text-align: center;
  padding: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .emoji { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.95rem; }

/* ── Search / filter bar ── */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}
.filter-bar .form-control { max-width: 260px; }
