/* ══════════════════════════════════════════════════════════════
   Pevra — Admin Panel
   Premium admin surface. Follows the app's design tokens (styles.css)
   so it tracks light/dark, with its own layout + components.
══════════════════════════════════════════════════════════════ */

html, body { overflow: auto !important; height: auto !important; overscroll-behavior: auto !important; }
body {
  background: var(--ink-1, #F6F1E9);
  color: var(--fg, #211C17);
  font-family: 'Geist', system-ui, sans-serif;
}
body:not(.admin-verified) { visibility: hidden; }

:root { --adm-accent: #E5552F; --adm-green: #2F9E6B; --adm-amber: #D98A2B; --adm-red: #D14545; }

/* ── Top bar ─────────────────────────────────────────────────── */
.adm-bar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ink-2, #FCFAF6) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line, rgba(33,28,23,.07));
  padding: 12px 22px; display: flex; align-items: center; gap: 14px;
}
.adm-logo {
  width: 30px; height: 30px; background: var(--adm-accent); border-radius: 9px;
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 4px 14px -4px rgba(229,85,47,.5);
}
.adm-bar h1 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 16px; font-weight: 600; }
.adm-updated { font-size: 11.5px; color: var(--fg-3, #8A8076); margin-left: auto; white-space: nowrap; }
.adm-updated .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--adm-green); margin-right: 5px; animation: admPulse 2.4s ease infinite; }
@keyframes admPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.adm-bar a, .adm-bar button.linkish {
  font-size: 13px; color: var(--fg-3, #8A8076); text-decoration: none; background: none;
  border: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; font-family: inherit;
  transition: background .15s, color .15s;
}
.adm-bar a:hover, .adm-bar button.linkish:hover { background: var(--line, rgba(33,28,23,.07)); color: var(--fg, #211C17); }

/* ── Customer plan preview ─────────────────────────────────── */
.plan-preview {
  display: grid; grid-template-columns: minmax(190px, .8fr) minmax(320px, 1.4fr) auto;
  align-items: center; gap: 22px; padding: 15px 22px 13px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--adm-accent) 9%, var(--ink-2, #FCFAF6)), var(--ink-2, #FCFAF6));
  border-bottom: 1px solid var(--line, rgba(33,28,23,.07));
}
.plan-preview-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.plan-preview-copy strong { font-family: 'Bricolage Grotesque', sans-serif; font-size: 13.5px; }
.plan-preview-copy span { color: var(--fg-3, #8A8076); font-size: 11.5px; line-height: 1.35; }
.plan-preview-control { min-width: 0; }
#plan-preview-slider { display: block; width: 100%; margin: 0; accent-color: var(--adm-accent); cursor: pointer; }
.plan-preview-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.plan-preview-labels span { width: 20%; text-align: center; color: var(--fg-3, #8A8076); font-size: 10.5px; }
.plan-preview-labels span:first-child { text-align: left; }
.plan-preview-labels span:last-child { text-align: right; }
.plan-preview-open { white-space: nowrap; padding: 8px 13px; }

/* ── Tabs ────────────────────────────────────────────────────── */
.adm-tabs {
  position: sticky; top: 55px; z-index: 40;
  display: flex; gap: 2px; padding: 0 20px;
  background: var(--ink-1, #F6F1E9);
  border-bottom: 1px solid var(--line, rgba(33,28,23,.07));
  overflow-x: auto;
}
.adm-tab {
  position: relative; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--fg-3, #8A8076);
  padding: 13px 16px; white-space: nowrap; transition: color .18s;
}
.adm-tab:hover { color: var(--fg-2, #5A5149); }
.adm-tab.active { color: var(--fg, #211C17); font-weight: 600; }
.adm-tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--adm-accent); border-radius: 2px; animation: admTabIn .25s var(--ease-out, ease);
}
@keyframes admTabIn { from { transform: scaleX(0); } }
.adm-tab .badge {
  display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px;
  border-radius: 8px; background: var(--adm-amber); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ── Body + panels ───────────────────────────────────────────── */
.adm-body { max-width: 1140px; margin: 0 auto; padding: 24px 20px 64px; }
.tab-panel { animation: admPanelIn .3s var(--ease-out, ease); }
.tab-panel.hidden { display: none; }
@keyframes admPanelIn { from { opacity: 0; transform: translateY(6px); } }

/* ── Stat tiles ──────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  background: var(--ink-2, #FCFAF6); border: 1px solid var(--line, rgba(33,28,23,.07));
  border-radius: 14px; padding: 17px 19px;
  transition: transform .2s var(--ease-out, ease), box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -14px rgba(33,28,23,.28); }
.stat-label { font-size: 11px; font-weight: 500; color: var(--fg-3, #8A8076); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 7px; }
.stat-val { font-family: 'Bricolage Grotesque', sans-serif; font-size: 27px; font-weight: 700; line-height: 1; }
.stat-sub { font-size: 11.5px; color: var(--fg-3, #8A8076); margin-top: 5px; }
.ember { color: var(--adm-accent); } .green { color: var(--adm-green); } .amber { color: var(--adm-amber); }

/* ── Section + cards ─────────────────────────────────────────── */
.section { margin-bottom: 26px; }
.section h2 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.section h2 .muted { font-size: 12px; font-weight: 400; color: var(--fg-3); }
.card, .tbl-wrap {
  background: var(--ink-2, #FCFAF6); border: 1px solid var(--line, rgba(33,28,23,.07));
  border-radius: 14px; overflow: hidden;
}
.tbl-wrap { overflow-x: auto; }
.card-pad { padding: 18px 20px; }

/* ── Tables ──────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 11px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fg-3, #8A8076); background: var(--ink-1, #F6F1E9);
  border-bottom: 1px solid var(--line, rgba(33,28,23,.07)); text-align: left; white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line, rgba(33,28,23,.07)); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--ink-1, #F6F1E9); }
.cell-name { font-weight: 500; }
.cell-sub { font-size: 11px; color: var(--fg-3, #8A8076); }
.num { font-variant-numeric: tabular-nums; }
.cost { color: var(--adm-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.empty-cell { text-align: center; color: var(--fg-3); padding: 24px; }

/* ── Cost-by-model bars ──────────────────────────────────────── */
.model-bar-track { height: 6px; border-radius: 3px; background: var(--line-2, rgba(33,28,23,.10)); overflow: hidden; min-width: 90px; }
.model-bar-fill { height: 100%; border-radius: 3px; background: var(--adm-accent); transition: width .5s var(--ease-out, ease); }
.model-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }

/* ── Tags ────────────────────────────────────────────────────── */
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.tag-ok  { background: rgba(47,158,107,.12); color: var(--adm-green); }
.tag-warn { background: rgba(217,138,43,.12); color: var(--adm-amber); }
.tag-off { background: rgba(33,28,23,.08); color: var(--fg-3, #8A8076); }
.tag-adm { background: rgba(229,85,47,.12); color: var(--adm-accent); }
.tag-plus { background: linear-gradient(135deg, rgba(229,85,47,.18), rgba(217,138,43,.18)); color: var(--adm-accent); border: 1px solid rgba(229,85,47,.3); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; border: 1px solid transparent; transition: all .15s; }
.btn:active { transform: scale(.96); }
.btn-p { background: var(--adm-accent); color: #fff; }
.btn-p:hover { background: #C8431F; }
.btn-g { background: none; border-color: var(--line-2, rgba(33,28,23,.12)); color: var(--fg-2, #5A5149); }
.btn-g:hover { background: var(--line, rgba(33,28,23,.07)); }
.btn-r { background: none; border-color: rgba(209,69,69,.25); color: var(--adm-red); }
.btn-r:hover { background: rgba(209,69,69,.07); }
.btn-row { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Inputs ──────────────────────────────────────────────────── */
.inp {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-2, rgba(33,28,23,.12));
  border-radius: 9px; font-family: inherit; font-size: 13px; color: var(--fg);
  background: var(--ink-1, #F6F1E9); outline: none; transition: border-color .15s;
}
.inp:focus { border-color: var(--adm-accent); }
.field-label { font-size: 12px; font-weight: 500; color: var(--fg-2, #5A5149); display: block; }
.field-label .inp, .field-label textarea.inp { margin-top: 5px; }
textarea.inp { resize: vertical; }

/* ── Usage mini bar ──────────────────────────────────────────── */
.ubar { display: flex; align-items: center; gap: 6px; }
.ubar-track { width: 64px; height: 4px; background: var(--line-2, rgba(33,28,23,.12)); border-radius: 2px; flex-shrink: 0; }
.ubar-fill { height: 100%; border-radius: 2px; }
.ubar-lbl { font-size: 11.5px; color: var(--fg-3, #8A8076); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Pevra toggle ─────────────────────────────────────────────── */
.pevra-toggle-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pevra-dot { width: 10px; height: 10px; border-radius: 50%; background: #aaa; flex-shrink: 0; }
.pevra-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.pevra-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.pevra-track { position: absolute; inset: 0; border-radius: 12px; background: var(--line-2, rgba(33,28,23,.12)); transition: background .2s; cursor: pointer; }
.pevra-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; cursor: pointer; }
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }

/* ── Messaging ───────────────────────────────────────────────── */
.msg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.msg-col { display: flex; flex-direction: column; gap: 12px; }
.seg { display: flex; gap: 6px; margin-top: 6px; }
.seg-btn { font-size: 12px; padding: 6px 13px; border-radius: 8px; border: 1px solid var(--line-2, rgba(33,28,23,.12)); background: none; color: var(--fg-2); cursor: pointer; font-family: inherit; transition: all .15s; }
.seg-btn.active { background: var(--adm-accent); color: #fff; border-color: var(--adm-accent); }
.msg-user-list { max-height: 160px; overflow-y: auto; border: 1px solid var(--line-2, rgba(33,28,23,.12)); border-radius: 10px; background: var(--ink-1, #F6F1E9); }
.msg-user-list label { display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line, rgba(33,28,23,.06)); font-size: 12.5px; }
.msg-user-list input { accent-color: var(--adm-accent); width: 14px; height: 14px; flex-shrink: 0; }
.msg-hist { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.msg-item { background: var(--ink-1, #F6F1E9); border: 1px solid var(--line, rgba(33,28,23,.07)); border-radius: 10px; padding: 10px 12px; }
.msg-item .mi-title { font-weight: 600; font-size: 13px; }
.msg-item .mi-body { font-size: 12px; color: var(--fg-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item .mi-meta { font-size: 11px; color: var(--fg-4, #B4A99C); margin-top: 4px; }
.msg-item .mi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

/* ── Modal ───────────────────────────────────────────────────── */
#modal-bg { display: none; position: fixed; inset: 0; z-index: 999; background: rgba(33,28,23,.42); backdrop-filter: blur(6px); padding: 24px; overflow-y: auto; }
#modal-bg.open { display: flex; align-items: flex-start; justify-content: center; animation: admFade .2s ease; }
@keyframes admFade { from { opacity: 0; } }
#modal-box { background: var(--ink-2, #FCFAF6); border: 1px solid var(--line, rgba(33,28,23,.07)); border-radius: 18px; width: 100%; max-width: 680px; overflow: hidden; box-shadow: 0 30px 70px rgba(33,28,23,.28); animation: admModalIn .28s var(--ease-spring, cubic-bezier(.34,1.56,.64,1)); }
@keyframes admModalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
#modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line, rgba(33,28,23,.07)); gap: 10px; }
#modal-back { display: none; background: none; border: none; cursor: pointer; font-size: 13px; color: var(--fg-3, #8A8076); padding: 4px 8px; border-radius: 6px; font-family: inherit; }
#modal-back:hover { background: var(--line, rgba(33,28,23,.07)); }
#modal-title { flex: 1; font-size: 14px; font-weight: 600; }
#modal-x { background: none; border: none; cursor: pointer; font-size: 22px; color: var(--fg-3); line-height: 1; padding: 2px; }
#modal-x:hover { color: var(--fg); }
#modal-body { padding: 20px; max-height: calc(100vh - 160px); overflow-y: auto; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ── Toast ───────────────────────────────────────────────────── */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #211C17; color: #F4EEE4; padding: 9px 18px; border-radius: 99px; font-size: 13.5px; box-shadow: 0 8px 32px rgba(0,0,0,.22); animation: t-in .22s ease; }
.toast.err { background: var(--adm-red); }
.toast.ok  { background: var(--adm-green); }
@keyframes t-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 640px) {
  .plan-preview { grid-template-columns: 1fr auto; gap: 12px; padding: 13px 16px; }
  .plan-preview-copy { grid-column: 1 / -1; }
  .plan-preview-control { min-width: 0; }
  .plan-preview-open { align-self: end; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .adm-body { padding: 18px 12px 52px; }
  .msg-grid { grid-template-columns: 1fr; }
  .adm-updated { display: none; }
}

/* ═══ User detail drawer ═══ */
.uds { display: flex; flex-direction: column; gap: 14px; }
.uds-sec { border: 1px solid var(--line-2, #e6ddd0); border-radius: 12px; padding: 12px 14px; background: var(--card-bg, rgba(0,0,0,.015)); }
.uds-h { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.uds-badge { font-size: 9.5px; font-weight: 600; letter-spacing: .02em; text-transform: none; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--adm-accent, #b5652f) 16%, transparent); color: var(--adm-accent, #b5652f); }
.uds-badge-ro { background: rgba(120,120,120,.16); color: var(--fg-3); }
.uds-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line-3, #eee6d9); }
.uds-row:last-child { border-bottom: none; }
.uds-row > span { color: var(--fg-3); }
.uds-row > b { color: var(--fg); font-weight: 600; text-align: right; }
.uds-ig { padding: 9px 0; border-bottom: 1px solid var(--line-3, #eee6d9); }
.uds-ig:last-child { border-bottom: none; }
.uds-ig-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.uds-ig-acc { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.uds-scopes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.uds-scope { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: rgba(120,120,120,.13); color: var(--fg-2, #555); }
.uds-tone { font-size: 12.5px; color: var(--fg); background: rgba(120,120,120,.08); border-radius: 8px; padding: 8px 10px; margin-top: 4px; white-space: pre-wrap; }
.uds-note { font-size: 11px; color: var(--fg-3); margin-top: 10px; line-height: 1.5; padding-top: 9px; border-top: 1px solid var(--line-3, #eee6d9); }
.uds-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-top: 10px; }
.uds-stat { text-align: center; padding: 9px 4px; border-radius: 10px; background: rgba(120,120,120,.07); }
.uds-stat b { display: block; font-size: 17px; font-weight: 800; color: var(--fg); }
.uds-stat span { font-size: 10px; color: var(--fg-3); text-transform: capitalize; }
.uds-spark { display: flex; align-items: flex-end; gap: 3px; height: 38px; padding: 2px 0; }
.uds-bar { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.uds-bar > span { width: 100%; max-width: 14px; background: var(--adm-accent, #b5652f); border-radius: 3px 3px 0 0; opacity: .82; display: block; }

/* editable notification toggles in the detail drawer */
.uds-sw { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.uds-sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.uds-sw-t { position: absolute; inset: 0; background: rgba(120,120,120,.35); border-radius: 999px; transition: background .18s; }
.uds-sw-t::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.uds-sw input:checked + .uds-sw-t { background: var(--adm-accent, #b5652f); }
.uds-sw input:checked + .uds-sw-t::before { transform: translateX(16px); }
.uds-hour { width: 54px; text-align: center; padding: 4px 6px; border: 1px solid var(--line-2, #e6ddd0); border-radius: 8px; background: var(--card-bg, #fff); color: var(--fg); font-size: 13px; }
.uds-hour-suffix { color: var(--fg-3); font-size: 12px; margin-left: -6px; }
.tag-pwa { background: color-mix(in srgb, var(--adm-accent, #b5652f) 14%, transparent); }

/* Recent conversation titles (admin detail drawer) */
.uds-convs summary { cursor: pointer; font-size: 12.5px; color: var(--adm-accent, #b5652f); font-weight: 600; padding: 4px 0; list-style: revert; }
.uds-convs summary::-webkit-details-marker { color: var(--adm-accent, #b5652f); }
.uds-conv-list { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.uds-conv { display: flex; flex-direction: column; gap: 1px; padding: 7px 0; border-bottom: 1px solid var(--line-3, #eee6d9); }
.uds-conv:last-child { border-bottom: none; }
.uds-conv-t { font-size: 13px; color: var(--fg); }
.uds-conv-m { font-size: 10.5px; color: var(--fg-3); }

/* Redacted conversation viewer */
.uds-conv { cursor: pointer; border-radius: 8px; transition: background .12s; }
.uds-conv:hover { background: color-mix(in srgb, var(--adm-accent, #b5652f) 8%, transparent); }
.uds-conv-open { font-size: 10.5px; color: var(--adm-accent, #b5652f); opacity: 0; transition: opacity .12s; }
.uds-conv:hover .uds-conv-open { opacity: 1; }
.cvw-banner { font-size: 11.5px; color: var(--fg-2, #6a5c4a); background: color-mix(in srgb, var(--adm-accent, #b5652f) 12%, transparent);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.cvw-list { display: flex; flex-direction: column; gap: 10px; }
.cvw-msg { padding: 9px 12px; border-radius: 12px; max-width: 88%; }
.cvw-user { align-self: flex-end; background: color-mix(in srgb, var(--adm-accent, #b5652f) 12%, var(--card-bg, #f3ece1)); }
.cvw-bot { align-self: flex-start; background: rgba(120,120,120,.09); }
.cvw-role { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); margin-bottom: 3px; }
.cvw-body { font-size: 13.5px; color: var(--fg); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.cvw-hidden { font-size: 12.5px; color: var(--fg-3); font-style: italic; }

/* Rendered markdown inside the conversation viewer */
.cvw-body .cvw-h { font-size: 14px; font-weight: 700; margin: 10px 0 4px; color: var(--fg); }
.cvw-body h1.cvw-h, .cvw-body h2.cvw-h { font-size: 15px; }
.cvw-body p { margin: 0 0 7px; }
.cvw-body ul, .cvw-body ol { margin: 4px 0 8px; padding-left: 20px; }
.cvw-body li { margin-bottom: 3px; }
.cvw-body code { font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  background: rgba(120,120,120,.14); padding: 1px 5px; border-radius: 4px; }
.cvw-pre { font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.5;
  background: rgba(120,120,120,.12); padding: 10px 12px; border-radius: 8px;
  overflow-x: auto; margin: 8px 0; white-space: pre; }
.cvw-table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12.5px; display: block; overflow-x: auto; }
.cvw-table th, .cvw-table td { border: 1px solid var(--line-3, #e6ddd0); padding: 6px 9px; text-align: left; }
.cvw-table th { background: rgba(120,120,120,.10); font-weight: 700; }

/* Failures panel */
.err-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 5px 11px; border-radius: 999px; background: rgba(209,69,69,.12);
  color: var(--adm-red, #d14545); border: 1px solid rgba(209,69,69,.25); }
.err-chip b { font-weight: 700; }
.err-row { display: flex; align-items: baseline; gap: 9px; font-size: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--line-3, #eee6d9); }
.err-row:last-child { border-bottom: none; }
.err-src { font-weight: 700; color: var(--adm-red, #d14545); flex: 0 0 auto; }
.err-msg { color: var(--fg-2); flex: 1; min-width: 0; word-break: break-word; line-height: 1.45; }
.err-at { color: var(--fg-3); font-size: 11px; flex: 0 0 auto; }

/* Image generation test */
.img-err { font-size: 12.5px; color: var(--adm-red, #d14545); background: rgba(209,69,69,.08);
  border-radius: 8px; padding: 9px 11px; line-height: 1.5; word-break: break-word; }
.img-hint { font-size: 12.5px; color: var(--fg-2); margin-top: 8px; line-height: 1.55; }
.img-hint code { background: rgba(120,120,120,.16); padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.img-models { font-size: 11.5px; color: var(--fg-3); margin-top: 9px; line-height: 1.5; }

/* Admin user notes & key dates */
.uds-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.uds-nf { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.uds-nf .inp { text-transform: none; letter-spacing: normal; font-weight: 400;
  font-size: 13px; color: var(--fg); }
.uds-nf textarea.inp { resize: vertical; line-height: 1.5; }
.uds-nrow { display: flex; align-items: center; gap: 12px; margin-top: 11px; }
.uds-next { font-size: 12px; color: var(--adm-accent, #b5652f); font-weight: 600; }

/* ══ Needs you ═══════════════════════════════════════════════════
   The point of the Today tab. One row per thing, sorted by nothing
   cleverer than being a real problem; tapping it goes where the thing
   lives. Empty is the good outcome and reads like one — an empty list
   with no message looks like a panel that failed to load. */
#attention-list { display: flex; flex-direction: column; gap: 8px; }
.att-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 15px; border-radius: 13px; cursor: pointer; font-family: inherit;
  background: var(--ink-2, #FCFAF6); border: 1px solid var(--line-3, rgba(33,28,23,.12));
  border-left-width: 3px; transition: transform .1s, border-color .15s, background .15s;
}
.att-row:hover { border-color: var(--adm-accent); }
.att-row:active { transform: scale(.995); }
.att-row.att-red   { border-left-color: var(--adm-red); }
.att-row.att-amber { border-left-color: var(--adm-amber); }
.att-n {
  flex: none; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
  background: var(--line, rgba(33,28,23,.07)); color: var(--fg, #211C17);
  font-variant-numeric: tabular-nums;
}
.att-red .att-n   { background: color-mix(in srgb, var(--adm-red) 14%, transparent);   color: var(--adm-red); }
.att-amber .att-n { background: color-mix(in srgb, var(--adm-amber) 16%, transparent); color: var(--adm-amber); }
.att-text { flex: 1; font-size: 13.5px; line-height: 1.4; color: var(--fg, #211C17); }
.att-cta { flex: none; font-size: 12px; font-weight: 600; color: var(--fg-3, #8A8076); white-space: nowrap; }
.att-row:hover .att-cta { color: var(--adm-accent); }
.att-empty {
  padding: 18px 16px; border-radius: 13px; font-size: 13.5px; color: var(--fg-3, #8A8076);
  background: var(--ink-2, #FCFAF6); border: 1px solid var(--line, rgba(33,28,23,.07));
  display: flex; align-items: center; gap: 10px;
}
.att-ok {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--adm-green) 15%, transparent);
  color: var(--adm-green); font-size: 12px; font-weight: 700;
}
.adm-tab .badge { margin-left: 6px; }

/* Jonas — inherits the admin palette and typography. */
.jonas-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:30px;
  border-radius:22px; margin-bottom:14px; color:#f9f6f0; overflow:hidden; position:relative;
  background:radial-gradient(circle at 86% 20%,rgba(91,199,164,.18),transparent 30%),linear-gradient(135deg,#12151a,#292e38); box-shadow:0 18px 45px rgba(10,14,20,.18); }
.jonas-hero:after{content:"";position:absolute;inset:auto -80px -130px auto;width:260px;height:260px;border:1px solid rgba(255,255,255,.08);border-radius:50%;pointer-events:none}
.jonas-hero h2 { font-size:32px; margin:2px 0 5px; }.jonas-hero p{margin:0;color:#c6cbd3}.jonas-kicker{text-transform:uppercase;letter-spacing:.12em;font-size:10px;color:#9da7b6}
.jonas-build{margin-top:9px;font-size:10px;color:#7f8997;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.jonas-orb { width:58px;height:58px;border-radius:50%;flex:none;background:radial-gradient(circle at 35% 30%,#9ca9b8,#44505e 38%,#15191f 70%);box-shadow:0 0 0 8px rgba(255,255,255,.04) }
.jonas-orb.online { background:radial-gradient(circle at 35% 30%,#d9f5ea,#4db58d 38%,#173b31 72%);box-shadow:0 0 22px rgba(77,181,141,.4),0 0 0 8px rgba(255,255,255,.04) }
.jonas-status-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-bottom:20px}.jonas-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(260px,.8fr);gap:18px}
.jonas-conversation{min-width:0}.jonas-chat{height:330px;overflow-y:auto;display:flex;flex-direction:column;gap:9px;padding:16px;border:1px solid var(--line-3);border-radius:16px;background:linear-gradient(180deg,var(--ink-2),color-mix(in srgb,var(--ink-2) 88%,var(--adm-accent) 4%));scrollbar-gutter:stable}
.jonas-msg{max-width:82%;padding:10px 13px;border-radius:13px;font-size:13.5px;line-height:1.5;white-space:pre-wrap}.jonas-msg.assistant{background:rgba(100,110,125,.12);align-self:flex-start}.jonas-msg.owner{background:var(--adm-accent);color:white;align-self:flex-end}
.jonas-compose{display:flex;align-items:flex-end;gap:8px;margin-top:9px}.jonas-compose textarea{flex:1;resize:none}.jonas-mic{font-size:17px}.jonas-speak{display:block;margin-top:8px;font-size:11.5px;color:var(--fg-3)}
.jonas-list{display:flex;flex-direction:column;gap:7px}.jonas-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line-3);border-radius:10px;background:var(--ink-2);border-left:3px solid #7d8794}.jonas-item b{font-size:12.5px}.jonas-item span{font-size:11.5px;color:var(--fg-3);margin-left:auto}.jonas-item.severity-error,.jonas-item.severity-critical{border-left-color:var(--adm-red)}.jonas-item.severity-warning,.jonas-item.severity-degraded{border-left-color:var(--adm-amber)}
.jonas-away-state{font-weight:650;margin-bottom:12px}.jonas-away-actions{display:flex;gap:8px;flex-wrap:wrap}
.jonas-command-strip{display:flex;gap:7px;overflow-x:auto;padding:10px 1px 2px;scrollbar-width:none}.jonas-command-strip::-webkit-scrollbar{display:none}.jonas-command-strip button,.jonas-try button{white-space:nowrap;border:1px solid var(--line-3);background:var(--ink-2);color:var(--fg-2);border-radius:999px;padding:7px 11px;font-family:inherit;font-size:11px;font-weight:600;cursor:pointer}.jonas-command-strip button:hover,.jonas-try button:hover{border-color:color-mix(in srgb,var(--adm-accent) 55%,var(--line-3));color:var(--adm-accent)}
.jonas-control-intro{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 14px;margin-bottom:12px;border-radius:12px;background:color-mix(in srgb,var(--adm-accent) 7%,var(--ink-2));border:1px solid color-mix(in srgb,var(--adm-accent) 20%,var(--line-3))}.jonas-control-intro b{display:block;font-size:12.5px}.jonas-control-intro span{display:block;color:var(--fg-3);font-size:11px;margin-top:2px}.jonas-safety-pill{flex:none!important;margin:0!important;padding:5px 9px;border-radius:999px;background:color-mix(in srgb,var(--adm-green) 13%,transparent);color:var(--adm-green)!important;font-weight:700}

/* ══ The users table on a phone ══════════════════════════════════
   Seven buttons per row in a horizontally-scrolling table is not a
   thing anyone can use one-handed. Below the fold-out width each row
   becomes a card, and the actions wrap instead of running off the
   side of the screen. */
@media (max-width: 720px) {
  .jonas-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.jonas-layout{grid-template-columns:1fr}.jonas-hero{padding:22px}.jonas-msg{max-width:90%}.jonas-control-intro{align-items:flex-start;flex-direction:column}.jonas-safety-pill{align-self:flex-start}
  .tbl-wrap table, .tbl-wrap thead, .tbl-wrap tbody,
  .tbl-wrap th, .tbl-wrap td, .tbl-wrap tr { display: block; width: 100%; }
  .tbl-wrap thead { display: none; }
  .tbl-wrap tbody tr {
    border: 1px solid var(--line-3, rgba(33,28,23,.12)); border-radius: 13px;
    padding: 12px 14px; margin-bottom: 10px; background: var(--ink-2, #FCFAF6);
  }
  .tbl-wrap td { border: 0 !important; padding: 3px 0 !important; }
  .tbl-wrap td[data-l]::before {
    content: attr(data-l); display: block; font-size: 10.5px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3, #8A8076);
    margin-bottom: 2px;
  }
  .tbl-wrap td.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .tbl-wrap td.btn-row .btn { flex: 1 1 auto; min-width: 92px; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width:721px) and (max-width:1050px){.jonas-status-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Jonas controls, permissions and memory — same palette, no new primitives. */
.jonas-banner{padding:11px 14px;border-radius:11px;margin-bottom:14px;font-size:13px;font-weight:600;background:rgba(214,158,46,.14);border:1px solid rgba(214,158,46,.4)}
.jonas-banner.paused{background:rgba(200,70,70,.14);border-color:rgba(200,70,70,.45)}
.jonas-steps{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;min-height:0}
.jonas-step{font-size:11px;padding:3px 9px;border-radius:99px;background:rgba(100,110,125,.14);color:var(--fg-3)}
.jonas-speak{display:flex;flex-wrap:wrap;gap:14px;align-items:center;margin-top:9px;font-size:11.5px;color:var(--fg-3)}
.jonas-speak label{display:flex;align-items:center;gap:5px}
.jonas-controls{display:flex;flex-direction:column;gap:12px}
.jonas-control-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.jonas-control-row small{display:block;color:var(--fg-3);font-size:11px;margin-top:2px}
.jonas-control-row select{max-width:150px}
.jonas-toggle{display:flex;align-items:center;gap:6px;font-size:12.5px}
.jonas-task-add{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.jonas-task-add input{flex:1;min-width:180px}
.jonas-task-add select{max-width:150px}
.jonas-perms{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
.jonas-perm{padding:10px 12px;border:1px solid var(--line-3);border-radius:10px;background:var(--ink-2)}
.jonas-perm b{display:block;font-size:12.5px;text-transform:capitalize}
.jonas-perm select{width:100%;margin-top:6px}
.jonas-perm .suspended{display:block;font-size:10.5px;color:var(--adm-amber);margin-top:4px}
.jonas-folders{margin-top:18px;border-top:1px solid var(--line);padding-top:14px}
.jonas-connectors{margin-top:14px;font-size:12px;color:var(--fg-3);display:flex;flex-direction:column;gap:4px}
.jonas-memory-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.jonas-item small{display:block;color:var(--fg-3);font-size:11px;font-weight:400}
.jonas-item .btn{margin-left:8px}
@media (max-width:720px){.jonas-control-row{flex-direction:column;align-items:stretch}.jonas-control-row select{max-width:none}.jonas-perms{grid-template-columns:1fr}}

/* Mac control test panel — an operational trace, not a chat log. */
.jonas-try{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}
.jonas-try button{font-size:11.5px;padding:5px 10px;border-radius:99px;border:1px solid var(--line-3);background:var(--ink-2);color:var(--fg-2);cursor:pointer}
.jonas-try button:hover{border-color:var(--adm-accent);color:var(--fg-1)}
.jonas-trace{margin-top:12px;display:flex;flex-direction:column;gap:0;font-size:12px}
.jonas-trace .row{display:flex;align-items:flex-start;gap:9px;padding:6px 0;border-bottom:1px solid var(--line-3)}
.jonas-trace .row:last-child{border-bottom:0}
.jonas-trace .dot{width:7px;height:7px;border-radius:50%;flex:none;margin-top:5px;background:var(--fg-3)}
.jonas-trace .row.ok .dot{background:#4db58d}
.jonas-trace .row.err .dot{background:var(--adm-red)}
.jonas-trace .row.run .dot{background:var(--adm-amber)}
.jonas-trace .what{font-weight:600}
.jonas-trace .detail{color:var(--fg-3);font-weight:400;margin-left:6px;font-size:11.5px}
.jonas-trace pre{margin:6px 0 0;padding:9px 11px;border-radius:9px;background:var(--ink-2);border:1px solid var(--line-3);max-height:220px;overflow:auto;font-size:11px;white-space:pre-wrap}
.jonas-perm-missing{border-left:3px solid var(--adm-amber)}
