:root {
  --charcoal: #41413D;
  --sage: #7D8872;
  --cream: #F3EFE5;
  --paper: #FBF9F4;
  --ink: #242520;
  --muted: #6F706A;
  --line: rgba(65,65,61,.14);
  --danger: #7B3E3E;
  --shadow: 0 18px 50px rgba(35,36,32,.10);
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(125,136,114,.10), transparent 32%),
    var(--cream);
  color: var(--ink);
}

button, input { font: inherit; }

button { cursor: pointer; }

.hidden { display: none !important; }

.shell { min-height: 100vh; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(430px, 100%);
  background: var(--charcoal);
  color: white;
  padding: 34px;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.logo {
  width: 190px;
  max-width: 75%;
  display: block;
  margin: 0 auto 20px;
}

.logo-fallback {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  display: none;
  place-items: center;
  margin: 0 auto 18px;
  font-family: Georgia, serif;
  font-size: 24px;
}

.auth-card h1,
.topbar h1,
.page-heading h2,
.modal h2,
.event-summary h3,
.section-row h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  margin: 0;
}

.auth-card h1 { font-size: 2.6rem; text-align: center; }

.auth-card .eyebrow { text-align: center; }

.muted { color: var(--muted); line-height: 1.5; }

.auth-card .muted {
  color: rgba(255,255,255,.70);
  text-align: center;
  margin: 10px 0 24px;
}

.eyebrow {
  font-size: .72rem;
  letter-spacing: .22em;
  font-weight: 800;
  margin: 0 0 8px;
}

.eyebrow.light { color: rgba(255,255,255,.62); }
.eyebrow.dark { color: var(--sage); }

.stack { display: grid; gap: 15px; }

label {
  display: grid;
  gap: 7px;
  font-size: .85rem;
  font-weight: 700;
}

.auth-card label { color: rgba(255,255,255,.85); }

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
  background: white;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(125,136,114,.14);
}

.btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  font-weight: 800;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }

.primary { background: var(--sage); color: white; }

.btn.light {
  background: rgba(255,255,255,.92);
  color: var(--charcoal);
}

.ghost-light {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,.28);
}

.danger-light {
  background: rgba(255,255,255,.12);
  color: white;
  border: 1px solid rgba(255,255,255,.24);
}

.text-btn {
  width: 100%;
  margin-top: 15px;
  color: rgba(255,255,255,.72);
  background: none;
  border: 0;
  padding: 8px;
}

.message {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.10);
  font-size: .9rem;
  line-height: 1.4;
}

.topbar {
  background: var(--charcoal);
  color: white;
  min-height: 94px;
  padding: 18px clamp(20px, 5vw, 70px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 16px; }

.top-logo { width: 112px; max-height: 48px; object-fit: contain; }

.topbar h1 { font-size: 1.65rem; }

.user-actions { display: flex; align-items: center; gap: 12px; }
.user-name { color: rgba(255,255,255,.75); font-size: .9rem; }

.content {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 70px;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.page-heading h2 { font-size: clamp(2rem, 4vw, 3rem); }

.back-btn {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  margin-bottom: 22px;
  font-weight: 700;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(255,255,255,.62);
  min-height: 190px;
}

button.tool-card {
  color: inherit;
}

.active-card {
  transition: transform .15s ease, box-shadow .15s ease;
}

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

.disabled-card { opacity: .62; }

.tool-kicker {
  display: inline-block;
  font-size: .68rem;
  letter-spacing: .15em;
  font-weight: 900;
  color: var(--sage);
  margin-bottom: 18px;
}

.tool-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 400;
  margin: 0 0 9px;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.tool-link {
  display: block;
  margin-top: 22px;
  color: var(--sage);
  font-weight: 800;
}

.event-summary {
  background: var(--charcoal);
  color: white;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.event-summary h3 { font-size: 1.9rem; }

.summary-copy { color: rgba(255,255,255,.68); margin: 8px 0 0; }

.summary-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.section-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 14px;
}

.section-row h3 { font-size: 1.7rem; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.70);
  color: var(--charcoal);
  font-size: 1.25rem;
}

.slot-list {
  display: grid;
  gap: 10px;
}

.admin-day-header {
  margin-top: 18px;
  padding: 13px 4px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--sage);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.admin-slot {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 15px 16px;
  display: grid;
  grid-template-columns: 185px 1fr auto;
  gap: 16px;
  align-items: center;
}

.slot-time { font-weight: 850; }

.slot-people {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.person-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px 7px 10px;
  border-radius: 999px;
  background: rgba(125,136,114,.12);
  color: var(--charcoal);
  font-size: .84rem;
  font-weight: 700;
}

.remove-name {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 0;
  background: rgba(65,65,61,.10);
  color: var(--charcoal);
  font-weight: 900;
  line-height: 1;
}

.empty-slot { color: var(--muted); font-style: italic; font-size: .88rem; }

.add-name {
  border: 1px solid rgba(125,136,114,.35);
  background: transparent;
  color: var(--sage);
  padding: 9px 11px;
  border-radius: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.slot-full {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.empty-state {
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
}

.empty-state h3 {
  font-family: Georgia, serif;
  font-size: 1.65rem;
  font-weight: 400;
  margin: 0;
}

.empty-state p { color: var(--muted); }

.history-section { margin-top: 38px; }

.history-list { display: grid; gap: 9px; }

.history-item {
  background: rgba(255,255,255,.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.history-date { font-weight: 800; }
.history-meta { color: var(--muted); font-size: .86rem; }

.loading {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31,32,29,.54);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  width: min(470px, 100%);
  background: var(--paper);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 28px 80px rgba(20,20,18,.25);
  position: relative;
}

.modal h2 { font-size: 1.8rem; margin-bottom: 18px; }

.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(65,65,61,.08);
  font-size: 1.4rem;
}

.modal-copy { margin-top: -8px; }

.fine-print {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
  margin: 14px 0 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--charcoal);
  color: white;
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 750;
  z-index: 80;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    padding: 16px 18px;
  }

  .top-logo { width: 88px; }

  .user-name { display: none; }

  .content {
    width: min(100% - 24px, 1120px);
    padding-top: 28px;
  }

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

  .page-heading.split,
  .event-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-actions { margin-top: 4px; }

  .admin-slot {
    grid-template-columns: 1fr auto;
  }

  .slot-people {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .history-item { flex-direction: column; gap: 4px; }
}
