/* Founders' admin page (admin.html). Colours, radii, shadows from tokens.css only; the few app basics it needs are copied
   from style.css (font stack, .seg, .btn, .toast) so the page doesn't load the whole app stylesheet. */
:root {
  --font: "Figtree", "Zen Kaku Gothic New", system-ui, -apple-system, "Hiragino Sans", sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { min-height: 100dvh; padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--gold-ink); }
html[data-theme="dark"] a { color: var(--gold); }

/* app bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; border-bottom: 1px solid var(--line); }
.bar .home { display: flex; flex: none; }
.mark { width: 32px; height: 32px; display: block; }
.bar h1 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.seg { display: inline-flex; background: var(--soft); border-radius: var(--radius-pill); padding: 3px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-seg); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

main { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.state { margin: 48px 0; text-align: center; color: var(--muted); line-height: 1.6; }
.state .btn { margin-top: 14px; }

/* tabs with counts (they scroll sideways on a phone) */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.tab .n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--soft); color: var(--muted);
  font-size: 12px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tab .n.has { background: var(--gold); color: var(--on-gold); }
.tab.on .n { background: var(--gold); color: var(--on-gold); }
.list-note { margin: 0 0 8px; font-size: 12px; color: var(--muted); }

/* cards */
.list { display: grid; gap: 12px; }
.card { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.card.leaving { opacity: .4; pointer-events: none; transition: opacity .2s; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.card-head b { font-size: 15px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.when { flex: none; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.meta span { overflow-wrap: anywhere; }
.text { margin: 0; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card-2);
  border-radius: var(--radius-sm); padding: 10px 12px; }
.quote { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--soft); color: var(--ink-2); }
.chip.warn { background: var(--warn-soft); color: var(--ink); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); }
html[data-theme="dark"] .chip.gold { color: var(--gold); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--soft); flex: none; display: grid; place-items: center;
  font-weight: 700; color: var(--muted); }
.person-name { display: grid; min-width: 0; }
.person-name b, .person-name small { overflow-wrap: anywhere; }
.person-name small { color: var(--muted); font-size: 13px; }

/* photos (signed URLs, 10 minutes) */
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos:empty { display: none; }
.photos a, .photos .ph { display: block; width: 104px; height: 104px; border-radius: var(--radius-sm); overflow: hidden; background: var(--soft); flex: none; }
.photos.big a, .photos.big .ph { width: 148px; height: 196px; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph { display: grid; place-items: center; font-size: 11px; color: var(--faint); text-align: center; padding: 6px; }
.photos figure { margin: 0; display: grid; gap: 4px; }
.photos figcaption { font-size: 11px; color: var(--muted); }

/* actions */
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { height: 40px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--card); font-weight: 600;
  font-size: 14px; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.gold { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.btn.danger { color: var(--danger); }
.btn.link { border: 0; background: none; padding: 0 4px; color: var(--gold-ink); }
html[data-theme="dark"] .btn.link { color: var(--gold); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 14px; }
.skeleton { height: 120px; border-radius: var(--radius-card); background: var(--card-2); }

.toast { z-index: 20; position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%);
  background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: var(--radius-pill); font-size: 14px;
  max-width: calc(100% - 32px); text-align: center; }
