/* =========================================================
   ProxyMgr — Metronic overrides & custom components
   ========================================================= */

/* ── Tab visibility ── */
.tab { display: none; }
.tab.is-active { display: block; }

/* ── Stats-tab content panels ── */
.stats-tab-content { display: none; }
.stats-tab-content.is-active { display: block; }

/* ── Monospace font var ── */
:root {
  --mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

/* ── Dark mode colour refinements ── */
/* Metronic's default dark has card == background (no depth). Fix it. */
.dark {
  --background: #141414;
  --card: #1a1a1a;
  --border: rgba(255,255,255,0.08);
  --accent: rgba(255,255,255,0.06);
  --muted-foreground: rgba(255,255,255,0.45);
  --primary: #3b82f6;
  --primary-foreground: #fff;
}

/* ── Body-vs-panel depth (demo10 layout) ── */
/* Body is the darker outer canvas, main panel sits on top with rounded edge. */
.dark body { background: #050505 !important; }

/* ── Nested cards inside ws-stats panel ── */
.dark #ws-stats-summary > div {
  background: #232323 !important;
  border-color: rgba(255,255,255,0.10) !important;
}

/* ── Form fields inside modals — need contrast against bg-card ── */
.dark .kt-input,
.dark .kt-select,
.dark .kt-textarea,
.dark input.kt-input,
.dark select.kt-select,
.dark textarea.kt-textarea {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: var(--foreground) !important;
}
.dark .kt-input:focus,
.dark .kt-select:focus,
.dark .kt-textarea:focus {
  border-color: var(--primary) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.20);
}
.dark .kt-input::placeholder,
.dark .kt-textarea::placeholder {
  color: rgba(255,255,255,0.30);
}

/* ── Monospace utility ── */
.font-mono { font-family: var(--mono); }

/* ── Sortable table headers ── */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: " \2195"; opacity: 0.35; font-size: 10px; }
th.sortable.sort-asc::after  { content: " \2191"; opacity: 1; }
th.sortable.sort-desc::after { content: " \2193"; opacity: 1; }

/* ── Activity feed ── */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.activity-item:last-child { border-bottom: none; }
.activity-time   { color: var(--muted-foreground); font-size: 11px; white-space: nowrap; }
.activity-action { font-weight: 500; font-size: 12.5px; }
.activity-detail {
  color: var(--muted-foreground);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

/* ── Region pills ── */
.region-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.region-pill {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--background);
  color: var(--muted-foreground);
  transition: border-color 0.1s, color 0.1s, background 0.1s;
  user-select: none;
  line-height: 1.6;
}
.region-pill:hover { border-color: color-mix(in oklab, var(--foreground) calc(0.4 * 100%), transparent); color: var(--foreground); }
.region-pill.selected {
  border-color: var(--foreground);
  color: var(--foreground);
  background: var(--accent);
}

/* ── Cred block (user credential display) ── */
.cred-block {
  font-family: var(--mono);
  background: var(--accent);
  padding: 12px 14px;
  border-radius: 6px;
  white-space: pre;
  font-size: 12px;
  border: 1px solid var(--border);
  margin: 10px 0;
  line-height: 1.7;
}

/* ── Toast notifications ── */
#toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 400;
  pointer-events: none;
}
.toast {
  background: var(--foreground);
  color: var(--background);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  min-width: 200px;
  max-width: 320px;
  font-size: 13px;
  font-weight: 500;
  animation: toast-in 0.18s ease;
  pointer-events: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.error { background: var(--destructive); color: var(--destructive-foreground); }
.toast.ok    { background: var(--foreground); }

/* ── Stats summary cards (inside api stats panel) ── */
.stats-summary-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.stat-mini {
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  min-width: 120px;
}
.stat-mini .label { font-size: 11px; color: var(--muted-foreground); margin-bottom: 4px; }
.stat-mini .value { font-size: 18px; font-weight: 700; color: var(--foreground); }

/* ── Blocklist entry rows ── */
.bl-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
}

/* ── Modal form label helper ── */
.modal-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.modal-label-text {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

/* ── Checkbox row pills ── */
.checkbox-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--background);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: border-color 0.1s, color 0.1s;
  margin: 0;
  user-select: none;
}
.checkbox-row label:has(input:checked) {
  border-color: var(--foreground);
  color: var(--foreground);
  background: var(--accent);
}
.checkbox-row input[type=checkbox] { width: 13px; height: 13px; margin: 0; }

/* ── Muted empty state ── */
.muted {
  color: var(--muted-foreground);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

/* ── Login page (keep login working standalone) ── */
.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  width: 100%;
  background: var(--background);
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  width: min(380px, 94vw);
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}
.flash { padding: 9px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; }
.flash-error {
  background: color-mix(in oklab, var(--destructive) calc(0.1 * 100%), transparent);
  color: var(--destructive);
  border: 1px solid color-mix(in oklab, var(--destructive) calc(0.3 * 100%), transparent);
}

/* ── Login page — brand block (preserved from old layout) ── */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 20px;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--primary-foreground);
  flex-shrink: 0;
}
/* Brand initial is rendered as inner text (Jinja); fallback to PM if empty */
.brand-mark:empty::after { content: 'PM'; }
.login-subtitle { font-size: 13px; color: var(--muted-foreground); margin: 3px 0 0; }

/* ── Login label / input (plain HTML in login form) ── */
.login-card label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.login-card label input {
  display: block;
  margin-top: 5px;
  width: 100%;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13.5px;
  text-transform: none;
  letter-spacing: 0;
}
.login-card label input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) calc(0.15 * 100%), transparent);
}

/* ── btn-primary alias for login submit ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.1s;
}
.btn-primary:hover { opacity: 0.88; }

/* ── Sidebar (demo10 — uses bg-mono from body) ── */
#sidebar {
  background: var(--mono) !important;
}
.dark #sidebar {
  background: #000 !important;
}
#sidebar .nav-item.is-active,
#sidebar .kt-menu-item.active > .nav-item {
  background: rgba(255,255,255,0.08) !important;
}
#sidebar .nav-item.is-active .kt-menu-icon i,
#sidebar .nav-item.is-active .kt-menu-title,
#sidebar .kt-menu-item.active .kt-menu-icon i,
#sidebar .kt-menu-item.active .kt-menu-title {
  color: #fff !important;
}
#sidebar .nav-item:hover:not(.is-active) {
  background: rgba(255,255,255,0.04) !important;
}

/* ── Header — clean white strip ── */
.kt-header {
  background: var(--background) !important;
  border-bottom-color: var(--border) !important;
}

/* ── Table rows — subtle hover ── */
#content tbody tr:hover {
  background: color-mix(in oklab, var(--accent) calc(0.4 * 100%), transparent) !important;
}

/* ── Stat cards — bolder numbers ── */
#stats-grid .text-2xl { font-size: 1.75rem !important; letter-spacing: -0.03em !important; }

/* ── Overview KPI cards: gentle hover lift ── */
#tab-dashboard .stat-kpi {
  transition: transform 0.15s ease, border-color 0.15s ease;
}
#tab-dashboard .stat-kpi:hover {
  border-color: rgba(255,255,255,0.14) !important;
  transform: translateY(-1px);
}

/* ── Activity feed inside Overview: tighter dot row ── */
#tab-dashboard #activity-feed::-webkit-scrollbar { width: 6px; }
#tab-dashboard #activity-feed::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}

/* ── Hero header (per-tab) ── */
.hero-header {
  border-color: rgba(255,255,255,0.10) !important;
}
.hero-header h2 { letter-spacing: -0.01em; }

/* ── Visually-hidden (a11y only) ── */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Bulk export card (admin only) ── */
.bulk-export-card {
  position: relative;
  border-radius: 14px;
  padding: 18px 18px 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(52,211,153,0.08) 0%, transparent 55%),
    linear-gradient(135deg, #14181c 0%, #0f1216 100%);
  border: 1px solid rgba(52,211,153,0.18);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px -16px rgba(0,0,0,0.6);
}
.bulk-export-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 30%);
}
.bulk-export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bulk-export-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bulk-export-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bulk-export-title {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  letter-spacing: -0.01em;
}
.bulk-export-format {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #9ca3af;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 6px;
  width: fit-content;
}
.bulk-export-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #34d399;
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.25);
  padding: 3px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.bulk-export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bulk-export-count {
  font-size: 11px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}
.bulk-export-textarea {
  width: 100%;
  resize: vertical;
  font-size: 12px;
  line-height: 1.55;
  color: #d1d5db;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.bulk-export-textarea:focus {
  border-color: rgba(52,211,153,0.4);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.12);
}
.bulk-export-textarea::-webkit-scrollbar { width: 8px; }
.bulk-export-textarea::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

/* ── Add-user mode toggle (Single IP / Pool shared) ── */
.user-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.user-mode-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: #9ca3af;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
.user-mode-tab:hover {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
}
.user-mode-tab > span:first-of-type {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  letter-spacing: -0.01em;
}
.user-mode-tab small {
  font-size: 11px;
  color: #6b7280;
  font-weight: normal;
}
.user-mode-tab i {
  color: inherit;
  margin-bottom: 2px;
}
.user-mode-tab.is-active {
  border-color: rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.10);
  color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}
.user-mode-tab.is-active small { color: #a5b4fc; }

.user-mode-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #9ca3af;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
}
.user-mode-hint i { color: #a5b4fc; margin-top: 2px; }
.user-mode-hint code {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/* ── Health summary pill (Proxies hero) ── */
.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: #d1d5db;
  font-variant-numeric: tabular-nums;
}
.health-pill strong { color: #f3f4f6; font-weight: 600; }
.health-pill .health-bad-count { color: #f87171; font-weight: 600; }

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #6b7280;
  flex-shrink: 0;
  position: relative;
}
.health-dot.is-ok    { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,0.18); }
.health-dot.is-warn  { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,0.18); }
.health-dot.is-bad   { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,0.20); }
.health-dot.is-pending { background: #6b7280; box-shadow: 0 0 0 3px rgba(107,114,128,0.18); }
.health-dot.is-ok::after {
  content: "";
  position: absolute; inset: -2px;
  border-radius: inherit;
  border: 1px solid rgba(52,211,153,0.45);
  animation: health-pulse 2.4s ease-out infinite;
}
@keyframes health-pulse {
  0%   { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(2.0); opacity: 0; }
}

/* ── Health cell on Proxies row ── */
.health-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.health-cell.is-ok      { color: #6ee7b7; background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.20); }
.health-cell.is-bad     { color: #fca5a5; background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.22); }
.health-cell.is-pending { color: #9ca3af; background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }

/* ── Compact Proxies table (Option B) ── */
.proxy-table-compact tbody tr { transition: background 80ms ease; }
.proxy-table-compact tbody tr:hover { background: rgba(255,255,255,0.025); }
.proxy-table-compact td { vertical-align: middle; }

.proxy-geo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.proxy-geo-flag { font-size: 14px; line-height: 1; }
.proxy-geo-code { color: #d1d5db; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.pool-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(168,85,247,0.10);
  border: 1px solid rgba(168,85,247,0.22);
  color: #d8b4fe;
  font-variant-numeric: tabular-nums;
}

.proxy-assigned {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 360px;
}
.proxy-assigned-user {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 4px;
  color: #e5e7eb;
  flex-shrink: 0;
}
.proxy-assigned-sep { color: rgba(255,255,255,0.25); }
.proxy-assigned-domain {
  color: #9ca3af;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.state-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #6b7280;
  position: relative;
  vertical-align: middle;
}
.state-dot.is-ok       { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,0.20); }
.state-dot.is-assigned { background: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,0.20); }
.state-dot.is-bad      { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,0.22); }
.state-dot.is-pending  { background: #6b7280; box-shadow: 0 0 0 3px rgba(107,114,128,0.18); }
.state-dot.is-bad::after,
.state-dot.is-ok::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 1px solid currentColor;
  opacity: 0.45;
  animation: state-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
.state-dot.is-bad  { color: #f87171; }
.state-dot.is-ok   { color: #34d399; }
@keyframes state-pulse {
  0%   { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.9);  opacity: 0; }
}

/* ── Speed Test stat cards ── */
.speed-stat {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.speed-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}
.speed-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  font-weight: 500;
}
.speed-stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f3f4f6;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.speed-stat-hint {
  font-size: 11px;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}
.speed-stat-accent {
  background: linear-gradient(135deg, rgba(96,165,250,0.10) 0%, rgba(96,165,250,0.02) 100%);
  border-color: rgba(96,165,250,0.22);
}
.speed-stat-accent .speed-stat-label { color: #93c5fd; }
.speed-stat-accent .speed-stat-value { color: #dbeafe; }

/* ── Pool pill on user row ── */
.user-pool-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(168,85,247,0.10);
  border: 1px solid rgba(168,85,247,0.28);
  color: #d8b4fe;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.user-pool-pill i { color: #c084fc; }
.user-pool-pill small {
  color: #9ca3af;
  font-weight: normal;
  font-size: 11px;
  margin-left: 2px;
  border-left: 1px solid rgba(255,255,255,0.08);
  padding-left: 6px;
}

/* ── Live connection cell ── */
.live-conn .kt-badge { font-variant-numeric: tabular-nums; }

/* ── User clients cell — clickable look ── */
.user-clients-cell button:hover {
  background: rgba(255,255,255,0.04) !important;
}

/* ── Badge tweaks ── */
.kt-badge-success  { background: hsl(142 71% 45% / 0.15) !important; color: hsl(142 71% 38%) !important; border: 1px solid hsl(142 71% 45% / 0.25) !important; }
.kt-badge-secondary{ background: var(--accent) !important; color: var(--muted-foreground) !important; border: 1px solid var(--border) !important; }
.kt-badge-danger   { background: color-mix(in oklab, var(--destructive) calc(0.12 * 100%), transparent) !important; color: var(--destructive) !important; border: 1px solid color-mix(in oklab, var(--destructive) calc(0.25 * 100%), transparent) !important; }

/* ── Settings sub-tabs ── */
.settings-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms;
  border-radius: 6px 6px 0 0;
}
.settings-pill:hover {
  color: var(--foreground);
  background: rgba(255,255,255,0.03);
}
.settings-pill.active {
  color: var(--foreground);
  border-bottom-color: var(--primary, #a78bfa);
}
.settings-pill .ki-filled { opacity: 0.7; }
.settings-pill.active .ki-filled { opacity: 1; }

/* ── Telegram event chips ── */
.tg-event-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 150ms;
  user-select: none;
}
.tg-event-chip:hover { color: var(--foreground); border-color: rgba(255,255,255,0.20); }
.tg-event-chip.on {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border-color: rgba(59,130,246,0.30);
}
.tg-event-chip.on::before { content: "✓"; font-weight: 700; }

/* ── User row overflow menu ── */
.user-more {
  position: relative;
  display: inline-block;
}
.user-more > summary {
  list-style: none;
  cursor: pointer;
}
.user-more > summary::-webkit-details-marker { display: none; }
.user-more > summary::marker { content: ""; }

.user-more-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  min-width: 11rem;
  margin-top: 0.25rem;
  padding: 0.25rem;
  background: var(--card, #1a1a1a);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.40);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.user-more-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  text-align: left;
  color: var(--foreground);
  background: transparent;
  border: 0;
  border-radius: 0.375rem;
  cursor: pointer;
}
.user-more-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.user-more-item .ki-filled {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* ⋯ glyph on the user-row More button — keenicons set has no
   `ki-dots`, so we render a Unicode ellipsis instead. Make it visible
   on the dark background and clearly clickable. */
.user-more-trigger-glyph {
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 700;
  color: var(--muted-foreground);
  letter-spacing: -0.05em;
}
.user-more-trigger:hover .user-more-trigger-glyph,
.user-more[open] .user-more-trigger-glyph {
  color: var(--foreground);
}
