/* Soon was yesterday — matte gold / peach / plum.  Flat surfaces, no blur or glass. */
@font-face {
  font-family: "Fredoka";
  src: url("/static/fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --plum-900: #2b1236;
  --plum-700: #4a2260;
  --plum-500: #7a4a94;
  --plum-300: #c9a0de;
  --gold: #e3b341;
  --gold-deep: #b98a1c;
  --peach: #ffb48a;
  --peach-soft: #ffd9c2;
  --cream: #fff3e6;
  --paper: #fffaf4;
  --ink: #2b1236;
  --muted: #6e5878;
  --ok: #2f7d4f;
  --bad: #a3323f;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
}
a { color: var(--plum-700); }
code { background: var(--peach-soft); padding: .05em .35em; border-radius: .35em; font-size: .9em; }
h1 { font-size: 1.9rem; margin: 0 0 .75rem; }
h2 { font-size: 1.25rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- persistent header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--plum-900);
  border-bottom: 4px solid var(--gold);
  padding: .6rem 1.25rem .7rem;
}
.topbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 2rem; }
.wordmark { font-size: 1.9rem; font-weight: 700; letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.wm-gold { color: var(--gold); }
.wm-peach { color: var(--peach); }
.wm-plum { color: var(--plum-300); }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; margin: 0 auto; }
.nav a { color: var(--peach-soft); text-decoration: none; padding: .15rem .35rem; border-radius: .5rem; font-weight: 500; }
.nav a:hover, .nav a:focus-visible { background: var(--plum-700); }
.nav a.active { color: var(--plum-900); background: var(--gold); }
.nav .sep { color: var(--plum-500); }

.topbar-aux { display: flex; justify-content: center; margin-top: .55rem; }
.aux-box {
  display: flex; align-items: center; gap: .9rem;
  background: var(--plum-700); border-radius: 1rem; padding: .45rem .9rem;
}
.aux-icon-wrap { display: inline-flex; }
.icon { width: 2rem; height: 2rem; fill: #fff; flex: none; }
.icon-dark { fill: var(--plum-700); width: 1.6rem; height: 1.6rem; }
.aux-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 9rem; }
.aux-label { color: var(--plum-300); font-size: .7rem; letter-spacing: .12em; }
.aux-name { color: #fff; font-weight: 600; text-decoration: none; }
.aux-name:hover { text-decoration: underline; }
.aux-timer { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 500; }
.aux-switch select { background: var(--paper); }

/* ---------- content ---------- */
.content { max-width: 64rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.card { background: var(--paper); border: 2px solid var(--peach-soft); border-radius: 1rem; padding: 1rem 1.25rem; margin: 0 0 1.25rem; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--peach-soft); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: .9rem; }
td.num, th.num { text-align: right; }
meter { width: 100%; min-width: 6rem; height: 1rem; }

input, select, textarea, button, .btn {
  font: inherit; color: var(--ink); border-radius: .6rem; border: 2px solid var(--peach);
  background: #fff; padding: .35rem .7rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold-deep); outline-offset: 2px;
}
button, .btn {
  background: var(--gold); border-color: var(--gold); font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-block; color: var(--plum-900);
}
button:hover, .btn:hover { background: var(--peach); border-color: var(--peach); }
button.danger { background: var(--paper); border-color: var(--bad); color: var(--bad); }
button.danger:hover { background: var(--bad); color: #fff; }
form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1rem; }
form.inline.add { margin: 1rem 0 0; }
form.inline label { display: inline-flex; align-items: center; gap: .4rem; }

.flash { padding: .5rem .8rem; border-radius: .6rem; margin: 0 0 1rem; font-weight: 500; }
.flash.ok { background: #dff3e6; color: var(--ok); }
.flash.bad { background: #f9dde0; color: var(--bad); }
.pill { display: inline-block; padding: .05rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--peach-soft); color: var(--plum-700); }
.pill.ok { background: #dff3e6; color: var(--ok); }
.pill.bad { background: #f9dde0; color: var(--bad); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; }
.tile {
  display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 2px solid var(--peach-soft); border-radius: 1rem;
}
.tile:hover { border-color: var(--gold); }

/* ---------- public pages (login, not-user) ---------- */
body.public { background: var(--plum-900); min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.public-card { background: var(--cream); border-radius: 1.5rem; border: 4px solid var(--gold); padding: 2rem; width: min(26rem, 100%); text-align: center; }
.public.wide .public-card { width: min(36rem, 100%); text-align: left; }
.public-logo { text-align: center; margin-bottom: 1.25rem; }
.public-card .wordmark { font-size: 2.2rem; }
.public-card .wm-gold { color: var(--gold-deep); }
.public-card .wm-peach { color: #e07a4f; }
.public-card .wm-plum { color: var(--plum-700); }
.lead { font-size: 1.2rem; }

@media (max-width: 640px) {
  .nav { margin: 0; }
  .topbar { padding: .5rem .75rem; }
  .aux-box { flex-wrap: wrap; justify-content: center; }
}

/* ---------- forms, cases, bills ---------- */
textarea { width: 100%; resize: vertical; }
input.narrow { width: 7rem; }
input[type="checkbox"] { width: 1.2rem; height: 1.2rem; accent-color: var(--plum-700); vertical-align: middle; }
form.stack { display: flex; flex-direction: column; gap: .6rem; max-width: 36rem; margin: 0 0 .5rem; }
form.stack label { display: flex; flex-direction: column; gap: .25rem; font-weight: 500; }
form.inline.tight { margin: 0; }
label.check { display: inline-flex; align-items: center; gap: .4rem; }
.small-btn { padding: .1rem .5rem; font-size: .85rem; }
details.pay summary { cursor: pointer; color: var(--plum-700); font-weight: 600; }
details.pay[open] { padding-bottom: .5rem; }
tfoot td { border-bottom: 0; border-top: 2px solid var(--peach); padding-top: .6rem; }
.batch { font-size: 1.15rem; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 3px solid var(--peach-soft); }
.timeline li { margin: 0 0 1rem; padding-left: .75rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -1.45rem; top: .45rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--gold); }
.timeline li.event::before { background: var(--plum-500); }
.timeline .when { display: block; color: var(--muted); font-size: .85rem; }
.note-text { white-space: pre-wrap; margin: .15rem 0 0; }
