/* Administration only. The public classic chat is rendered separately by Go. */
:root {
    color-scheme: light;
    --bg: #f3f5f7;
    --paper: #fff;
    --text: #172633;
    --muted: #526575;
    --border: #cbd5df;
    --accent: #12675e;
    --accent-dark: #0b5049;
    --danger: #9c2531;
    --radius: 8px;
}
*, *::before, *::after { box-sizing: border-box; }
body.admin-page { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
.admin-shell { width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px clamp(12px, 3vw, 40px) 48px; min-width: 0; }
.admin-compact .admin-shell { max-width: 460px; margin: clamp(24px, 10vh, 90px) auto 24px; padding: 28px; background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -.015em; overflow-wrap: anywhere; }
h1 { font-size: 29px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid #087f72; outline-offset: 3px; }
.eyebrow { margin: 0 0 5px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .10em; color: var(--accent-dark); }
.auth-heading { margin-bottom: 24px; }
.dashboard-header, .section-heading, .subheading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dashboard-header { margin-bottom: 18px; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.account-name { font-weight: 650; overflow-wrap: anywhere; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: #e5ebef; border-radius: var(--radius); margin-bottom: 20px; }
.tabs a { padding: 9px 16px; text-decoration: none; border-radius: 5px; font-weight: 600; color: #344958; }
.tabs a:hover { background: #f7fafb; }
.tabs a[aria-current="page"] { color: #fff; background: var(--accent); }
.panel { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(12px, 2vw, 24px); margin-bottom: 18px; min-width: 0; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.narrow-panel { max-width: 640px; }
.section-heading { margin-bottom: 18px; }
.subheading { border-top: 1px solid var(--border); padding-top: 16px; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
form { margin: 0; min-width: 0; }
.form-stack { display: grid; gap: 14px; margin-top: 16px; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; min-width: 0; max-width: 100%; }
.field { display: grid; gap: 5px; font-size: 14px; font-weight: 600; min-width: 0; }
.field span { overflow-wrap: anywhere; }
input:not([type="hidden"]), select, button, .button { font: inherit; }
input:not([type="hidden"]), select { border: 1px solid #9eafbd; border-radius: 5px; background: #fff; color: var(--text); padding: 8px 10px; min-height: 40px; width: 100%; min-width: 0; max-width: 100%; }
.toolbar .field { flex: 1 1 220px; min-width: 0; }
.toolbar select { width: min(100%, 340px); }
button, .button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 5px; min-height: 40px; padding: 8px 13px; text-decoration: none; font-weight: 600; cursor: pointer; white-space: nowrap; }
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { color: #233b4b; background: #fff; border-color: #a6b5c1; }
.secondary:hover { background: #edf2f5; }
.danger { background: var(--danger); color: #fff; }
.danger:hover { background: #7d1723; }
.danger-outline { background: #fff; color: var(--danger); border-color: #cb9da2; }
.danger-outline:hover { background: #fbecee; }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; min-width: 650px; }
.data-table th { background: #eaf0f3; color: #344958; font-weight: 650; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 12px; vertical-align: top; border-bottom: 1px solid #dce3e8; overflow-wrap: anywhere; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:nth-child(even) { background: #f8fafb; }
.data-table tbody tr:hover { background: #edf6f4; }
.chat-table { min-width: 980px; table-layout: fixed; }
.chat-table th:nth-child(1) { width: 6%; }
.chat-table th:nth-child(2) { width: 12%; }
.chat-table th:nth-child(3) { width: 13%; }
.chat-table th:nth-child(5) { width: 13%; }
.chat-table th:nth-child(6) { width: 260px; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.username { font-weight: 600; }
.numeric, .timestamp, .ip-address { font-variant-numeric: tabular-nums; }
.timestamp, .ip-address { color: #405667; }
.metadata { max-width: 560px; }
.metadata code, pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: 13px; }
.row-action { display: grid; grid-template-columns: minmax(0, 1fr) 88px; align-items: center; gap: 5px; }
.row-action + .row-action { margin-top: 6px; }
.row-action input, .row-action button { min-height: 34px; font-size: 13px; padding: 5px 7px; }
.pill { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 650; color: #405667; background: #e8edf1; border-radius: 999px; }
.pill.active { color: #14594d; background: #dcefe9; }
.deleted-row .message-body { color: var(--muted); }
.empty { text-align: center; padding: 30px 12px !important; color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 14px; }
.notice { padding: 12px; border-radius: 5px; background: #eef3f7; color: #344958; margin: 12px 0; }
.notice.warning { background: #fff1d9; color: #6c440a; }
.notice.error { background: #fbecee; color: #84202a; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: absolute; left: 12px; top: 12px; z-index: 10; background: #fff; padding: 10px; }
@media (max-width: 720px) {
    .admin-shell { padding: 14px 12px 24px; }
    .admin-compact .admin-shell { width: calc(100% - 24px); padding: 20px; }
    .panel-grid { grid-template-columns: 1fr; gap: 0; }
    .tabs a { flex: 1 1 auto; text-align: center; padding: 9px 12px; }
    .toolbar { width: 100%; }
    .toolbar select { width: 100%; }
    .account { width: 100%; }
}
