/* ========== DARK THEME (default) ========== */
:root,
[data-theme="dark"] {
  --bg-base: #0b0e1a;
  --bg-panel: #111726;
  --bg-card: #161d30;
  --bg-hover: #1d2540;
  --border: rgba(255,255,255,0.07);
  --text-primary: #e8eaf2;
  --text-secondary: #8b90a7;
  --text-muted: #555c77;

  --blue: #4f8ef7;
  --blue-glow: rgba(79,142,247,0.25);
  --purple: #a56ef5;
  --purple-glow: rgba(165,110,245,0.25);
  --green: #3ecf8e;
  --green-glow: rgba(62,207,142,0.25);
  --orange: #f5924e;
  --orange-glow: rgba(245,146,78,0.25);
  --red: #f56e6e;

  --accent: var(--blue);
  --accent2: var(--purple);
  --accent-glow: var(--blue-glow);
  --gradient-main: linear-gradient(135deg, var(--blue), var(--purple));

  --sidebar-w: 240px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ========== LIGHT THEME ========== */
[data-theme="light"] {
  --bg-base: #f0f2f8;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f4f6fc;
  --border: rgba(0,0,0,0.09);
  --text-primary: #1a1d2e;
  --text-secondary: #5a6280;
  --text-muted: #99a0be;

  --blue: #3b7cf4;
  --blue-glow: rgba(59,124,244,0.2);
  --purple: #8b5cf6;
  --purple-glow: rgba(139,92,246,0.2);
  --green: #10b981;
  --green-glow: rgba(16,185,129,0.2);
  --orange: #f59e0b;
  --orange-glow: rgba(245,158,11,0.2);
  --red: #ef4444;

  --accent: var(--blue);
  --accent2: var(--purple);
  --accent-glow: var(--blue-glow);
  --gradient-main: linear-gradient(135deg, var(--blue), var(--purple));

  --sidebar-w: 240px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ========== OATEY THEME ========== */
[data-theme="oatey"] {
  --bg-base: #fdf8f0;
  --bg-panel: #ffffff;
  --bg-card: #fffdf9;
  --bg-hover: #fef4e0;
  --border: rgba(180,140,60,0.15);
  --text-primary: #2c1f0e;
  --text-secondary: #7a5c38;
  --text-muted: #b59a75;

  --blue: #f5c400;
  --blue-glow: rgba(245,196,0,0.3);
  --purple: #e68c00;
  --purple-glow: rgba(230,140,0,0.25);
  --green: #5a9e3c;
  --green-glow: rgba(90,158,60,0.2);
  --orange: #d96c1a;
  --orange-glow: rgba(217,108,26,0.2);
  --red: #c0392b;

  --accent: #f5c400;
  --accent2: #e68c00;
  --accent-glow: rgba(245,196,0,0.3);
  --gradient-main: linear-gradient(135deg, #f5c400, #e68c00);

  --sidebar-w: 240px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(180,140,40,0.15);
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}



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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px var(--blue-glow);
}

.logo-text {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: var(--transition);
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(79,142,247,0.18), rgba(165,110,245,0.12));
  color: var(--blue);
  border: 1px solid rgba(79,142,247,0.25);
}

.nav-icon { font-size: 18px; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
}

.avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ===================== MAIN CONTENT ===================== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===================== TOP BAR ===================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-left { display: flex; align-items: baseline; gap: 14px; }

.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: linear-gradient(90deg, #fff 60%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-date { font-size: 12px; color: var(--text-muted); }

.top-bar-right { display: flex; align-items: center; gap: 14px; }

.period-selector {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.period-btn {
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.period-btn.active,
.period-btn:hover {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
}

.add-lead-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px var(--blue-glow);
}

.add-lead-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--blue-glow); }
.add-lead-btn span { font-size: 18px; line-height: 1; }

/* ===================== SECTIONS ===================== */
.section { display: none; padding: 28px 32px; }
.section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================== KPI CARDS ===================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.kpi-card[data-color="blue"]::before { background: linear-gradient(90deg, var(--blue), var(--purple)); }
.kpi-card[data-color="purple"]::before { background: linear-gradient(90deg, var(--purple), #e879f9); }
.kpi-card[data-color="green"]::before { background: linear-gradient(90deg, var(--green), #06b6d4); }
.kpi-card[data-color="orange"]::before { background: linear-gradient(90deg, var(--orange), #fbbf24); }

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.kpi-icon { font-size: 22px; }

.kpi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}

.kpi-badge.up { background: rgba(62,207,142,0.15); color: var(--green); }
.kpi-badge.down { background: rgba(245,110,110,0.15); color: var(--red); }

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0.75));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
}

.kpi-bar {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}

.kpi-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: 4px;
  transition: width 1s ease;
}

/* ===================== CHART CARDS ===================== */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.chart-card:hover { border-color: rgba(255,255,255,0.12); }
.chart-card.wide { grid-column: span 1; }

.charts-row .chart-card:first-child { grid-column: span 1; }
/* Make first chart in 2-column span wider */
.charts-row:has(.chart-card:first-child:not(.wide)) .chart-card:first-child {
  grid-column: span 1 !important;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.chart-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Chart wrapper — MUST have explicit height for Chart.js maintainAspectRatio:false */
.chart-wrap {
  position: relative;
  height: 230px;
}
.chart-wrap.h-280 {
  height: 280px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.blue { background: var(--blue); }
.legend-dot.dashed { background: transparent; border: 2px dashed var(--text-muted); }

/* ===================== ACTIVITY LIST ===================== */
.activity-list { display: flex; flex-direction: column; gap: 10px; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  transition: var(--transition);
  animation: slideIn 0.4s ease;
}

.activity-item:hover { background: rgba(255,255,255,0.05); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===================== TARGETS ===================== */
.targets-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.month-selector {
  display: flex;
  align-items: center;
  gap: 14px;
}

.current-month {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 150px;
  text-align: center;
}

.arrow-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  font-family: inherit;
}

.arrow-btn:hover { background: var(--bg-hover); color: var(--blue); }

.edit-target-btn {
  padding: 9px 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.edit-target-btn:hover { border-color: var(--blue); color: var(--blue); }

.target-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.target-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.target-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.target-values {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 14px;
}

.target-actual {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.target-of {
  font-size: 13px;
  color: var(--text-muted);
}

.target-ring-wrapper {
  position: absolute;
  top: 18px; right: 18px;
}

.target-ring {
  width: 52px; height: 52px;
  transform: rotate(-90deg);
}

.ring-bg { fill: none; stroke: var(--bg-hover); stroke-width: 5; }
.ring-fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 138;
  stroke-dashoffset: 138;
  transition: stroke-dashoffset 1.2s ease;
}

.target-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 4px;
  text-align: center;
}

.target-status {
  font-size: 11px;
  font-weight: 600;
}

.target-status.on-track { color: var(--green); }
.target-status.at-risk { color: var(--orange); }
.target-status.behind { color: var(--red); }

/* ===================== LEADS PIPELINE ===================== */
.leads-toolbar, .tracker-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}

.search-box input::placeholder { color: var(--text-muted); }
.search-icon { font-size: 14px; }

.filter-group { display: flex; gap: 10px; }

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.filter-select:hover, .filter-select:focus { border-color: var(--blue); color: var(--text-primary); }

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.pipeline-col {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.col-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.col-count {
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--text-muted);
}

.col-cards { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }

.lead-card {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  padding: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  animation: fadeIn 0.3s ease;
}

.lead-card:hover {
  border-color: rgba(79,142,247,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.lead-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.lead-card-company {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lead-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.lead-source-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-muted);
}

/* ===================== SALES TRACKER TABLE ===================== */
.tracker-table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: auto;
}

.tracker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tracker-table thead tr {
  border-bottom: 1px solid var(--border);
}

.tracker-table th {
  padding: 14px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-panel);
}

.tracker-table td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.035);
  color: var(--text-secondary);
  vertical-align: middle;
}

.tracker-table tbody tr:hover { background: var(--bg-hover); }
.tracker-table tbody tr:last-child td { border-bottom: none; }

.td-lead-name { font-weight: 700; color: var(--text-primary) !important; }
.td-company { color: var(--text-muted) !important; font-size: 11px !important; margin-top: 2px; }

.stage-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.stage-new { background: rgba(79,142,247,0.15); color: var(--blue); }
.stage-contacted { background: rgba(165,110,245,0.15); color: var(--purple); }
.stage-qualified { background: rgba(6,182,212,0.15); color: #22d3ee; }
.stage-proposal { background: rgba(245,146,78,0.15); color: var(--orange); }
.stage-negotiation { background: rgba(251,191,36,0.15); color: #fbbf24; }
.stage-closed-won { background: rgba(62,207,142,0.15); color: var(--green); }
.stage-closed-lost { background: rgba(245,110,110,0.15); color: var(--red); }

.action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  margin-right: 5px;
}

.action-btn:hover { border-color: var(--blue); color: var(--blue); }
.action-btn.del:hover { border-color: var(--red); color: var(--red); }

/* ===================== MODAL ===================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }

.modal {
  background: var(--bg-panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 30px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.3s ease;
  scrollbar-width: thin;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(90deg, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.modal-close:hover { border-color: var(--red); color: var(--red); }

.modal-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.modal-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.modal-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }

.modal-form textarea { resize: vertical; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.btn-cancel {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel:hover { border-color: rgba(255,255,255,0.2); color: var(--text-primary); }

.btn-save {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px var(--blue-glow);
}

.btn-save:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--blue-glow); }

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }


/* ===================== RESPONSIVE ===================== */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .target-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline-board { grid-template-columns: repeat(2, 1fr); }
}


@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .charts-row { grid-template-columns: 1fr; }
}

/* ===================== PRIORITY BADGES ===================== */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.priority-high {
  background: rgba(192, 57, 43, 0.15);
  color: #e74c3c;
}

.priority-med {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.priority-low {
  background: rgba(62, 207, 142, 0.15);
  color: var(--green);
}

/* ===================== CATEGORY BADGES ===================== */
.category-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cat-horeca {
  background: rgba(165, 110, 245, 0.15);
  color: var(--purple);
}

.cat-corporate {
  background: rgba(79, 142, 247, 0.15);
  color: var(--blue);
}

.cat-collab {
  background: rgba(62, 207, 142, 0.15);
  color: var(--green);
}

/* ===================== FOLLOW-UP DATES ===================== */
.followup-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.followup-urgent {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
  background: rgba(245, 146, 78, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ===================== FORM FIELD HINTS ===================== */
.field-hint {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  min-height: 14px;
  font-weight: 600;
  transition: color 0.2s;
}

/* Oatey theme category badge overrides */
[data-theme="oatey"] .cat-horeca {
  background: rgba(245, 196, 0, 0.15);
  color: #c49500;
}

[data-theme="oatey"] .cat-corporate {
  background: rgba(230, 140, 0, 0.15);
  color: var(--orange);
}

[data-theme="oatey"] .priority-high {
  background: rgba(192, 57, 43, 0.12);
  color: var(--red);
}


/* ===================== THEME SWITCHER ===================== */
.theme-switcher {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  gap: 0;
}

.theme-btn {
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.theme-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.theme-btn.active {
  background: var(--gradient-main);
  color: #fff;
}

/* Oatey button — always keeps brand yellow feel when active */
[data-theme="oatey"] .theme-btn.active {
  background: linear-gradient(135deg, #f5c400, #e68c00);
  color: #2c1f0e;
}

/* ===================== OATEY LOGO ===================== */
.oatey-logo-img {
  height: 42px;
  width: auto;
  display: block;
}

.logo-oatey {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4px 0;
}

/* ===================== LIGHT THEME OVERRIDES ===================== */
[data-theme="light"] .kpi-card:hover {
  border-color: rgba(0,0,0,0.15);
}

[data-theme="light"] .chart-card:hover {
  border-color: rgba(0,0,0,0.15);
}

[data-theme="light"] .nav-item.active {
  background: linear-gradient(135deg, rgba(59,124,244,0.12), rgba(139,92,246,0.08));
  color: var(--blue);
  border: 1px solid rgba(59,124,244,0.2);
}

[data-theme="light"] .lead-card:hover {
  border-color: rgba(59,124,244,0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

[data-theme="light"] .tracker-table td {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

[data-theme="light"] .page-title {
  background: linear-gradient(90deg, #1a1d2e, #5a6280);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .kpi-value {
  background: linear-gradient(90deg, #1a1d2e, #3d4266);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .modal {
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
}

/* ===================== OATEY THEME OVERRIDES ===================== */
[data-theme="oatey"] .nav-item.active {
  background: linear-gradient(135deg, rgba(245,196,0,0.18), rgba(230,140,0,0.1));
  color: #c49500;
  border: 1px solid rgba(245,196,0,0.35);
}

[data-theme="oatey"] .nav-item:hover {
  background: var(--bg-hover);
  color: #c49500;
}

[data-theme="oatey"] .kpi-bar-fill {
  background: linear-gradient(90deg, #f5c400, #e68c00);
}

[data-theme="oatey"] .logo-text {
  background: linear-gradient(90deg, #f5c400, #e68c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="oatey"] .page-title {
  background: linear-gradient(90deg, #2c1f0e, #7a5c38);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="oatey"] .kpi-value {
  background: linear-gradient(90deg, #2c1f0e, #5c3d1e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="oatey"] .lead-card:hover {
  border-color: rgba(245,196,0,0.4);
  box-shadow: 0 4px 16px rgba(180,130,40,0.15);
}

[data-theme="oatey"] .add-lead-btn {
  background: linear-gradient(135deg, #f5c400, #e68c00);
  color: #2c1f0e;
  box-shadow: 0 4px 16px rgba(245,196,0,0.3);
}

[data-theme="oatey"] .add-lead-btn:hover {
  box-shadow: 0 8px 24px rgba(245,196,0,0.4);
}

[data-theme="oatey"] .period-btn.active,
[data-theme="oatey"] .period-btn:hover {
  background: linear-gradient(135deg, #f5c400, #e68c00);
  color: #2c1f0e;
}

[data-theme="oatey"] .btn-save {
  background: linear-gradient(135deg, #f5c400, #e68c00);
  color: #2c1f0e;
  box-shadow: 0 4px 16px rgba(245,196,0,0.3);
}

[data-theme="oatey"] .filter-select:hover,
[data-theme="oatey"] .filter-select:focus {
  border-color: #f5c400;
}

[data-theme="oatey"] .modal-overlay {
  background: rgba(44,31,14,0.5);
}

[data-theme="oatey"] .sidebar {
  background: #fff9ec;
  border-right: 1px solid rgba(180,140,60,0.2);
}

[data-theme="oatey"] .top-bar {
  background: #fff9ec;
  border-bottom: 1px solid rgba(180,140,60,0.2);
}

/* ===================== CSV ACTION BUTTONS ===================== */
.csv-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.18s;
  white-space: nowrap;
}

.csv-btn:hover { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }

.export-btn { border-color: var(--primary); color: var(--primary); }
.import-btn { border-color: var(--green);   color: var(--green); cursor: pointer; }
.reset-btn  { border-color: var(--border);  color: var(--text-muted); }

.reset-btn:hover { border-color: var(--red); color: var(--red); background: rgba(245,110,110,0.07); }

/* ===================== IMPORT PREVIEW MODAL ===================== */
.import-modal { max-width: 860px; width: 96vw; }

.import-summary { margin-bottom: 14px; }

.import-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}

.import-mappings, .import-warnings {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
}

.import-mappings {
  background: rgba(79, 142, 247, 0.07);
  border: 1px solid rgba(79, 142, 247, 0.15);
  color: var(--text-secondary);
}

.import-warnings {
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--orange);
}

.import-mappings ul, .import-warnings ul { margin: 4px 0 0 16px; padding: 0; }

.import-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 12px;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.import-preview-table th {
  background: var(--bg-hover);
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.import-preview-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.import-preview-table tr:last-child td { border-bottom: none; }
.import-preview-table tr:hover td { background: var(--bg-hover); }

/* ===================== TOAST NOTIFICATION ===================== */
.dm-toast {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 9999;
  transition: bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  pointer-events: none;
}

.dm-toast.visible { bottom: 28px; }
.dm-toast.warn    { border-color: var(--orange); color: var(--orange); }

/* ===================== CATEGORY FILTER TABS ===================== */
.cat-tabs { display: flex; gap: 6px; padding: 10px 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.cat-tab { padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.18s; }
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-tab.horeca.active { background: #0891b2; border-color: #0891b2; }
.cat-tab.corp.active   { background: var(--primary); border-color: var(--primary); }
.cat-tab.collab.active { background: var(--green); border-color: var(--green); }

/* ===================== BULK ACTION BAR ===================== */
.bulk-bar { display: none; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(79,142,247,0.08); border: 1px solid rgba(79,142,247,0.2); margin-bottom: 10px; animation: fadeInDown 0.2s ease; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.bulk-count { font-size: 13px; font-weight: 700; color: var(--primary); }
.bulk-actions { display: flex; gap: 8px; align-items: center; }
.bulk-btn { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); transition: all 0.15s; }
.bulk-btn:hover { border-color: var(--primary); color: var(--primary); }
.bulk-btn.del-btn { color: var(--red); border-color: var(--red); }
.bulk-btn.del-btn:hover { background: rgba(245,110,110,0.07); }
.bulk-btn.apply-btn { background: var(--primary); color: #fff; border-color: var(--primary); }
.bulk-btn.apply-btn:hover { opacity: 0.88; }
.bulk-col { width: 36px; text-align: center; }

/* ===================== DATA HEALTH ===================== */
.health-score-row { display: grid; grid-template-columns: 220px 1fr; gap: 20px; margin-bottom: 24px; }
.health-score-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hs-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.hs-score { font-size: 56px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.hs-bar   { width: 100%; height: 8px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.hs-fill  { height: 100%; border-radius: 4px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.hs-sub   { font-size: 12px; color: var(--text-muted); text-align: center; }
.health-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-content: start; }
.hs-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; text-align: center; }
.hs-stat-value { font-size: 26px; font-weight: 800; }
.hs-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.health-issues-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.health-issue-count { color: var(--text-muted); font-size: 13px; }
.health-empty { padding: 32px; text-align: center; color: var(--green); font-size: 15px; font-weight: 600; }
.health-row-error   td { background: rgba(239,68,68,0.04) !important; }
.health-row-warning td { background: rgba(245,158,11,0.04) !important; }

/* ===================== KEYBOARD SHORTCUTS ===================== */
.shortcuts-table { width: 100%; border-collapse: collapse; }
.shortcuts-table td { padding: 9px 6px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.shortcuts-table tr:last-child td { border-bottom: none; }
.shortcuts-table td:first-child { width: 60px; }
kbd { display: inline-block; padding: 3px 8px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 5px; font-family: monospace; font-size: 12px; font-weight: 700; color: var(--text-primary); box-shadow: 0 2px 0 var(--border); }

/* ===================== AI PITCH ===================== */
.ai-pitch-section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }

.ai-pitch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.btn-ai-pitch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid #7c3aed;
  background: linear-gradient(135deg, #7c3aed22, #a855f722);
  color: #a855f7;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ai-pitch:hover   { background: linear-gradient(135deg, #7c3aed44, #a855f744); box-shadow: 0 0 12px #a855f733; }
.btn-ai-pitch:disabled { opacity: 0.55; cursor: not-allowed; }

.ai-btn-icon { font-size: 14px; animation: sparkle 1.5s infinite alternate; }
@keyframes sparkle { from { opacity: 0.7; } to { opacity: 1; filter: drop-shadow(0 0 4px #a855f7); } }

.ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.ai-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ai-error {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--red);
  background: rgba(239,68,68,0.07);
  color: var(--red);
  font-size: 12px;
  line-height: 1.6;
}

.ai-pitch-card {
  border: 1.5px solid #7c3aed44;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed0a, #a855f70a);
  padding: 14px 16px;
  position: relative;
}

.ai-pitch-text {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.ai-pitch-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}

.ai-mini-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #7c3aed44;
  background: transparent;
  color: #a855f7;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.ai-mini-btn:hover { background: #a855f711; }

/* Pitch badge in tracker table */
.pitch-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed22, #a855f722);
  border: 1px solid #7c3aed44;
  color: #a855f7;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pitch-badge:hover { background: #a855f733; }

/* ===================== PHASE 5: OVERVIEW ENHANCEMENTS ===================== */

.ai-insights-body { margin-top: 14px; }
.ai-insights-placeholder { font-size: 13px; color: var(--text-muted); line-height: 1.6; padding: 10px; }

/* Leaderboard Table Adjustments */
#leaderboard-body .tracker-table td { padding: 12px 6px; border-bottom: 1px solid var(--border); }
#leaderboard-body .tracker-table tr:last-child td { border-bottom: none; }

/* ===================== PHASE 7: LOGIN OVERLAY ===================== */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-main);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-logo .logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: white;
}
.login-logo .logo-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 30px;
  margin-top: -10px;
}

.login-error {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.system-status {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.system-status h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.status-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.status-badge.ok { background: rgba(62, 207, 142, 0.15); color: var(--green); }
.status-badge.err { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.status-text { font-family: monospace; color: var(--text-primary); background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; }

/* ===================== LOGOUT & PROFILE UI ===================== */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-badge {
  flex: 1;
  transition: background 0.2s;
}
.user-badge:hover {
  background: var(--bg-hover);
}
.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}
.logout-btn svg {
  width: 20px;
  height: 20px;
}

/* ===================== PHASE 8: LEADERSHIP FILTER BAR ===================== */
.lf-bar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 73px; /* below top-bar */
  z-index: 40;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  animation: fadeIn 0.25s ease;
}

.lf-bar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 32px;
}

.lf-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  margin-right: 4px;
}

.lf-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lf-group-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lf-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 80px;
}

.lf-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lf-chip {
  padding: 4px 11px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0.55;
}

.lf-chip.active {
  background: rgba(79,142,247,0.12);
  border-color: rgba(79,142,247,0.35);
  color: var(--blue);
  opacity: 1;
}

.lf-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
  opacity: 1;
}

.lf-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  width: 130px;
  transition: var(--transition);
}

.lf-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(79,142,247,0.15);
}

.lf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.lf-apply-btn {
  padding: 7px 16px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 10px var(--blue-glow);
}

.lf-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--blue-glow);
}

.lf-reset-btn {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.lf-reset-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.lf-active-count {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(79,142,247,0.12);
  color: var(--blue);
  border: 1px solid rgba(79,142,247,0.25);
  white-space: nowrap;
}

/* Leadership-only elements hidden for salesperson role */
.leadership-only { display: none; }
body[data-role="leadership"] .leadership-only { display: flex; }

/* Salesperson-mode banner */
.role-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 32px;
  background: linear-gradient(90deg, rgba(165,110,245,0.08), transparent);
  border-bottom: 1px solid rgba(165,110,245,0.12);
  font-size: 12px;
  color: var(--purple);
  font-weight: 600;
}

.role-banner.visible { display: flex; }
.role-banner-icon { font-size: 15px; }

/* KPI cyan var */
.kpi-card[data-color="cyan"]::before { background: linear-gradient(90deg, #22d3ee, #4f8ef7); }

/* ===================== PHASE 9: DUAL-PROFILE DASHBOARDS ===================== */

/* AI Briefing Banner */
.ai-briefing-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(145deg, rgba(79,142,247,0.08), rgba(165,110,245,0.08));
  border: 1px solid rgba(165,110,245,0.2);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.ai-briefing-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(165,110,245,0.4));
}

.ai-briefing-content {
  flex: 1;
}

.ai-briefing-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--purple);
  margin-bottom: 4px;
}

.ai-briefing-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.ai-briefing-loading {
  position: absolute;
  top: 16px;
  right: 24px;
  display: none;
}

.ai-briefing-banner.loading .ai-briefing-loading {
  display: block;
}

.ai-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(165,110,245,0.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Kpi 5 and 4 Col grids */
.kpi-5col { grid-template-columns: repeat(5, 1fr); margin-bottom: 24px!important; }
.kpi-4col { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) {
  .kpi-5col, .kpi-4col { grid-template-columns: repeat(2, 1fr); }
}

/* Pipeline Health Gauge */
.health-gauge-wrap {
  position: relative;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  text-align: center;
}
.health-gauge { width: 100%; height: auto; display: block; }
.health-gauge-score {
  position: absolute;
  bottom: 15px;
  left: 0; right: 0;
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
}
.health-gauge-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 10px;
}
.health-factors {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.h-factor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}
.h-factor span.bad { color: var(--red); font-weight: 600; }
.h-factor span.warn { color: var(--orange); font-weight: 600; }
.h-factor span.good { color: var(--green); font-weight: 600; }

/* Rep Quick Cards */
.rep-quick-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.rep-quick-card {
  flex: 0 0 140px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.rep-quick-card:hover { border-color: var(--blue); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.rep-q-name { font-weight: 600; font-size: 13px; color: var(--text-primary); margin-bottom: 4px; }
.rep-q-rev { font-weight: 800; font-size: 15px; color: var(--green); margin-bottom: 2px; }
.rep-q-conv { font-size: 11px; color: var(--text-muted); }

/* Team Performance Matrix */
.team-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}
.team-heading { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.team-subheading { font-size: 13px; color: var(--text-muted); }

.rep-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.team-rep-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tr-header { display: flex; justify-content: space-between; align-items: flex-start; }
.tr-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.tr-won-amount { font-size: 20px; font-weight: 800; color: var(--green); }
.tr-target-info { font-size: 11px; color: var(--text-muted); text-align: right; }
.tr-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-secondary); background: var(--bg-panel); padding: 8px; border-radius: 6px; }
.tr-stat { flex: 1; text-align: center; }
.tr-stat strong { display: block; color: var(--text-primary); font-size: 14px; font-weight: 700; }
.tr-alert { font-size: 12px; color: var(--red); font-weight: 600; background: rgba(239, 68, 68, 0.1); padding: 6px 10px; border-radius: 6px; display: inline-block; }

/* Set Targets Modal */
.rep-targets-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.rep-targets-month-label { font-size: 16px; font-weight: 700; color: var(--text-primary); min-width: 120px; text-align: center; }
.rep-targets-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}
.rt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.rt-name { font-weight: 600; color: var(--text-primary); width: 150px; }
.rt-input-wrap { display: flex; align-items: center; gap: 8px; }
.rt-input {
  background: var(--bg-card); border: 1px solid var(--border); padding: 6px 10px; border-radius: 6px; color: var(--text-primary); width: 120px; outline: none; transition: var(--transition);
}
.rt-input:focus { border-color: var(--blue); }

/* Salesperson My Dashboard */
.greeting-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.greeting-name { font-size: 24px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.greeting-date { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.greeting-stat { font-size: 14px; color: var(--text-secondary); background: var(--bg-panel); padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); }

/* Today's Followup List */
.followup-badge-count { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; margin-left: 8px; }
.followup-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.followup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.f-item-left { display: flex; flex-direction: column; gap: 4px; }
.f-item-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.f-item-meta { font-size: 12px; color: var(--text-muted); }
.f-item-actions button {
  background: var(--blue); color: #fff; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600; transition: var(--transition);
}
.f-item-actions button:hover { opacity: 0.9; }

/* My Target Gauge wrap */
.my-target-gauge-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 10px; }
.my-target-details { margin-top: -10px; text-align: center; }
.my-target-details .achieved { font-size: 24px; font-weight: 800; color: var(--text-primary); }
.my-target-details .total { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===================== PHASE 6B: ACTIVITY TIMELINE ===================== */
.timeline-section {
  display: flex;
  flex-direction: column;
}
.timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
  margin-bottom: 16px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}
.timeline-item:last-child::before {
  display: none;
}
.tl-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1;
  position: relative;
  flex-shrink: 0;
}
.tl-content-area {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  flex: 1;
}
.tl-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.tl-author {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}
.tl-time {
  font-size: 11px;
  color: var(--text-muted);
}
.tl-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}
