/* Admin area. Uses the color and type tokens from /style.css. */
.admin { padding-block: clamp(1.5rem, 4vw, 3rem); min-height: 60vh; }
.muted { color: var(--muted); }
.btn.small { padding: 0.45rem 0.85rem; font-size: 0.9rem; white-space: nowrap; }
button.btn { font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
button.btn:disabled { opacity: 0.6; cursor: wait; }
button.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.btn.danger { background: transparent; color: #b3261e; border-color: #b3261e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #ff8a80; border-color: #ff8a80; } }
:root[data-theme="dark"] .btn.danger { color: #ff8a80; border-color: #ff8a80; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(1.2rem, 3vw, 2rem); max-width: 34rem; margin-inline: auto; }
.panel h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 700; margin-top: 0.6rem; }
.panel p { color: var(--muted); margin-top: 0.8rem; }
.panel .eyebrow { display: block; }

form.stack { display: grid; gap: 0.35rem; margin-top: 1.2rem; }
form.stack label { font-weight: 600; font-size: 0.95rem; margin-top: 0.7rem; }
form.stack label small { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 0.8rem;
}
textarea { resize: vertical; min-height: 7rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
form.stack .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; align-items: center; }
.msg { margin-top: 0.9rem; font-size: 0.95rem; min-height: 1.2em; }
.msg.error { color: #b3261e; }
.msg.ok { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.error { color: #ff8a80; } }
:root[data-theme="dark"] .msg.error { color: #ff8a80; }

/* Dashboard */
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.5rem; }
.dash-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.4rem; border-bottom: 1px solid var(--line); }
.tabs button { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 3px solid transparent; padding: 0.6rem 0.9rem; color: var(--muted); cursor: pointer; }
.tabs button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font-family: var(--font-mono); font-size: 0.75rem; margin-left: 0.35rem; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0.05rem 0.5rem; }
.view { margin-top: 1.6rem; display: grid; gap: 1.4rem; }
.view h2 { font-size: 1.4rem; font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; min-width: 0; }
.card .n { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.card .l { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }

.mlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mlist li { border-bottom: 1px solid var(--line); }
.mlist button.mrow { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 0.8rem minmax(0, 1fr) auto; gap: 0.2rem 0.9rem; align-items: baseline; width: 100%; padding: 0.9rem 0.3rem; cursor: pointer; }
.mlist button.mrow:hover { background: var(--surface); }
.mlist button.mrow:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.mlist .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; }
.mlist .dot.read { background: transparent; }
.mlist .who { font-weight: 600; }
.mlist .who span { font-weight: 400; color: var(--muted); margin-left: 0.5rem; overflow-wrap: anywhere; }
.mlist .when { color: var(--muted); font-size: 0.85rem; font-family: var(--font-mono); }
.mlist .prev { grid-column: 2 / 4; color: var(--muted); font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 1.2rem 0; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table.q { width: 100%; border-collapse: collapse; min-width: 34rem; }
table.q th, table.q td { text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); }
table.q th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
table.q tr:last-child td { border-bottom: 0; }
table.q td.num { font-variant-numeric: tabular-nums; text-align: right; }
table.q th.num { text-align: right; }
table.q button.link { font-weight: 600; }
.pill { display: inline-block; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.65rem; }
.pill.Accepted { border-color: var(--accent); color: var(--accent); }

.detail { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(1rem, 3vw, 1.6rem); display: grid; gap: 1rem; }
.detail dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.4rem 1.2rem; margin: 0; }
.detail dt { color: var(--muted); font-size: 0.9rem; }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.detail .body { white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid var(--line); padding-top: 1rem; }
.detail .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.detail form.stack { margin-top: 0; max-width: 34rem; }

.appframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; color: var(--muted); }
.note b { color: var(--ink); }

@media (max-width: 520px) { table.q .hide-s { display: none; } table.q { min-width: 0; } }
