/* ══════════════════════════════════════════════════════
   AGENT SUPPORT DASHBOARD
   Uses project CSS vars (--bg, --sf, --ink, --gr, etc.)
   for automatic dark/light theme support
══════════════════════════════════════════════════════ */

/* ── Base ── */
#support-root {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
}
.sp {
  width: 100%;
  max-width: 100%;
  padding: 28px 40px 40px;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Force scrollbar always visible to prevent layout shift ── */
#support-root { overflow-y: scroll !important; }

/* ── Pill nav fix for support (no GSAP animation) ── */
#sp-pill-nav .pill-label { opacity: 1; }
#sp-pill-nav .pill-label-hover { opacity: 0; }
#sp-pill-nav .pill .hover-circle { width: 0; height: 0; }
#sp-pill-nav .pill.is-active { background: var(--base); color: var(--hover-text); }
#sp-pill-nav .pill.is-active .pill-label { opacity: 0; }
#sp-pill-nav .pill.is-active .pill-label-hover { opacity: 1; }
#sp-pill-nav .pill:not(.is-active):hover { background: var(--sf3); }

/* ── Panel pages ── */
.sp-panel-page { animation: spFadeIn .25s ease; }
@keyframes spFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Back ── */
.sp-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; color: var(--gr);
  text-decoration: none; cursor: pointer; margin-bottom: 18px;
  border: none; background: none; padding: 0;
}
.sp-back:hover { color: var(--ink); }
.sp-back svg { width: 14px; height: 14px; }

/* ── Hero ── */
.sp-hero {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
}
.sp-greeting {
  font-size: 13px; color: var(--gr); margin-bottom: 2px;
}
.sp-headline {
  font-size: 32px; font-weight: 300; color: var(--gr2); line-height: 1.2;
}
.sp-headline strong {
  display: block; font-size: 32px; font-weight: 700; color: var(--ink);
  margin-top: 0;
}

/* ── Top grid: KPIs left + KB right ── */
.sp-top {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── KPI row ── */
.sp-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.sp-kpi {
  background: var(--sf);
  border: 1px solid var(--sf3);
  border-radius: 16px;
  padding: 20px;
  transition: box-shadow .15s;
}
.sp-kpi:hover { box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.sp-kpi-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.sp-kpi-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.sp-kpi-label {
  font-size: 12px; font-weight: 500; color: var(--gr);
}
.sp-kpi-val {
  font-size: 36px; font-weight: 700; letter-spacing: -.03em;
  color: var(--ink); line-height: 1;
}

/* ── KB Widget ── */
.sp-kb-w {
  background: var(--sf);
  border: 1px solid var(--sf3);
  border-radius: 16px;
  padding: 18px;
  display: flex; flex-direction: column;
}
.sp-kb-w-hd {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.sp-kb-w-title {
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.sp-kb-w-actions {
  display: flex; gap: 6px; align-items: center;
}
.sp-kb-w-search {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--sf3); border-radius: 10px;
  padding: 7px 12px; background: var(--sf2); margin-bottom: 14px;
}
.sp-kb-w-search input {
  border: none; outline: none; font-size: 12px; font-family: inherit;
  color: var(--ink); background: transparent; width: 80px;
}
.sp-kb-w-search input::placeholder { color: var(--gr2); }
.sp-kb-w-search svg { width: 14px; height: 14px; color: var(--gr); flex-shrink: 0; }
.sp-kb-item {
  border: 1px solid var(--sf3); border-radius: 12px;
  padding: 14px; margin-bottom: 10px;
  transition: border-color .15s; cursor: pointer;
}
.sp-kb-item:hover { border-color: var(--gr2); }
.sp-kb-item-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 4px;
}
.sp-kb-item-title {
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.sp-kb-item-meta {
  display: flex; gap: 12px; font-size: 11px; color: var(--gr); margin-bottom: 6px;
}
.sp-kb-item-footer {
  display: flex; justify-content: space-between; align-items: center;
}
.sp-ai-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; color: var(--gr);
}
button.sp-toggle-sm {
  position: relative; width: 38px; height: 22px;
  background: #bbb !important; border-radius: 11px; cursor: pointer;
  border: none !important; padding: 0; transition: all .2s;
  display: inline-block; vertical-align: middle;
  outline: 2px solid rgba(0,0,0,.1);
}
button.sp-toggle-sm.on { background: #22c55e !important; outline-color: #16a34a; }
button.sp-toggle-sm::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
button.sp-toggle-sm.on::after { transform: translateX(16px); }
.sp-tag {
  display: inline-block; padding: 3px 10px;
  font-size: 11px; font-weight: 600; border-radius: 6px;
}
.sp-tag-blue { background: #e0f2fe; color: #0369a1; }
.sp-tag-orange { background: #fff7ed; color: #c2410c; }
.sp-tag-green { background: #f0fdf4; color: #15803d; }
.sp-tag-gray { background: var(--sf2); color: var(--gr); }
[data-theme="dark"] .sp-tag-blue { background: #0c4a6e; color: #7dd3fc; }
[data-theme="dark"] .sp-tag-orange { background: #7c2d12; color: #fdba74; }
[data-theme="dark"] .sp-tag-green { background: #14532d; color: #86efac; }
.sp-kb-item-date {
  font-size: 11px; color: var(--gr);
}

/* ── Charts row ── */
.sp-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.sp-card {
  background: var(--sf);
  border: 1px solid var(--sf3);
  border-radius: 16px;
  padding: 22px;
}
.sp-card-hd {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.sp-card-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
}

/* Chart bars */
.sp-bars {
  display: flex; align-items: flex-end; gap: 6px; height: 140px;
}
.sp-bar-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.sp-bar {
  width: 100%; max-width: 30px; border-radius: 5px 5px 0 0;
  min-height: 3px; transition: height .4s ease;
}
.sp-bar-cur { background: #f97316; }
.sp-bar-prev { background: var(--sf3); }
.sp-bar-lbl { font-size: 10px; color: var(--gr); }

/* Channel bars — 3 side by side, height = proportion, hover shows count */
.sp-ch-grid {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  height: 150px;
  padding: 0 8px;
}
.sp-ch-block {
  flex: 1;
  max-width: 80px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
.sp-ch-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.sp-ch-tip {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%) scale(.9);
  background: #1e1e1e;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.sp-ch-block:hover .sp-ch-tip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
[data-theme="dark"] .sp-ch-tip { background: #e5e7eb; color: #111; }

/* Legend */
.sp-legend-row {
  display: flex; gap: 20px; margin-top: 12px;
  font-size: 11px; color: var(--gr);
}
.sp-legend-row span {
  display: flex; align-items: center; gap: 5px;
}
.sp-ldot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* ── Table section ── */
.sp-section {
  background: var(--sf); border: 1px solid var(--sf3);
  border-radius: 16px; padding: 0; overflow: hidden;
  margin-bottom: 20px;
}
.sp-section-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; border-bottom: 1px solid var(--sf3);
}
.sp-section-tabs {
  display: flex; gap: 0; align-items: center;
}
.sp-stab {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 16px; font-size: 13px; font-weight: 500;
  color: var(--gr); background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.sp-stab:hover { color: var(--ink); }
.sp-stab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.sp-stab svg { width: 14px; height: 14px; }

.sp-section-right {
  display: flex; align-items: center; gap: 10px;
}
.sp-search {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--sf3); border-radius: 10px;
  padding: 7px 12px; background: var(--sf2);
}
.sp-search input {
  border: none; outline: none; font-size: 12px; font-family: inherit;
  color: var(--ink); background: transparent; width: 120px;
}
.sp-search input::placeholder { color: var(--gr2); }
.sp-search svg { width: 14px; height: 14px; color: var(--gr); }
.sp-filter-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; font-size: 12px; font-weight: 500;
  color: var(--gr); background: none; border: 1px solid var(--sf3);
  border-radius: 10px; cursor: pointer; font-family: inherit;
}
.sp-filter-btn:hover { border-color: var(--gr2); color: var(--ink); }
.sp-filter-btn svg { width: 14px; height: 14px; }

/* Table */
.sp-table {
  width: 100%; border-collapse: collapse;
}
.sp-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--gr);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 12px 16px; border-bottom: 1px solid var(--sf3);
  white-space: nowrap;
}
.sp-table td {
  padding: 14px 16px; font-size: 13px; color: var(--ink);
  border-bottom: 1px solid var(--sf3); vertical-align: middle;
}
.sp-table tbody tr { cursor: pointer; transition: background .1s; }
.sp-table tbody tr:hover td { background: var(--sf2); }
.sp-table tbody tr.highlighted td { background: rgba(239,68,68,.08); }
.sp-table td.sp-td-id {
  font-size: 12px; font-weight: 500; color: var(--gr);
}

/* Customer cell */
.sp-customer {
  display: flex; align-items: center; gap: 8px;
}
.sp-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* Channel cell */
.sp-channel {
  display: flex; align-items: center; gap: 8px;
}
.sp-ch-dot {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}

/* Priority */
.sp-priority {
  display: flex; align-items: center; gap: 6px; font-weight: 500;
}
.sp-pri-bar {
  width: 24px; height: 4px; border-radius: 2px;
}

/* Status badge */
.sp-badge {
  display: inline-block; padding: 4px 12px;
  font-size: 11px; font-weight: 600; border-radius: 20px;
  white-space: nowrap;
}
.sp-badge-open { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.sp-badge-progress { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.sp-badge-escalated { background: #fef9c3; color: #a16207; border: 1px solid #fde68a; }
.sp-badge-resolved { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
[data-theme="dark"] .sp-badge-open { background: #1e3a5f; color: #93c5fd; border-color: #1e40af; }
[data-theme="dark"] .sp-badge-progress { background: #431407; color: #fdba74; border-color: #9a3412; }
[data-theme="dark"] .sp-badge-escalated { background: #422006; color: #fde68a; border-color: #854d0e; }
[data-theme="dark"] .sp-badge-resolved { background: #052e16; color: #86efac; border-color: #166534; }

/* Checkbox */
.sp-check {
  width: 18px; height: 18px; border: 2px solid var(--sf3);
  border-radius: 5px; cursor: pointer; appearance: none;
  -webkit-appearance: none; background: var(--sf); transition: all .15s;
  flex-shrink: 0;
}
.sp-check:checked { background: #ef4444; border-color: #ef4444; }
.sp-check:checked::after {
  content: '✓'; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}

/* Date cell */
.sp-date { font-size: 13px; color: var(--ink); }
.sp-time { font-size: 11px; color: var(--gr); }

/* ── Buttons ── */
.sp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
}
.sp-btn-primary { background: var(--ink); color: var(--bg); }
.sp-btn-primary:hover { opacity: .85; }
.sp-btn-secondary { background: var(--sf2); color: var(--ink); }
.sp-btn-secondary:hover { background: var(--sf3); }
.sp-btn-outline {
  background: transparent; color: var(--ink); border: 1px solid var(--sf3);
}
.sp-btn-outline:hover { border-color: var(--gr2); }
.sp-btn-sm { padding: 5px 10px; font-size: 11px; }
.sp-btn-danger { background: none; color: #ef4444; font-size: 12px; font-weight: 500; }
.sp-btn-danger:hover { background: rgba(239,68,68,.08); }
.sp-btn-icon {
  width: 30px; height: 30px; padding: 0; border-radius: 8px;
  background: var(--sf2); border: 1px solid var(--sf3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gr); transition: all .15s;
}
.sp-btn-icon:hover { border-color: var(--gr2); color: var(--ink); }
.sp-btn-icon svg { width: 14px; height: 14px; }
.sp-btn-accent {
  background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0;
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.sp-btn-accent:hover { background: #dcfce7; }
[data-theme="dark"] .sp-btn-accent { background: #052e16; color: #86efac; border-color: #166534; }
[data-theme="dark"] .sp-btn-accent:hover { background: #14532d; }

/* ── Config form ── */
.sp-form-group { margin-bottom: 20px; }
.sp-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--gr);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.sp-input {
  width: 100%; border: 1px solid var(--sf3); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-family: inherit;
  outline: none; background: var(--sf2); color: var(--ink);
  transition: border-color .15s; box-sizing: border-box;
}
.sp-input:focus { border-color: var(--gr); }
.sp-radio-group { display: flex; gap: 8px; }
.sp-radio {
  padding: 8px 16px; border: 1px solid var(--sf3); border-radius: 10px;
  font-size: 13px; cursor: pointer; background: var(--sf2); color: var(--gr);
  font-weight: 500; transition: all .15s;
}
.sp-radio.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── Embed code ── */
.sp-code {
  background: #0a0a0a; color: #d4d4d4; border-radius: 12px;
  padding: 20px; font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px; line-height: 1.8; overflow-x: auto;
  position: relative; margin-top: 8px;
}
.sp-code-copy {
  position: absolute; top: 10px; right: 10px;
  padding: 5px 12px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.08); color: #888; border: none;
  border-radius: 6px; cursor: pointer; font-family: inherit;
}
.sp-code-copy:hover { background: rgba(255,255,255,.15); color: #ddd; }

/* ── Crawl ── */
.sp-crawl-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--sf2); border-radius: 10px;
  font-size: 12px; color: var(--gr);
}
.sp-crawl-spinner {
  width: 14px; height: 14px; border: 2px solid var(--sf3);
  border-top-color: var(--ink); border-radius: 50%;
  animation: spSpin .6s linear infinite;
}
@keyframes spSpin { to { transform: rotate(360deg); } }

/* ── Empty ── */
.sp-empty {
  text-align: center; padding: 48px 20px; color: var(--gr);
}
.sp-empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }
.sp-empty-title { font-size: 14px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.sp-empty-sub { font-size: 13px; color: var(--gr2); margin-bottom: 20px; }

/* ── Skeleton ── */
.sp-skeleton {
  height: 14px;
  background: linear-gradient(90deg, var(--sf2) 25%, var(--sf3) 50%, var(--sf2) 75%);
  background-size: 200% 100%; animation: spShimmer 1.5s infinite;
  border-radius: 6px; margin-bottom: 10px;
}
@keyframes spShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Modal ── */
.sp-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px); z-index: 10000;
  display: none; align-items: center; justify-content: center;
}
.sp-modal-overlay.open { display: flex; }
.sp-modal {
  background: var(--sf); border-radius: 16px; padding: 28px;
  max-width: 560px; width: 92%; max-height: 82vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
.sp-modal-title {
  font-size: 16px; font-weight: 700; color: var(--ink);
  margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;
}
.sp-modal-close {
  width: 28px; height: 28px; border-radius: 50%; background: var(--sf2);
  border: none; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; color: var(--gr);
}
.sp-modal-close:hover { background: var(--sf3); }

/* ── Toast ── */
.sp-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 20px;
  border-radius: 10px; font-size: 13px; font-weight: 500;
  z-index: 10001; opacity: 0; transition: all .3s; pointer-events: none;
}
.sp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .sp-top { grid-template-columns: 1fr; }
  .sp-kpis { grid-template-columns: repeat(2, 1fr); }
  .sp-charts { grid-template-columns: 1fr; }
  .sp-kb-w { grid-row: auto; }
  #sp-pg-integration > div { grid-template-columns: 1fr !important; }
  .sp-section { overflow-x: auto; }
}
@media (max-width: 600px) {
  .sp { padding: 16px; }
  .sp-kpis { grid-template-columns: 1fr 1fr; }
  .sp-hero { flex-direction: column; gap: 12px; }
  .sp-section-bar { flex-direction: column; gap: 10px; align-items: stretch; }
}

/* ══════════════════════════════════════════════════════
   DARK THEME — matched to veille dashboard palette
══════════════════════════════════════════════════════ */
[data-theme="dark"] .sp { background: #111; color: #e5e7eb; }
[data-theme="dark"] .sp-headline { color: #6b7280; }
[data-theme="dark"] .sp-headline strong { color: #e5e7eb; }
[data-theme="dark"] .sp-greeting { color: #9ca3af; }
[data-theme="dark"] .sp-kpi { background: #1a1a1a; border-color: #2a2a2a; }
[data-theme="dark"] .sp-kpi:hover { box-shadow: 0 2px 16px rgba(0,0,0,.2); }
[data-theme="dark"] .sp-kpi-val { color: #e5e7eb; }
[data-theme="dark"] .sp-kpi-label { color: #9ca3af; }
[data-theme="dark"] .sp-kb-w { background: #1a1a1a; border-color: #2a2a2a; }
[data-theme="dark"] .sp-kb-w-title { color: #e5e7eb; }
[data-theme="dark"] .sp-kb-w-search { background: #222; border-color: #333; }
[data-theme="dark"] .sp-kb-w-search input { color: #e5e7eb; }
[data-theme="dark"] .sp-kb-item { border-color: #2a2a2a; }
[data-theme="dark"] .sp-kb-item:hover { border-color: #444; }
[data-theme="dark"] .sp-kb-item-title { color: #e5e7eb; }
[data-theme="dark"] .sp-kb-item-meta { color: #6b7280; }
[data-theme="dark"] .sp-kb-item-date { color: #6b7280; }
[data-theme="dark"] .sp-card { background: #1a1a1a; border-color: #2a2a2a; }
[data-theme="dark"] .sp-card:hover { box-shadow: 0 2px 16px rgba(0,0,0,.2); }
[data-theme="dark"] .sp-card-title { color: #e5e7eb; }
[data-theme="dark"] .sp-bar-prev { background: #2a2a2a; }
[data-theme="dark"] .sp-bar-lbl { color: #6b7280; }
[data-theme="dark"] .sp-legend-row { color: #6b7280; }
[data-theme="dark"] .sp-section { background: #1a1a1a; border-color: #2a2a2a; }
[data-theme="dark"] .sp-section-bar { border-color: #2a2a2a; }
[data-theme="dark"] .sp-stab { color: #9ca3af; }
[data-theme="dark"] .sp-stab:hover { color: #e5e7eb; }
[data-theme="dark"] .sp-stab.active { color: #e5e7eb; border-bottom-color: #e5e7eb; }
[data-theme="dark"] .sp-search { background: #222; border-color: #333; }
[data-theme="dark"] .sp-search input { color: #e5e7eb; }
[data-theme="dark"] .sp-filter-btn { border-color: #333; color: #9ca3af; }
[data-theme="dark"] .sp-filter-btn:hover { border-color: #555; color: #e5e7eb; }
[data-theme="dark"] .sp-table th { color: #6b7280; border-color: #2a2a2a; }
[data-theme="dark"] .sp-table td { color: #e5e7eb; border-color: #2a2a2a; }
[data-theme="dark"] .sp-table tbody tr:hover td { background: #222; }
[data-theme="dark"] .sp-table tbody tr.highlighted td { background: rgba(239,68,68,.12); }
[data-theme="dark"] .sp-table td.sp-td-id { color: #6b7280; }
[data-theme="dark"] .sp-date { color: #e5e7eb; }
[data-theme="dark"] .sp-time { color: #6b7280; }
[data-theme="dark"] .sp-check { background: #222; border-color: #444; }
[data-theme="dark"] .sp-back { color: #9ca3af; }
[data-theme="dark"] .sp-back:hover { color: #e5e7eb; }
[data-theme="dark"] .sp-btn-primary { background: #e5e7eb; color: #111; }
[data-theme="dark"] .sp-btn-secondary { background: #222; color: #e5e7eb; }
[data-theme="dark"] .sp-btn-secondary:hover { background: #333; }
[data-theme="dark"] .sp-btn-outline { border-color: #333; color: #e5e7eb; }
[data-theme="dark"] .sp-btn-outline:hover { border-color: #555; }
[data-theme="dark"] .sp-btn-icon { background: #222; border-color: #333; color: #9ca3af; }
[data-theme="dark"] .sp-btn-icon:hover { border-color: #555; color: #e5e7eb; }
[data-theme="dark"] .sp-input { background: #222; border-color: #333; color: #e5e7eb; }
[data-theme="dark"] .sp-input:focus { border-color: #555; }
[data-theme="dark"] .sp-radio { background: #222; border-color: #333; color: #9ca3af; }
[data-theme="dark"] .sp-radio.active { background: #e5e7eb; color: #111; border-color: #e5e7eb; }
[data-theme="dark"] .sp-crawl-status { background: #222; color: #9ca3af; }
[data-theme="dark"] .sp-crawl-spinner { border-color: #444; border-top-color: #e5e7eb; }
[data-theme="dark"] .sp-empty-title { color: #9ca3af; }
[data-theme="dark"] .sp-empty-sub { color: #6b7280; }
[data-theme="dark"] .sp-skeleton { background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%); background-size: 200% 100%; }
[data-theme="dark"] .sp-modal { background: #1a1a1a; box-shadow: 0 24px 64px rgba(0,0,0,.4); }
[data-theme="dark"] .sp-modal-title { color: #e5e7eb; }
[data-theme="dark"] .sp-modal-close { background: #222; color: #9ca3af; }
[data-theme="dark"] .sp-modal-close:hover { background: #333; }
[data-theme="dark"] .sp-toast { background: #e5e7eb; color: #111; }
[data-theme="dark"] .sp-label { color: #9ca3af; }

/* Badges — neutral gray tones in dark */
[data-theme="dark"] .sp-badge-open { background: #222; color: #9ca3af; border-color: #333; }
[data-theme="dark"] .sp-badge-progress { background: #222; color: #9ca3af; border-color: #333; }
[data-theme="dark"] .sp-badge-escalated { background: #2a2020; color: #f87171; border-color: #3a2a2a; }
[data-theme="dark"] .sp-badge-resolved { background: #1a2a1a; color: #86efac; border-color: #2a3a2a; }

/* Tags — neutral in dark */
[data-theme="dark"] .sp-tag-blue { background: #222; color: #9ca3af; }
[data-theme="dark"] .sp-tag-orange { background: #222; color: #9ca3af; }
[data-theme="dark"] .sp-tag-green { background: #222; color: #9ca3af; }
[data-theme="dark"] .sp-tag-gray { background: #222; color: #6b7280; }

/* Channel dot, priority bar — muted in dark */
[data-theme="dark"] .sp-ch-dot { opacity: .7; }
[data-theme="dark"] .sp-pri-bar { opacity: .6; }

/* Accent button — gray in dark */
[data-theme="dark"] .sp-btn-accent { background: #222; color: #9ca3af; border-color: #333; }
[data-theme="dark"] .sp-btn-accent:hover { background: #2a2a2a; color: #e5e7eb; }

/* AI toggle label */
[data-theme="dark"] .sp-ai-toggle { color: #6b7280; }
[data-theme="dark"] button.sp-toggle-sm { background: #555 !important; outline-color: rgba(255,255,255,.1); }
[data-theme="dark"] button.sp-toggle-sm.on { background: #22c55e !important; outline-color: #16a34a; }
[data-theme="dark"] button.sp-toggle-sm::after { background: #fff !important; }
