/* VFW Events — mobile-first. Black/white like fallbrookvfw.org, Bitter headings, status colors. */
:root {
  --ink: #1b1b1b;
  --muted: #5e5e5e;
  --line: #dbdbdb;
  --soft: #f5f5f4;
  --bg: #ffffff;
  --card: #ffffff;
  --btn: #1b1b1b;
  --btn-ink: #ffffff;
  --err: #a11d1d;
  --err-bg: #fdecec;
  --ok-bg: #eaf5ec;
  /* status */
  --s-pending: #1f5fbf;      --s-pending-bg: #e8f0fc;
  --s-soon: #8a6400;         --s-soon-bg: #fff4d1;   --s-soon-bar: #e6b100;
  --s-go: #1d6b35;           --s-go-bg: #e4f4e8;
  --s-canceled: #a11d1d;     --s-canceled-bg: #fdecec;
  --s-completed: #3d3d3d;    --s-completed-bg: #ececec;
  --s-expired: #7a7a7a;      --s-expired-bg: #f2f2f2;
  --updated: #6b2bbf;        --updated-bg: #f1e9fc;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.5 Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: 'Bitter', Georgia, serif; font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--ink); }
.wrap { max-width: 820px; margin: 0 auto; padding: 16px 16px 60px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* header + tabs */
.top { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; padding: 10px 16px 0; padding-top: max(10px, env(safe-area-inset-top)); }
.brand { color: #fff; text-decoration: none; font-family: 'Bitter', Georgia, serif; font-size: 1.1rem; display: inline-block; margin-bottom: 8px; }
.brand span { opacity: .7; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: #cfcfcf; text-decoration: none; padding: 9px 11px 11px; white-space: nowrap; font-size: .95rem; border-bottom: 3px solid transparent; }
.tabs a.on { color: #fff; border-bottom-color: #fff; }

/* buttons + forms */
button, .btn { font: inherit; font-weight: 700; background: var(--btn); color: var(--btn-ink); border: 1px solid var(--btn); border-radius: 6px; padding: 10px 16px; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.2; min-height: 44px; }
button.ghost, .btn.ghost { background: #fff; color: var(--ink); border-color: #bfbfbf; }
button.danger { background: var(--s-canceled); border-color: var(--s-canceled); }
button.small, .btn.small { padding: 6px 10px; min-height: 36px; font-size: .875rem; }
button:disabled { opacity: .5; cursor: default; }
.field { margin-bottom: 14px; }
label, .label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 5px; }
.req { color: var(--err); }
.opt { font-weight: 400; color: var(--muted); font-size: .82rem; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=password], input[type=month], textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid #bfbfbf; border-radius: 6px; padding: 10px 11px; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--s-pending); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; min-height: 40px; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; }
.seg { display: flex; border: 1px solid #bfbfbf; border-radius: 6px; overflow: hidden; }
.seg label { flex: 1; margin: 0; font-weight: 400; text-align: center; padding: 10px 6px; cursor: pointer; border-left: 1px solid #bfbfbf; font-size: .92rem; }
.seg label:first-child { border-left: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; }
.seg label:has(input:disabled) { opacity: .45; cursor: default; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin: 0 0 16px; min-width: 0; }
legend { font-family: 'Bitter', Georgia, serif; padding: 0 6px; font-size: 1.02rem; }
.error { background: var(--err-bg); color: var(--err); border-radius: 6px; padding: 10px 12px; margin: 0 0 14px; }
.needs { background: var(--soft); border-radius: 8px; padding: 10px 12px; font-size: .9rem; margin-bottom: 14px; }

/* status pills + badges */
.pill { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.st-pending .pill, .pill.st-pending { background: var(--s-pending-bg); color: var(--s-pending); }
.st-pending-soon .pill, .pill.st-pending-soon { background: var(--s-soon-bg); color: var(--s-soon); }
.st-go .pill, .pill.st-go { background: var(--s-go-bg); color: var(--s-go); }
.st-canceled .pill, .pill.st-canceled { background: var(--s-canceled-bg); color: var(--s-canceled); }
.st-completed .pill, .pill.st-completed { background: var(--s-completed-bg); color: var(--s-completed); }
.st-expired .pill, .pill.st-expired { background: var(--s-expired-bg); color: var(--s-expired); }
.badge-upd { background: var(--updated-bg); color: var(--updated); }
.badge-type { background: var(--soft); color: var(--muted); }

/* event review cards */
.ev { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--s-pending); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.ev.st-pending-soon { border-left-color: var(--s-soon-bar); }
.ev.st-go { border-left-color: var(--s-go); }
.ev.st-canceled { border-left-color: var(--s-canceled); }
.ev.st-completed { border-left-color: var(--s-completed); }
.ev.st-expired { border-left-color: #b5b5b5; }
.ev-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.ev-title { font-family: 'Bitter', Georgia, serif; font-size: 1.15rem; display: block; margin: 2px 0; text-decoration: none; }
.ev-title:hover { text-decoration: underline; }
.ev-when { color: var(--muted); font-size: .9rem; }
.st-canceled .ev-title { text-decoration: line-through; }
.appr { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0; }
@media (min-width: 560px) { .appr { grid-template-columns: repeat(4, 1fr); } }
.appr div { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: .85rem; line-height: 1.25; }
.appr b { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.appr .box { width: 18px; height: 18px; border: 2px solid #8a8a8a; border-radius: 4px; display: inline-grid; place-items: center; font-size: 13px; flex: none; }
.appr .done { background: var(--s-go-bg); border-color: #b7dcc1; }
.appr .done .box { background: var(--s-go); border-color: var(--s-go); color: #fff; }
.appr .na { opacity: .4; background: var(--soft); }
.appr .need .box { border-color: var(--s-pending); }
.actions { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; display: grid; gap: 10px; }
.actions form { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .actions form.inline { grid-template-columns: 1fr 1fr auto; align-items: end; } }
.actions textarea { min-height: 44px; height: 44px; }
details > summary { cursor: pointer; font-weight: 700; font-size: .9rem; padding: 6px 0; list-style-position: inside; }
.log { list-style: none; padding: 0; margin: 4px 0 0; font-size: .88rem; }
.log li { border-top: 1px dashed var(--line); padding: 6px 0; }
.log .meta { color: var(--muted); font-size: .78rem; }
.log .k-approve .txt { color: var(--s-go); }
.log .k-unapprove .txt, .log .k-cancel .txt { color: var(--s-canceled); }
.log .k-edit .txt { color: var(--updated); }

/* filters */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; margin-bottom: 14px; }
.filters .field { margin: 0; }
.filters .btns { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 560px) { .filters { grid-template-columns: 1fr 1fr auto; } .filters .btns { grid-column: auto; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-head h1 { margin: 0; font-size: 1.3rem; text-align: center; flex: 1; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .dow { font-size: .72rem; text-align: center; color: var(--muted); padding: 4px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
.cal .day { min-height: 64px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px; font-size: .75rem; background: #fff; cursor: pointer; text-align: left; color: var(--ink); font-weight: 400; border-radius: 0; min-width: 0; display: block; }
.cal .day.out { background: var(--soft); color: #a0a0a0; }
.cal .day.today .num { background: var(--ink); color: #fff; border-radius: 999px; padding: 0 6px; }
.cal .day.sel { outline: 2px solid var(--s-pending); outline-offset: -2px; }
.cal .num { font-weight: 700; display: inline-block; margin-bottom: 2px; }
.cal .chip { display: block; border-radius: 3px; padding: 1px 3px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .68rem; border-left: 3px solid; }
.chip.st-pending { background: var(--s-pending-bg); border-color: var(--s-pending); }
.chip.st-pending-soon { background: var(--s-soon-bg); border-color: var(--s-soon-bar); }
.chip.st-go { background: var(--s-go-bg); border-color: var(--s-go); }
.chip.st-canceled { background: var(--s-canceled-bg); border-color: var(--s-canceled); text-decoration: line-through; }
.chip.st-completed { background: var(--s-completed-bg); border-color: var(--s-completed); }
.chip.st-expired { background: var(--s-expired-bg); border-color: #b5b5b5; }
@media (max-width: 520px) {
  .cal .day { min-height: 52px; }
  .cal .chip { font-size: 0; height: 6px; padding: 0; border-left-width: 0; margin-top: 3px; }
  .chip.st-pending { background: var(--s-pending); } .chip.st-pending-soon { background: var(--s-soon-bar); }
  .chip.st-go { background: var(--s-go); } .chip.st-canceled { background: var(--s-canceled); }
  .chip.st-completed { background: var(--s-completed); } .chip.st-expired { background: #b5b5b5; }
}
.daylist { margin-top: 16px; }
.mini { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; text-decoration: none; }
.mini .t { flex: 1; min-width: 0; }
.mini .t b { display: block; font-weight: 400; font-family: 'Bitter', Georgia, serif; }

/* layouts picker */
.layouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.layouts label { margin: 0; font-weight: 400; border: 2px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; font-size: .85rem; text-align: center; }
.layouts label:has(input:checked) { border-color: var(--ink); background: var(--soft); }
.layouts input { position: absolute; opacity: 0; pointer-events: none; }
.layouts img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: var(--soft); border-radius: 4px; display: block; margin-bottom: 4px; }
.layouts .noimg { aspect-ratio: 4/3; display: grid; place-items: center; background: var(--soft); border-radius: 4px; margin-bottom: 4px; color: var(--muted); }

/* menus */
.md { line-height: 1.55; }
.md h1, .md h2, .md h3 { margin-top: .8em; }
.md ul, .md ol { padding-left: 1.3em; margin: 0 0 1em; }
.menu-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.menu-card .rev { font-size: .8rem; color: var(--muted); }
.editor { display: grid; gap: 12px; }
@media (min-width: 760px) { .editor { grid-template-columns: 1fr 1fr; } }
.editor textarea { min-height: 360px; font-family: ui-monospace, Consolas, monospace; font-size: 15px; }
.preview { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; min-height: 120px; overflow-wrap: anywhere; }
.menu-pick { display: grid; gap: 4px; }

/* settings tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.inactive td { color: #a0a0a0; }
.card-list .item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.card-list .item.inactive { opacity: .55; }
.thumb { width: 96px; aspect-ratio: 4/3; object-fit: contain; background: var(--soft); border-radius: 4px; }

/* login */
.login { max-width: 360px; margin: 10vh auto 0; text-align: center; }
.login input { text-align: center; margin-bottom: 12px; }
.login button { width: 100%; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; transition: transform .2s; max-width: calc(100% - 32px); z-index: 20; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--err); }
