/* HearthBee admin: the Ink look from DESIGN.md (black, white, one gray family, Geist). Light only, like the boards. */
@font-face { font-family: Geist; src: url(/fonts/geist-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Geist; src: url(/fonts/geist-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Geist; src: url(/fonts/geist-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Geist; src: url(/fonts/geist-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Geist; src: url(/fonts/geist-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #ffffff; --text: #0a0a0a; --sub: #5c5c5c; --tab-off: #404040; --faint: #8c8c8c;
  --card: #f3f3f3; --line: #ebebeb; --track: #d4d4d4; --ink: #0a0a0a; --on-ink: #ffffff; --danger: #d92d20;
  --font: Geist, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 400 17px/24px var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--text); }
a:hover { color: var(--sub); }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: var(--text); }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Shell */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 232px; max-width: 264px; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { font-size: 17px; font-weight: 800; padding: 0 12px 20px; }
.side .menu-btn { display: none; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; line-height: 20px; border-radius: 20px; text-decoration: none; color: var(--tab-off); font-size: 15px; font-weight: 500; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on { background: var(--ink); color: var(--on-ink); }
.nav .count { flex-shrink: 0; margin-left: auto; font-size: 13px; line-height: 18px; font-weight: 600; background: var(--card); color: var(--text); border-radius: 999px; padding: 2px 8px; }
.nav a.on .count { background: var(--on-ink); }
.me { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.me b { font-size: 15px; font-weight: 600; }
.me span { font-size: 14px; color: var(--sub); }
.me button { align-self: flex-start; padding: 8px 0 0; border: 0; background: none; font-size: 14px; text-decoration: underline; }
main.page { flex: 999 1 560px; min-width: 0; padding: 32px 40px 60px; display: flex; flex-direction: column; gap: 36px; max-width: 1180px; }
main.page.tight { gap: 24px; }

/* ---------------------------------------------------------------- Type and bits */
.h1 { font-size: 32px; line-height: 38px; font-weight: 800; }
.h2 { font-size: 21px; line-height: 27px; font-weight: 700; margin: 0 0 8px; }
.h2x { font-size: 24px; line-height: 30px; font-weight: 800; overflow-wrap: anywhere; }
.lede { margin-top: 6px; font-size: 15px; line-height: 21px; color: var(--sub); }
.sub { font-size: 15px; line-height: 21px; color: var(--sub); }
.s { font-size: 14px; line-height: 20px; color: var(--sub); }
.lbl { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--sub); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: var(--card); font-size: 15px; font-weight: 600; white-space: nowrap; }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--on-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 22px; border: 0; background: var(--card); font-size: 15px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 18px; }
.btn.md { height: 40px; padding: 0 16px; border-radius: 20px; }
.btn.p { background: var(--ink); color: var(--on-ink); }
.btn:hover { filter: brightness(.94); }
.btn.p:hover { background: #2a2a2a; filter: none; }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn.wide { width: 100%; height: 56px; border-radius: 28px; font-size: 17px; }
.ghost { border: 0; background: none; padding: 0; font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.danger { white-space: nowrap; border: 0; background: none; padding: 0; height: 40px; font-size: 15px; font-weight: 600; color: var(--danger); align-self: flex-start; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mark { flex-shrink: 0; white-space: nowrap; font-size: 13px; line-height: 18px; font-weight: 600; background: var(--card); border-radius: 999px; padding: 5px 12px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.input, .area, select.input { width: 100%; border: 0; border-radius: 14px; background: var(--card); padding: 0 14px; height: 48px; font-size: 17px; }
.input.big { height: 56px; padding: 0 16px; }
.area { height: auto; padding: 12px 14px; line-height: 24px; resize: vertical; min-height: 96px; }
select.input { height: 40px; font-size: 15px; padding: 0 12px; width: auto; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; border-radius: 24px; background: var(--card); padding: 0 16px; }
.search svg { flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; outline: none; }
.search:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 17px; font-weight: 600; }
a.row:hover { color: var(--text); background: linear-gradient(var(--card), var(--card)) no-repeat; background-size: 100% 100%; border-radius: 14px; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 4px 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.line > :last-child { text-align: right; }
.empty { padding: 32px 0; color: var(--sub); font-size: 15px; }
.err { padding: 16px; border-radius: 14px; background: #fdecea; color: #8a1c13; font-size: 15px; line-height: 21px; }
.loading { color: var(--sub); font-size: 15px; padding: 24px 0; }
.note { font-size: 14px; line-height: 20px; color: var(--sub); }

/* ---------------------------------------------------------------- Overview */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.kpi .kl { font-size: 15px; line-height: 20px; color: var(--sub); }
.kpi .kv { font-size: 36px; line-height: 42px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .ks { font-size: 14px; line-height: 20px; color: var(--sub); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.bars { height: 180px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--track); padding-top: 8px; }
.bars span { flex: 1; min-height: 2px; background: var(--ink); border-radius: 3px 3px 0 0; }
.bars span.zero { background: var(--line); }
.axis { display: flex; justify-content: space-between; font-size: 14px; color: var(--sub); padding-top: 6px; }
.meter { width: 45%; height: 8px; border-radius: 4px; background: var(--line); flex: none; }
.meter i { display: block; height: 8px; border-radius: 4px; background: var(--ink); }
.val { width: 72px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }

/* ---------------------------------------------------------------- Lists with a detail pane */
.split { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.split > .list { flex: 2 1 320px; min-width: 0; }
.split > .detail { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.item { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 14px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; border-radius: 0; }
.item:hover { background: var(--card); border-radius: 14px; border-bottom-color: transparent; }
.item.sel { background: var(--card); border-radius: 14px; border-bottom-color: transparent; }
.item .t { font-size: 17px; line-height: 23px; font-weight: 600; overflow-wrap: anywhere; }
.item .s { overflow-wrap: anywhere; }
.body-text { font-size: 17px; line-height: 25px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Tables (16px in front of the first column, the selected row a rounded gray band) */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 21px; }
th { text-align: left; font-size: 14px; font-weight: 600; color: var(--sub); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 16px; }
td.mid { vertical-align: middle; }
th.n, td.n { text-align: right; font-variant-numeric: tabular-nums; }
td.n { font-weight: 600; }
tbody tr.pick { cursor: pointer; }
tbody tr.pick:hover td { background: #f9f9f9; }
tbody tr.sel td, tbody tr.sel:hover td { background: var(--card); border-bottom-color: transparent; }
tr.sel td:first-child { border-radius: 14px 0 0 14px; }
tr.sel td:last-child { border-radius: 0 14px 14px 0; }
.cellbtn { border: 0; background: none; padding: 0; text-align: left; font-weight: 700; font-size: 15px; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--line); width: 160px; }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--ink); }
.steps { margin: 4px 0 0; padding-left: 20px; color: var(--text); font-size: 15px; line-height: 22px; }
.steps li + li { margin-top: 4px; }

/* Users aside */
.aside { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.users-main { flex: 3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* Problem reports */
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 560px; }
.bubble { font-size: 17px; line-height: 24px; padding: 12px 16px; border-radius: 20px; background: var(--card); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.team { align-self: flex-end; align-items: flex-end; }
.msg.team .bubble { background: var(--ink); color: var(--on-ink); }
.thread { display: flex; flex-direction: column; gap: 16px; }
.shots { display: flex; gap: 12px; flex-wrap: wrap; }
.shot { display: block; width: 132px; height: 240px; border-radius: 14px; background: var(--card); overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Team log */
.log { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 21px; }
.log:last-child { border-bottom: 0; }
.log time { width: 132px; flex: none; color: var(--sub); }
.log span { overflow-wrap: anywhere; }

/* Content */
.cols { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.cols > section { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.edit { display: flex; flex-direction: column; gap: 12px; padding: 12px 0 16px; border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------- Sign in */
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.signin form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 28px; }
.signin .top { display: flex; flex-direction: column; gap: 8px; }
.signin .eyebrow { font-size: 15px; font-weight: 600; color: var(--sub); }

/* ---------------------------------------------------------------- Dialog and toast */
dialog { border: 0; border-radius: 28px; padding: 28px; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog form { display: flex; flex-direction: column; gap: 20px; }
dialog h2 { font-size: 21px; line-height: 27px; font-weight: 700; }
dialog .actions { justify-content: flex-end; }
.picks { display: flex; flex-direction: column; }
.picks label { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 17px; cursor: pointer; }
.picks label:last-child { border-bottom: 0; }
.picks input { width: 20px; height: 20px; accent-color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 12px 20px; border-radius: 22px; font-size: 15px; font-weight: 500; max-width: calc(100vw - 32px); z-index: 10; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--danger); }

/* ---------------------------------------------------------------- Narrow screens */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .shell { flex-direction: column; flex-wrap: nowrap; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; max-width: none; flex: none; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
  .side .bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .side .brand { padding: 0; }
  .side .menu-btn { display: inline-flex; }
  .side:not(.open) .nav, .side:not(.open) .me { display: none; }
  .side.open .nav { padding-top: 12px; }
  .me { margin-top: 8px; }
  main.page { padding: 24px 16px 48px; gap: 28px; }
  .kpi .kv { font-size: 30px; line-height: 36px; }
  .split, .cols { gap: 28px; }
  .log { flex-direction: column; gap: 2px; }
  .log time { width: auto; }
  .bar { width: 72px; }
  .hide-sm { display: none; }
  td { overflow-wrap: break-word; }
  a.row { flex-wrap: wrap; gap: 2px 12px; padding: 12px 0; }
  a.row .sub { flex-basis: 100%; }
  th:first-child, td:first-child { padding-left: 12px; }
  .meter { width: 35%; }
}
