/* Thanksgiving signup tracker */
:root {
  --bg: #faf6ef;
  --card: #ffffff;
  --ink: #2a211b;
  --muted: #73665b;
  --line: #e7dccd;
  --accent: #a6461d;       /* pumpkin */
  --accent-ink: #ffffff;
  --accent-soft: #f6e5d8;
  --cran: #8c2f39;
  --cran-soft: #f7e1e3;
  --gold: #b07a12;
  --gold-soft: #fbefd2;
  --sage: #4e6b3c;
  --sage-soft: #e5eedd;
  --deep: #2f5130;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .05);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .92rem; margin: .25rem 0 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.req { color: var(--cran); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 0 0 24px; }
.card.narrow { max-width: 520px; }
ul.plain { list-style: none; margin: 0; padding: 0; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(160deg, #7c2f1c 0%, #a6461d 55%, #c06a24 100%); color: #fff8f0; padding: 44px 0 40px; margin-bottom: 28px; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; opacity: .85; margin: 0 0 .4rem; }
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero .when { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 .8rem; font-weight: 600; }
.hero .when span + span::before { content: "·"; margin-right: 18px; opacity: .6; }
.hero .welcome { max-width: 46em; margin: 0; opacity: .95; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-num { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .9rem; }

/* ---------- needs ---------- */
.needs { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-bottom: 28px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-needed { border-top: 4px solid var(--cran); }
.panel-plenty { border-top: 4px solid var(--sage); }
.need-list, .plenty-list { list-style: none; margin: 0; padding: 0; }
.need-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.need-row:first-child { border-top: 0; }
.need-row strong { display: block; }
.need-amt { color: var(--muted); font-size: .9rem; }
.need-row.status-need strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cran); margin-right: 8px; vertical-align: middle; }
.need-row.status-low strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: middle; }
.plenty-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.plenty-list li:first-child { border-top: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #8e3a16; }
.btn-ghost { background: transparent; }
.btn-small { padding: 6px 12px; font-size: .88rem; }
.btn-danger { color: var(--cran); border-color: #e3bcc0; }
.btn-danger:hover { background: var(--cran-soft); border-color: var(--cran); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-icon { font: inherit; background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; cursor: pointer; color: var(--muted); line-height: 1; }
.btn-icon:hover { border-color: var(--line); color: var(--ink); background: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
:focus-visible { outline: 3px solid #e6a15a; outline-offset: 2px; }

/* ---------- forms ---------- */
.signup { border-top: 4px solid var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field { display: block; margin-bottom: 14px; }
.field > span, .line-row label > span, .size-row label > span, .inline-form label > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field small { display: block; color: var(--muted); margin-top: 4px; font-size: .84rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d6c8b5; border-radius: 8px; padding: 9px 11px; min-height: 42px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(166, 70, 29, .18); }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 6px 0 18px; }
legend { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; padding: 0 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.line-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) 90px auto; gap: 10px; align-items: end; padding: 12px; margin-bottom: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; transition: box-shadow .3s; }
.line-row.flash { box-shadow: 0 0 0 3px #e6a15a; }
.line-row .btn-icon { margin-bottom: 6px; font-size: 1rem; }
.lr-custom { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 10px; }
.lr-est { grid-column: 1 / -1; margin: 0; color: var(--sage); font-size: .88rem; font-weight: 600; min-height: 0; }
.lr-est:empty { display: none; }
.size-row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-bottom: 8px; }

/* ---------- alerts ---------- */
.alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; border: 1px solid; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-ok { background: var(--sage-soft); border-color: #c4d6b5; }
.alert-error { background: var(--cran-soft); border-color: #e3bcc0; color: #5e1d25; }
.alert-warn { background: var(--gold-soft); border-color: #ecd59c; }
.thanks h2 { margin-bottom: .3em; }
.thanks ul { margin: .3rem 0 .6rem; }

/* ---------- board ---------- */
.menu-section { margin-top: 8px; }
.board { columns: 2 380px; column-gap: 16px; }
.cat-card { break-inside: avoid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 6px; margin: 0 0 16px; display: inline-block; width: 100%; }
.cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; }
.cat-head h3 { margin: 0; }
.cat-total { font-size: .85rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item-name { font-weight: 600; }
.badge { font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--bg); color: var(--muted); }
.status-need .badge { background: var(--cran-soft); color: var(--cran); }
.status-low .badge { background: var(--gold-soft); color: #7a5408; }
.status-good .badge { background: var(--sage-soft); color: var(--sage); }
.status-plenty .badge { background: var(--deep); color: #fff; }
.item-extra .badge { background: var(--accent-soft); color: var(--accent); }
.bar { height: 6px; background: #efe6da; border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.bar span { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
.status-need .bar span { background: var(--cran); }
.status-low .bar span { background: var(--gold); }
.status-good .bar span { background: var(--sage); }
.status-plenty .bar span { background: var(--deep); }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-meta .note { font-style: italic; }
.who-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.who { font-size: .82rem; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.who-church { background: var(--accent-soft); border-color: #ecc9b0; }
.bring-link { display: inline-block; margin-top: 8px; font-size: .86rem; font-weight: 600; }
.cat-total.status-need { color: var(--cran); }
.cat-total.status-good, .cat-total.status-plenty { color: var(--sage); }

.foot { color: var(--muted); font-size: .9rem; padding-top: 12px; padding-bottom: 40px; text-align: center; }

/* ---------- admin ---------- */
.admin-bar { background: #2a211b; color: #f4ebe0; margin-bottom: 24px; }
.admin-bar a { color: #f4c9a4; }
.admin-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 12px; padding-bottom: 8px; }
.brand { font-family: var(--serif); font-size: 1.15rem; }
.brand .muted { color: #b9a996; font-family: var(--sans); font-size: .85rem; }
.year-switch select { min-height: 34px; padding: 4px 8px; width: auto; background: #3b3029; color: #fff; border-color: #5a4a3e; }
.admin-links { margin-left: auto; display: flex; gap: 16px; font-size: .92rem; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a { color: #d8c9b8; text-decoration: none; padding: 10px 14px; border-radius: 8px 8px 0 0; font-weight: 600; font-size: .94rem; white-space: nowrap; }
.tabs a:hover { color: #fff; }
.tabs a.active { background: var(--bg); color: var(--ink); }
.admin-main { padding-bottom: 60px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar h1 { margin: 0; }
.toolbar h1 .muted { font-size: 1rem; font-family: var(--sans); font-weight: 400; }
.table-wrap { overflow-x: auto; margin-bottom: 12px; }
.table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .94rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fbf8f3; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.inactive td { opacity: .55; }
.table-menu { table-layout: fixed; min-width: 720px; }
.table-menu th:nth-child(1) { width: 24%; }
.table-menu th:nth-child(2) { width: 10%; }
.table-menu th:nth-child(4), .table-menu th:nth-child(5) { width: 8%; }
.table-menu th:nth-child(6) { width: 150px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); }
.pill.status-need { background: var(--cran-soft); color: var(--cran); }
.pill.status-low { background: var(--gold-soft); color: #7a5408; }
.pill.status-good { background: var(--sage-soft); color: var(--sage); }
.pill.status-plenty { background: var(--deep); color: #fff; }
.cat-admin { padding-top: 14px; }
.cat-admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.cat-tools { display: flex; gap: 2px; }
.cat-tools form { display: inline; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline-form input { width: auto; }
.cat-name-input { font-family: var(--serif); font-size: 1.2rem !important; font-weight: 600; border-color: transparent !important; background: transparent !important; padding-left: 4px !important; }
.cat-name-input:hover, .cat-name-input:focus { border-color: #d6c8b5 !important; background: #fff !important; }
.unit-label { display: flex; align-items: center; gap: 6px; }
.unit-label > span { margin: 0 !important; font-weight: 400 !important; color: var(--muted); }
.danger-zone { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; }
.login-box { max-width: 420px; margin: 10vh auto; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .needs, .grid-2 { grid-template-columns: 1fr; }
  .grid-2 { gap: 0; }
  .line-row { grid-template-columns: 1fr 80px auto; }
  .line-row .lr-item { grid-column: 1 / -1; }
  .lr-custom { grid-template-columns: 1fr 1fr; }
  .lr-custom label:first-child { grid-column: 1 / -1; }
  .hero { padding: 32px 0 28px; }
  .need-row { flex-wrap: wrap; }
  .admin-links { margin-left: 0; }
}

/* ---------- print: a clean "who's bringing what" sheet ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .hero { background: none; color: #000; padding: 0; margin: 0 0 10px; }
  .hero h1 { color: #000; }
  .signup, .admin-bar, .foot, .bring-link, .btn, .row-actions, .needs .btn, .alert { display: none !important; }
  .card, .cat-card, .stat, .panel { box-shadow: none; border-color: #bbb; }
  .board { columns: 2; }
}
