/* K & A — admin.html page styles */

.page-head { padding: 56px 40px 32px; text-align: center; background: var(--green-pale); }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.page-head .eyebrow::before, .page-head .eyebrow::after { content: ""; width: 36px; height: 1.5px; background: var(--pink); }
.page-head h1 { font-size: 80px; line-height: 0.9; margin: 0 0 10px; letter-spacing: -0.03em; }
.page-head h1 em { font-style: italic; font-weight: 400; color: var(--pink); }
.page-head p { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-2); max-width: 56ch; margin: 0 auto; }

/* ── STATS ── */
.stats-shell { padding: 48px 40px 0; }
.stats-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.stat { background: var(--cream); border: 1px solid var(--rule); border-radius: 8px; padding: 20px 22px; display: flex; flex-direction: column; min-height: 120px; }
.stat.is-key { background: var(--pink); border-color: transparent; color: var(--cream); }
.stat.is-yes { background: var(--green-pale); border-color: transparent; }
.stat .lbl { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.stat.is-key .lbl { color: rgba(255,246,224,0.9); }
.stat.is-yes .lbl { color: var(--ink-3); }
.stat .big { font-family: var(--serif); font-weight: 900; font-size: 52px; line-height: 1; color: var(--pink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: auto; }
.stat.is-key .big { color: var(--cream); }
.stat.is-yes .big { color: var(--pink-2); }
.stat .sub { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.stat.is-key .sub { color: rgba(255,246,224,0.85); }

/* ── TOOLBAR ── */
.toolbar-shell { padding: 32px 40px 10px; }
.toolbar { max-width: 1240px; margin: 0 auto; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 260px; min-width: 220px; position: relative; }
.search input {
  width: 100%; font-family: var(--sans); font-size: 14px;
  padding: 11px 16px 11px 40px; background: var(--cream);
  border: 1.5px solid var(--rule); border-radius: 999px; color: var(--ink);
  outline: none; transition: border-color 0.18s;
}
.search input:focus { border-color: var(--pink); }
.search::before { content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-52%); font-size: 17px; color: var(--ink-3); pointer-events: none; }
.seg { display: inline-flex; background: var(--cream); border: 1.5px solid var(--rule); border-radius: 999px; padding: 3px; }
.seg button { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 8px 14px; border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; cursor: pointer; transition: all 0.18s; white-space: nowrap; }
.seg button:hover { color: var(--pink); }
.seg button.is-on { background: var(--pink); color: var(--cream); }
.seg button.tone-yes.is-on { background: var(--green-mid); color: var(--cream); }
.seg button.tone-no.is-on  { background: var(--orange); color: var(--cream); }
.actions { display: inline-flex; gap: 8px; margin-left: auto; align-items: center; }
.actions .btn { font-size: 11px; padding: 11px 16px; }
.actions .btn.small { background: var(--cream); color: var(--ink-2); border-color: var(--rule); }
.actions .btn.small:hover { background: var(--pink); color: var(--cream); border-color: var(--pink); }
.actions .btn.small.btn-import:hover { background: var(--orange); color: var(--cream); border-color: var(--orange); }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; top: calc(100% + 4px); right: 0; background: var(--cream); border: 1px solid var(--rule); border-radius: 8px; min-width: 140px; box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 200; overflow: hidden; }
.dropdown-menu.hidden { display: none; }
.dropdown-menu button { display: block; width: 100%; padding: 10px 16px; text-align: left; background: none; border: none; border-bottom: 1px solid var(--rule); font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.dropdown-menu button:last-child { border-bottom: none; }
.dropdown-menu button:hover { background: var(--green-pale); color: var(--green-deep); }

/* ── TABLE ── */
.table-shell { padding: 20px 40px 80px; }
.table-inner { max-width: 1240px; margin: 0 auto; background: var(--cream); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.table-meta {
  padding: 16px 22px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--rule); background: var(--butter-2);
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2);
}
.table-meta strong { color: var(--pink); font-weight: 800; }
table.guests { width: 100%; border-collapse: collapse; font-family: var(--sans); }
table.guests th {
  background: var(--cream); padding: 14px 16px; text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--rule); white-space: nowrap; position: sticky; top: 0;
}
table.guests td { padding: 14px 16px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; font-size: 13px; color: var(--ink-2); }
tr.row { cursor: pointer; transition: background 0.12s; }
tr.row:hover td { background: var(--butter-2); }
tr.row.is-open td { background: rgba(225,29,90,0.04); }
tr.row .gname { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -0.01em; }
tr.row .gname .party-label { display: block; font-family: var(--sans); font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 400; letter-spacing: 0.04em; margin-top: 2px; }
tr.row .ts { font-size: 11px; color: var(--ink-3); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-yes  { background: rgba(110,138,82,0.18); color: var(--green-deep); }
.pill-no   { background: rgba(225,29,90,0.12); color: var(--pink-2); }
.pill-diet { display: inline-block; font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 4px; background: rgba(245,114,43,0.12); color: var(--orange-d); margin: 2px 2px 2px 0; }
/* event chips — coloured by day */
.ev-chip { display: inline-block; font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 9px; border-radius: 4px; margin: 2px 3px 2px 0; white-space: nowrap; }
.ev-chip-fri { background: var(--pink);       color: var(--cream); }
.ev-chip-sat { background: var(--orange);       color: var(--cream); }
.ev-chip-no  { background: var(--rule-2);     color: var(--ink-3); border: 1px solid var(--rule); }

/* expanded detail row */
tr.detail { display: none; }
tr.row.is-open + tr.detail { display: table-row; }
tr.detail td { padding: 0 !important; background: rgba(225,29,90,0.03); }
.detail-inner {
  padding: 22px 26px 28px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px;
  border-top: 1px solid var(--rule);
}
.detail-block h5 { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--pink); margin: 0 0 8px; }
.note-block { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-2); line-height: 1.5; padding: 14px 16px; background: var(--cream); border-left: 3px solid var(--pink); border-radius: 4px; }
.note-block.empty { color: var(--ink-3); opacity: 0.6; }
.detail-block dl { margin: 0; display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; }
.detail-block dt { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); align-self: center; }
.detail-block dd { margin: 0; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink); align-self: center; }

/* empty state */
.empty-state { padding: 72px 40px; text-align: center; }
.empty-state h3 { font-family: var(--serif); font-weight: 900; font-size: 32px; color: var(--pink); margin: 0 0 10px; }
.empty-state h3 em { font-style: italic; font-weight: 400; color: var(--orange); }
.empty-state p { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-2); max-width: 46ch; margin: 0 auto 20px; }

/* ── INLINE-STYLE EXTRACTIONS (formerly style="" in the markup / row templates) ── */
.hidden-input { display: none; }
.search.is-narrow { max-width: 300px; }
/* Scoped to their actual container (#tbody td / .detail-block) so they win over
   table.guests td's color and .detail-block h5/dd's margin/font-style — a bare
   single class here would lose that specificity fight and silently no-op. */
#tbody .text-muted { color: var(--ink-3); }
#tbody .song-highlight { color: var(--pink); font-family: var(--serif); font-style: italic; }
.detail-block .mt-16 { margin-top: 16px; }
.detail-block .dd-mono { font-family: monospace; font-style: normal; font-size: 11px; }
.btn-delete-rsvp { margin-top: 14px; color: var(--pink-2); background: none; border-color: var(--pink-2); }
.child-tag.ml-8 { margin-left: 8px; }
.ts-relative { opacity: .6; }

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .stats-shell { padding: 32px 16px 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .toolbar-shell { padding: 20px 16px 8px; }
  .table-shell { padding: 12px 16px 56px; }
  .page-head .eyebrow { font-size: 10px; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .table-inner { font-size: 13px; }
}

/* ── TABS ── */
.admin-tabs-shell { background: var(--cream); border-bottom: 1.5px solid var(--rule); }
.admin-tabs { max-width: 1240px; margin: 0 auto; padding: 0 40px; display: flex; gap: 0; }
.admin-tab {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 14px 20px; background: none; border: none; border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px; cursor: pointer; color: var(--ink-3); transition: all 0.18s;
}
.admin-tab:hover { color: var(--pink); }
.admin-tab.is-on { color: var(--pink); border-bottom-color: var(--pink); }
.admin-pane { display: none; }
.admin-pane.is-active { display: block; }

/* ── GUEST LIST ── */
.glist-shell { padding: 28px 40px 80px; max-width: 1240px; margin: 0 auto; }
.glist-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.glist-meta { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); flex: 1; min-width: 0; }
.gltable { width: 100%; border-collapse: collapse; background: var(--cream); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.gltable th { background: var(--butter-2); padding: 12px 16px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.gltable td { padding: 13px 16px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.glr:last-child td { border-bottom: 0; }
.glr:hover td { background: var(--butter-2); }
.glr-num { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-3); width: 44px; }
.glr-members { font-size: 13px; line-height: 1.8; }
.gl-member { display: inline-block; font-size: 13px; color: var(--ink-2); margin-right: 8px; white-space: nowrap; }
.child-tag { display: inline-block; font-family: var(--sans); font-size: 9px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--green-pale); color: var(--green-text); margin-left: 4px; vertical-align: middle; }
.glr-last { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.glr-count { font-size: 13px; color: var(--ink-3); text-align: center; width: 52px; }
.glr-actions { text-align: right; white-space: nowrap; width: 130px; }
.gl-btn { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; cursor: pointer; color: var(--ink-2); transition: all 0.15s; margin-left: 6px; }
.gl-btn:hover { border-color: var(--orange); color: var(--green-deep); }
.gl-btn.danger:hover { border-color: var(--pink); color: var(--pink-2); }
.glist-empty { text-align: center; padding: 64px 40px; }
.glist-empty p { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink-3); }

/* ── GUEST MODAL ── */
.gmodal { position: fixed; inset: 0; z-index: 9998; background: rgba(42,15,28,0.52); display: flex; align-items: center; justify-content: center; padding: 20px; }
.gmodal.hidden { display: none; }
.gmodal-card { background: var(--cream); border: 1px solid var(--rule); border-radius: 10px; padding: 40px; max-width: 580px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(42,15,28,0.22); }
.gmodal-hd { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.gmodal-title { font-family: var(--serif); font-weight: 900; font-size: 30px; color: var(--pink); letter-spacing: -0.01em; }
.gmodal-x { background: none; border: none; cursor: pointer; font-size: 24px; color: var(--ink-3); line-height: 1; padding: 0; transition: color 0.15s; }
.gmodal-x:hover { color: var(--pink); }
.gmodal-sub { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-3); margin: 0 0 24px; }
.gmodal-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.gmr { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.gmr-first, .gmr-last { font-family: var(--sans); font-size: 14px; padding: 9px 12px; border: 1.5px solid var(--rule); border-radius: 6px; outline: none; color: var(--ink); background: var(--butter-2); transition: border-color 0.15s; }
.gmr-first:focus, .gmr-last:focus { border-color: var(--pink); background: #fff; }
.gmr-child-wrap { display: flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.gmr-child-wrap input[type=checkbox] { accent-color: var(--pink); width: 15px; height: 15px; cursor: pointer; }
.gmr-del { background: none; border: 1px solid var(--rule); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; color: var(--ink-3); transition: all 0.15s; flex-shrink: 0; }
.gmr-del:hover { border-color: var(--pink); color: var(--pink); }
.gmodal-add-row { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; background: none; border: 1.5px dashed var(--rule); border-radius: 8px; width: 100%; padding: 12px; cursor: pointer; color: var(--ink-3); transition: all 0.15s; margin-bottom: 24px; }
.gmodal-add-row:hover { border-color: var(--pink); color: var(--pink); }
.gmodal-ft { display: flex; justify-content: flex-end; gap: 12px; padding-top: 20px; border-top: 1px solid var(--rule); }

@media (max-width: 768px) {
  .admin-tabs { padding: 0 16px; }
  .glist-shell { padding: 20px 16px 56px; }
  .glist-toolbar { gap: 10px; }
}
@media (max-width: 600px) {
  .gmr { grid-template-columns: 1fr 1fr; }
  .gmr-child-wrap { grid-column: 1; }
  .gmr-del { grid-column: 2; justify-self: end; }
  .glr-last, .glr-count { display: none; }
  .gmodal-card { padding: 28px 20px; }
}

/* ── LOGIN GATE ── */
/* Gate overlay */
#gate {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--green-pale);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
#gate.hidden { display: none; }
.gate-card {
  background: var(--cream); border: 1px solid var(--rule);
  border-radius: 8px; padding: 56px 48px;
  max-width: 440px; width: 100%; text-align: center;
  box-shadow: 0 24px 64px rgba(42,15,28,0.12);
}
.gate-mono {
  font-family: var(--serif); font-weight: 900; font-style: italic;
  font-size: 32px; color: var(--pink); margin-bottom: 24px;
}
.gate-mono span { color: var(--orange); }
.gate-h2 {
  font-family: var(--serif); font-weight: 900; font-size: 48px;
  line-height: 1; color: var(--pink); margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.gate-h2 em { font-style: italic; font-weight: 400; color: var(--orange); }
.gate-sub {
  font-family: var(--serif); font-style: italic; font-size: 16px;
  color: var(--ink-2); margin: 0 0 32px;
}
.gate-field { text-align: left; margin-bottom: 16px; }
.gate-field label {
  display: block; font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px;
}
.gate-field input {
  width: 100%; font-family: var(--sans); font-size: 16px;
  padding: 14px 16px; background: var(--butter-2);
  border: 1.5px solid var(--rule); border-radius: 8px; color: var(--ink);
  outline: none; transition: all 0.18s cubic-bezier(.22,.68,0,1);
  text-align: center; letter-spacing: 0.15em;
}
.gate-field input:focus { border-color: var(--pink); background: #fff; box-shadow: 0 0 0 4px rgba(224,56,111,0.12); }
#gate-error {
  display: none; font-family: var(--sans); font-size: 13px;
  color: var(--pink-2); margin-bottom: 16px;
  padding: 10px 14px; background: rgba(225,29,90,0.08);
  border-radius: 6px;
}
#gate-error.visible { display: block; }
.gate-btn { width: 100%; justify-content: center; margin-top: 4px; }
