/* =========================================================
   CarsBook Super Admin — design system
   Dark surfaces + gold accent, one spacing/typography scale.
   ========================================================= */

:root {
  color-scheme: light;
  /* Light "white label" palette: neutral surfaces so the accent can be
     re-skinned per brand without touching component CSS. */
  --bg: #F4F6F9;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F7F9FB;
  --border: #E4E8EE;
  --border-2: #D2D8E2;
  --text: #111721;
  --muted: #5B6472;
  --muted-2: #8A93A2;
  --gold: #B07C2E;
  --gold-2: #8A5F1C;
  --gold-soft: rgba(176, 124, 46, 0.10);
  --ok: #15803D;
  --ok-soft: rgba(21, 128, 61, 0.10);
  --warn: #B45309;
  --warn-soft: rgba(180, 83, 9, 0.10);
  --bad: #B91C1C;
  --bad-soft: rgba(185, 28, 28, 0.10);
  --info: #1D4ED8;
  --info-soft: rgba(29, 78, 216, 0.10);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --sidebar: 264px;
  --topbar: 64px;
  --shadow: 0 12px 32px -20px rgba(17, 23, 33, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background:
    radial-gradient(1100px 520px at 15% -12%, rgba(176, 124, 46, 0.07), transparent 62%),
    radial-gradient(900px 480px at 92% -6%, rgba(96, 165, 250, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

a { text-decoration: none; }
h1, h2, h3, h4, h5 { letter-spacing: -0.01em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 40px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #14100A; font-weight: 900; font-size: 14px; letter-spacing: -0.4px;
  box-shadow: 0 8px 22px -12px rgba(176, 124, 46, 0.9);
}
.brand-mark img { width: 100%; height: 100%; border-radius: 11px; object-fit: contain; background: #fff; padding: 3px; }
.brand-name { font-weight: 800; font-size: 1.02rem; line-height: 1.1; }
.brand-sub { font-size: 9.5px; letter-spacing: 1.6px; color: var(--gold); font-weight: 800; }
.brand-host { font-size: 11px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.brand-host .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.nav-section { font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted-2); font-weight: 800; padding: 0 10px; margin-bottom: 8px; }
.side-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 0.9rem; font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.side-nav a i { font-size: 1rem; width: 18px; text-align: center; opacity: 0.85; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active {
  background: linear-gradient(135deg, rgba(176, 124, 46, 0.16), rgba(176, 124, 46, 0.05));
  color: var(--gold-2); border-color: rgba(176, 124, 46, 0.3); font-weight: 700;
}
.side-nav a.active i { opacity: 1; }
.side-nav a .nav-pill {
  margin-left: auto; font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  background: var(--warn-soft); border: 1px solid rgba(245, 158, 11, 0.4); color: #FEF3C7;
  font-variant-numeric: tabular-nums;
}
.side-nav a.active .nav-pill { background: rgba(17, 23, 33, 0.10); border-color: rgba(17, 23, 33, 0.12); color: #14100A; }

.queue-note {
  display: block; padding: 9px 11px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 700;
  background: var(--warn-soft); border: 1px solid rgba(245, 158, 11, 0.35); color: #FEF3C7;
  transition: background 0.18s, border-color 0.18s;
}
.queue-note:hover { background: rgba(245, 158, 11, 0.2); color: #B45309; }
.queue-note.clear { background: var(--ok-soft); border-color: rgba(34, 197, 94, 0.32); color: #15803D; }
.queue-note.clear:hover { background: rgba(34, 197, 94, 0.2); color: #DCFCE7; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-user {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
}
.side-user .avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px; display: grid; place-items: center;
  background: var(--gold-soft); border: 1px solid rgba(176, 124, 46, 0.32); color: var(--gold-2); font-size: 12px; font-weight: 800;
}
.side-user .who { min-width: 0; }
.side-user .who strong { display: block; font-size: 0.82rem; }
.side-user .who span { display: block; font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.12rem; font-weight: 800; margin: 0; }
.topbar .sub { font-size: 12.5px; color: var(--muted-2); }
.topbar-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted-2); }
.topbar-mobile { display: none; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.96); }
.topbar-mobile strong { font-size: 0.95rem; }

.livedot { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.livedot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.livedot.warn .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.livedot.bad .dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

/* ---------- Content ---------- */
.content { padding: 24px; flex: 1 1 auto; min-width: 0; }
.content > * { max-width: 100%; }
.page-intro { margin-bottom: 20px; }
.page-intro p { color: var(--muted); font-size: 0.92rem; margin: 6px 0 0; max-width: 70ch; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--border);
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h2, .card-header h3, .card-header h5 { font-size: 0.98rem; font-weight: 700; margin: 0; }
.card-header .hint { font-size: 12px; color: var(--muted-2); font-weight: 400; }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------- KPI ---------- */
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; height: 100%; position: relative; overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.kpi-card::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px;
  background: radial-gradient(closest-side, var(--gold-soft), transparent 70%); pointer-events: none;
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: 0 22px 44px -26px rgba(0,0,0,0.95); }
.kpi-label { font-size: 11.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted-2); font-weight: 700; display: flex; align-items: center; gap: 7px; }
.kpi-value { font-size: 1.85rem; font-weight: 800; line-height: 1.15; margin-top: 8px; letter-spacing: -0.02em; }
.kpi-delta { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.kpi-icon {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1rem;
  background: var(--gold-soft); border: 1px solid rgba(176, 124, 46, 0.28); color: var(--gold-2);
}
.kpi-icon.ok { background: var(--ok-soft); border-color: rgba(34,197,94,.3); color: var(--ok); }
.kpi-icon.info { background: var(--info-soft); border-color: rgba(96,165,250,.3); color: var(--info); }
.kpi-icon.bad { background: var(--bad-soft); border-color: rgba(239,68,68,.3); color: var(--bad); }
.kpi-icon.warn { background: var(--warn-soft); border-color: rgba(245,158,11,.3); color: var(--warn); }

/* ---------- Status text helpers ---------- */
.t-ok { color: var(--ok) !important; }
.t-warn { color: var(--warn) !important; }
.t-bad { color: var(--bad) !important; }
.t-info { color: var(--info) !important; }
.t-gold { color: var(--gold-2) !important; }
.t-muted { color: var(--muted-2) !important; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--r-sm); font-weight: 600; font-size: 0.88rem; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 60%, #A9853F);
  border: 1px solid rgba(17, 23, 33, 0.10); color: #14100A; font-weight: 800;
}
.btn-gold:hover, .btn-gold:focus { color: #14100A; filter: brightness(1.06); box-shadow: 0 10px 26px -14px rgba(176, 124, 46, 0.9); }
.btn-gold:disabled { filter: grayscale(0.4) brightness(0.9); }

.btn-quiet {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.btn-quiet:hover { background: #1B2430; border-color: var(--border-2); color: var(--text); }

.btn-outline-quiet { background: transparent; border: 1px solid var(--border-2); color: var(--muted); }
.btn-outline-quiet:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }

.btn-danger-soft { background: var(--bad-soft); border: 1px solid rgba(239,68,68,.35); color: #B91C1C; }
.btn-danger-soft:hover { background: rgba(239, 68, 68, 0.22); color: #FEE2E2; }

.btn-ok-soft { background: var(--ok-soft); border: 1px solid rgba(34,197,94,.35); color: #15803D; }
.btn-ok-soft:hover { background: rgba(34, 197, 94, 0.22); color: #DCFCE7; }

/* ---------- Forms ---------- */
.form-control, .form-select, .form-check-input {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-sm); font-size: 0.9rem;
}
.form-control::placeholder { color: var(--muted-2); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  background: var(--bg-2); border-color: var(--gold); color: var(--text);
  box-shadow: 0 0 0 0.2rem rgba(176, 124, 46, 0.14);
}
/* The background shorthand above resets background-size/position to their
   initial values, which made Bootstrap's arrow SVG stretch across the whole
   control. Re-assert them so the chevron renders at 16x12px on the right. */
.form-select {
  background-image: var(--bs-form-select-bg-img);
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 16px 12px;
  padding-right: 2.25rem;
}
.form-check-input { background-color: var(--bg-2); border-color: var(--border-2); }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.form-text { font-size: 11.5px; color: var(--muted-2); }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--muted); font-size: 0.85rem; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); margin-bottom: 0; }
.table > thead > tr > th {
  background: rgba(17, 23, 33, 0.03);
  color: var(--muted-2); font-size: 10.5px; letter-spacing: 0.7px; text-transform: uppercase;
  font-weight: 800; border-bottom: 1px solid var(--border); padding: 11px 14px; white-space: nowrap;
}
.table > tbody > tr > td { border-color: var(--border); padding: 12px 14px; vertical-align: middle; font-size: 0.89rem; }
.table > tbody > tr:hover > td { background: rgba(17, 23, 33, 0.05); }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table thead th:first-child, .table tbody td:first-child { padding-left: 18px; }
.table thead th:last-child, .table tbody td:last-child { padding-right: 18px; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-empty { padding: 40px 18px; text-align: center; color: var(--muted-2); }
.table-empty i { font-size: 1.6rem; display: block; margin-bottom: 8px; opacity: 0.7; }

/* ---------- Badges (Bootstrap overrides) ---------- */
.badge { font-weight: 700; font-size: 10.5px; letter-spacing: 0.2px; padding: 5px 9px; border-radius: 999px; }
.text-bg-gold { background: var(--gold-soft) !important; color: var(--gold-2) !important; border: 1px solid rgba(201,168,106,.3); }
.text-bg-success { background: var(--ok-soft) !important; color: #15803D !important; border: 1px solid rgba(34,197,94,.3); }
.text-bg-danger { background: var(--bad-soft) !important; color: #B91C1C !important; border: 1px solid rgba(239,68,68,.3); }
.text-bg-warning { background: var(--warn-soft) !important; color: #FEF3C7 !important; border: 1px solid rgba(245,158,11,.3); }
.text-bg-info { background: var(--info-soft) !important; color: #1D4ED8 !important; border: 1px solid rgba(96,165,250,.3); }
.text-bg-secondary { background: var(--surface-2) !important; color: var(--muted) !important; border: 1px solid var(--border-2); }

/* ---------- Alerts / flash ---------- */
.flash {
  display: flex; align-items: flex-start; gap: 11px;
  margin: 0 0 20px; padding: 13px 16px; border-radius: var(--r); font-size: 0.9rem;
  background: var(--surface); border: 1px solid var(--border);
}
.flash i { font-size: 1.05rem; margin-top: 1px; }
.flash-success { background: var(--ok-soft); border-color: rgba(34, 197, 94, 0.35); color: #DCFCE7; }
.flash-warning { background: var(--warn-soft); border-color: rgba(245, 158, 11, 0.35); color: #B45309; }
.flash-danger  { background: var(--bad-soft);  border-color: rgba(239, 68, 68, 0.35); color: #FEE2E2; }
.flash-info    { background: var(--info-soft); border-color: rgba(96, 165, 250, 0.35); color: #DBEAFE; }

/* ---------- Misc components ---------- */
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted-2); }
.empty-state i { font-size: 2rem; display: block; margin-bottom: 10px; opacity: 0.6; }
.empty-state strong { display: block; color: var(--muted); margin-bottom: 4px; }

.chart-wrap { position: relative; min-height: 180px; }
.chart-wrap canvas { max-height: 280px; }

.list-plain { list-style: none; display: flex; flex-direction: column; }
.list-plain > li { padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 0.89rem; }
.list-plain > li:last-child { border-bottom: 0; }

.avatar-sm {
  width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  font-size: 11.5px; font-weight: 800; flex: 0 0 30px;
}
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .name { font-weight: 600; }
.person .sub { font-size: 11.5px; color: var(--muted-2); }

.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-tight { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

.plan-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--gold-soft); border: 1px solid rgba(176, 124, 46, 0.3); color: var(--gold-2);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #5B6472; }

::selection { background: rgba(176, 124, 46, 0.28); }

/* ---------- Chat inbox ---------- */
.conv-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 13px 18px; border-bottom: 1px solid var(--border); color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.conv-row:last-child { border-bottom: 0; }
.conv-row:hover { background: var(--surface-2); color: var(--text); }
.conv-row.active { background: rgba(176, 124, 46, 0.10); box-shadow: inset 3px 0 0 var(--gold); }
.conv-avatars { display: flex; }
.conv-avatars .avatar-sm + .avatar-sm { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.conv-main { min-width: 0; }
.conv-title { display: block; font-weight: 700; font-size: 0.88rem; }
.conv-last { display: block; font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: block; font-size: 11.5px; color: var(--muted-2); }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 11.5px; white-space: nowrap; }

.thread-day { text-align: center; font-size: 11px; color: var(--muted-2); margin: 12px 0 8px; }
.bubble { max-width: 78%; margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.bubble.from-a { margin-right: auto; border-top-left-radius: 4px; }
.bubble.from-b { margin-left: auto; border-top-right-radius: 4px; background: rgba(176, 124, 46, 0.08); }
.bubble-head { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted-2); margin-bottom: 4px; }
.bubble-text { font-size: 0.88rem; white-space: pre-wrap; word-break: break-word; }
.bubble-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.82rem; color: var(--gold-2); }
.bubble-meta { margin-top: 4px; font-size: 11px; color: var(--muted-2); }

/* =========================================================
   Legacy bridge — maps older markup onto the current system
   so existing pages stay consistent without inline styles.
   ========================================================= */
.glass { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.glass-strong {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--border);
}
.glass-gold {
  background: linear-gradient(150deg, rgba(176, 124, 46, 0.12), rgba(176, 124, 46, 0.03));
  border: 1px solid rgba(176, 124, 46, 0.28);
}
.card.kpi-card { background: var(--surface); border: 1px solid var(--border); }
.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(17, 23, 33, 0.04) 50%, transparent 70%);
  transform: translateX(-100%); animation: shimmer 3.6s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.glow-gold { box-shadow: 0 0 0 1px rgba(176, 124, 46, 0.16), var(--shadow); }
.glow-green { box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.16), var(--shadow); }
.glow-blue { box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.16), var(--shadow); }
.compact { padding: 12px 14px !important; }
.tight { letter-spacing: -0.01em; line-height: 1.2; }
.fix-extended { max-width: 100%; overflow: hidden; }

.btn-outline-secondary { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); }
.btn-outline-secondary:hover, .btn-outline-secondary:focus { background: #1B2430; border-color: #5B6472; color: var(--text); }
.btn-warning { background: linear-gradient(135deg, var(--gold-2), var(--gold)); border: 1px solid rgba(17, 23, 33, 0.10); color: #14100A; font-weight: 700; }
.btn-warning:hover { filter: brightness(1.06); color: #14100A; }

.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.modal-header, .modal-footer { border-color: var(--border) !important; }
.modal-header .btn-close { filter: none; }
.toast { background: var(--surface); border: 1px solid var(--border); }

.nav-tabs { border-color: var(--border); }
.nav-tabs .nav-link { color: var(--muted-2); border-color: transparent; font-weight: 600; }
.nav-tabs .nav-link:hover { color: var(--text); border-color: var(--border); }
.nav-tabs .nav-link.active { color: var(--gold-2); background: var(--surface); border-color: var(--border); border-bottom-color: var(--surface); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .topbar { display: none; }
  .topbar-mobile { display: flex; }
  .content { padding: 16px; }
  .offcanvas { background: rgba(255, 255, 255, 0.99); border-right: 1px solid var(--border); }
  .offcanvas .side-nav a { font-size: 0.95rem; padding: 11px 12px; }
  .offcanvas .offcanvas-header { border-bottom: 1px solid var(--border); }
}
@media (max-width: 575.98px) {
  .kpi-value { font-size: 1.55rem; }
  .card-body { padding: 14px; }
  .table > tbody > tr > td, .table > thead > tr > th { padding: 10px; }
  .table thead th:first-child, .table tbody td:first-child { padding-left: 12px; }
  .table thead th:last-child, .table tbody td:last-child { padding-right: 12px; }
  .btn { font-size: 0.84rem; }
}

/* ---------- Chat attachments ---------- */
.bubble-audio { display: grid; gap: 6px; margin-top: 6px; }
.bubble-audio audio { width: 100%; max-width: 320px; height: 34px; }
.bubble-file.is-broken { opacity: .75; font-style: italic; cursor: default; }