/* ═══════════════════════════════════════════════════════════════
   TeleLog — Premium Glassmorphism Dashboard
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  --bg:            #060614;
  --bg-grad:       radial-gradient(ellipse at 60% -10%, #12123a 0%, #060614 55%);
  --surface:       rgba(18, 18, 38, 0.55);
  --surface-hover: rgba(28, 28, 55, 0.65);
  --surface-solid: rgba(14, 14, 30, 0.95);
  --border:        rgba(255,255,255,0.07);
  --border-focus:  rgba(255,255,255,0.18);
  --primary:       #5eead4;
  --primary-dim:   rgba(94,234,212,0.12);
  --primary-glow:  rgba(94,234,212,0.35);
  --primary-dark:  rgba(94,234,212,0.06);
  --danger:        #f43f5e;
  --danger-dim:    rgba(244,63,94,0.12);
  --warning:       #fbbf24;
  --warning-dim:   rgba(251,191,36,0.12);
  --success:       #10b981;
  --success-dim:   rgba(16,185,129,0.12);
  --purple:        #a78bfa;
  --purple-dim:    rgba(167,139,250,0.12);
  --text-main:     #f1f5f9;
  --text-muted:    #64748b;
  --text-sub:      #94a3b8;
  --font-ui:       'Outfit', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --blur:          blur(18px);
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --trans:         all 0.25s var(--ease);
  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     20px;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg) var(--bg-grad);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

::-webkit-scrollbar            { width: 5px; height: 5px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,0.2); }

/* ── Ambient Glow ──────────────────────────────────────────────── */
.ambient { position: fixed; border-radius: 50%; filter: blur(130px); z-index: 0; pointer-events: none; opacity: 0.25; }
.ambient.c1 { width: 500px; height: 500px; background: var(--primary); top: -180px; right: -120px; }
.ambient.c2 { width: 350px; height: 350px; background: var(--danger);  bottom: -80px; left: -80px; }
.ambient.c3 { width: 250px; height: 250px; background: var(--purple);  top: 50%; left: 25%; opacity: 0.12; }

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: var(--trans);
}

.logo {
  padding: 28px 22px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.logo-icon {
  width: 38px; height: 38px;
  background: var(--primary-dim);
  border: 1px solid rgba(94,234,212,0.3);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 17px;
  box-shadow: 0 0 18px var(--primary-glow);
  flex-shrink: 0;
}
.logo-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--primary);
  margin-top: 6px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  opacity: 0.8;
}

.nav { padding: 18px 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 12px 14px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: var(--trans);
  position: relative;
  user-select: none;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-main); }
.nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid rgba(94,234,212,0.18);
  box-shadow: inset 0 0 20px rgba(94,234,212,0.05);
}
.nav-item i { width: 16px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  animation: badgePop 0.3s var(--ease);
}
@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.sidebar-footer {
  padding: 20px 22px;
  border-top: 1px solid var(--border);
}
.conn-status { display: flex; align-items: center; gap: 12px; }
.conn-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
  transition: var(--trans);
}
.conn-dot.connected  { background: var(--success); box-shadow: 0 0 10px var(--success); animation: pulse 2s infinite; }
.conn-dot.connecting { background: var(--warning); box-shadow: 0 0 10px var(--warning); animation: pulse 1s infinite; }
.conn-dot.error      { background: var(--danger);  box-shadow: 0 0 10px var(--danger); }
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.conn-label  { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1px; }
.conn-name   { color: var(--text-main); font-weight: 600; margin-top: 3px; font-size: 13px; }

/* ── Main Content ──────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; z-index: 1; }

.topbar {
  padding: 0 36px;
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(6,6,20,0.7);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  z-index: 5;
  flex-shrink: 0;
}
.page-title { font-size: 20px; font-weight: 700; }
.page-sub   { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.cache-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--primary-dark);
  border: 1px solid rgba(94,234,212,0.15);
  border-radius: 20px;
  padding: 5px 12px;
  font-family: var(--font-mono); font-size: 11px; color: var(--primary);
}

.content { flex: 1; overflow-y: auto; padding: 28px 36px; }
.page { display: none; animation: pageIn 0.35s var(--ease) forwards; }
.page.active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer; font-family: var(--font-ui);
  font-size: 13px; font-weight: 600;
  transition: var(--trans); outline: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #000; box-shadow: 0 4px 18px var(--primary-dim); }
.btn-primary:hover { background: #fff; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost   { background: var(--surface); color: var(--text-main); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--primary); color: var(--primary); }
.btn-danger  { background: var(--danger-dim); color: var(--danger); border-color: rgba(244,63,94,0.25); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning-dim); color: var(--warning); border-color: rgba(251,191,36,0.25); }
.btn-warning:hover { background: var(--warning); color: #000; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 8px 10px; }

/* Spinner for loading state */
.btn .spinner { width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.3); border-top-color: #000; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Panels ────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--trans);
}
.panel:hover { border-color: var(--border-focus); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.panel-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.02);
}
.panel-title { font-weight: 700; font-size: 15px; }
.panel-body  { padding: 22px; }

/* ── Stats Grid ────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(6,6,20,0.7) 100%);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative; overflow: hidden;
  transition: var(--trans);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.stat-card.c-cyan::before   { background: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }
.stat-card.c-red::before    { background: var(--danger);  box-shadow: 0 0 12px rgba(244,63,94,0.5); }
.stat-card.c-amber::before  { background: var(--warning); box-shadow: 0 0 12px rgba(251,191,36,0.5); }
.stat-card.c-green::before  { background: var(--success); box-shadow: 0 0 12px rgba(16,185,129,0.5); }
.stat-card.c-purple::before { background: var(--purple);  box-shadow: 0 0 12px rgba(167,139,250,0.5); }
.stat-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.stat-value { font-size: 34px; font-weight: 800; line-height: 1; }
.stat-card.c-cyan   .stat-value { color: var(--primary); }
.stat-card.c-red    .stat-value { color: var(--danger); }
.stat-card.c-amber  .stat-value { color: var(--warning); }
.stat-card.c-green  .stat-value { color: var(--success); }
.stat-card.c-purple .stat-value { color: var(--purple); }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ── Grid Layouts ──────────────────────────────────────────────── */
.two-col           { display: grid; grid-template-columns: 1.6fr 1fr;  gap: 18px; margin-bottom: 24px; }
.three-col         { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 24px; }
.chart-wrap        { height: 230px; position: relative; }

/* ── Feed Cards ────────────────────────────────────────────────── */
.feed-stream { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 190px); overflow-y: auto; padding-right: 8px; }
.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--trans);
  animation: slideIn 0.3s var(--ease);
  position: relative;
}
.feed-card.edit  { border-left-color: var(--warning); }
.feed-card:hover { transform: translateX(3px); border-color: rgba(255,255,255,0.12); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: none; }
}
.feed-header { display: flex; justify-content: space-between; margin-bottom: 10px; align-items: flex-start; gap: 12px; }
.feed-sender { font-weight: 700; font-size: 14px; }
.feed-chat   { color: var(--primary); font-size: 12px; font-weight: 500; margin-top: 2px; }
.feed-meta   { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.feed-time   { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.feed-body {
  font-family: var(--font-mono); font-size: 12px;
  background: rgba(0,0,0,0.35); padding: 11px 14px;
  border-radius: var(--radius-sm); color: #cbd5e1;
  white-space: pre-wrap; word-break: break-word;
  border: 1px solid rgba(255,255,255,0.03);
  line-height: 1.6;
}
.feed-body.old { color: var(--text-muted); text-decoration: line-through; margin-bottom: 6px; background: rgba(244,63,94,0.06); }
.feed-body.new { background: rgba(16,185,129,0.06); }
.feed-footer { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.feed-copy-btn {
  margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 6px; padding: 3px 9px;
  font-size: 11px; cursor: pointer; transition: var(--trans);
}
.feed-copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.media-thumb {
  margin-top: 10px; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); max-width: 260px; cursor: pointer;
}
.media-thumb img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.media-thumb video { width: 100%; max-height: 200px; display: block; }

/* ── Tags ──────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
}
.tag-media  { background: var(--warning-dim); color: var(--warning); }
.tag-cached { background: var(--primary-dim); color: var(--primary); }
.tag-miss   { background: var(--danger-dim);  color: var(--danger); }
.tag-ttl    { background: var(--purple-dim);  color: var(--purple); }

/* ── Tables & Log Explorer ─────────────────────────────────────── */
.log-controls { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.input-control {
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text-main);
  font-family: var(--font-ui); font-size: 14px;
  outline: none; transition: var(--trans);
}
.input-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
select.input-control option { background: #0e0e22; }

.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  background: var(--surface);
  backdrop-filter: var(--blur);
}
table { width: 100%; border-collapse: collapse; }
th {
  background: rgba(0,0,0,0.3);
  padding: 13px 16px;
  text-align: left;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px; vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.td-mono { font-family: var(--font-mono); font-size: 12px; }
.td-text {
  max-width: 280px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  color: #94a3b8; font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
}

/* ── Pagination ────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15); flex-shrink: 0;
}
.pagination-info { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.pagination-controls { display: flex; gap: 6px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 10px;
  background: var(--surface-hover); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-sub);
  font-family: var(--font-mono); font-size: 12px;
  cursor: pointer; transition: var(--trans); display: flex; align-items: center; justify-content: center;
}
.page-btn:hover   { border-color: var(--primary); color: var(--primary); }
.page-btn.active  { background: var(--primary-dim); border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Media Vault ───────────────────────────────────────────────── */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.vault-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--trans);
  position: relative;
  cursor: pointer;
}
.vault-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.vault-thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  display: block; background: rgba(0,0,0,0.3);
}
.vault-thumb-video { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.vault-thumb-placeholder {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,0.4); font-size: 36px; color: var(--text-muted);
}
.vault-info {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.vault-sender { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-chat   { color: var(--primary); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-time   { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.vault-badge  {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.7); border-radius: 6px; padding: 2px 8px;
  font-size: 10px; font-family: var(--font-mono); color: var(--primary);
  backdrop-filter: blur(6px);
}
.vault-empty {
  grid-column: 1/-1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 80px 20px; color: var(--text-muted); text-align: center;
}
.vault-empty i { font-size: 48px; opacity: 0.3; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.9); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox-content { max-width: 90vw; max-height: 85vh; position: relative; }
.lightbox-content img,
.lightbox-content video { max-width: 100%; max-height: 85vh; border-radius: var(--radius); border: 1px solid var(--border); }
.lightbox-close {
  position: fixed; top: 20px; right: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 50%; width: 40px; height: 40px;
  cursor: pointer; color: var(--text-main); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--trans);
}
.lightbox-close:hover { background: var(--danger-dim); color: var(--danger); }

/* ── Auth Overlays ─────────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(6,6,20,0.96);
  backdrop-filter: blur(24px) saturate(1.2);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s var(--ease);
}
.auth-overlay.hidden { opacity: 0; pointer-events: none; }
.auth-card {
  background: var(--surface);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border-focus);
  border-radius: 24px;
  padding: 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  text-align: center;
  animation: floatUp 0.55s cubic-bezier(0.16,1,0.3,1);
}
@keyframes floatUp {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.auth-card h1 { font-size: 26px; margin-bottom: 8px; }
.auth-card p  { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; line-height: 1.6; }
.auth-input {
  width: 100%; background: rgba(0,0,0,0.45);
  border: 2px solid var(--border); border-radius: 12px;
  padding: 15px; font-size: 18px; color: white;
  text-align: center; margin-bottom: 20px; outline: none;
  transition: var(--trans); font-family: var(--font-mono);
  letter-spacing: 3px;
}
.auth-input:focus { border-color: var(--primary); box-shadow: 0 0 18px var(--primary-dim); }
.auth-btn { width: 100%; padding: 15px; font-size: 15px; border-radius: 12px; }

/* ── Settings ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 22px; }
.form-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--primary); text-transform: uppercase;
  margin-bottom: 8px; letter-spacing: 1px;
}
.form-label .tip {
  font-size: 10px; color: var(--text-muted); text-transform: none;
  letter-spacing: 0; font-family: var(--font-ui);
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }

/* Toggle switch */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info h4 { font-size: 14px; font-weight: 600; }
.toggle-info p  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.toggle {
  position: relative; width: 46px; height: 26px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  border-radius: 13px; cursor: pointer; transition: var(--trans);
}
.toggle input:checked + .toggle-track { background: var(--primary); border-color: var(--primary); }
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: white;
  border-radius: 50%; transition: var(--trans);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }

/* Chat blocklist picker */
.dialog-picker {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 220px; overflow-y: auto;
  background: rgba(0,0,0,0.3);
}
.dialog-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer; transition: var(--trans);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dialog-item:last-child { border-bottom: none; }
.dialog-item:hover { background: var(--surface-hover); }
.dialog-item input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.dialog-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-dim); display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--primary); flex-shrink: 0;
}
.dialog-icon.group { background: var(--purple-dim); color: var(--purple); }
.dialog-name { font-size: 13px; font-weight: 500; }
.dialog-type { font-size: 11px; color: var(--text-muted); }
.dialog-loader { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--text-muted); font-size: 13px; }

/* ── Top Chats List ─────────────────────────────────────────────── */
.chat-bar-row { margin-bottom: 12px; }
.chat-bar-row:last-child { margin-bottom: 0; }
.chat-bar-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.chat-bar { height: 4px; background: var(--surface-hover); border-radius: 2px; overflow: hidden; }
.chat-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--purple)); border-radius: 2px; transition: width 0.6s var(--ease); }

/* ── Toasts ────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 18px; min-width: 290px; max-width: 380px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  animation: toastIn 0.4s var(--ease) forwards;
  pointer-events: all;
  display: flex; align-items: flex-start; gap: 12px;
}
.toast-icon { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.toast-body h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.toast-body p  { font-size: 12px; color: var(--text-sub); font-family: var(--font-mono); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ── Dividers & Utils ──────────────────────────────────────────── */
.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-sub);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.font-mono { font-family: var(--font-mono); }
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 14px;
  color: var(--text-muted); text-align: center;
}
.empty-state i    { font-size: 42px; opacity: 0.25; }
.empty-state span { font-size: 14px; }
