/* Admin page. Reuses the tokens and header from styles.css.
   Calm by default: one surface colour, plain numbers, colour only for a
   problem. */
html:has(body.admin), body.admin { height: auto; min-height: 100%; overflow: auto; }
body.admin a { color: var(--accent); }
body.admin .header-right a.ghost-btn { text-decoration: none; }
body.admin .header-right { flex-shrink: 1; flex-wrap: wrap; justify-content: flex-end; }

.admin-main { max-width: 1040px; margin: 0 auto; padding: 16px 24px 80px; height: auto; }
.admin-main > div > section, .admin-details { margin-top: 40px; }
.admin-main h2 { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.bad { color: var(--bad); }

.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; }
.admin-notice { margin-top: 24px; }
.admin-notice h2 { margin-bottom: 6px; }

/* Status: one sentence, then only what is wrong. */
.admin-status { margin-top: 24px; }
.status-headline { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.good { background: var(--good); }
.dot.bad { background: var(--bad); }
.checks { list-style: none; margin: 10px 0 4px; padding: 0 0 0 19px; display: grid; gap: 4px; font-size: 14px; }
.checks .problem { color: var(--bad); }

/* A strip of figures inside one surface, split by hairlines. */
.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
}
.figure { padding: 16px 18px; border-left: 1px solid var(--border); min-width: 0; }
.figure:first-child { border-left: 0; }
.figure-label { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.figure-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere; }
.figure-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.strip > p { padding: 16px 18px; margin: 0; }

.admin-details summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text); }
.admin-details summary::marker { color: var(--muted); }
.admin-details[open] summary { margin-bottom: 12px; }
.admin-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table.compact td, .admin-table.compact th { padding: 8px 12px; }
.admin-split .admin-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
code.ref { font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }

.admin-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.admin-filters label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.admin-filters label.grow { flex: 1 1 200px; }
.admin-filters select, .admin-filters input {
  font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 7px 10px;
}

.admin-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.admin-list li { padding: 12px 16px; font-size: 13.5px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.admin-list li:first-child { border-top: 0; }
.admin-list code { display: block; margin-top: 4px; }
.event-text { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: pre-wrap; }
.tag { font-size: 12px; font-weight: 500; color: var(--muted); }
.tag.error { color: var(--bad); }

/* Our fee */
.fee-now { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.fee-form { margin-top: 14px; }
.fee-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.fee-fields label { display: grid; gap: 6px; margin-top: 0; }
.fee-form button { width: auto; padding: 0 20px; justify-self: start; }
.fee-form button:disabled { opacity: 0.5; cursor: default; }
.fee-form [hidden] { display: none; }
.fee-log { margin-top: 16px; }

@media (max-width: 640px) {
  .admin-main { padding: 8px 16px 56px; }
  .admin-main > div > section, .admin-details { margin-top: 32px; }
  body.admin header { padding: 12px 16px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure { border-left: 0; border-top: 1px solid var(--border); }
  .figure:nth-child(2n) { border-left: 1px solid var(--border); }
  .figure:nth-child(-n+2) { border-top: 0; }
  .figure-value { font-size: 18px; }
  .status-headline { font-size: 19px; }
}
