/* ============================================================
   BabyNameVault — Main Stylesheet
   Aesthetic: Warm Organic Editorial
   Fonts: Cormorant Garamond (display) + DM Sans (body)
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --cream:       #FEF9F0;
  --cream-dark:  #F5EDE0;
  --rose:        #E8A598;
  --rose-deep:   #D4766A;
  --gold:        #C9A96E;
  --gold-light:  #E8D5B0;
  --sage:        #7A9E7E;
  --sage-light:  #B8D4BA;
  --charcoal:    #2C2520;
  --brown:       #6B4C3B;
  --muted:       #9A8878;
  --white:       #FFFFFF;
  --shadow-sm:   0 2px 8px rgba(44,37,32,.08);
  --shadow-md:   0 4px 20px rgba(44,37,32,.12);
  --shadow-lg:   0 8px 40px rgba(44,37,32,.16);
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-pill: 100px;
  --transition:  .25s ease;
  --serif:       'Cormorant Garamond', Georgia, serif;
  --sans:        'DM Sans', system-ui, sans-serif;
  --max-w:       1200px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--cream);
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--rose-deep); }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
h1,h2,h3,h4,h5,h6 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ── HEADER ────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--cream-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  /* Allow mobile nav dropdown to position against this */
}
.site-header .header-inner {
  position: relative;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 70px;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-text {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: -.02em;
}
.main-nav {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}
.main-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--brown);
  letter-spacing: .02em;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.main-nav a:hover { color: var(--rose-deep); border-bottom-color: var(--rose); }
.header-search { display: flex; align-items: center; }
.header-search form {
  display: flex;
  align-items: center;
  background: var(--cream);
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: border-color var(--transition);
}
.header-search form:focus-within { border-color: var(--rose); }
.header-search input {
  background: none;
  border: none;
  outline: none;
  padding: .45rem 1rem;
  font-size: .875rem;
  color: var(--charcoal);
  width: 200px;
}
.header-search button {
  padding: .45rem .8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.header-search button:hover { color: var(--rose-deep); }
.menu-toggle { display: none; flex-direction: column; gap: 5px; padding: .4rem; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--charcoal); border-radius: 2px; transition: all var(--transition); }
.main-nav.mobile-open {
  display: flex !important;
  flex-direction: column;
  position: absolute;
  top: 70px; left: 0; right: 0;
  background: var(--white);
  border-bottom: 2px solid var(--cream-dark);
  padding: 1rem 0;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.main-nav.mobile-open a {
  padding: .75rem 1.5rem;
  border-bottom: none;
}

/* ── HERO ──────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #FEF9F0 0%, #F5EDE0 40%, #FAEAE6 100%);
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  /* overflow:visible so the autocomplete dropdown is never clipped */
  overflow: visible;
  /* sit above the strip-section below it */
  z-index: 10;
}
/* Decorative blobs: clipped inside their own wrapper so they don't
   cause page scrollbars now that .hero is overflow:visible */
.hero-blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.hero-blobs::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(232,165,152,.25) 0%, transparent 70%);
}
.hero-blobs::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(122,158,126,.15) 0%, transparent 70%);
}
.hero-eyebrow {
  display: inline-block;
  background: var(--gold-light);
  color: var(--brown);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .35rem 1rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--charcoal);
  margin-bottom: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.hero h1 em { color: var(--rose-deep); font-style: italic; }
.hero p {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 2.5rem;
}
.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  z-index: 50;
}
.hero-search-form {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.hero-search-form:focus-within { border-color: var(--rose); }
.hero-search-form input {
  flex: 1;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border: none;
  outline: none;
  background: transparent;
  color: var(--charcoal);
}
.hero-search-form button {
  margin: .4rem .4rem .4rem 0;
  padding: .7rem 1.75rem;
  background: var(--rose-deep);
  color: var(--white);
  font-size: .9rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: background var(--transition), transform var(--transition);
}
.hero-search-form button:hover { background: var(--charcoal); transform: scale(1.02); }
.hero-filters {
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem 1.1rem;
  background: var(--white);
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-pill);
  font-size: .83rem;
  font-weight: 500;
  color: var(--brown);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.filter-chip:hover,
.filter-chip.active { background: var(--rose); border-color: var(--rose); color: var(--white); }

/* ── SECTION HEADINGS ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--charcoal);
}
.section-header a { font-size: .875rem; color: var(--rose-deep); font-weight: 500; }
.section-header a:hover { text-decoration: underline; }
.section { padding: 4rem 0; }
.section--alt { background: var(--white); }

/* ── NAME CARDS ────────────────────────────────────────────── */
.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.name-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232,165,152,.15);
  transition: all var(--transition);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}
.name-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  transform: scaleX(0);
  transition: transform var(--transition);
}
.name-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.name-card:hover::before { transform: scaleX(1); }
.name-card .name { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--charcoal); margin-bottom: .35rem; }
.name-card .meaning { font-size: .83rem; color: var(--muted); margin-bottom: .75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.name-card .meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .65rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.badge-boy     { background: #DCEEFF; color: #1A5E9E; }
.badge-girl    { background: #FFE4EC; color: #B5345E; }
.badge-unisex  { background: #E8F5E9; color: #2E7D32; }
.badge-popular { background: var(--gold-light); color: var(--brown); }
.badge-trending { background: #FFF3E0; color: #E65100; }

/* ── ALPHABET BAR ──────────────────────────────────────────── */
.alpha-bar {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
  margin-bottom: 2rem;
}
.alpha-bar ul {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.alpha-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .875rem;
  color: var(--brown);
  border: 1.5px solid var(--cream-dark);
  transition: all var(--transition);
  text-decoration: none;
}
.alpha-bar a:hover,
.alpha-bar a.active { background: var(--rose-deep); color: var(--white); border-color: var(--rose-deep); }

/* ── FILTER SIDEBAR ────────────────────────────────────────── */
.browse-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}
.filter-panel {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
  position: sticky;
  top: 90px;
}
.filter-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--charcoal);
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--cream-dark);
}
.filter-group { margin-bottom: 1.5rem; }
.filter-group label { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: .6rem; }
.filter-group select,
.filter-group input[type="text"] {
  width: 100%;
  padding: .55rem .85rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--charcoal);
  background: var(--cream);
  outline: none;
  transition: border-color var(--transition);
}
.filter-group select:focus,
.filter-group input:focus { border-color: var(--rose); }
.filter-btn {
  width: 100%;
  padding: .75rem;
  background: var(--rose-deep);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  transition: background var(--transition);
}
.filter-btn:hover { background: var(--charcoal); }
.filter-reset { display: block; text-align: center; margin-top: .75rem; font-size: .83rem; color: var(--muted); }
.filter-reset:hover { color: var(--rose-deep); }

/* ── NAME DETAIL PAGE ──────────────────────────────────────── */
.name-hero {
  background: linear-gradient(135deg, var(--cream) 0%, #FAEAE6 100%);
  padding: 4rem 0 3rem;
  text-align: center;
}
.name-hero .display-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.name-hero .name-origin-label {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.name-hero .name-meaning-lead {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--brown);
  max-width: 500px;
  margin: 0 auto 1.5rem;
  font-family: var(--serif);
}

.name-detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 3rem 0;
  align-items: start;
}
.detail-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
  margin-bottom: 1.5rem;
}
.detail-card h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--cream-dark);
  color: var(--charcoal);
}
.detail-card p { color: var(--brown); line-height: 1.8; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat-item { text-align: center; padding: 1.25rem; background: var(--cream); border-radius: var(--radius-sm); }
.stat-item .stat-value { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--rose-deep); }
.stat-item .stat-label { font-size: .78rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }

.similar-names { display: flex; flex-wrap: wrap; gap: .5rem; }
.similar-names a {
  padding: .4rem .9rem;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-pill);
  font-size: .875rem;
  color: var(--brown);
  transition: all var(--transition);
}
.similar-names a:hover { background: var(--rose); color: var(--white); border-color: var(--rose); }

/* ── SEARCH PAGE ───────────────────────────────────────────── */
.search-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--cream-dark);
  margin-bottom: 2rem;
}
.search-header h1 { font-size: 1.75rem; }
.search-header .count { color: var(--muted); font-size: .9rem; }
.no-results {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}
.no-results svg { margin: 0 auto 1rem; opacity: .3; }
.no-results h3 { font-size: 1.5rem; color: var(--charcoal); margin-bottom: .5rem; }

/* ── PAGINATION ────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; margin-top: 3rem; }
.pagination ul { display: flex; gap: .4rem; align-items: center; }
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--cream-dark);
  font-size: .875rem;
  color: var(--brown);
  transition: all var(--transition);
}
.pagination a:hover,
.pagination a.active { background: var(--rose-deep); color: var(--white); border-color: var(--rose-deep); }
.pagination .dots { color: var(--muted); padding: 0 .25rem; }

/* ── ALERTS ────────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 500;
}
.alert-success { background: #F0FFF4; color: #276749; border-left: 4px solid #48BB78; }
.alert-error   { background: #FFF5F5; color: #C53030; border-left: 4px solid #FC8181; }
.alert-warning { background: #FFFBEB; color: #92400E; border-left: 4px solid #F6AD55; }
.alert-info    { background: #EBF8FF; color: #2B6CB0; border-left: 4px solid #63B3ED; }

/* ── TRENDING/POPULAR STRIP ────────────────────────────────── */
.strip-section { padding: 1.5rem 0; background: var(--charcoal); color: var(--white); }
.strip-section .container { display: flex; gap: 2rem; align-items: center; overflow-x: auto; }
.strip-label { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rose); white-space: nowrap; }
.strip-names { display: flex; gap: 1rem; }
.strip-names a {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: rgba(255,255,255,.8);
  white-space: nowrap;
  transition: color var(--transition);
}
.strip-names a:hover { color: var(--gold); }

/* ── STATS BAR ─────────────────────────────────────────────── */
.stats-bar { padding: 3rem 0; background: var(--white); }
.stats-bar .container { display: grid; grid-template-columns: repeat(4,1fr); gap: 2rem; }
.stat-block { text-align: center; }
.stat-block .num { font-family: var(--serif); font-size: 2.75rem; font-weight: 700; color: var(--rose-deep); }
.stat-block .lbl { font-size: .85rem; color: var(--muted); font-weight: 500; }

/* ── FOOTER ────────────────────────────────────────────────── */
.site-footer { background: #1E1812; color: rgba(255,255,255,.7); padding-top: 4rem; }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand p { font-size: .875rem; margin-top: .75rem; max-width: 240px; }
.footer-brand .logo-text { color: var(--white); }
.footer-nav { display: flex; gap: 3rem; }
.footer-col { display: flex; flex-direction: column; gap: .6rem; }
.footer-col h3 { font-family: var(--serif); font-size: 1rem; color: var(--white); margin-bottom: .25rem; }
.footer-col a { font-size: .85rem; color: rgba(255,255,255,.55); transition: color var(--transition); }
.footer-col a:hover { color: var(--rose); }
.footer-bottom {
  padding: 1.25rem 0;
  font-size: .8rem;
  color: rgba(255,255,255,.35);
}
.footer-bottom .container { display: flex; justify-content: space-between; }

/* ── AUTOCOMPLETE ──────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--cream-dark);
  max-height: 280px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: var(--charcoal);
}
.autocomplete-item:hover,
.autocomplete-item.focused { background: var(--cream); }
.autocomplete-item .ac-name { font-family: var(--serif); font-size: 1.1rem; }
.autocomplete-item .ac-meaning { font-size: .78rem; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-header {
  padding: .45rem 1.25rem .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--cream);
  border-bottom: 1px solid var(--cream-dark);
}
.ac-footer {
  display: block;
  padding: .65rem 1.25rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--rose-deep);
  border-top: 1px solid var(--cream-dark);
  text-align: center;
  background: var(--cream);
  transition: background var(--transition);
  text-decoration: none;
}
.ac-footer:hover { background: var(--cream-dark); color: var(--charcoal); }

/* ── ADMIN PANEL ───────────────────────────────────────────── */
.admin-body {
  background: #F3F4F6;
  font-family: var(--sans);
}
.admin-header {
  background: var(--charcoal);
  color: var(--white);
  padding: 0 2rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.admin-logo { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--white); }
.admin-logo span { color: var(--rose); }
.admin-nav-top { display: flex; align-items: center; gap: 1.5rem; }
.admin-nav-top a { font-size: .875rem; color: rgba(255,255,255,.7); transition: color var(--transition); }
.admin-nav-top a:hover { color: var(--white); }
.admin-nav-top .logout-btn { color: var(--rose); }

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 62px);
}
.admin-sidebar {
  background: var(--white);
  border-right: 1px solid #E5E7EB;
  padding: 1.5rem 0;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  font-size: .875rem;
  color: #4B5563;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: #FEF2F2;
  color: var(--rose-deep);
  border-left-color: var(--rose-deep);
}
.admin-sidebar .nav-section {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9CA3AF;
  padding: 1.25rem 1.5rem .5rem;
}
.admin-main { padding: 2rem; overflow: auto; }
.admin-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.admin-page-title h1 { font-size: 1.5rem; color: var(--charcoal); }

/* Admin Cards */
.admin-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid #E5E7EB;
  overflow: hidden;
}
.admin-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-header h2 { font-size: 1rem; color: var(--charcoal); }
.admin-card-body { padding: 1.5rem; }

/* Admin Stats */
.admin-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; margin-bottom: 2rem; }
.admin-stat {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.admin-stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.admin-stat-icon.rose   { background: #FEF2F2; }
.admin-stat-icon.blue   { background: #EFF6FF; }
.admin-stat-icon.green  { background: #F0FDF4; }
.admin-stat-icon.gold   { background: #FFFBEB; }
.admin-stat .num { font-size: 1.75rem; font-weight: 700; color: var(--charcoal); line-height: 1; }
.admin-stat .lbl { font-size: .78rem; color: #6B7280; margin-top: .2rem; }

/* Admin Table */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.admin-table th {
  background: #F9FAFB;
  padding: .8rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6B7280;
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
}
.admin-table td {
  padding: .9rem 1rem;
  border-bottom: 1px solid #F3F4F6;
  color: #374151;
  vertical-align: middle;
}
.admin-table tr:hover td { background: #F9FAFB; }
.admin-table .name-cell { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.action-btn.edit   { background: #EFF6FF; color: #1D4ED8; }
.action-btn.edit:hover { background: #1D4ED8; color: var(--white); }
.action-btn.delete { background: #FEF2F2; color: #DC2626; }
.action-btn.delete:hover { background: #DC2626; color: var(--white); }

/* Admin Forms */
.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.admin-form .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: .02em;
}
.form-label .req { color: var(--rose-deep); }
.form-control {
  padding: .65rem .9rem;
  border: 1.5px solid #D1D5DB;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--charcoal);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.form-control:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(232,165,152,.15); }
textarea.form-control { resize: vertical; min-height: 110px; }
.form-hint { font-size: .75rem; color: #9CA3AF; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--rose-deep); color: var(--white); }
.btn-primary:hover { background: var(--charcoal); }
.btn-secondary { background: #F3F4F6; color: #374151; border: 1px solid #D1D5DB; }
.btn-secondary:hover { background: #E5E7EB; }
.btn-success { background: #059669; color: var(--white); }
.btn-success:hover { background: #047857; }
.btn-danger { background: #DC2626; color: var(--white); }
.btn-danger:hover { background: #B91C1C; }

/* CSV Upload */
.upload-zone {
  border: 2px dashed #D1D5DB;
  border-radius: var(--radius-md);
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #F9FAFB;
}
.upload-zone:hover,
.upload-zone.drag-over { border-color: var(--rose); background: #FEF2F2; }
.upload-zone .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.upload-zone h3 { font-size: 1.1rem; color: var(--charcoal); margin-bottom: .35rem; }
.upload-zone p { font-size: .875rem; color: #6B7280; }
.upload-zone input[type=file] { display: none; }

/* Admin Login */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--charcoal) 0%, #3D2B1F 100%);
}
.admin-login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.admin-login-card .login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.admin-login-card h1 {
  font-size: 1.75rem;
  color: var(--charcoal);
  margin-top: .5rem;
}
.admin-login-card .subtitle { font-size: .875rem; color: var(--muted); }

/* Search results highlight */
mark { background: rgba(232,165,152,.35); color: inherit; padding: 0 2px; border-radius: 2px; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* ── Mobile admin sidebar toggle ───────────────────────────── */
.admin-sidebar-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  font-size: .85rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
}
.admin-sidebar-toggle .tog-icon { font-size: 1.1rem; }
.admin-sidebar.mobile-open { display: block !important; }

@media (max-width: 960px) {
  /* ── Public pages ── */
  .browse-layout         { grid-template-columns: 1fr; }
  .filter-panel          { position: static; }
  .name-detail-grid      { grid-template-columns: 1fr; }
  .stats-bar .container  { grid-template-columns: repeat(2,1fr); }
  .footer-inner          { grid-template-columns: 1fr; gap: 2rem; }
  .footer-nav            { flex-wrap: wrap; gap: 2rem; }
  /* ── Admin ── */
  .admin-layout          { grid-template-columns: 1fr; }
  .admin-sidebar         { display: none; border-right: none; border-bottom: 1px solid #E5E7EB; padding: 0; }
  .admin-sidebar-toggle  { display: flex; }
  .admin-stats           { grid-template-columns: repeat(2,1fr); }
  .admin-page-title      { flex-wrap: wrap; gap: .75rem; }
  .admin-page-title h1   { font-size: 1.2rem; }
}

@media (max-width: 768px) {
  /* ── Nav ── */
  .main-nav    { display: none; }
  .menu-toggle { display: flex; }

  /* ── Hero ── */
  .hero        { padding: 2.5rem 0 2rem; overflow: visible; }
  .hero h1     { font-size: clamp(1.75rem, 6vw, 2.5rem); }
  .hero p      { font-size: .95rem; }
  .hero-search { max-width: 100%; padding: 0 1rem; }
  .hero-search-form { flex-direction: row; }
  .hero-search-form input { min-width: 0; }
  .hero-filters { flex-wrap: wrap; gap: .4rem; justify-content: center; }

  /* ── Name grid ── */
  .names-grid  { grid-template-columns: repeat(2, 1fr); gap: .75rem; }

  /* ── Header search ── */
  .header-search { display: none; }

  /* ── Admin ── */
  .admin-main  { padding: 1rem; }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .admin-form  { grid-template-columns: 1fr; }
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table { min-width: 600px; }
  .admin-card-body { padding: 1rem; }

  /* ── Ad edit page ── */
  #ad-form > div[style*="grid-template-columns:1fr 340px"] {
    display: block !important;
  }
  #ad-form > div > div:last-child {
    margin-top: 1rem;
  }

  /* ── Origins/Religions grid ── */
  div[style*="grid-template-columns:1fr 340px"] {
    display: block !important;
  }
  div[style*="grid-template-columns:1fr 340px"] > div:last-child {
    margin-top: 1rem;
  }

  /* ── Upload page ── */
  div[style*="grid-template-columns:1fr 320px"] {
    display: block !important;
  }
  div[style*="grid-template-columns:1fr 320px"] > div:last-child {
    margin-top: 1rem;
  }

  /* ── Search header ── */
  .search-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .search-header form { width: 100%; }
  .search-header form .autocomplete-wrap { flex: 1; }
  .search-header form input { width: 100% !important; }

  /* ── Browse filter ── */
  .filter-form > .form-group { flex: 1; min-width: 140px; }

  /* ── Footer ── */
  .footer-bottom .container { flex-direction: column; gap: .5rem; }
  .stats-bar .container { grid-template-columns: repeat(2,1fr); gap: 1rem; }
}

@media (max-width: 480px) {
  .names-grid { grid-template-columns: 1fr; }
  .hero-search-form { gap: .4rem; }
  .admin-stats { grid-template-columns: 1fr; }
  .hours-grid { grid-template-columns: repeat(6, 1fr); }
  .name-card { padding: 1rem; }
  .container { padding: 0 1rem; }

  /* Admin page titles stack */
  .admin-page-title { flex-direction: column; align-items: flex-start; }
  .admin-page-title > div { width: 100%; }
  .admin-page-title > div .btn { flex: 1; justify-content: center; }
}

/* ── Utilities ──────────────────────────────────────────────── */
.mt-1 { margin-top:.5rem; } .mt-2 { margin-top:1rem; } .mt-3 { margin-top:1.5rem; } .mt-4 { margin-top:2rem; }
.mb-1 { margin-bottom:.5rem; } .mb-2 { margin-bottom:1rem; } .mb-3 { margin-bottom:1.5rem; }
.text-center { text-align:center; } .text-muted { color:var(--muted); }
.d-flex { display:flex; } .gap-1 { gap:.5rem; } .gap-2 { gap:1rem; }
.align-center { align-items:center; } .justify-between { justify-content:space-between; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ── Ad Zones ────────────────────────────────────────────── */
.ad-zone {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 0;
  background: transparent;
  position: relative;
}
.ad-zone:empty { display: none; padding: 0; }
.ad-unit {
  display: inline-block;
  position: relative;
  max-width: 100%;
  overflow: hidden;
}
.ad-unit img { border-radius: 4px; }
.ad-code-wrap,
.ad-script-wrap { display: inline-block; max-width: 100%; }
/* Leaderboard between header and content */
.ad-zone--leaderboard_top { background: #F9FAFB; border-bottom: 1px solid #F3F4F6; }
/* Footer zone */
.ad-zone--footer_banner { border-top: 1px solid #F3F4F6; background: #F9FAFB; }
/* Hero zone */
.ad-zone--hero_banner { padding: 1.5rem 0 .75rem; }
/* In-content zones */
.ad-zone--in_content_1,
.ad-zone--in_content_2 { padding: 1.5rem 0; }
