/* ═══════════════════════════════════════════════════════════════════════
   Admin.

   Same two inks, same typeface, same tracking as the guest site — this is
   the back of the same house, not a different building. Tokens come from
   site.css; nothing new is invented here.

   The one deliberate difference is density. The guest site is a card with
   air around it; admin is a working surface where ~100 households need to
   be legible at a glance, so the rhythm is tighter and the type smaller.
   ══════════════════════════════════════════════════════════════════════ */

body.admin {
  background: var(--cream);
}

/* ── Centred auth pages ──────────────────────────────────────────────── */

body.admin-centred {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 2rem 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  text-align: center;
}

.auth-card .eyebrow {
  margin: 0 0 .35rem;
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: var(--track-label);
  font-size: .82rem;
  color: var(--muted);
}

.auth-card h1 {
  margin: 0 0 1.75rem;
  font-weight: 400;
  font-size: 2rem;
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: var(--track-name);
}

.auth-intro { margin: 0 0 1.5rem; }

.button {
  display: inline-block;
  width: 100%;
  padding: .75rem 1.5rem;
  border: 1px solid var(--navy);
  border-radius: 2px;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1rem;
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: var(--track-detail);
  cursor: pointer;
}

.button:hover:not(:disabled) { background: #0a2c60; }
.button:disabled { opacity: .55; cursor: default; }

.auth-note {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  font-size: .95rem;
  color: var(--muted);
}

.auth-note.is-error { color: #8B2114; }

.auth-help {
  margin: 2rem 0 0;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ── Fields ──────────────────────────────────────────────────────────── */

.field {
  display: block;
  margin: 0 0 1.25rem;
  text-align: left;
}

.field-label {
  display: block;
  margin-bottom: .3rem;
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: var(--track-label);
  font-size: .8rem;
  color: var(--muted);
}

.field input[type="text"] {
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1rem;
}

.field input[type="text"]:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

.field-help {
  display: block;
  margin-top: .3rem;
  font-size: .82rem;
  color: var(--muted);
}

/* ── Rail and working pages ──────────────────────────────────────────── */

.admin-rail ul { margin-bottom: 2rem; }

.admin-main {
  padding: 3rem 1.5rem;
  max-width: 68rem;
}

.admin-head { margin-bottom: 2rem; }

.admin-head h1 {
  margin: 0;
  font-weight: 400;
  font-size: 1.75rem;
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: var(--track-name);
}

.admin-sub {
  margin: .25rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}

.admin-placeholder { color: var(--muted); }

/* A button that has to sit inside a form but read as a link. */
.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}

/* ── Filters, tables, forms ─────────────────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 0 0 1.5rem;
}

.filter-bar input[type="text"],
.filter-bar select {
  padding: .45rem .6rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
  color: var(--navy);
  font-family: var(--serif);
  font-size: .92rem;
}

.button-small {
  width: auto;
  padding: .5rem 1.1rem;
  font-size: .88rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: .94rem;
}

.admin-table th,
.admin-table td {
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.admin-table th {
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: var(--track-label);
  font-size: .78rem;
  color: var(--muted);
  font-weight: 400;
}

.admin-table a { color: var(--navy); }

.new-household { margin-top: 1rem; }
.new-household summary {
  cursor: pointer;
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: var(--track-label);
  font-size: .85rem;
  color: var(--muted);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  max-width: 28rem;
  margin: 1rem 0 2rem;
}

.stack-form textarea {
  width: 100%;
  min-height: 4.5rem;
  padding: .55rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: .95rem;
}

.stack-form select {
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
  font-family: var(--serif);
  font-size: 1rem;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: .3rem 0 1rem;
  font-size: .92rem;
}

.admin-subhead {
  margin: 2rem 0 .75rem;
  font-weight: 400;
  font-size: 1.15rem;
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: var(--track-name);
}

.guest-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-width: 34rem;
}

.guest-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--rule);
}

.inline-form {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.inline-form input[type="text"] {
  padding: .35rem .5rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: .92rem;
}

.tag {
  padding: .15rem .5rem;
  border-radius: 999px;
  background: var(--ground);
  font-size: .78rem;
  color: var(--muted);
}

.archive-form { margin-top: 1.5rem; }

.event-form { margin-bottom: 2.5rem; }

.user-card { margin-bottom: 2rem; }

.cred-list {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  max-width: 30rem;
}

.cred-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--rule);
}

.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .9rem;
}

.audit-list li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--rule);
}

.audit-list time { color: var(--muted); }

/* ── Eligibility grid ────────────────────────────────────────────────── */

.grid-scroll {
  /* The page must never scroll horizontally; the grid, with ~100 rows and a
     column per event, is the one thing wide enough to need its own scroller. */
  overflow-x: auto;
  max-width: 100%;
}

.eligibility-grid { min-width: max-content; }

.eligibility-grid th,
.eligibility-grid td { text-align: center; }

.eligibility-grid th:first-child,
.eligibility-grid td:first-child { text-align: left; }

.capacity-card { margin-bottom: 2.5rem; }

.stat-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  max-width: 26rem;
}

.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--rule);
}

.grid-cell {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--navy);
  cursor: pointer;
}
