/* ============================================================
   EliteBiotech Sales Dashboard — Complete UI/UX Overhaul
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ───────────────────────────────── */
:root {
  --bg-base:    #07101e;
  --bg-card:    #0c1829;
  --bg-card2:   #091422;
  --bg-hover:   #132236;
  --bg-glass:   rgba(12, 24, 41, 0.7);
  --border:     #1a3050;
  --border2:    #234570;
  --text:       #e4eeff;
  --text-muted: #6b8fba;
  --text-dim:   #304f75;
  --accent:     #3b82f6;
  --accent2:    #8b5cf6;
  --accent3:    #06b6d4;
  --success:    #10b981;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --sidebar-w:  240px;
  --radius:     16px;
  --radius-sm:  10px;
  --topbar-h:   64px;
  --transition: 0.18s ease;
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

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

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

/* ── Custom Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-card2);
}
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

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

/* ── Layout ──────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1828 0%, #070f1c 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo .icon {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
  flex-shrink: 0;
}

.sidebar-logo .brand h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.sidebar-logo .brand p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0 8px;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 14px 18px 5px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px 9px 18px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-left: 4px solid transparent;
  text-align: left;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-item .icon {
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity var(--transition), filter var(--transition);
}

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

.nav-item:hover .icon {
  opacity: 1;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.04) 100%);
  color: #93c5fd;
  border-left: 4px solid var(--accent);
  font-weight: 600;
}

.nav-item.active .icon {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.7));
}

.sidebar-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.refresh-info {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
}

.refresh-countdown {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent3);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 6px;
  padding: 2px 8px;
}

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  /* MUST stay above the sidebar (z=100) so children with absolute positioning
     (notification panel, dropdowns) are not clipped/hidden by the fixed sidebar.
     The topbar is inside .main-content which is offset by margin-left:sidebar-w
     so this z-index doesn't cause visual overlap with the sidebar. */
  z-index: 150;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

.topbar-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.topbar-back-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
  color: var(--text);
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}

.topbar-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  gap: 1px;
}

.clock-time {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

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

/* ── Period Tabs ─────────────────────────────────────────── */
.period-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.period-tab {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  transition: background var(--transition), color var(--transition);
}

.period-tab.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.period-tab:not(.active):hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── Logout Button ───────────────────────────────────────── */
.logout-btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  transition: all var(--transition);
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ── Page Wrapper ────────────────────────────────────────── */
.page {
  padding: 24px;
  animation: pageSlideIn 0.3s ease both;
  min-height: calc(100vh - var(--topbar-h));
}

.page-hero {
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--hero-accent) 18%, transparent) 0%, transparent 42%),
    linear-gradient(145deg, rgba(12, 24, 41, 0.96) 0%, rgba(7, 16, 30, 0.98) 100%);
  border: 1px solid color-mix(in srgb, var(--hero-accent) 24%, var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 22px 22px 18px;
  margin-bottom: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

.page-hero-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-hero-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-accent);
}

.page-hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-hero-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-hero-desc {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  opacity: 0.7;
}

.page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hero-action-btn,
.toolbar-btn {
  --action-accent: var(--hero-accent, var(--accent));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}

.hero-action-btn:hover,
.toolbar-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--action-accent) 46%, var(--border2));
  color: var(--text);
}

.hero-action-btn.primary,
.toolbar-btn.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--action-accent) 88%, #ffffff 4%) 0%, color-mix(in srgb, var(--action-accent) 58%, #07101e 42%) 100%);
  border-color: color-mix(in srgb, var(--action-accent) 68%, transparent);
  color: #fff;
}

.page-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.hero-chip.interactive {
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.hero-chip.interactive:hover {
  border-color: var(--border2);
  color: var(--text);
}

.hero-chip.default {
  border-color: rgba(59, 130, 246, 0.16);
  background: rgba(59, 130, 246, 0.08);
  color: #bfdbfe;
}

.hero-chip.active {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
}

.hero-chip.warning {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
}

.hero-chip.success {
  border-color: rgba(16, 185, 129, 0.24);
  background: rgba(16, 185, 129, 0.08);
  color: #6ee7b7;
}

.hero-chip.danger {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.hero-chip-clear {
  font-size: 13px;
  line-height: 1;
  opacity: 0.8;
}

.page-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-stat {
  flex: 1 1 120px;
  padding: 0 20px 0 0;
  margin-right: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.hero-stat:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}

.hero-stat.warning .hero-stat-value { color: #f59e0b; }
.hero-stat.success .hero-stat-value { color: #10b981; }
.hero-stat.danger  .hero-stat-value { color: #ef4444; }

.hero-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.hero-stat-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.hero-stat-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Section Title ───────────────────────────────────────── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border2);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.card-subtitle {
  margin-top: -10px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ── KPI Cards ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card2) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--kpi-color, var(--accent));
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  position: relative;
  overflow: visible; /* tooltip must escape the card boundary */
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, z-index 0s;
  animation: fadeInUp 0.4s ease both;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.kpi-card:hover {
  z-index: 10; /* bring hovered card above siblings so tooltip isn't cut by them */
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.kpi-card:nth-child(1) { animation-delay: 0ms; }
.kpi-card:nth-child(2) { animation-delay: 60ms; }
.kpi-card:nth-child(3) { animation-delay: 120ms; }
.kpi-card:nth-child(4) { animation-delay: 180ms; }
.kpi-card:nth-child(5) { animation-delay: 240ms; }
.kpi-card:nth-child(6) { animation-delay: 300ms; }

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  border-color: var(--border2);
  z-index: 10;
}

.kpi-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  padding-right: 40px;
}

.kpi-value {
  font-size: 38px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Sparkline ───────────────────────────────────────────── */
.kpi-sparkline {
  margin-top: 10px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.kpi-sparkline svg {
  flex: 1;
  min-width: 0;
  opacity: 0.85;
}

.spark-trend {
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
  margin-bottom: 2px;
}

/* ── Charts ──────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.chart-container {
  height: 260px;
  position: relative;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.03) 0%, transparent 100%);
  border-radius: var(--radius-sm);
  padding: 4px 0 0;
}

/* ── Leaderboard ─────────────────────────────────────────── */
.leaderboard-header {
  display: grid;
  grid-template-columns: 44px 1fr 80px 80px 100px 70px 70px;
  gap: 8px;
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* ── Rep filter bar ──────────────────────────────────────── */
.rep-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  align-items: center;
}

.rep-filter-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.rep-filter-chip:hover {
  border-color: var(--border2);
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.rep-filter-chip.active {
  border-color: var(--accent);
  background: rgba(59,130,246,0.12);
  color: var(--accent);
}

.rfc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rep-row-selected {
  background: rgba(255,255,255,0.04) !important;
  border-left-color: var(--accent) !important;
}

.rep-row {
  display: grid;
  grid-template-columns: 44px 1fr 80px 80px 100px 70px 70px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  margin-bottom: 2px;
}

.rep-row:hover {
  background: var(--bg-hover);
  border-left-color: var(--accent);
  border-color: var(--border);
}

.rep-rank-1 {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.08) 0%, transparent 60%);
  border-left: 3px solid #fbbf24 !important;
}

.rep-rank-2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0%, transparent 60%);
  border-left: 3px solid #94a3b8 !important;
}

.rep-rank-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.08) 0%, transparent 60%);
  border-left: 3px solid #cd7f32 !important;
}

.rep-rank {
  font-size: 18px;
  text-align: center;
  line-height: 1;
}

.rep-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rep-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
}

.rep-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-team {
  font-size: 11px;
  color: var(--text-dim);
}

.rep-stat {
  text-align: right;
}
.rep-stat-clickable {
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.rep-stat-clickable:hover {
  background: rgba(59,130,246,0.10);
  transform: translateY(-1px);
}

.rep-stat .val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.rep-stat .lbl {
  font-size: 10px;
  color: var(--text-dim);
}

.stale-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 20px;
  padding: 1px 6px;
  margin-top: 2px;
}

/* ── Progress Bars ───────────────────────────────────────── */
.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
  margin: 4px 0;
}

.progress-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent3) 100%);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
  transition: width 0.4s ease;
}

.progress-fill.success {
  background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.progress-fill.warn {
  background: linear-gradient(90deg, var(--warning) 0%, #fcd34d 100%);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.progress-fill.danger {
  background: linear-gradient(90deg, var(--danger) 0%, #f97316 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Funnel Bars ─────────────────────────────────────────── */
.funnel-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.funnel-bar-row.active {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

.funnel-bar-label {
  width: 130px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.funnel-bar-track {
  flex: 1;
  height: 28px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.funnel-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  min-width: 32px;
  transition: width 0.4s ease;
}

.funnel-bar-count {
  width: 36px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

/* ── Stage Funnel (Overview page) ────────────────────────── */
.stage-funnel {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 4px 4px;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.funnel-step.is-clickable,
.funnel-parallel-row.is-clickable {
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--transition), transform var(--transition);
}

.funnel-step.is-clickable:hover,
.funnel-parallel-row.is-clickable:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(2px);
}

.funnel-step.is-active,
.funnel-parallel-row.is-active {
  background: rgba(59, 130, 246, 0.08);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.funnel-step-label {
  width: 148px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  text-align: right;
}

.funnel-step-track {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.funnel-step-bar {
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.88;
}

.funnel-step-bar:hover {
  opacity: 1;
  filter: brightness(1.1);
}

.funnel-step-count {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.funnel-step-pct {
  width: 34px;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

.funnel-total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.funnel-total strong {
  color: var(--text);
}

/* ── Habit Cards ─────────────────────────────────────────── */
.habits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.habit-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.habit-card:hover {
  border-color: var(--border2);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

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

.habit-rep-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.habit-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.habit-team {
  font-size: 11px;
  color: var(--text-dim);
}

.call-progress {
  margin-bottom: 12px;
}

/* ── Streak Dots ─────────────────────────────────────────── */
.streak-dots {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.streak-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid;
  flex-direction: column;
  transition: transform 0.15s ease;
}

.streak-dot:hover {
  transform: scale(1.15);
}

.streak-dot.hit {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  color: var(--success);
}

.streak-dot.miss {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: rgba(239, 68, 68, 0.6);
}

/* ── Tables ──────────────────────────────────────────────── */
.overflow-x-auto {
  overflow-x: auto;
}

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

thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-card2);
}

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(26, 48, 80, 0.5);
  color: var(--text);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition);
  border-left: 3px solid transparent;
}

tbody tr:nth-child(even) {
  background: rgba(9, 20, 34, 0.5);
}

tbody tr:nth-child(odd) {
  background: rgba(12, 24, 41, 0.3);
}

tbody tr:hover {
  background: var(--bg-hover);
  border-left-color: var(--accent);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ── Grade Badge ─────────────────────────────────────────── */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.grade-A\+ { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.grade-A   { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35); }
.grade-B   { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.35); }
.grade-C   { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }
.grade-D   { background: rgba(239, 68, 68, 0.18);  color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }

/* ── Info Tip ────────────────────────────────────────────── */
.info-tip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(107, 143, 186, 0.15);
  border: 1px solid rgba(107, 143, 186, 0.25);
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.info-tip-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.info-tip-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-line;
  width: 240px;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.15s ease;
}

.info-tip-pop.wide {
  width: 320px;
}

.info-tip-arrow {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border2);
}

/* ── Tooltip ─────────────────────────────────────────────── */
.tooltip {
  position: relative;
}

.tooltip[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 16, 30, 0.95);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  z-index: 999;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ── Rep Selector Chips ──────────────────────────────────── */
.rep-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rep-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.rep-chip:hover {
  border-color: var(--border2);
  color: var(--text);
}

.rep-chip.active {
  color: #fff;
}

/* ── Deep Dive Tables ────────────────────────────────────── */
.deep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.deep-table th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.deep-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(26, 48, 80, 0.5);
  white-space: normal;
  word-break: break-word;
}
.deep-table td:not(:first-child) {
  white-space: nowrap;
}

.deep-table tbody tr:last-child td {
  border-bottom: none;
}

.deep-table tbody tr:hover td {
  background: var(--bg-hover);
}

/* ── Analytics Cards ─────────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.analytics-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.15s ease;
}

.analytics-card:hover {
  border-color: var(--border2);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.analytics-card.selected {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.analytics-card.dimmed {
  opacity: 0.45;
  pointer-events: auto;
}

/* ── Rep Profile Modal ───────────────────────────────────── */
.rep-profile-modal {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card2) 100%);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

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

.rpm-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.rpm-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background var(--transition);
}
.rpm-close:hover { background: var(--bg-hover); color: var(--text); }

.rpm-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

@media (max-width: 700px) {
  .rpm-scores { grid-template-columns: repeat(2, 1fr); }
}

.rpm-score-item {
  padding: 6px 12px;
}
.rpm-score-item + .rpm-score-item {
  border-left: 1px solid var(--border);
}

.rpm-alerts {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.rpm-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.rpm-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
}

.rpm-tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.rpm-tab:hover { color: var(--text); }
.rpm-tab.active { color: var(--accent); font-weight: 600; }

.rpm-body {
  padding: 20px;
}

.analytics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.overall-score {
  font-size: 18px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
}

.score-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.alert-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.alert-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.alert-pill.danger  { background: rgba(239, 68, 68, 0.15);  color: #fca5a5;  border: 1px solid rgba(239, 68, 68, 0.25); }
.alert-pill.warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d;  border: 1px solid rgba(245, 158, 11, 0.25); }

.badge-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.badge-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(6, 182, 212, 0.1);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.2);
  font-weight: 600;
}

/* ── Detail sections ─────────────────────────────────────── */
.detail-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(26, 48, 80, 0.4);
  color: var(--text-muted);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Alert Banners ───────────────────────────────────────── */
.alert-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 8px;
  border: 1px solid;
}

.alert-banner.danger  { background: rgba(239, 68, 68, 0.08);  border-color: rgba(239, 68, 68, 0.2);  color: #fca5a5; }
.alert-banner.warning { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.alert-banner.alert-clickable { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.alert-banner.alert-clickable:hover { transform: translateX(2px); box-shadow: 0 0 0 1px rgba(59,130,246,0.40), 0 4px 12px rgba(59,130,246,0.15); }

.error-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

.warn-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  color: #6ee7b7;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Flags Page ──────────────────────────────────────────── */
.flag-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flag-tab {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.flag-tab:hover {
  border-color: var(--border2);
  color: var(--text);
}

.flag-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.flag-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

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

.flag-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.fcs {
  text-align: right;
}

.fcs .v {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.fcs .l {
  font-size: 10px;
  color: var(--text-dim);
}

.flag-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flag-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 12px;
  flex-wrap: wrap;
}

.flag-item.critical {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}

.flag-item.warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}

.flag-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flag-sev-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.flag-sev-badge.critical { background: rgba(239, 68, 68, 0.18);  color: #fca5a5; }
.flag-sev-badge.warning  { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }

.flag-msg {
  color: var(--text);
  font-weight: 500;
}

.flag-action {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
}

/* ── Pipeline Page ───────────────────────────────────────── */
.aging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.aging-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  transition: border-color var(--transition);
}

.aging-cell:hover {
  border-color: var(--border2);
}

.aging-cell.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.aging-count {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.aging-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stale-0-1   { color: var(--success); }
.stale-2-3   { color: #34d399; }
.stale-4-7   { color: var(--warning); }
.stale-8-14  { color: #f97316; }
.stale-15-30 { color: var(--danger); }
.stale-30    { color: #dc2626; }

.stale-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stale-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stale-rep-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stale-rep-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.stale-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-item .v {
  font-size: 14px;
  font-weight: 700;
}

.stat-item .l {
  font-size: 10px;
  color: var(--text-dim);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-action-row-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.velocity-stage-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  color: inherit;
  text-align: left;
}

.velocity-stage-row:hover {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.18);
  transform: translateX(2px);
}

/* ── Conversations Page ──────────────────────────────────── */
.converters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  transition: border-color var(--transition);
}

.converter-card:hover {
  border-color: var(--border2);
}

.converter-info .won  { font-size: 16px; font-weight: 800; color: var(--success); }
.converter-info .rev  { font-size: 13px; font-weight: 600; color: var(--text); }
.converter-info .name { font-size: 11px; color: var(--text-muted); }

.wins-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.win-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color var(--transition);
}

.win-item:hover {
  border-color: var(--border2);
}

.win-item .deal-name { font-size: 13px; font-weight: 600; color: var(--text); }
.win-item .deal-meta { font-size: 11px; color: var(--text-muted); }
.win-item .amount    { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--success); white-space: nowrap; }

/* ── Settings Page ───────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-row input,
.form-row select {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 9px 12px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row select option {
  background: var(--bg-card);
}

.save-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition), transform 0.1s ease;
  letter-spacing: 0.02em;
}

.save-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cron-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cron-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
}

.cron-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.cron-dot.ok    { background: var(--success); box-shadow: 0 0 6px var(--success); }
.cron-dot.error { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.cron-dot.never { background: var(--text-dim); }

/* ── Training Page ───────────────────────────────────────── */
.training-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.training-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

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

.download-btn {
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
}

.download-btn:hover {
  opacity: 0.88;
}

.training-intro {
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.training-note {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.6;
}

.training-note.warning {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.25);
}

.training-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.training-card-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  border-radius: 6px;
  padding: 5px 10px;
  margin-bottom: 12px;
  display: inline-block;
}

.checklist-items {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.checklist-check {
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.stage-card { margin-bottom: 12px; }

.stage-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.stage-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.stage-label {
  font-size: 15px;
  font-weight: 700;
}

.stage-threshold {
  display: flex;
  align-items: center;
  gap: 8px;
}

.threshold-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid;
}

.stage-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-meaning,
.stage-action {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.stage-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(107, 143, 186, 0.15);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.stage-tag.action {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

.field-card { margin-bottom: 10px; }

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

.field-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.required-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.field-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.field-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.field-tag.where   { background: rgba(139, 92, 246, 0.12); color: #c4b5fd; }
.field-tag.format  { background: rgba(6, 182, 212, 0.12);  color: #67e8f9; }
.field-tag.example { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }

.field-example {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text);
}

.field-why {
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid var(--border);
  line-height: 1.5;
}

.call-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.call-step:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.call-step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.call-step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.call-step-detail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.alert-trigger-card {
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid;
}

.alert-trigger-card.critical {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}

.alert-trigger-card.warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}

.alert-trigger-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.alert-trigger-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.alert-trigger-fix {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.donot-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.donot-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.donot-x {
  color: var(--danger);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: -1px;
}

/* ── Skeleton Loaders ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  height: 120px;
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-row {
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}

.skeleton-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease infinite;
}

/* ── Spinner / Loading ────────────────────────────────────── */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
  border-radius: var(--radius-sm);
}

/* ── Utility ─────────────────────────────────────────────── */
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
}

/* ── Responsive — Tablet (collapsed icon sidebar) ────────── */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 64px;
  }

  .sidebar {
    width: 64px;
    overflow: visible;
  }

  .sidebar-logo .brand,
  .nav-group-label,
  .nav-item > span:not(.icon),
  .refresh-info,
  .refresh-countdown {
    display: none;
  }

  .sidebar-logo {
    justify-content: center;
    padding: 16px 0;
  }

  .sidebar-logo .icon {
    font-size: 24px;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
    border-left-width: 3px;
  }

  .nav-item .icon {
    font-size: 20px;
    margin: 0;
  }

  .sidebar-footer {
    padding: 10px 0;
    display: flex;
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .page-hero-title-row {
    flex-direction: column;
  }

  .page-hero-actions {
    justify-content: flex-start;
  }

  .leaderboard-header,
  .rep-row {
    grid-template-columns: 40px 1fr 70px 70px 90px 60px 60px;
  }
}

/* ── Responsive — Mobile ─────────────────────────────────── */
@media (max-width: 600px) {
  :root {
    --sidebar-w: 0px;
  }

  /* Sidebar handled by drawer rules at end of file — do NOT hide */

  .main-content {
    margin-left: 0;
  }

  .page {
    padding: 14px;
  }

  .topbar {
    padding: 0 14px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-value {
    font-size: 26px;
  }

  .page-hero {
    padding: 18px 16px 16px;
  }

  .page-hero-title {
    font-size: 22px;
  }

  .page-hero-stats {
    flex-wrap: wrap;
    gap: 12px 0;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-header {
    display: none;
  }

  .rep-row {
    grid-template-columns: 36px 1fr repeat(3, auto);
    gap: 6px;
  }

  .topbar-clock {
    display: none;
  }

  .analytics-grid,
  .habits-grid {
    grid-template-columns: 1fr;
  }

  .rpm-quick-actions,
  .detail-action-row-group,
  .stale-rep-actions {
    width: 100%;
  }

  .period-tabs {
    flex-wrap: wrap;
    gap: 4px;
  }
  .period-tab {
    font-size: 10px;
    padding: 3px 8px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MAIL SYSTEM PAGE
   ============================================================ */

.mail-system-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* Status banner */
.mail-status-banner {
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}
.mail-status-banner.ok  { background: rgba(16,185,129,0.09); border: 1px solid rgba(16,185,129,0.25); color: #6ee7b7; }
.mail-status-banner.err { background: rgba(239,68,68,0.09);  border: 1px solid rgba(239,68,68,0.25);  color: #fca5a5; }

/* Info tip inside cards */
.mail-tip {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 16px;
  padding: 10px 13px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border-left: 3px solid var(--border2);
}

/* SMTP preset row */
.smtp-preset-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.preset-btn {
  padding: 5px 14px;
  border: 1px solid var(--border2);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.preset-btn:hover { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #93c5fd; }

/* SMTP fields layout */
.smtp-fields { display: flex; flex-direction: column; gap: 2px; }

/* SMTP action buttons */
.smtp-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.smtp-btn {
  padding: 9px 20px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  border: 1px solid transparent;
}

.smtp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.smtp-btn.test {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.3);
  color: #93c5fd;
}
.smtp-btn.test:hover:not(:disabled) { background: rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.5); }

.smtp-btn.save {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 3px 12px rgba(16,185,129,0.25);
}
.smtp-btn.save:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(16,185,129,0.35); }

/* SMTP session log */
.smtp-log {
  margin-top: 14px;
  background: #050c17;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
}

.smtp-log-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-family: inherit;
}

.smtp-log-line {
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
}
.smtp-log-line.sent { color: #60a5fa; }
.smtp-log-line.recv { color: #86efac; }

/* Day picker */
.day-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.day-btn:hover { border-color: var(--border2); color: var(--text); }
.day-btn.active {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.4);
  color: #93c5fd;
}

/* Email log list */
.mail-log-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mail-log-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.mail-log-row:hover { background: var(--bg-hover); }

.mail-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.mail-log-dot.ok      { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.mail-log-dot.fail    { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.mail-log-dot.partial { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }

.mail-log-body { flex: 1; min-width: 0; }

.mail-log-subject {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.mail-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
}

.mail-log-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.mail-log-badge.ok      { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.mail-log-badge.fail    { background: rgba(239,68,68,0.12);  color: #fca5a5; }
.mail-log-badge.partial { background: rgba(245,158,11,0.12); color: #fcd34d; }

.mail-log-error {
  font-size: 11px;
  color: #f87171;
  margin-top: 3px;
  padding: 4px 8px;
  background: rgba(239,68,68,0.06);
  border-radius: 5px;
}

/* Responsive */
@media (max-width: 900px) {
  .mail-system-grid { grid-template-columns: 1fr; }
}

/* ── Stale Urgency Banner (Feature 2) ────────────────────── */
.stale-urgency-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid #ef4444;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  color: #fca5a5;
  animation: fadeInUp 0.3s ease;
}
.stale-urgency-banner strong { color: #ef4444; }
.stale-urgency-banner .sub-icon { font-size: 20px; flex-shrink: 0; }
.stale-urgency-banner .sub-action { margin-left: auto; color: #ef4444; text-decoration: none; font-weight: 600; white-space: nowrap; font-size: 12px; }
.stale-urgency-banner .sub-action:hover { text-decoration: underline; }

/* ── Target Gauge Card (Feature 3) ──────────────────────── */
.target-gauge-card { padding: 16px 20px; }
.target-gauge-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.target-label { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.target-pct { font-size: 18px; font-weight: 700; }
.target-values { font-size: 12px; color: var(--text-muted); }
.target-track { height: 10px; background: rgba(255,255,255,0.06); border-radius: 5px; overflow: hidden; }
.target-fill { height: 100%; border-radius: 5px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.target-sub { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* ── Funnel Drop-off (Feature 4) ────────────────────────── */
.funnel-dropoff { text-align: center; font-size: 10px; color: var(--text-muted); padding: 1px 0; opacity: 0.7; }
.funnel-win-loss { display: flex; gap: 16px; justify-content: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 600; flex-wrap: wrap; }

/* ── Parallel funnel group (interchangeable stages) ──────── */
.funnel-parallel-group { border: 1px dashed rgba(251,191,36,0.35); border-radius: 8px; padding: 8px 10px 6px; background: rgba(251,191,36,0.03); }
.funnel-parallel-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.funnel-parallel-title { font-size: 11px; font-weight: 700; color: #d97706; }
.funnel-parallel-note { font-size: 10px; color: var(--text-muted); font-style: italic; }
.funnel-parallel-bars { display: flex; flex-direction: column; gap: 4px; }
.funnel-parallel-row { display: flex; align-items: center; gap: 8px; }
.funnel-parallel-sub { width: 120px; font-size: 11px; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.funnel-parallel-total { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 5px; }
.funnel-parallel-total strong { color: var(--text); }

/* ── Dead Hours Badge (Feature 6) ───────────────────────── */
.dead-hours-badge { font-size: 10px; background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }

/* ── Export CSV Button (Feature 7) ──────────────────────── */
.export-csv-btn { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 11px; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.export-csv-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(59,130,246,0.08); }

/* ── Deal Link (Feature 11) ─────────────────────────────── */
.deal-link { color: var(--text); text-decoration: none; max-width: 220px; display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.deal-link:hover { color: var(--accent); text-decoration: underline; }

/* ── Clickable KPI Cards ──────────────────────────────────── */
.kpi-clickable {
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.15s ease;
  position: relative;
}
.kpi-clickable:hover {
  border-color: var(--kpi-color);
  box-shadow: 0 0 0 1px var(--kpi-color), 0 8px 24px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.kpi-expand-hint {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  pointer-events: none;
  transition: color var(--transition);
}
.kpi-clickable:hover .kpi-expand-hint {
  color: var(--kpi-color);
}

/* ── Back Button ──────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  margin-bottom: 16px;
}
.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.06);
}

/* ── Funnels Rep Header ───────────────────────────────────── */
.funnel-rep-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 16px;
}
.funnel-rep-info { display: flex; flex-direction: column; gap: 4px; }
.funnel-rep-name { font-size: 17px; font-weight: 700; }
.funnel-rep-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }

/* ── Funnels Split Layout ─────────────────────────────────── */
.funnel-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .funnel-split-layout { grid-template-columns: 1fr; }
}

/* ── KPI Detail Panel ─────────────────────────────────────── */
@keyframes kdpSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kpi-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  animation: kdpSlideDown 0.2s ease;
}
.kdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.kdp-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.kdp-body {
  font-size: 13px;
  color: var(--text);
}

/* Rep profile button */
.rep-profile-btn {
  font-size: 10px;
  padding: 2px 7px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 5px;
  color: #93c5fd;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}
.rep-profile-btn:hover {
  background: rgba(59,130,246,0.25);
  border-color: #3b82f6;
}

.inline-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: #93c5fd;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  line-height: inherit;
}

.inline-link-btn:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

/* Deal links */
.deal-link {
  color: #93c5fd;
  text-decoration: none;
  transition: color 0.15s;
}
.deal-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* Habit expand */
.habit-card {
  transition: box-shadow 0.15s;
}
.habit-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* Funnel bar row as button */
.funnel-bar-row {
  transition: background 0.15s;
  border-radius: 6px;
  padding: 2px 4px;
}
.funnel-bar-row:hover {
  background: rgba(255,255,255,0.03);
}

/* ============================================================
   NEW UI COMPONENTS — v20260407
   Action Plan, Deal Detail, Forecast, Acks, Notifications,
   Severity badges, Sortable tables, Mobile fixes
   ============================================================ */

/* ── Topbar additions ── */
.topbar-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.30);
  border-radius: 8px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.topbar-refresh-btn:hover {
  background: rgba(59, 130, 246, 0.20);
  color: #dbeafe;
}

.topbar-period-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 8px;
  opacity: 0.8;
}

.topbar-period-select {
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.topbar-period-select:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(59,130,246,0.40);
}

.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 6px currentColor;
}

/* ── Notification bell ── */
.notif-wrap { position: relative; }
.notif-bell {
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}
.notif-bell:hover { background: rgba(255,255,255,0.12); }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-glass);
}
.notif-panel {
  /* `position: fixed` (not absolute) means the panel is anchored to the viewport,
     not to its parent. It escapes the topbar/sidebar stacking contexts entirely
     and CANNOT be clipped by the fixed sidebar overlay. Position is computed in
     JS from the bell's bounding rect and applied as inline styles. */
  position: fixed;
  width: 380px;
  /* Cap to 75% of viewport so the panel never extends off-screen on small displays
     while still showing more notifications on tall ones. */
  max-height: min(75vh, 640px);
  background: #0f1c2e;
  border: 1px solid #1e3352;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 9999;           /* on top of everything */
  overflow: hidden;        /* clip rounded corners; inner list scrolls */
  display: flex;
  flex-direction: column;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid #1e3352;
  flex-shrink: 0;
}
.notif-panel-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: none;
  letter-spacing: 0;
}
.notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.notif-list {
  /* `min-height: 0` is required for a flex child to honour parent's max-height
     and let `overflow: auto` actually trigger scrolling. */
  min-height: 0;
  flex: 1 1 auto;
  /* Force a visible scrollbar so users on macOS (where scrollbars auto-hide) see
     they can scroll for more. */
  overflow-y: scroll;
  scrollbar-width: thin;                /* Firefox */
  scrollbar-color: rgba(255,255,255,0.20) transparent;
}
.notif-list::-webkit-scrollbar { width: 8px; }
.notif-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}
.notif-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.notif-success { border-left: 3px solid #22c55e; }
.notif-item.notif-warning { border-left: 3px solid #f59e0b; }
.notif-item.notif-error   { border-left: 3px solid #ef4444; }
.notif-icon { font-size: 18px; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

/* ── Severity badge with icon ── */
.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.severity-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  color: #0a0e1a;
  font-size: 9px;
  font-weight: 900;
  font-family: -apple-system, sans-serif;
}

/* ── Empty state ── */
.empty-state-card {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  margin: 24px 0;
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state-hint { font-size: 13px; color: var(--text-muted); }

/* ── Acknowledge button ── */
.ack-wrap { position: relative; display: inline-block; }
.ack-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.30);
  border-radius: 6px;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ack-btn:hover { background: rgba(59,130,246,0.22); }
.ack-btn.compact { font-size: 10px; padding: 3px 8px; }
.ack-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ack-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.30);
  border-radius: 6px;
  color: #4ade80;
  font-size: 11px;
  font-weight: 600;
}
.ack-pill-active { animation: pulseAck 2s ease-out 1; }
@keyframes pulseAck {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  100% { box-shadow: 0 0 0 12px rgba(34,197,94,0); }
}
.ack-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #0f1c2e;
  border: 1px solid #1e3352;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 220px;
  z-index: 50;
  overflow: hidden;
}
.ack-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.ack-menu button:hover { background: rgba(255,255,255,0.06); }
.ack-menu button + button { border-top: 1px solid rgba(255,255,255,0.05); }

/* ── Action Plan page ── */
.action-headline {
  background: linear-gradient(135deg, rgba(239,68,68,0.10), rgba(239,68,68,0.04));
  border: 1px solid rgba(239,68,68,0.25);
  border-left: 4px solid #ef4444;
  border-radius: 12px;
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 600;
  color: #fca5a5;
  line-height: 1.5;
  margin-bottom: 24px;
}
.action-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.action-item {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  transition: all 0.15s;
}
.action-item-critical { border-left: 4px solid #ef4444; }
.action-item-warning  { border-left: 4px solid #f59e0b; }
.action-item-info     { border-left: 4px solid #3b82f6; }
.action-item-success  { border-left: 4px solid #22c55e; }
.action-item.acked { opacity: 0.55; }
.action-item-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.action-item-main {
  flex: 1;
  min-width: 200px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.action-item-text { flex: 1; min-width: 0; }
.action-item-title { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.action-item-detail { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.action-item-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rep-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.rep-chip:hover { background: rgba(255,255,255,0.08); }
.rep-chip span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}
.rep-chip.secondary {
  padding: 5px 12px;
}
.rep-chip.secondary:hover {
  background: rgba(255,255,255,0.10);
}

/* ── Deal Detail page ── */
.deal-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.deal-prop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.deal-prop {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.deal-prop span:first-child {
  color: var(--text-muted);
  font-weight: 500;
}
.deal-prop span:last-child {
  color: var(--text);
  font-weight: 600;
}
.deal-next-step {
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.20);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 16px;
}
.deal-next-step-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #4ade80;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.deal-next-step-text {
  font-size: 13px;
  color: var(--text);
}

.stage-timeline {
  position: relative;
  padding-left: 20px;
}
.stage-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(255,255,255,0.10);
}
.stage-timeline-step {
  position: relative;
  padding-bottom: 14px;
}
.stage-timeline-step:last-child { padding-bottom: 0; }
.stage-timeline-dot {
  position: absolute;
  left: -19px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1e3352;
  border: 2px solid var(--bg-glass);
}
.stage-timeline-step.current .stage-timeline-dot {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.20);
}
.stage-timeline-label { font-size: 13px; font-weight: 600; color: var(--text); }
.stage-timeline-current { color: #60a5fa; font-size: 11px; font-weight: 500; }
.stage-timeline-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.activity-section-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.activity-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 12px;
}
.activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  margin-bottom: 4px;
}
.activity-tag {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-muted);
}
.call-direction-outbound { color: #3b82f6; font-weight: 600; }
.call-direction-inbound  { color: #a78bfa; font-weight: 600; }
.activity-time { color: var(--text-dim); margin-left: auto; }
.activity-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ── Forecast page ── */
.forecast-hero {
  padding: 8px 4px;
}
.forecast-hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}
.forecast-hero-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.forecast-hero-amounts {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.forecast-amt-projected {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}
.forecast-amt-divider {
  font-size: 18px;
  color: var(--text-dim);
}
.forecast-amt-target {
  font-size: 18px;
  color: var(--text-muted);
}
.forecast-pct {
  font-size: 36px;
  font-weight: 800;
}
.forecast-bar {
  position: relative;
  height: 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.forecast-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
}
.forecast-bar-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.5);
}
.forecast-hero-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── MOBILE RESPONSIVE FIXES ── */
@media (max-width: 768px) {
  /* Sidebar becomes a slide-in drawer (hidden by default) */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    right: auto !important;
    width: 260px !important;
    height: 100vh !important;
    flex-direction: column !important;
    border-right: 1px solid var(--border) !important;
    border-top: none !important;
    z-index: 200;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex !important;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  }
  .sidebar-logo, .sidebar-footer { display: flex !important; }
  .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100%;
    padding: 0;
  }
  .sidebar-nav > div { display: block !important; }
  .nav-group-label { display: block !important; }
  .nav-item {
    flex-shrink: 0;
    flex-direction: row !important;
    justify-content: flex-start !important;
    padding: 12px 18px !important;
    border-radius: 0;
    font-size: 14px !important;
    text-align: left !important;
    min-width: 0 !important;
  }
  .nav-item .icon { font-size: 18px !important; margin: 0 12px 0 0 !important; }
  .nav-item span:not(.icon) { font-size: 14px !important; display: inline !important; }
  .sidebar-logo .brand { display: block !important; }
  .sidebar-logo .brand h2 { display: block !important; }

  .main-content { padding-bottom: 0; margin-left: 0 !important; }

  /* Topbar collapses */
  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
    padding: 10px 12px;
    gap: 8px;
  }
  .topbar-title { font-size: 14px; }
  .topbar-sub { display: none; }
  .topbar-clock { display: none; }
  .topbar-period-tag { display: none; }
  .period-tabs { order: 99; width: 100%; }
  .topbar-back-btn { font-size: 11px; padding: 4px 8px; }
  .topbar-refresh-btn { font-size: 11px; padding: 5px 9px; }
  .logout-btn { font-size: 11px; padding: 5px 9px; }

  /* Hamburger button visible on mobile */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
  }
  .mobile-menu-btn:hover { background: rgba(255,255,255,0.12); }

  /* Backdrop visible when drawer is open */
  .sidebar-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 150;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
}

/* Hamburger button + backdrop hidden on desktop */
.mobile-menu-btn { display: none; }
.sidebar-backdrop { display: none; }

  /* Settings page two-column → single */
  .settings-grid { grid-template-columns: 1fr !important; }

  /* Mail page two-column → single */
  .mail-system-grid { grid-template-columns: 1fr !important; }

  /* Deal detail two-column → single */
  .deal-detail-grid { grid-template-columns: 1fr; }

  /* KPI grid: 2 columns on mobile */
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }

  /* Tables get x-scroll affordance */
  .deep-table { font-size: 12px; }

  /* Modal goes full-screen */
  .rep-profile-modal-bg { padding: 0; }
  .rep-profile-modal {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  /* Action plan: stack items vertically */
  .action-item-row { flex-direction: column; }
  .action-item-side { width: 100%; justify-content: flex-start; }

  /* Forecast hero numbers shrink */
  .forecast-amt-projected { font-size: 22px; }
  .forecast-pct { font-size: 28px; }

  /* PageHero stats wrap */
  .page-hero-stats { gap: 8px; }
  .page-hero-stats > * { min-width: 80px; }
}

/* ── Sortable table headers ── */
.deep-table th[onClick], .deep-table th[style*="cursor"] {
  user-select: none;
  transition: color 0.15s;
}
.deep-table th[style*="cursor"]:hover {
  color: #93c5fd;
}

/* ── Modal focus trap visual improvements ── */
.rep-profile-modal-bg {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.65);
}

/* ── Improved muted text contrast (WCAG AA) ── */
:root {
  --text-muted: #94a3b8;
  --text-dim: #64748b;
}
