:root {
  --navy: #0c2841;
  /* Muted brick red — the Early Burg accent, softened from the newsletter's
     electric #c40008 so it doesn't shout in a dense list UI. */
  --red: #b23c39;
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e3e6ea;
  --text: #14202c;
  --muted: #6a7683;
  --ok: #1a7f45;
  --ok-bg: #e7f4ec;
  --mut-bg: #eef0f2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a; --card: #171e26; --line: #262f3a; --text: #e7ecf1;
    --muted: #93a0ad; --ok: #4cc98a; --ok-bg: #17301f; --mut-bg: #1c242d;
    /* Lift the red slightly on dark so it reads as a warm accent, not mud. */
    --red: #d1615a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.45;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1.2rem; background: var(--navy); color: #fff;
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
.brand { color: #fff; font-weight: 700; font-size: 1.1rem; }
.brand span { font-weight: 400; opacity: .7; font-size: .85rem; }
.topbar nav { display: flex; align-items: center; gap: 1rem; }
.topbar nav a { color: #fff; opacity: .85; }
.topbar nav a:hover { opacity: 1; }

main { max-width: 900px; margin: 0 auto; padding: 1.2rem; }

.banner {
  background: var(--red); color: #fff; padding: .6rem 1rem;
  border-radius: 8px; margin-bottom: 1rem; font-weight: 600;
}

.stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.pill {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: .2rem .7rem; font-size: .82rem; font-weight: 600;
}
.pill-ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill-mut { color: var(--muted); }
.pill-music { color: var(--red); }
/* Clickable status filters — pills that jump the list to a status, keeping the
   current date range + filters. The active one gets a ring. */
a.pill.pill-filter { text-decoration: none; cursor: pointer; }
a.pill.pill-filter:hover { text-decoration: none; border-color: var(--muted); }
.pill-active { box-shadow: 0 0 0 2px var(--navy); border-color: transparent; }
@media (prefers-color-scheme: dark) { .pill-active { box-shadow: 0 0 0 2px var(--text); } }

/* City/region tabs — switch which city's newsletter you're reviewing. */
.region-tabs {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin-bottom: .9rem; padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.region-tabs .pill { font-size: .9rem; padding: .3rem .9rem; }

.filters {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .9rem; margin-bottom: 1rem;
}
.filters label { font-size: .8rem; color: var(--muted); display: flex;
  flex-direction: column; gap: .2rem; }
.filters label.check { flex-direction: row; align-items: center; gap: .3rem; }
.filters select { padding: .3rem .4rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.filters .spacer { flex: 1; }
.exports { font-size: .8rem; color: var(--muted); }
.count { color: var(--muted); font-size: .85rem; margin: .3rem 0 1rem; }
.range-note { font-variant-numeric: tabular-nums; }

.daterange {
  flex-basis: 100%; display: flex; align-items: center; gap: .6rem;
  flex-wrap: wrap; padding-top: .7rem; margin-top: .1rem;
  border-top: 1px solid var(--line);
}
.dr-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.dr-field { flex-direction: row !important; align-items: center; gap: .3rem !important; }
.daterange input[type=date] {
  padding: .3rem .4rem; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); color-scheme: light dark;
}
.presets { display: flex; gap: .35rem; flex-wrap: wrap; }
.presets .btn { font-size: .76rem; padding: .28rem .5rem; }

.day {
  font-size: 1rem; color: var(--navy); border-bottom: 2px dashed var(--line);
  padding-bottom: .3rem; margin: 1.4rem 0 .6rem;
}
@media (prefers-color-scheme: dark) { .day { color: var(--text); } }

/* Collapsible day groups (native <details>) */
.day-group { margin: 1.2rem 0 0; }
.day-group > summary.day {
  cursor: pointer; user-select: none; list-style: none;
  display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem;
}
.day-group > summary.day::-webkit-details-marker { display: none; }
.day-group > summary.day::before {
  content: "›"; color: var(--muted); font-weight: 700; font-size: 1.1rem;
  line-height: 1; transition: transform .15s ease;
}
.day-group[open] > summary.day::before { transform: rotate(90deg); }
.day-group > summary.day:hover { color: var(--red); }
.day-count {
  color: var(--muted); font-weight: 400; font-size: .78rem;
  background: var(--mut-bg); border-radius: 999px; padding: .05rem .5rem;
}

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.event {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--line); border-radius: 10px; padding: .7rem .9rem;
}
.event.is-music { border-left-color: var(--red); }
.event.status-approved { border-left-color: var(--ok); }
.event.status-rejected { opacity: .5; }
.ev-main { display: flex; gap: .7rem; align-items: flex-start; min-width: 0; }
.ev-thumb {
  position: relative; flex-shrink: 0; width: 60px; height: 60px;
  border-radius: 8px; overflow: hidden; background: var(--mut-bg);
}
.ev-thumb-txt {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 1.4rem; font-weight: 700;
  color: var(--muted);
}
.ev-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ev-title { font-weight: 600; }
.ev-meta .has-addr { text-decoration: underline dotted; text-underline-offset: 2px;
  cursor: help; }
.ev-time { font-variant-numeric: tabular-nums; }
.ev-meta { color: var(--muted); font-size: .82rem; display: flex;
  flex-wrap: wrap; gap: .6rem; margin-top: .15rem; }
.ev-meta .src { text-transform: uppercase; letter-spacing: .03em;
  font-size: .72rem; opacity: .8; }
.ev-link { font-weight: 600; white-space: nowrap; }
.ev-eng { white-space: nowrap; }
.ev-recur { white-space: nowrap; opacity: .85; }
.tag { font-size: .68rem; text-transform: uppercase; letter-spacing: .03em;
  background: var(--mut-bg); color: var(--muted); border-radius: 4px;
  padding: .05rem .35rem; margin-left: .3rem; }
.tag-music { background: var(--red); color: #fff; }

.ev-actions { display: flex; gap: .35rem; flex-shrink: 0; align-items: center; }
.inline { display: inline; margin: 0; }
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 7px; padding: .32rem .6rem; font-size: .8rem; font-weight: 600;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
/* Approve/Reject are toggles: outline when not the current answer, filled when
   they are (click the filled one again to reset the event to new). */
.btn-ok { background: var(--card); border-color: var(--ok); color: var(--ok); }
.btn-ok.is-active { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-mut { background: var(--card); border-color: var(--line); color: var(--muted); }
.btn-mut.is-active { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; }

.empty, .desc { color: var(--muted); }
.table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: .5rem .7rem;
  border-bottom: 1px solid var(--line); font-size: .85rem; }
.table th { color: var(--muted); font-weight: 600; }
.run-failed td { color: var(--red); }
.errmsg { cursor: help; }

.edit-form { display: grid; gap: .8rem; max-width: 640px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.edit-form label { display: flex; flex-direction: column; gap: .25rem;
  font-size: .82rem; color: var(--muted); }
.edit-form label.check { flex-direction: row; align-items: center; }
.edit-form input[type=text] { padding: .45rem .55rem; border-radius: 7px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.edit-form .row { display: flex; gap: .8rem; flex-wrap: wrap; }
.edit-form .row label { flex: 1; min-width: 160px; }
