/* ═══════════════════════════════════════════════
   LSIP — Lazada Seller Intelligence Platform
   ═══════════════════════════════════════════════ */

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

:root {
  --bg:        #0c0e16;
  --surface:   #13151f;
  --surface2:  #1a1d2b;
  --border:    #252836;
  --border2:   #2f3347;
  --text:      #e4e6f0;
  --muted:     #6b7080;
  --accent:    #4f7cff;
  --accent2:   #3a5fd9;
  --green:     #22c55e;
  --blue:      #3b82f6;
  --yellow:    #eab308;
  --red:       #ef4444;
  --orange:    #f97316;
  --tier-a:    #22c55e;
  --tier-b:    #3b82f6;
  --tier-c:    #eab308;
  --tier-d:    #6b7280;
  --radius:    8px;
  --radius-lg: 12px;
  --sidebar-w: 220px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ── Layout ────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-dot { font-size: 22px; color: var(--accent); line-height: 1; }
.logo-name { font-weight: 800; font-size: 16px; letter-spacing: -0.5px; }
.logo-sub  { font-size: 10px; color: var(--muted); }

.nav-links {
  list-style: none;
  padding: 8px 8px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
.nav-links li { margin-bottom: 1px; }
.nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--surface2); color: var(--text); }
.nav-links a.active { background: rgba(79,124,255,0.12); color: var(--accent); }
.nav-icon { font-size: 14px; width: 18px; text-align: center; }
.badge-count {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-bottom {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-role { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.5px; }
.user-name { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.logout-link { font-size: 12px; color: var(--muted); }
.logout-link:hover { color: var(--red); }

.page-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.maria-status { font-size: 11px; color: var(--green); }

.page-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* ── Cards ─────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-weight: 600; font-size: 13px; }
.card-meta  { font-size: 11px; color: var(--muted); }
.card-link  { font-size: 12px; color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── KPI Row ────────────────────────────────────── */

.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}
.kpi-highlight { border-color: var(--accent); background: rgba(79,124,255,0.06); }
.tier-a-card   { border-color: var(--tier-a); background: rgba(34,197,94,0.06); }
.tier-b-card   { border-color: var(--tier-b); background: rgba(59,130,246,0.06); }
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 32px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; }
.kpi-sub   { font-size: 11px; color: var(--muted); }
.kpi-sub a { color: var(--accent); }

/* ── Buttons ────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border2); color: var(--text); }
.btn-ghost     { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.ml-auto { margin-left: auto; }
.mt-8 { margin-top: 8px; }

/* ── Forms ─────────────────────────────────────── */

.form-input, .form-select, .form-textarea {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-textarea { resize: vertical; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ── Auth ─────────────────────────────────────── */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 380px;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.logo-dot-lg { font-size: 36px; color: var(--accent); display: block; line-height: 1; margin-bottom: 8px; }
.auth-logo h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.auth-logo p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-footer { text-align: center; font-size: 11px; color: var(--muted); margin-top: 20px; }

/* ── Alerts ─────────────────────────────────────── */

.alert {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 4px;
}
.alert-error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }

/* ── Tier Badges ──────────────────────────────── */

.tier-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
}
.tier-a { background: rgba(34,197,94,0.15);  color: var(--tier-a); }
.tier-b { background: rgba(59,130,246,0.15); color: var(--tier-b); }
.tier-c { background: rgba(234,179,8,0.15);  color: var(--tier-c); }
.tier-d { background: rgba(107,114,128,0.15);color: var(--tier-d); }
.tier-lg { font-size: 16px; padding: 4px 14px; }

/* ── Tier Bar (leads page) ─────────────────────── */

.tier-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.tier-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s;
  cursor: pointer;
}
.tier-pill:hover, .tier-pill.active { border-color: var(--accent); }
.tier-pill.tier-a.active { border-color: var(--tier-a); }
.tier-pill.tier-b.active { border-color: var(--tier-b); }
.tier-pill.tier-c.active { border-color: var(--tier-c); }
.tp-label { font-size: 18px; font-weight: 800; }
.tier-pill.tier-a .tp-label { color: var(--tier-a); }
.tier-pill.tier-b .tp-label { color: var(--tier-b); }
.tier-pill.tier-c .tp-label { color: var(--tier-c); }
.tier-pill.tier-d .tp-label { color: var(--tier-d); }
.tp-count  { font-size: 20px; font-weight: 700; }
.tp-action { font-size: 11px; color: var(--muted); }
.clear-tier { font-size: 12px; color: var(--muted); padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border); }
.clear-tier:hover { color: var(--red); border-color: var(--red); }

/* ── Filter bar ────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-bar .form-input  { max-width: 220px; }
.filter-bar .form-select { width: auto; }
.fi-search { flex: 1; min-width: 160px; }
.result-total { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── Table ─────────────────────────────────────── */

.table-card { padding: 0; overflow: hidden; }
.leads-table { width: 100%; border-collapse: collapse; }
.leads-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.leads-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leads-table tbody tr:last-child td { border-bottom: none; }
.leads-table tbody tr:hover td { background: rgba(255,255,255,0.015); }
.col-name a { color: var(--accent); font-weight: 500; }
.col-name a:hover { text-decoration: underline; }

/* ── Score bars ────────────────────────────────── */

.score-bar-sm {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}
.score-fill-sm {
  height: 5px;
  background: var(--accent);
  border-radius: 3px;
  flex: 0 0 auto;
  min-width: 3px;
  max-width: 60px;
}
.score-num-sm { font-weight: 600; font-size: 12px; }

.score-mini { display: flex; align-items: center; gap: 6px; }
.score-fill-mini {
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  min-width: 2px;
  max-width: 50px;
}

/* ── Platform badges ────────────────────────────── */

.plt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 2px;
}
.plt.shopee  { background: rgba(238,77,45,0.15); color: #ee4d2d; }
.plt.tiktok  { background: rgba(0,0,0,0.3); color: #fff; }
.plt.fb      { background: rgba(24,119,242,0.15); color: #1877f2; }
.plt.ig      { background: rgba(225,48,108,0.15); color: #e1306c; }
.plt.web     { background: rgba(79,124,255,0.15); color: var(--accent); }

.plt-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
  margin-bottom: 4px;
}
.plt-badge.shopee   { background: rgba(238,77,45,0.12); color: #ee4d2d; }
.plt-badge.tiktok   { background: rgba(255,255,255,0.08); color: #fff; }
.plt-badge.fb       { background: rgba(24,119,242,0.12); color: #1877f2; }
.plt-badge.ig       { background: rgba(225,48,108,0.12); color: #e1306c; }
.plt-badge.web      { background: rgba(79,124,255,0.12); color: var(--accent); }
.plt-badge.ads      { background: rgba(234,179,8,0.12); color: var(--yellow); }
.plt-badge.multi    { background: rgba(249,115,22,0.12); color: var(--orange); }
.plt-badge.lazada-on  { background: rgba(239,68,68,0.12); color: var(--red); }
.plt-badge.lazada-off { background: rgba(34,197,94,0.12); color: var(--green); }

.badge-lazada {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-lazada.on  { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-lazada.off { background: rgba(34,197,94,0.12); color: var(--green); }

/* ── Signal tags ──────────────────────────────── */

.signal-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-left: 4px;
  vertical-align: middle;
}
.signal-tag.ads   { background: rgba(234,179,8,0.15); color: var(--yellow); }
.signal-tag.multi { background: rgba(249,115,22,0.15); color: var(--orange); }

/* ── Status pills ──────────────────────────────── */

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.status-new          { background: rgba(79,124,255,0.12); color: var(--accent); }
.status-contacted    { background: rgba(234,179,8,0.12);  color: var(--yellow); }
.status-interested   { background: rgba(34,197,94,0.12);  color: var(--green); }
.status-not-interested { background: rgba(239,68,68,0.12); color: var(--red); }
.status-onboarding   { background: rgba(249,115,22,0.12); color: var(--orange); }
.status-converted    { background: rgba(34,197,94,0.2);   color: var(--green); font-weight: 700; }
.status-archived     { background: rgba(107,114,128,0.12);color: var(--muted); }

/* ── Triggers ──────────────────────────────────── */

.trigger-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.trigger-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface2);
  border-left: 3px solid var(--border);
}
.trigger-item.priority-urgent { border-left-color: var(--red); }
.trigger-item.priority-high   { border-left-color: var(--orange); }
.trigger-item.priority-medium { border-left-color: var(--yellow); }
.trigger-item.priority-low    { border-left-color: var(--muted); }
.trigger-item.read            { opacity: 0.45; }
.tr-read td { opacity: 0.5; }

.trigger-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 4px;
}
.priority-urgent .trigger-dot { background: var(--red); }
.priority-high   .trigger-dot { background: var(--orange); }
.priority-medium .trigger-dot { background: var(--yellow); }
.trigger-title { font-size: 12px; font-weight: 500; }
.trigger-meta  { font-size: 11px; color: var(--muted); }
.btn-mark-read {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.btn-mark-read:hover { color: var(--green); background: rgba(34,197,94,0.1); }

.priority-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.priority-dot.priority-urgent { background: var(--red); }
.priority-dot.priority-high   { background: var(--orange); }
.priority-dot.priority-medium { background: var(--yellow); }
.priority-dot.priority-low    { background: var(--muted); }
.priority-label { font-size: 12px; font-weight: 500; }
.type-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--muted);
}
.t-title { font-weight: 500; }
.t-desc  { margin-top: 2px; }
.status-read   { font-size: 11px; color: var(--muted); }
.status-unread { font-size: 11px; color: var(--accent); font-weight: 600; }

/* ── Discovery card ────────────────────────────── */

.discovery-card .card-header { margin-bottom: 12px; }
.discovery-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.discovery-row .form-input { flex: 1; min-width: 200px; }
.disc-status { margin-top: 10px; padding: 9px 14px; border-radius: 6px; font-size: 13px; }
.disc-status.loading { background: rgba(79,124,255,0.08); color: var(--accent); }
.disc-status.success { background: rgba(34,197,94,0.08); color: var(--green); }
.disc-status.error   { background: rgba(239,68,68,0.08); color: var(--red); }
.hidden { display: none !important; }
.last-scout { margin-top: 10px; font-size: 11px; color: var(--muted); }

/* ── Brief ─────────────────────────────────────── */

.brief-text { font-size: 13px; line-height: 1.7; color: var(--text); }
.brief-recs { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.brief-rec  { font-size: 12px; color: var(--accent); }

/* ── Category bars ─────────────────────────────── */

.cat-bars { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 10px; }
.cat-name { font-size: 12px; color: var(--muted); width: 130px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar-wrap { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.cat-bar { height: 100%; background: var(--accent); border-radius: 3px; }
.cat-count { font-size: 12px; color: var(--muted); width: 30px; text-align: right; }

/* ── Mini table ────────────────────────────────── */

.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.mini-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); font-size: 12px; }
.mini-table tbody tr:last-child td { border-bottom: none; }
.mini-table a { color: var(--accent); }

/* ── Lead detail ───────────────────────────────── */

.detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.detail-main   { display: flex; flex-direction: column; gap: 16px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 68px; }

.seller-header .sh-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.sh-name { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.sh-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sh-score-block { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sh-score { font-size: 40px; font-weight: 800; line-height: 1; }

.score-breakdown { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.bd-row { display: flex; align-items: center; gap: 10px; }
.bd-label { font-size: 11px; color: var(--muted); width: 110px; flex-shrink: 0; }
.bd-track { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.bd-fill  { height: 100%; background: var(--accent); border-radius: 2px; }
.bd-pts   { font-size: 11px; color: var(--muted); width: 36px; text-align: right; }

.platform-row { display: flex; flex-wrap: wrap; gap: 4px; }

.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.dg-item { display: flex; flex-direction: column; gap: 2px; }
.dg-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.dg-val   { font-size: 13px; font-weight: 500; }

.source-link  { font-size: 12px; color: var(--accent); display: block; margin-bottom: 8px; }
.snippet-text { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 6px; }

.ai-summary  { font-size: 13px; line-height: 1.7; }
.pitch-block { margin-top: 14px; padding: 12px 16px; background: var(--surface2); border-radius: var(--radius); border-left: 3px solid var(--accent); }
.pitch-label { font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.pitch-text  { font-size: 13px; line-height: 1.7; }
.scan-meta   { margin-top: 10px; }
.scanning-badge { font-size: 11px; color: var(--yellow); }

.status-block { margin-bottom: 12px; }
.assigned-info { margin-top: 6px; }
.pushed-badge  { font-size: 13px; color: var(--green); font-weight: 600; }
.contact-row   { padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.contact-row:last-child { border-bottom: none; }

/* ── Radar ─────────────────────────────────────── */

.trend-flag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.flag-rising   { background: rgba(34,197,94,0.12); color: var(--green); }
.flag-declining{ background: rgba(239,68,68,0.12); color: var(--red); }
.flag-new      { background: rgba(234,179,8,0.12); color: var(--yellow); }
.flag-stable   { background: rgba(107,114,128,0.12); color: var(--muted); }
.text-green    { color: var(--green); }
.text-red      { color: var(--red); }
.text-blue     { color: var(--blue); }
.cat-name-cell { font-weight: 500; }

/* ── Territory ─────────────────────────────────── */

.gap-bar { display: inline-block; width: 60px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.gap-fill { height: 100%; border-radius: 3px; }
.gap-high { background: var(--green); }
.gap-mid  { background: var(--yellow); }
.gap-low  { background: var(--muted); }
.gap-label { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 3px; }
.gap-label.high { background: rgba(34,197,94,0.12); color: var(--green); }
.gap-label.mid  { background: rgba(234,179,8,0.12);  color: var(--yellow); }
.gap-label.low  { background: rgba(107,114,128,0.12);color: var(--muted); }
.territory-legend { margin-top: 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }

.region-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.region-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}
.rc-city  { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.rc-count { font-size: 28px; font-weight: 800; }
.rc-label { font-size: 11px; color: var(--muted); }
.rc-score { font-size: 11px; color: var(--accent); margin-top: 6px; }
.rc-tier-a{ font-size: 11px; color: var(--tier-a); margin-top: 2px; }

/* ── Pagination ────────────────────────────────── */

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; border-top: 1px solid var(--border); }
.page-btn  { font-size: 13px; color: var(--accent); }
.page-info { font-size: 12px; color: var(--muted); }

/* ── Bulk bar ──────────────────────────────────── */

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(79,124,255,0.08);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

/* ── Empty state ───────────────────────────────── */

.empty-state { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty-state p:first-child { font-size: 15px; margin-bottom: 6px; color: var(--text); }
.empty-state a { color: var(--accent); }

/* ── Misc ──────────────────────────────────────── */

.muted  { color: var(--muted); }
.small  { font-size: 11px; }
.btn-row-detail { font-size: 14px; color: var(--muted); padding: 3px 8px; border-radius: 4px; }
.btn-row-detail:hover { color: var(--accent); background: rgba(79,124,255,0.08); }

/* ── Velocity & Prediction Badges ───────────────── */

.velocity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.velocity-badge.surging  { background: rgba(255,107,53,0.15); color: #ff6b35; border: 1px solid rgba(255,107,53,0.3); }
.velocity-badge.growing  { background: rgba(247,201,72,0.15); color: #f7c948; border: 1px solid rgba(247,201,72,0.3); }
.velocity-badge.stable   { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.2); }
.velocity-badge.declining{ background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

.confidence-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.confidence-badge.high   { background: rgba(62,207,142,0.15); color: #3ecf8e; }
.confidence-badge.medium { background: rgba(247,201,72,0.15); color: #f7c948; }
.confidence-badge.low    { background: rgba(100,116,139,0.12); color: #94a3b8; }

.accent { color: var(--accent); }

/* ── Help Panel ─────────────────────────────────── */

.help-trigger {
  margin-left: auto;
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
}
.help-trigger:hover { color: var(--accent); border-color: var(--accent); }

.help-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 24px;
}
.help-panel-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.help-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.help-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.help-close:hover { color: var(--text); background: var(--hover); }
.help-section { margin-bottom: 20px; }
.help-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.help-section p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.help-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.help-list li {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
  line-height: 1.5;
}
.help-list li strong { color: var(--text); }

/* ── KPI Card Tooltips ───────────────────────────── */

.tooltip-card { position: relative; }

.kpi-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background: #0f1624;
  border: 1px solid rgba(62,207,142,0.3);
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 12px;
  color: #a0aec0;
  line-height: 1.6;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(62,207,142,0.08);
  pointer-events: none;
}

/* Arrow points UP (tooltip is below) */
.kpi-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(62,207,142,0.3);
}

.kpi-tooltip-title {
  font-size: 12px;
  font-weight: 700;
  color: #3ecf8e;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.tooltip-card:hover .kpi-tooltip {
  display: block;
  animation: tooltipFadeIn 0.18s ease;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Keep tooltip inside viewport on edge cards */
.kpi-card:first-child .kpi-tooltip,
.card:first-child .kpi-tooltip { left: 0; transform: none; }
.kpi-card:first-child .kpi-tooltip::after,
.card:first-child .kpi-tooltip::after { left: 24px; }

.kpi-card:last-child .kpi-tooltip,
.card:last-child .kpi-tooltip { left: auto; right: 0; transform: none; }
.kpi-card:last-child .kpi-tooltip::after,
.card:last-child .kpi-tooltip::after { left: auto; right: 24px; }

.tier-pill:first-child .kpi-tooltip { left: 0; transform: none; }
.tier-pill:first-child .kpi-tooltip::after { left: 24px; }
.tier-pill:last-child .kpi-tooltip { left: auto; right: 0; transform: none; }
.tier-pill:last-child .kpi-tooltip::after { left: auto; right: 24px; }
