/* LTWC Events — a ledger, not a dashboard.
   Numbers are set in a mono face and right-aligned so columns of money read
   the way a bank statement does. Everything else stays quiet. */

:root {
  --ink:        #16202e;
  --ink-soft:   #4a5666;
  --ink-faint:  #8a94a3;
  --paper:      #f4f6f9;
  --surface:    #ffffff;
  --rule:       #dfe4ec;
  --rule-soft:  #edf0f5;
  --cedar:      #0e7c66;
  --cedar-soft: #e4f2ee;
  --amber:      #9a6a09;
  --amber-soft: #fbf1dc;
  --rust:       #a63930;
  --rust-soft:  #fbeae8;
  --focus:      #2f6fd0;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --radius: 3px;
  --shadow: 0 1px 2px rgba(22, 32, 46, .06), 0 8px 24px -16px rgba(22, 32, 46, .25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--focus); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; font-family: var(--sans); font-weight: 600; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }

/* --- chrome --------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px; height: 54px;
  background: var(--ink); color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.brand { font-family: var(--serif); font-size: 18px; color: #fff; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--cedar); margin-right: 4px; }
.topbar nav { display: flex; gap: 22px; flex: 1; }
.topbar nav a { color: #b8c2d1; font-size: 14px; padding: 4px 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar nav a.on { color: #fff; border-bottom-color: var(--cedar); }
.who { display: flex; gap: 14px; align-items: center; font-size: 13px; color: #b8c2d1; }
.who a { color: #b8c2d1; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 24px 80px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; }

.flashes { margin-bottom: 18px; display: grid; gap: 8px; }
.flash {
  padding: 10px 14px; border-radius: var(--radius); font-size: 14px;
  background: var(--cedar-soft); color: #0a5a4a; border-left: 3px solid var(--cedar);
}
.flash.error { background: var(--rust-soft); color: #8a2b23; border-left-color: var(--rust); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- controls ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-faint); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #24344a; }
.btn.go { background: var(--cedar); border-color: var(--cedar); color: #fff; }
.btn.go:hover { background: #0b6b58; }
.btn.danger { color: var(--rust); border-color: #eccfcc; }
.btn.small { padding: 4px 9px; font-size: 13px; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=time], select, textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  padding: 7px 10px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); width: 100%;
}
textarea { line-height: 1.55; resize: vertical; }
label { font-size: 13px; color: var(--ink-soft); display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.checkline input { width: auto; }

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card h2, .card h3 { margin-bottom: 14px; }
.hint { font-size: 13px; color: var(--ink-faint); }

/* --- the ledger strip: the one loud element ------------------------------- */

.ledger {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow);
}
.ledger div { padding: 14px 16px; border-right: 1px solid var(--rule-soft); }
.ledger div:last-child { border-right: 0; }
.ledger dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 0 0 6px; }
.ledger dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 21px; }
.ledger .settle { background: var(--ink); color: #fff; }
.ledger .settle dt { color: #98a4b5; }
.ledger .pos dd { color: #7ee0b8; }
.ledger .neg dd { color: #ffb0a6; }
.ledger small { display: block; font-family: var(--sans); font-size: 11px; color: var(--ink-faint); margin-top: 3px; }
.ledger .settle small { color: #98a4b5; }

/* --- tables --------------------------------------------------------------- */

.table-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
/* Not sticky: .table-wrap needs overflow-x for wide tables, which makes it a
   scroll container, and a sticky th then anchors to the wrapper rather than the
   viewport — leaving a gap and letting row 1 render behind the header. */
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); font-weight: 600; padding: 11px 10px;
  border-bottom: 1px solid var(--rule); background: #f7f9fc;
  white-space: nowrap;
}
th.num, td.num { text-align: right; }
td { padding: 9px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
td .btn.small + .btn.small, td form { margin-left: 4px; }
tbody tr:hover { background: #fbfcfe; }
tbody tr:last-child td { border-bottom: 0; }
.name { font-weight: 500; }
.name + .meta { margin-left: 6px; }
.meta { color: var(--ink-faint); font-size: 12.5px; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-faint); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; font-family: var(--serif); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  background: var(--rule-soft); color: var(--ink-soft);
}
.tag.yes { background: var(--cedar-soft); color: #0a5a4a; }
.tag.no { background: var(--rust-soft); color: #8a2b23; }
.tag.pending { background: var(--amber-soft); color: var(--amber); }
.tag.owed { background: var(--rust-soft); color: #8a2b23; }
.tag.paid { background: var(--cedar-soft); color: #0a5a4a; }

.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.seg button {
  border: 0; background: var(--surface); font: inherit; font-size: 12.5px;
  padding: 4px 10px; cursor: pointer; color: var(--ink-soft);
  border-right: 1px solid var(--rule);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #fff; }
.seg button.on[data-value=yes] { background: var(--cedar); }
.seg button.on[data-value=no] { background: var(--rust); }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input[type=text] { width: auto; min-width: 130px; }

.qty { width: 54px; text-align: center; padding: 4px; }

/* --- check-in ------------------------------------------------------------- */

.checkin-list { display: grid; gap: 8px; }
.checkin-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
}
.checkin-row.done { background: var(--cedar-soft); border-color: #bfe0d6; }
.checkin-row .who-name { flex: 1; font-size: 16px; }
.checkin-row .who-name small { display: block; color: var(--ink-faint); font-size: 12.5px; }
.checkin-row button { min-width: 104px; justify-content: center; }

/* --- public RSVP ---------------------------------------------------------- */

.rsvp-page { background: var(--ink); min-height: 100vh; padding: 40px 20px; }
.rsvp-card { max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: 4px; padding: 34px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); }
.rsvp-card h1 { font-size: 28px; margin-bottom: 6px; }
.rsvp-when { font-family: var(--mono); font-size: 14px; color: var(--ink-soft); margin-bottom: 22px; }
.rsvp-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.rsvp-choice label {
  display: block; text-align: center; padding: 16px; border: 1px solid var(--rule);
  border-radius: var(--radius); cursor: pointer; font-size: 16px; color: var(--ink); margin: 0;
}
.rsvp-choice input { position: absolute; opacity: 0; }
.rsvp-choice input:checked + span { font-weight: 600; }
.rsvp-choice label:has(input:checked) { border-color: var(--ink); background: #f7f9fc; box-shadow: inset 0 0 0 1px var(--ink); }
.rsvp-extras { border-top: 1px solid var(--rule-soft); padding-top: 16px; margin-top: 4px; }

@media (max-width: 720px) {
  .topbar { gap: 14px; padding: 0 12px; overflow-x: auto; }
  .wrap { padding: 18px 12px 60px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
