/* ============================================================
   GLIIMU ADMIN — self-contained stylesheet.
   Tokens match the member app's design system so the two feel
   like the same product, but nothing is imported from public/:
   this bundle deploys to its own origin.
   ============================================================ */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-xl: 1rem;
  --radius-full: 9999px;
  --transition: 180ms cubic-bezier(.4, 0, .2, 1);
}

:root, [data-theme="light"] {
  --bg-primary: #FFFFFF; --bg-secondary: #F8FAFC; --bg-tertiary: #F1F5F9;
  --surface: #FFFFFF; --surface-hover: #F8FAFC;
  --text-primary: #0F172A; --text-secondary: #475569; --text-muted: #94A3B8;
  --brand-primary: #6366F1; --brand-hover: #4F46E5; --brand-light: #EEF2FF;
  --success: #10B981; --success-light: #D1FAE5; --success-text: #065F46;
  --warning: #F59E0B; --warning-light: #FEF3C7; --warning-text: #92400E;
  --error: #EF4444; --error-light: #FEE2E2; --error-text: #991B1B;
  --info: #3B82F6; --info-light: #DBEAFE; --info-text: #1E40AF;
  --border: #E2E8F0; --border-strong: #CBD5E1;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .1);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .12);
}

[data-theme="dark"] {
  --bg-primary: #0A0F1E; --bg-secondary: #111827; --bg-tertiary: #1E293B;
  --surface: #111827; --surface-hover: #1E293B;
  --text-primary: #F8FAFC; --text-secondary: #CBD5E1; --text-muted: #64748B;
  --brand-primary: #818CF8; --brand-hover: #A5B4FC; --brand-light: rgba(129, 140, 248, .15);
  --success: #34D399; --success-light: rgba(52, 211, 153, .15); --success-text: #6EE7B7;
  --warning: #FBBF24; --warning-light: rgba(251, 191, 36, .15); --warning-text: #FCD34D;
  --error: #F87171; --error-light: rgba(248, 113, 113, .15); --error-text: #FCA5A5;
  --info: #60A5FA; --info-light: rgba(96, 165, 250, .15); --info-text: #93C5FD;
  --border: #1E293B; --border-strong: #334155;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: clip; }
img { max-width: 100%; display: block; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  transition: background-color var(--transition), color var(--transition);
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Every display rule below would otherwise beat the [hidden] UA default. */
[hidden] { display: none !important; }

/* ---------------- Gate (sign-in / denied) ---------------- */

.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px; box-shadow: var(--shadow-lg); text-align: center;
}
.gate-logo { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; }
.gate-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.gate-sub { color: var(--text-secondary); font-size: 14px; margin: 8px 0 24px; }
.gate-card form { text-align: left; }
.gate-error { color: var(--error); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* ---------------- Layout ---------------- */

.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex-shrink: 0; background: var(--bg-primary); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-name strong { font-weight: 800; color: var(--brand-primary); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active { background: var(--brand-light); color: var(--brand-primary); font-weight: 600; }
.nav-text { flex: 1; }
.nav-count {
  background: var(--brand-primary); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: var(--radius-full);
}

.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }
.admin-card { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.admin-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); object-fit: cover; }
.admin-meta { min-width: 0; }
.admin-name { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role { display: block; font-size: 11px; color: var(--text-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px;
  background: var(--bg-primary); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; padding: 6px; border-radius: var(--radius-sm); color: var(--text-secondary); }

.view { padding: 24px; max-width: 1180px; width: 100%; }

/* ---------------- Buttons ---------------- */

.btn-primary, .btn-quiet, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
  padding: 9px 16px; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--brand-primary); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-quiet { background: var(--bg-tertiary); color: var(--text-secondary); }
.btn-quiet:hover { background: var(--border); color: var(--text-primary); }
.btn-danger { background: var(--error-light); color: var(--error-text); }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-small { padding: 6px 12px; font-size: 13px; width: auto; }
.btn-primary.danger { background: var(--error); }

/* ---------------- Inputs ---------------- */

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.input {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px; font-size: 14px;
  transition: border-color var(--transition);
}
.input:focus { outline: none; border-color: var(--brand-primary); }
textarea.input { resize: vertical; min-height: 88px; line-height: 1.55; }
select.input { cursor: pointer; }

/* ---------------- Cards, lists, tables ---------------- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px;
  position: relative;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.card-body { font-size: 14px; color: var(--text-secondary); }

.delete-btn {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px; cursor: pointer;
  color: var(--text-muted); transition: all 0.15s ease;
  z-index: 1;
}
.delete-btn:hover {
  background: var(--danger); border-color: var(--danger);
  color: white;
}

.row-list { display: flex; flex-direction: column; gap: 10px; }

/* Submissions: search toolbar + grid cards */
.submissions-toolbar { margin-bottom: 16px; }
.submissions-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; max-width: 400px;
}
.submissions-search svg { color: var(--text-muted); flex-shrink: 0; }
.submissions-search input {
  background: none; border: none; outline: none;
  font-size: 14px; color: var(--text-primary); width: 100%;
  font-family: var(--font-sans);
}

.submissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.sub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.sub-card:hover { box-shadow: var(--shadow-md); }

.sub-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
}

.sub-card-body { padding: 14px; }

.sub-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.sub-card-title {
  font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.sub-card-menu-wrap { position: relative; flex-shrink: 0; }
.sub-card-menu-btn {
  background: transparent; border: none; border-radius: 6px;
  padding: 4px; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.sub-card-menu-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }

.sub-card-menu {
  display: none;
  position: absolute; top: 100%; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  min-width: 160px; z-index: 100; overflow: hidden;
}
.sub-card-menu.active { display: block; }
.sub-card-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 13px; cursor: pointer;
  color: var(--text-primary); border-bottom: 1px solid var(--border);
}
.sub-card-menu-item:last-child { border-bottom: none; }
.sub-card-menu-item:hover { background: var(--bg-secondary); }
.sub-card-menu-item.danger { color: var(--danger); }
.sub-card-menu-item.danger:hover { background: var(--danger-light, rgba(239,68,68,.08)); }

.sub-card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.sub-card-author {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--text-primary);
}
.sub-card-author:hover { color: var(--brand-primary); }
.sub-card-author img, .sub-card-author .avatar-placeholder {
  width: 20px; height: 20px; border-radius: 50%;
}
.sub-card-info { font-size: 11px; color: var(--text-muted); }

.sub-card-desc {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.kv { display: grid; grid-template-columns: 132px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }

.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------------- Finance ---------------- */

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
}
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.stat-note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); padding: 8px 10px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tr[data-open] { cursor: pointer; }
.table tr[data-open]:hover td { background: var(--bg-tertiary); }
.table-wrap { overflow-x: auto; }
.amount-pos { color: var(--success-text); font-weight: 700; white-space: nowrap; }
.amount-neg { color: var(--text-primary); font-weight: 700; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: var(--radius-full); background: var(--bg-tertiary); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand-primary); }

.avatar { width: 30px; height: 30px; border-radius: var(--radius-full); object-fit: cover; flex-shrink: 0; }
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); color: var(--text-secondary); font-size: 13px; font-weight: 700;
}
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who span { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Badges ---------------- */

.badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--radius-full); text-transform: capitalize;
  letter-spacing: 0.01em;
}
.badge-neutral { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-brand { background: var(--brand-light); color: var(--brand-primary); }
.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-error { background: var(--error-light); color: var(--error-text); }
.badge-info { background: var(--info-light); color: var(--info-text); }

/* ---------------- Filters ---------------- */

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filter-btn {
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary);
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-btn.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.filters .input { width: auto; flex: 1; min-width: 180px; padding: 7px 12px; }

/* ---------------- Drawer ---------------- */

.drawer-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 60;
  display: flex; justify-content: flex-end; backdrop-filter: blur(2px);
}
.drawer {
  width: 100%; max-width: 620px; height: 100%; overflow-y: auto;
  background: var(--bg-secondary); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.drawer-head {
  position: sticky; top: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 18px 22px; display: flex; align-items: flex-start; gap: 12px; z-index: 2;
}
.drawer-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-close { margin-left: auto; font-size: 24px; line-height: 1; color: var(--text-muted); padding: 0 4px; }
.drawer-close:hover { color: var(--text-primary); }
.drawer-body { padding: 22px; }
.drawer-foot {
  position: sticky; bottom: 0; background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 16px 22px; display: flex; gap: 10px;
}
.drawer-foot .btn-primary, .drawer-foot .btn-danger, .drawer-foot .btn-quiet { flex: 1; width: auto; }

/* ---------------- Submission preview ---------------- */

.cover-preview { width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border); }
.block-preview-item { border-left: 3px solid var(--brand-primary); padding: 4px 0 4px 12px; margin-bottom: 12px; }
.block-preview-item img, .block-preview-item video { max-width: 100%; border-radius: var(--radius-md); margin-top: 6px; }
.block-preview-item p { font-size: 14px; color: var(--text-secondary); white-space: pre-wrap; }
.block-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.file-chip {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px;
  font-size: 13px;
}
.file-chip a { margin-left: auto; color: var(--brand-primary); font-weight: 600; font-size: 12.5px; }

/* ---------------- Dialog ---------------- */

.dialog-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.dialog-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow-lg);
}
.dialog-card h2 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.dialog-card p { font-size: 14px; color: var(--text-secondary); white-space: pre-wrap; margin-bottom: 20px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn-primary, .dialog-actions .btn-quiet { flex: 1; width: auto; }

/* ---------------- Support inbox ---------------- */

.inbox {
  display: grid; grid-template-columns: 330px 1fr;
  gap: 14px; align-items: stretch;
}
.inbox-list {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow-y: auto; max-height: calc(100vh - 190px); min-height: 320px;
}
.inbox-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.inbox-row:last-child { border-bottom: none; }
.inbox-row:hover { background: var(--bg-tertiary); }
.inbox-row.active { background: var(--brand-light); }
.inbox-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.inbox-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-preview { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.inbox-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.inbox-unread {
  background: var(--brand-primary); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; padding: 1px 6px; border-radius: var(--radius-full); text-align: center;
}

.inbox-thread {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  min-height: 520px; max-height: calc(100vh - 190px); overflow: hidden;
}
.inbox-blank {
  margin: auto; padding: 40px 28px; text-align: center;
  color: var(--text-muted); font-size: 14px; max-width: 420px;
}
.inbox-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.inbox-head .card-title, .inbox-head .card-sub { display: block; }
.inbox-back { display: none; padding: 4px; margin-left: -4px; border-radius: var(--radius-sm); color: var(--text-secondary); }
.inbox-body {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column;
  gap: 12px; background: var(--bg-secondary);
}
.inbox-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 14px 0; }
.inbox-composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.inbox-composer .input { flex: 1; min-height: 42px; }
.inbox-icon-btn { padding: 9px; border-radius: var(--radius-md); border: 1px solid var(--border); color: var(--text-secondary); }
.inbox-icon-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.sb { display: flex; gap: 8px; max-width: 78%; }
.sb.me { margin-left: auto; flex-direction: row-reverse; }
.sb-avatar { flex-shrink: 0; }
.sb-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sb.me .sb-col { align-items: flex-end; }
.sb-who { font-size: 11px; font-weight: 700; color: var(--text-muted); padding-left: 2px; }
.sb-bubble {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 4px 14px 14px 14px; padding: 9px 12px; font-size: 14px; overflow-wrap: anywhere;
}
.sb.me .sb-bubble {
  background: var(--brand-primary); border-color: var(--brand-primary); color: #fff;
  border-radius: 14px 4px 14px 14px;
}
.sb-text { white-space: pre-wrap; }
.sb-time { font-size: 10.5px; color: var(--text-muted); align-self: flex-end; }
.sb.me .sb-time { color: rgba(255, 255, 255, .78); }
.sb-attach { display: block; max-width: 240px; max-height: 200px; border-radius: var(--radius-md); }
.sb-file { font-size: 13px; font-weight: 600; color: var(--brand-primary); }
.sb.me .sb-file { color: #fff; text-decoration: underline; }
.sb-del {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 0;
  background: none; border: 0; cursor: pointer;
  color: rgba(255, 255, 255, .7); vertical-align: -2px;
}
.sb-del:hover { color: #fff; }

/* Gliim P.A. handover: the desk shows who currently owns the thread. */
.sb-hold {
  margin-left: auto; flex-shrink: 0; font-size: 11.5px; font-weight: 700;
  color: var(--text-muted); background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius-full); padding: 6px 11px;
  white-space: nowrap;
}
.sb-hold.active { color: var(--brand-primary); background: var(--brand-light); border-color: var(--brand-primary); }
.inbox-esc {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 11px; font-weight: 700; color: var(--warning-text);
}
.sb-esc {
  align-self: center; max-width: 92%; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--warning); border-radius: var(--radius-md);
  padding: 11px 13px; font-size: 13.5px; color: var(--text-primary);
  overflow-wrap: anywhere;
}
.sb-esc-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; color: var(--warning-text); text-transform: uppercase; letter-spacing: .03em; }
.sb-esc-q { font-weight: 600; }
.sb-esc-a { color: var(--text-secondary); }
.sb-esc-hint { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }

/* Admins room: the same thread chrome, no member involved. */
.room-count { margin-left: auto; }
.inbox-icon-btn.recording {
  color: #fff; background: var(--error); border-color: var(--error);
  animation: room-pulse 1.2s ease-in-out infinite;
}
@keyframes room-pulse { 50% { opacity: .55; } }

/* ---------------- States ---------------- */

.empty {
  text-align: center; color: var(--text-muted); font-size: 14px;
  padding: 48px 24px; border: 1px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--surface);
}
.loading { text-align: center; color: var(--text-muted); font-size: 14px; padding: 48px 0; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%);
    transition: transform var(--transition); box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .view { padding: 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .drawer { max-width: 100%; }
  .card-actions { margin-left: 0; width: 100%; }
  .card-head { flex-wrap: wrap; }

  /* Support desk becomes a single pane: list, then the open thread */
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { max-height: none; min-height: 0; }
  .inbox-thread { display: none; min-height: calc(100vh - 170px); max-height: none; }
  .inbox.open .inbox-list { display: none; }
  .inbox.open .inbox-thread { display: flex; }
  .inbox-back { display: flex; }
  .sb { max-width: 88%; }
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.dash-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.dash-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dash-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary, var(--brand-primary)));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.dash-content {
  flex: 1;
}

.dash-count {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.dash-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.dash-section h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.dash-action-btn {
  display: block;
  padding: 14px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.dash-action-btn:hover {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

/* ============================================
   SLIM BRAND SCROLLBARS
   ============================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-primary) transparent;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brand-primary); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary-hover); }
::-webkit-scrollbar-corner { background: transparent; }
