/* ═══════════════════════════════════════════════════════
   CTB Realty — Dashboard (Stripe Design Language)
   ═══════════════════════════════════════════════════════ */

.dash-body { padding: 28px 28px 40px; max-width: 1440px; margin: 0 auto; }
.main-content-scroll { margin-right: 300px; }

/* ── Period Selector ── */
.period-selector {
  display: flex; background: var(--bg); border-radius: 9999px; padding: 3px; gap: 2px;
  border: 1px solid var(--border);
}
.ps-btn {
  border: none; background: transparent; color: var(--ink-muted); font-size: 11px; font-weight: 600;
  padding: 5px 14px; border-radius: 9999px; cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.ps-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.1),0 1px 2px rgba(0,0,0,0.06); }
.ps-btn:hover:not(.active) { color: var(--ink); }

/* ── KPI Cards ── */
.kpi-row-modern { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card-v2 {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.03);
  display: flex; flex-direction: column; transition: box-shadow 0.18s;
}
.kpi-card-v2:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.06),0 4px 16px rgba(0,0,0,0.04); }
.kpi-v2-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kpi-v2-label { font-size: 11px; font-weight: 600; color: var(--ink-muted); }
.kpi-v2-icon {
  width: 30px; height: 30px; border-radius: 8px; background: rgba(99,91,255,0.08); color: #635bff;
  display: flex; align-items: center; justify-content: center;
}
.kpi-v2-icon svg { width: 14px; height: 14px; }
.kpi-v2-value { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 4px; line-height: 1; }
.kpi-v2-delta { font-size: 11px; font-weight: 600; display: flex; align-items: center; margin-bottom: 12px; }
.kpi-v2-delta.up { color: var(--emerald); }
.kpi-v2-delta.down { color: var(--rose); }
.kpi-v2-sub { color: var(--ink-faint); font-weight: 400; margin-left: 4px; }
.kpi-v2-bars { display: flex; align-items: flex-end; gap: 2px; height: 22px; width: 100%; margin-top: auto; }
.kpi-bar { flex: 1; border-radius: 2px; background: rgba(0,0,0,0.05); transition: height 0.5s cubic-bezier(0.16,1,0.3,1); min-height: 2px; }
.kpi-bar.active { background: #635bff; }

/* ── Cards ── */
.dash-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.03);
  display: flex; flex-direction: column; overflow: hidden;
}
.chart-card-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.chart-title { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.chart-subtitle { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.header-badge { background: var(--bg); color: var(--ink-muted); font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 20px; flex-shrink: 0; }

/* ── Funnel Chart ── */
.chart-wrap { padding: 14px 20px 18px; flex: 1; min-height: 240px; }
.funnel-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 6px 22px 4px; }
.fstat-item { display: flex; align-items: flex-start; gap: 8px; }
.fstat-dot { width: 3px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.fstat-label { font-size: 10px; font-weight: 500; color: var(--ink-muted); }
.fstat-val { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1; }
.fstat-delta { font-size: 10px; font-weight: 600; }
.fstat-delta.up { color: var(--emerald); }
.fstat-delta.down { color: var(--rose); }

/* ── District Map ── */
.map-wrap { padding: 14px 20px 18px; position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; }
.map-svg { width: 100%; height: auto; max-height: 240px; }
.map-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 10px; font-weight: 600; color: var(--ink-faint); width: 100%; justify-content: center; }
.map-legend-bar { flex: 1; height: 4px; background: linear-gradient(to right, rgba(5,150,105,0.1), #059669); border-radius: 4px; max-width: 120px; }

/* ── Map Tooltip ── */
.map-tooltip {
  position: fixed; pointer-events: none; background: #0f1119; color: #fff;
  padding: 12px 16px; border-radius: 10px; font-size: 12px; z-index: 1000;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25); display: none; transform: translate(-50%,-100%); margin-top: -10px;
}
.map-tooltip::after { content:""; position:absolute; bottom:-5px; left:50%; transform:translateX(-50%); border-left:5px solid transparent; border-right:5px solid transparent; border-top:5px solid #0f1119; }
.mt-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; display: block; }
.mt-row { font-size: 12px; color: rgba(255,255,255,0.8); margin-bottom: 1px; display: flex; align-items: center; gap: 5px; }
.mt-val { font-weight: 600; color: #fff; }
.mt-label { color: rgba(255,255,255,0.5); }
.district-node { cursor: pointer; transition: opacity 0.15s; }
.district-node:hover { opacity: 0.8; }

/* ── Map Detail Panel ── */
.map-detail { display: none; width: 100%; margin-top: 8px; background: var(--bg); border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border); }
.map-detail.open { display: block; }
.map-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.map-detail-title { font-size: 13px; font-weight: 700; }
.map-detail-close { width: 22px; height: 22px; border-radius: 6px; border: none; background: var(--surface); color: var(--ink-muted); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.map-detail-close:hover { background: var(--border); }
.map-detail-stats { display: flex; gap: 14px; margin-bottom: 8px; }
.mds-val { font-size: 16px; font-weight: 800; }
.mds-label { font-size: 9px; color: var(--ink-faint); text-transform: uppercase; font-weight: 600; }
.map-detail-deals { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.map-detail-deal { padding: 6px 8px; background: var(--surface); border-radius: 6px; border: 1px solid var(--hairline); }
.mdd-name { font-size: 11px; font-weight: 700; }
.mdd-meta { font-size: 10px; color: var(--ink-muted); margin-top: 1px; }
.map-detail-crm-link { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; background: #635bff; color: #fff; border-radius: 7px; font-size: 10px; font-weight: 600; text-decoration: none; }
.map-detail-crm-link:hover { opacity: 0.85; }
.map-expand-btn { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: #fff; color: var(--ink-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ── Expanded Map ── */
.map-expanded-overlay { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); align-items: center; justify-content: center; }
.map-expanded-overlay.open { display: flex; }
.map-expanded-card { background: #fff; border-radius: 20px; border: 1px solid var(--border); width: 90vw; max-width: 800px; max-height: 90vh; overflow: hidden; }
.map-expanded-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.map-expanded-close { width: 26px; height: 26px; border-radius: 7px; border: none; background: var(--bg); color: var(--ink-muted); font-size: 16px; cursor: pointer; }
.map-expanded-body { padding: 16px 20px 20px; }
.map-svg-expanded { width: 100%; height: auto; max-height: 55vh; }

/* ── Sentiment Tracker ── */
.spark-grid-modern { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 22px 20px; }
.spark-modern-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  background: var(--bg); transition: box-shadow 0.18s; cursor: pointer; overflow: hidden;
}
.spark-modern-card:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.06),0 2px 8px rgba(0,0,0,0.04); }
.smc-detail { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s ease,opacity 0.2s ease,margin-top 0.2s ease; margin-top: 0; border-top: 1px solid transparent; }
.spark-modern-card.expanded .smc-detail { max-height: 200px; opacity: 1; margin-top: 10px; border-top-color: var(--hairline); padding-top: 8px; }
.smc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.smc-name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.smc-priority { font-size: 8px; font-weight: 800; padding: 2px 7px; border-radius: 20px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.smc-meta { font-size: 10px; color: var(--ink-faint); margin-bottom: 10px; }
.smc-spark-wrap { height: 44px; width: 100%; margin-bottom: 10px; }
.smc-footer { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid var(--hairline); padding-top: 10px; }
.smc-stat-val { font-size: 15px; font-weight: 800; color: var(--ink); line-height: 1; }
.smc-stat-val.blue { color: #3b82f6; }
.smc-stat-label { font-size: 8px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 3px; line-height: 1.1; }
.smc-detail-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 10px; }
.smc-detail-label { color: var(--ink-faint); }
.smc-detail-val { color: var(--ink); font-weight: 600; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smc-crm-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 5px 12px; background: #635bff; color: #fff; border-radius: 7px; font-size: 10px; font-weight: 600; text-decoration: none; }
.smc-crm-link:hover { opacity: 0.85; }

/* ── Reminders ── */
.reminder-stack { display: flex; flex-direction: column; padding: 0 22px 20px; gap: 2px; }
.rem-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px;
  cursor: pointer; transition: background 0.12s; text-decoration: none; color: inherit;
}
.rem-item:hover { background: var(--bg); }
.rem-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rem-icon.orange { background: #fff7ed; color: #f97316; }
.rem-icon.blue { background: #eff6ff; color: #3b82f6; }
.rem-icon.red { background: #fef2f2; color: #ef4444; }
.rem-icon svg { width: 17px; height: 17px; }
.rem-content { flex: 1; min-width: 0; }
.rem-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.rem-subtext { font-size: 11px; color: var(--ink-faint); margin-top: 1px; }
.rem-chevron { width: 13px; height: 13px; color: var(--border); flex-shrink: 0; }

/* ── Activity Rail ── */
.activity-rail {
  position: fixed; top: 0; right: 0; bottom: 0; width: 300px;
  background: #F9F9FB; border-left: 1px solid rgba(0,0,0,0.07);
  display: flex; flex-direction: column; z-index: 90;
  transition: background 0.3s;
}
[data-theme="dark"] .activity-rail { background: #111116; border-left-color: rgba(255,255,255,0.06); }
.rail-header { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.rail-title { font-size: 14px; font-weight: 700; }
.rail-badge { background: var(--bg); color: var(--ink-muted); font-size: 10px; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.rail-stream { flex: 1; overflow-y: auto; padding: 12px; }
.ev-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; background: var(--bg); margin-bottom: 4px; cursor: pointer; transition: background 0.12s; }
.ev-item:hover { background: var(--border); }
.ev-av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.ev-body { flex: 1; min-width: 0; }
.ev-type { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 1px; }
.ev-desc { font-size: 11px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-bottom: 1px; }
.ev-agent { font-size: 10px; color: var(--ink-faint); }
.ev-time { font-size: 9px; color: var(--ink-faint); text-align: right; flex-shrink: 0; }

/* ── Leaderboard ── */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th { text-align: left; padding: 9px 20px; font-size: 9px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.lb-table td { padding: 10px 20px; border-bottom: 1px solid var(--hairline); }
.ag-cell { display: flex; align-items: center; gap: 10px; }
.ag-rank { font-weight: 800; font-size: 12px; width: 14px; }
.ag-name { font-weight: 700; font-size: 13px; color: var(--ink); }
.prog-track { height: 5px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.gci-val { font-weight: 800; font-size: 13px; color: var(--ink); }

/* ── Period Select ── */
.period-select {
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  color: var(--ink); font-family: inherit; font-size: 11px; font-weight: 500;
  padding: 5px 8px; cursor: pointer; outline: none;
}
.period-select:focus { border-color: #635bff; }

/* ── Calendar ── */
.cal-nav-btn { width: 26px; height: 26px; border-radius: 7px; background: var(--bg); border: 1px solid var(--border); color: var(--ink-muted); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.cal-nav-btn:hover { background: var(--border); color: var(--ink); }

/* ── Schedule ── */
.schedule-card { padding-bottom: 18px; }
.sch-month-nav { display: flex; justify-content: center; align-items: center; gap: 36px; margin: 8px 0 14px; }
.sch-nav-btn { border: 1px solid var(--border); background: #fff; width: 26px; height: 26px; border-radius: 7px; color: var(--ink-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; font-family: inherit; }
.sch-nav-btn:hover { background: var(--bg); color: var(--ink); }
.sch-calendar { padding: 0 16px 12px; }
.sch-cal-header { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; margin-bottom: 3px; text-align: center; }
.sch-cal-day-name { font-size: 9px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; padding: 3px 0; }
.sch-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; }
.sch-cal-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; transition: all 0.12s; position: relative; font-size: 11px; font-weight: 500; color: var(--ink); }
.sch-cal-cell:hover { background: var(--bg); }
.sch-cal-cell.other-month { color: var(--ink-faint); opacity: 0.3; pointer-events: none; }
.sch-cal-cell.today { font-weight: 800; }
.sch-cal-cell.selected { background: #635bff; color: #fff; font-weight: 700; }
.sch-cal-cell.today:not(.selected) { box-shadow: inset 0 0 0 1.5px #635bff; }
.sch-cal-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--emerald); position: absolute; bottom: 2px; }
.sch-cal-cell.selected .sch-cal-dot { background: rgba(255,255,255,0.6); }
.sch-search-wrap { background: var(--bg); border-radius: 10px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.sch-search-wrap input { border: none; background: transparent; font-size: 12px; font-weight: 500; width: 100%; outline: none; color: var(--ink); font-family: inherit; }
.sch-search-cmd { font-size: 9px; font-weight: 600; color: var(--ink-faint); background: #fff; border: 1px solid var(--border); padding: 1px 4px; border-radius: 3px; }
.sch-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.sch-item { background: var(--bg); border-radius: 12px; padding: 14px; cursor: pointer; transition: background 0.12s; overflow: hidden; }
.sch-item:hover { background: var(--border); }
.sch-item-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.sch-item-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.sch-chevron { flex-shrink: 0; color: var(--ink-faint); transition: transform 0.2s ease; }
.sch-item.expanded .sch-chevron { transform: rotate(180deg); }
.sch-item-time { font-size: 11px; font-weight: 500; color: var(--ink-muted); margin-bottom: 8px; }
.sch-item-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.sch-item-loc { font-size: 11px; color: var(--ink-muted); display: flex; align-items: center; gap: 3px; }
.sch-detail { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s ease,opacity 0.2s ease,margin-top 0.2s ease; margin-top: 0; }
.sch-item.expanded .sch-detail { max-height: 200px; opacity: 1; margin-top: 12px; }
.sch-detail-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--hairline); font-size: 11px; }
.sch-detail-label { color: var(--ink-faint); font-weight: 500; }
.sch-detail-val { color: var(--ink); font-weight: 600; }
.sch-crm-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 6px 12px; background: #635bff; color: #fff; border-radius: 7px; font-size: 10px; font-weight: 600; text-decoration: none; }
.sch-crm-link:hover { opacity: 0.85; }
.sch-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.sch-badge.blue { background: #e0e7ff; color: #4338ca; }
.sch-badge.orange { background: #ffedd5; color: #9a3412; }

/* ── Reminders Rail Content ── */
.rem-rail-section { margin-bottom: 2px; }
.rem-rail-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 4px; }
.rem-rail-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.rem-rail-label.red    { color: #ef4444; }
.rem-rail-label.orange { color: #f97316; }
.rem-rail-label.blue   { color: #3b82f6; }
.rem-rail-label.purple { color: #8b5cf6; }
.rem-rail-label.amber  { color: #f59e0b; }
.rem-rail-count { font-size: 10px; font-weight: 600; color: var(--ink-faint); background: var(--bg); padding: 1px 7px; border-radius: 20px; }
.rem-rail-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; text-decoration: none; color: inherit; transition: background 0.12s; }
.rem-rail-item:hover { background: var(--bg); }
.rem-rail-ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rem-rail-ico svg { width: 13px; height: 13px; }
.rem-rail-ico.red    { background: #fef2f2; color: #ef4444; }
.rem-rail-ico.orange { background: #fff7ed; color: #f97316; }
.rem-rail-ico.blue   { background: #eff6ff; color: #3b82f6; }
.rem-rail-ico.purple { background: #f5f3ff; color: #8b5cf6; }
.rem-rail-ico.amber  { background: #fffbeb; color: #f59e0b; }
.rem-rail-text { flex: 1; min-width: 0; }
.rem-rail-name { font-size: 11px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-rail-sub  { font-size: 10px; color: var(--ink-faint); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-rail-tag  { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 20px; flex-shrink: 0; white-space: nowrap; }
.rem-rail-tag.red    { background: #fef2f2; color: #ef4444; }
.rem-rail-tag.orange { background: #fff7ed; color: #ea580c; }
.rem-rail-tag.blue   { background: #eff6ff; color: #2563eb; }
.rem-rail-tag.amber  { background: #fffbeb; color: #b45309; }
.rem-rail-tag.purple { background: #f5f3ff; color: #7c3aed; }
.rem-rail-empty { text-align: center; padding: 48px 20px; color: var(--ink-faint); font-size: 12px; line-height: 1.6; display: flex; flex-direction: column; align-items: center; }

/* ── Dark Mode ── */
[data-theme="dark"] .kpi-card-v2 { background: var(--surface); }
[data-theme="dark"] .dash-card { background: var(--surface); }
[data-theme="dark"] .ps-btn.active { background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
[data-theme="dark"] .activity-rail { background: var(--surface); }
[data-theme="dark"] .ev-item { background: var(--surface); }
[data-theme="dark"] .ev-item:hover { background: var(--border); }
[data-theme="dark"] .spark-modern-card { background: var(--surface); }
[data-theme="dark"] .smc-priority { background: var(--bg); }
[data-theme="dark"] .sch-nav-btn { background: var(--surface); }
[data-theme="dark"] .sch-cal-cell.selected { background: #7c73ff; }
[data-theme="dark"] .sch-item { background: var(--surface); }
[data-theme="dark"] .sch-item:hover { background: var(--border); }
[data-theme="dark"] .sch-search-cmd { background: var(--surface); }
[data-theme="dark"] .rem-icon.orange { background: #431407; color: #fb923c; }
[data-theme="dark"] .rem-icon.blue { background: #0a1e3e; color: #60a5fa; }
[data-theme="dark"] .rem-icon.red { background: #450a0a; color: #f87171; }
[data-theme="dark"] .kpi-bar { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .rem-rail-ico.red    { background: #450a0a; color: #f87171; }
[data-theme="dark"] .rem-rail-ico.orange { background: #431407; color: #fb923c; }
[data-theme="dark"] .rem-rail-ico.blue   { background: #0a1e3e; color: #60a5fa; }
[data-theme="dark"] .rem-rail-ico.purple { background: #1e1030; color: #a78bfa; }
[data-theme="dark"] .rem-rail-ico.amber  { background: #1a1400; color: #fbbf24; }
[data-theme="dark"] .map-tooltip { background: #f5f5f7; color: #1c1c1e; }
[data-theme="dark"] .map-tooltip::after { border-top-color: #f5f5f7; }
[data-theme="dark"] .mt-title, [data-theme="dark"] .mt-val { color: #1c1c1e; }
[data-theme="dark"] .mt-row, [data-theme="dark"] .mt-label { color: rgba(0,0,0,0.6); }
[data-theme="dark"] .map-detail { background: var(--surface); }
[data-theme="dark"] .map-detail-deal { background: var(--bg); }
[data-theme="dark"] .sch-badge.blue { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .sch-badge.orange { background: #431407; color: #fb923c; }

/* ── Responsive ── */
.dash-row-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.dash-row-3-2 { grid-template-columns: 3fr 2fr; }
.dash-row-1-1 { grid-template-columns: 1fr 1fr; }

@media (max-width:1200px) { 
  .activity-rail { display:none; } 
  .main-content-scroll { margin-right:0; } 
  .kpi-row-modern { grid-template-columns:1fr 1fr; } 
  .dash-row-3-2, .dash-row-1-1 { grid-template-columns: 1fr; }
}
@media (max-width:860px) { 
  .kpi-row-modern { grid-template-columns:1fr; } 
  .spark-grid-modern { grid-template-columns:1fr; } 
  .dash-body { padding:16px; } 
  .dash-row-grid { gap: 12px; }
}
@media (max-width:480px) { 
  .kpi-card-v2 { padding:14px 16px; } 
  .kpi-v2-value { font-size:22px; } 
  .chart-card-head { padding:14px 16px 0; } 
  .funnel-stats { grid-template-columns:repeat(2,1fr); } 
}
