:root {
  --papyrus: #F2EDE0;
  --ink: #241C13;
  --clay: #B05535;
  --ochre: #C08A34;
  --moss: #4B7A3E;
  --sage: #6B9460;
  --sand: #D9C7A0;
  --card-tint: #EDE5D4;
  --destructive: #C0392B;
  --leaf: #3D6B35;
  --leaf-soft: rgba(61, 107, 53, 0.08);

  --font-display: "Cormorant Garamond", serif;
  --font-body: "Lato", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--papyrus);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  margin: 0;
  padding: 0;
  display: block;
}

#site-footer {
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0 0 0.5em; }
h1 { font-size: clamp(36px, 4vw, 56px); line-height: 1.1; }
h2 { font-size: clamp(28px, 3vw, 42px); line-height: 1.2; }
h3 { font-size: clamp(22px, 2.5vw, 32px); line-height: 1.3; }

.card {
  max-width: 420px;
  margin: 80px auto;
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 6px;
  padding: 32px;
}

label { display: block; font-size: 14px; margin: 16px 0 6px; }

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sand);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
}

button {
  margin-top: 24px;
  width: 100%;
  padding: 12px;
  background: var(--clay);
  color: var(--papyrus);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

button:hover { opacity: 0.92; }

.error-msg {
  background: #fbe9e3;
  color: var(--clay);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-top: 16px;
  display: none;
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  border-left: 3px solid transparent;
  background: var(--card-tint);
}
.alert-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.alert-title { font-weight: 600; margin: 0 0 2px; }
.alert-body { margin: 0; opacity: 0.85; }

.alert-success { border-left-color: var(--clay); }
.alert-success .alert-icon { color: var(--clay); }

.alert-error { border-left-color: var(--destructive); }
.alert-error .alert-icon { color: var(--destructive); }

.alert-info { border-left-color: var(--moss); }
.alert-info .alert-icon { color: var(--moss); }

/* ---------- Progress bars ---------- */
.progress-block { margin: var(--space-3) 0; }
.progress-label {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink); opacity: 0.65; margin-bottom: 6px;
  display: flex; justify-content: space-between;
}
.progress-track { height: 6px; background: var(--sand); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--clay); border-radius: 999px; transition: width 0.25s ease; }
.progress-fill.is-complete { width: 100%; }

/* Indeterminate/shimmer state — used when we can't measure real percentage (e.g. small cover image) */
.progress-fill.is-shimmer {
  width: 40%;
  background: linear-gradient(90deg, var(--clay) 0%, var(--ochre) 50%, var(--clay) 100%);
  background-size: 200% 100%;
  animation: progress-shimmer 1.1s ease-in-out infinite;
}
@keyframes progress-shimmer {
  0% { background-position: 200% 0; margin-left: 0%; }
  50% { margin-left: 55%; }
  100% { background-position: -200% 0; margin-left: 0%; }
}

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  border: 1px dashed var(--sand);
  border-radius: var(--radius-lg);
}
.empty-state-icon { width: 48px; height: 48px; color: var(--sand); margin: 0 auto var(--space-4); }
.empty-state h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: var(--space-2); }
.empty-state p { font-size: 14px; opacity: 0.7; margin-bottom: var(--space-6); }

.mono { font-family: var(--font-mono); font-size: 13px; opacity: 0.7; }

/* ---------- Layout shell ---------- */
.container { max-width: 1440px; margin: 0 auto; padding: 0 40px; margin-bottom: 50px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--sand);
  position: relative;
}

.brand-lockup { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.brand-text em { color: var(--clay); font-style: italic; font-weight: 400; }

.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 15px; }
.site-nav a.active { color: var(--clay); font-weight: 600; }
.site-nav a:hover { color: var(--clay); }

.nav-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink); }

@media (max-width: 760px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--papyrus);
    padding: 16px 24px;
    border-bottom: 1px solid var(--sand);
    gap: 14px;
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 24px;
  text-align: center;
}
.hero h1 { font-size: 52px; max-width: 800px; margin: 0 auto 20px; line-height: 1.1; }
.hero p.lead { font-family: var(--font-body); font-size: 20px; max-width: 680px; margin: 0 auto 36px; opacity: 0.85; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 28px;
  background: var(--clay);
  color: var(--papyrus);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { opacity: 0.92; }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }

.btn-outline { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
.btn-outline:hover { background: rgba(36,28,19,0.06); opacity: 1; }

.btn-secondary { background: var(--moss); color: var(--papyrus); }
.btn-secondary:hover { opacity: 0.92; }

.btn-ghost { background: transparent; color: var(--ink); border: none; }
.btn-ghost:hover { background: rgba(36,28,19,0.06); opacity: 1; }

.btn-link {
  background: none; border: none; color: var(--clay);
  padding: 0; text-decoration: underline; text-underline-offset: 3px;
}
.btn-link:hover { opacity: 0.8; }

.btn-destructive { background: var(--destructive); color: #fff; }
.btn-destructive:hover { opacity: 0.92; }

/* Loading state — spinner replaces label, button keeps its width */
.btn.is-loading { color: transparent; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
.btn-outline.is-loading::after,
.btn-ghost.is-loading::after,
.btn-link.is-loading::after {
  border-color: rgba(36,28,19,0.25);
  border-top-color: var(--ink);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Sizes */
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-md { padding: 12px 28px; font-size: 15px; }

/* ---------- Sections / cards ---------- */
section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 48px; font-size: clamp(28px, 3vw, 44px); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

.tile {
  background: #fff;
  border: 1px solid var(--sand);
  border-top: 3px solid var(--moss);
  border-radius: var(--radius-sm);
  padding: 28px;
}
.tile h3 { margin-bottom: 10px; }

.pillar-band {
  background: var(--ink);
  color: var(--papyrus);
}
.pillar-band .tile { background: transparent; border-color: rgba(217,199,160,0.25); border-top-color: var(--sage); }
.pillar-band .tile h3 { color: var(--papyrus); }

blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--clay);
  border-left: 3px solid var(--sand);
  padding-left: 20px;
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--papyrus);
  padding: 56px 5vw 24px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  display: block;
}
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; max-width: 1440px; margin: 0 auto; }
.footer-cols h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; color: var(--sand); }
.footer-cols a { display: block; color: var(--papyrus); text-decoration: none; font-size: 14px; margin-bottom: 8px; opacity: 0.8; }
.footer-cols a:hover { color: var(--clay); opacity: 1; }
.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(217,199,160,0.35);
  border-radius: 50%;
  color: var(--papyrus);
  text-decoration: none;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.footer-social a:hover {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--papyrus);
  transform: translateY(-2px);
}

@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr 1fr; } }


/* Honeypot field — visually hidden, still present in the DOM for bots to fill */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

.page-hero { padding: 48px 40px 56px; text-align: center; }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(2.8rem, 5vw, 4.2rem); color: var(--ink); margin-bottom: 16px; }

/* ---------- Dashboard ---------- */
.dashboard-nav {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: 1300px; margin: 0 auto 40px; padding: 0 20px;
}
.dashboard-nav a {
  padding: 7px 15px; border-radius: 20px; text-decoration: none;
  color: var(--ink); font-size: 13px; border: 1px solid var(--sand);
  white-space: nowrap; transition: all 0.2s ease;
}
.dashboard-nav a.active { background: var(--clay); color: var(--papyrus); border-color: var(--clay); }
.dashboard-nav a:hover:not(.active) { border-color: var(--clay); }

.dash-container { max-width: 1320px; width: 92%; margin: 0 auto; padding: 0 0 60px; }
.dash-list { display: flex; flex-direction: column; gap: 14px; }
.dash-row {
  background: #fff; border: 1px solid var(--sand); border-radius: 6px;
  padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.dash-row h3 { margin: 0 0 4px; font-size: 17px; }
.status-tag { font-family: var(--font-mono); font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--sand); }
.status-tag.cancelled { background: var(--clay); color: var(--papyrus); }
.status-tag.paid { background: var(--moss); color: var(--papyrus); }
.btn-small { padding: 8px 16px; font-size: 13px; width: auto; margin-top: 0; }
.btn-danger { background: var(--destructive); }
.btn-danger:hover { opacity: 0.92; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { background: #fff; border: 1px solid var(--sand); border-radius: 6px; padding: 20px; text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--clay); }
@media (max-width: 600px) { .stat-grid { grid-template-columns: 1fr; } }

/* ---------- Admin Toolbar (Search Bar & Dropdown Filters) ---------- */
.admin-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 2px 10px rgba(36,28,19,0.03);
}

.admin-toolbar-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}

.admin-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.admin-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clay);
  pointer-events: none;
}

.admin-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--sand);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--papyrus);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.admin-search-input:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(176, 85, 53, 0.12);
}

.admin-filter-select {
  padding: 10px 14px;
  border: 1px solid var(--sand);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  min-width: 150px;
}

.admin-filter-select:focus {
  border-color: var(--clay);
}

.admin-count-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  opacity: 0.75;
  white-space: nowrap;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-toolbar-actions .btn {
  width: auto;
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 6px;
  margin-top: 0;
}

/* ---------- Admin ---------- */
.admin-container { max-width: 1680px; width: 94%; margin: 0 auto; padding: 0 0 60px; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 6px; }
.admin-table { width: 100%; min-width: 640px; border-collapse: collapse; background: #fff; border: 1px solid var(--sand); border-radius: 6px; overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--sand); font-size: 14px; }
.admin-table th { background: var(--sand); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: none; }
.badge { font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: 20px; background: var(--sand); display: inline-block; }
.badge.approved, .badge.paid, .badge.attended { background: var(--moss); color: var(--papyrus); }
.badge.cancelled, .badge.no_show { background: var(--clay); color: var(--papyrus); }
.badge.new { background: var(--ochre); color: var(--ink); }
.inline-form { background: #fff; border: 1px solid var(--sand); border-radius: 6px; padding: 20px; margin-bottom: 24px; }
.inline-form input, .inline-form textarea { margin-bottom: 10px; }
.inline-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-tiny { padding: 5px 12px; font-size: 12px; width: auto; margin: 0 4px 0 0; }
.btn-tiny.btn-outline { background: transparent; color: var(--moss); border: 1px solid var(--moss); }
.btn-tiny.btn-outline:hover { background: var(--moss); color: var(--papyrus); }
.section-block { margin-bottom: 40px; }
.section-block h2 { font-size: 20px; margin-bottom: 16px; }

/* ---------- Modal (replaces browser alert/confirm) ---------- */
.emw-modal-overlay {
  position: fixed; inset: 0; background: rgba(36,28,19,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4); z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.emw-modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.emw-modal {
  background: var(--papyrus); border-radius: var(--radius-lg);
  max-width: 420px; width: 100%; padding: var(--space-6);
  box-shadow: 0 20px 60px rgba(36,28,19,0.25);
  transform: translateY(8px) scale(0.98); transition: transform 0.18s ease;
}
.emw-modal-overlay.is-open .emw-modal { transform: translateY(0) scale(1); }
.emw-modal-icon { width: 36px; height: 36px; margin-bottom: var(--space-3); color: var(--clay); }
.emw-modal-icon.is-danger { color: var(--destructive); }
.emw-modal h3 { font-family: var(--font-display); font-size: 20px; margin: 0 0 var(--space-2); color: var(--ink); }
.emw-modal p { font-size: 14px; line-height: 1.55; opacity: 0.8; margin: 0 0 var(--space-6); color: var(--ink); }
.emw-modal-actions { display: flex; gap: var(--space-3); justify-content: flex-end; }
.emw-modal-actions .btn { padding: 10px 22px; font-size: 14px; }
@media (max-width: 480px) {
  .emw-modal-actions { flex-direction: column-reverse; }
  .emw-modal-actions .btn { width: 100%; }
}

