/* ═══════════════════════════════════════════════════════════════════════════════
   CLOSEPIPE V2 — Design Token Override Layer
   Loads AFTER style.css to override all custom properties.
   Remove this file to revert to V1 instantly.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Base Reset ─────────────────────────────────────────────────────────── */

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

body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── V2 Design Tokens ────────────────────────────────────────────────────── */

:root {
  /* Primary — Indigo (matches logo) */
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-light: rgba(59,130,246,0.08);
  --primary-tint: rgba(59,130,246,0.12);

  /* Legacy aliases (for components that reference apple-blue) */
  --apple-blue: #3B82F6;
  --apple-blue-hover: #2563EB;
  --apple-blue-light: rgba(59,130,246,0.08);
  --apple-blue-tint: rgba(59,130,246,0.12);
  --apple-indigo: #3B82F6;

  /* Semantic */
  --success: #22C55E;
  --success-light: rgba(34,197,94,0.1);
  --apple-green: #22C55E;
  --apple-green-light: rgba(34,197,94,0.1);

  --warning: #F59E0B;
  --warning-light: rgba(245,158,11,0.1);
  --apple-orange: #F59E0B;
  --apple-orange-light: rgba(245,158,11,0.1);

  --danger: #EF4444;
  --danger-light: rgba(239,68,68,0.08);
  --apple-red: #EF4444;
  --apple-red-light: rgba(239,68,68,0.08);

  --apple-purple: #06B6D4;
  --apple-pink: #EC4899;
  --apple-teal: #06B6D4;

  /* Surfaces */
  --page-bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --hover-bg: rgba(0,0,0,0.04);
  --border: rgba(15,23,42,0.06);
  --border-light: rgba(15,23,42,0.03);
  --separator: rgba(15,23,42,0.08);

  /* Text — solid hex for better contrast (WCAG AA) */
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;

  /* Sidebar — deep Slate */
  --sidebar-bg: #0F172A;
  --sidebar-border: rgba(255,255,255,0.06);
  --sidebar-text: rgba(255,255,255,0.5);
  --sidebar-text-hover: rgba(255,255,255,0.85);
  --sidebar-active-bg: rgba(59,130,246,0.2);
  --sidebar-active-text: #93C5FD;

  /* Shadows — refined */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);

  /* Radius — tighter for SaaS density */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Font — Plus Jakarta Sans */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
}


/* ─── Dark Mode ───────────────────────────────────────────────────────────── */

.theme-dark {
  --page-bg: #0B0F1A;
  --card-bg: #1E293B;
  --hover-bg: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.03);
  --separator: rgba(255,255,255,0.08);

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #475569;

  --sidebar-bg: #020617;
  --sidebar-border: rgba(255,255,255,0.04);

  --primary-light: rgba(59,130,246,0.15);
  --primary-tint: rgba(59,130,246,0.2);
  --apple-blue-light: rgba(59,130,246,0.15);
  --apple-blue-tint: rgba(59,130,246,0.2);

  --success-light: rgba(34,197,94,0.15);
  --apple-green-light: rgba(34,197,94,0.15);
  --warning-light: rgba(245,158,11,0.15);
  --apple-orange-light: rgba(245,158,11,0.15);
  --danger-light: rgba(239,68,68,0.12);
  --apple-red-light: rgba(239,68,68,0.12);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);

  color-scheme: dark;
}


/* Dark Mode overrides moved to end of file for cascade priority */

.theme-dark .column-count {
  background: rgba(30,41,59,0.85);
  color: var(--text-secondary);
}

.theme-dark .data-table th {
  background: rgba(255,255,255,0.02) !important;
}

.theme-dark .data-table tbody tr:hover {
  background: rgba(59,130,246,0.06) !important;
}

.theme-dark .data-table tbody tr.selected {
  background: rgba(59,130,246,0.12) !important;
}

.theme-dark .board-column {
  background: rgba(255,255,255,0.03) !important;
}

.theme-dark .btn-secondary {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-primary);
}
.theme-dark .btn-secondary:hover {
  background: rgba(255,255,255,0.1) !important;
}

.theme-dark .btn-icon:hover {
  background: rgba(255,255,255,0.06) !important;
}

.theme-dark .search-input,
.theme-dark .data-table-search,
.theme-dark .form-input {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

.theme-dark .search-input:focus,
.theme-dark .data-table-search:focus,
.theme-dark .form-input:focus {
  background: var(--card-bg) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2) !important;
}

html.theme-dark body {
  background: var(--page-bg) !important;
}

.theme-dark .main-wrapper {
  background: var(--page-bg) !important;
}

.theme-dark .top-bar {
  background: rgba(11,15,26,0.8) !important;
  border-bottom-color: var(--separator);
}

.theme-dark .modal-backdrop {
  background: rgba(0,0,0,0.6);
}

.theme-dark .deal-slideover-backdrop {
  background: rgba(0,0,0,0.5);
}

.theme-dark .phase-filter-btn {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-secondary) !important;
}
.theme-dark .phase-filter-btn:hover {
  background: rgba(255,255,255,0.1) !important;
}

.theme-dark .pagination-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.theme-dark .pagination-btn:hover {
  background: rgba(255,255,255,0.1);
}

.theme-dark .view-toggle {
  background: rgba(255,255,255,0.06) !important;
}
.theme-dark .view-toggle-btn.active {
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.theme-dark .badge-gray {
  background: rgba(255,255,255,0.06) !important;
}

.theme-dark .card-answered-questions,
.theme-dark .so-note-box {
  background: rgba(255,255,255,0.04) !important;
}

.theme-dark .toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.theme-dark .settings-card-icon {
  background: var(--primary-light);
}

.theme-dark .th-resizer {
  background: rgba(255,255,255,0.1);
}
.theme-dark .th-resizer:hover {
  background: rgba(255,255,255,0.2);
}

.theme-dark .inline-add-btn {
  color: var(--text-muted);
}
.theme-dark .inline-add-btn:hover {
  color: var(--text-secondary);
}

.theme-dark .label-toggle {
  border-color: rgba(255,255,255,0.1);
  color: var(--text-secondary);
}

.theme-dark .modal-close {
  background: rgba(255,255,255,0.06);
}
.theme-dark .modal-close:hover {
  background: rgba(255,255,255,0.1);
}

.theme-dark .modal-header,
.theme-dark .modal-footer {
  border-color: var(--separator);
}

.theme-dark .data-table td {
  border-bottom-color: rgba(255,255,255,0.04);
}

.theme-dark .sidebar-active-text {
  color: #93C5FD;
}

.theme-dark .nav-item.active {
  color: #E0E7FF;
}

.theme-dark .so-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Scrollbar dark */
.theme-dark .column-cards::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
}
.theme-dark .column-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}


/* ─── Desktop Layout Base (from style.css migration) ─────────────────────── */

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--page-bg);
}

.page-content {
  flex: 1;
  padding: 24px;
}

/* ─── Buttons Base (from style.css migration) ────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  line-height: 1.35;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  white-space: nowrap;
  user-select: none;
  position: relative;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: scale(1.02);
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
  border: none;
}
.btn-secondary:hover { background: rgba(0,0,0,0.08); }
.btn-secondary:active { transform: scale(0.98); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255,59,48,0.14); }

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.btn-icon {
  padding: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.btn-icon:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }

/* ─── Slide-Over Base (from style.css migration) ─────────────────────────── */

.slideover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slideover-backdrop.visible { opacity: 1; }

.slideover-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 620px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  background: #FBFBFD;
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 120px rgba(0,0,0,0.18), 0 0 0 0.5px rgba(0,0,0,0.08);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.35s ease;
  opacity: 0;
}
.slideover-panel.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.slideover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--separator);
  flex-shrink: 0;
  background: var(--card-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.slideover-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.so-header-actions { display: flex; align-items: center; gap: 8px; }

.so-btn-call {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--apple-green);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.so-btn-call:hover { background: #2DB84D; transform: scale(1.03); }

.so-btn-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.05);
  color: var(--text-primary);
  border: none;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.so-btn-email:hover { background: rgba(0,0,0,0.09); }

.so-btn-more {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.2rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.so-btn-more:hover { background: rgba(0,0,0,0.05); color: var(--text-primary); }

.slideover-close {
  background: rgba(0,0,0,0.04);
  border: none;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.slideover-close:hover { background: rgba(0,0,0,0.08); color: var(--text-primary); }

.slideover-tabs {
  display: flex;
  padding: 10px 22px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-bottom: 1px solid var(--separator);
}

.slideover-tabs-inner {
  display: flex;
  width: 100%;
  background: rgba(118,118,128,0.12);
  border-radius: 9px;
  padding: 2px;
}

.slideover-tab {
  flex: 1;
  padding: 10px 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  text-align: center;
}
.slideover-tab:hover { color: var(--text-primary); }
.slideover-tab.active {
  color: white;
  background: var(--apple-blue);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,122,255,0.3);
}

.slideover-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0;
}

.slideover-tab-content {
  min-height: calc(100vh - 280px);
}

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

.slideover-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.slideover-section-header:hover .slideover-section-title { color: var(--text-primary); }

.slideover-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.slideover-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slideover-section-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  flex-shrink: 0;
}
.slideover-section.collapsed .slideover-section-chevron {
  transform: rotate(180deg);
}

.slideover-section-body {
  margin-top: 14px;
  overflow: hidden;
  max-height: 1200px;
  transition: max-height 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease, margin 0.35s ease;
  opacity: 1;
}
.slideover-section.collapsed .slideover-section-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.slideover-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--separator);
  flex-shrink: 0;
  background: var(--card-bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── KPI Cards Base (from style.css migration) ──────────────────────────── */

.dash-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  vertical-align: middle;
}

.dash-info-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  color: var(--text-muted, #8E8E93);
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.dash-info-btn:hover {
  background: rgba(0,122,255,0.08);
  border-color: rgba(0,122,255,0.25);
  color: var(--apple-blue, #007AFF);
}

.dash-kpi-value-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.dash-kpi-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.dash-kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.015);
}

.dash-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dash-kpi-info { flex: 1; }

.dash-kpi-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.dash-kpi-label {
  font-size: 0.725rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

/* ─── Page Header Base (from style.css migration) ────────────────────────── */

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

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.page-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── View Toggle Base (from style.css migration) ────────────────────────── */

.view-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.05);
  border-radius: 9px;
  padding: 2px;
}

.view-toggle-btn {
  padding: 6px 14px;
  font-size: 0.775rem;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  background: none;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.view-toggle-btn.active {
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04);
  font-weight: 600;
}

/* ─── Dashboard Cards Base (from style.css migration) ────────────────────── */

.dash-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.dash-card-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dash-card-body { padding: 14px 18px 18px; }

.dash-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 24px 0;
}

/* ─── V2: Refined Component Styles ────────────────────────────────────────── */

/* Smoother sidebar backdrop */
.sidebar {
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  transition: width var(--duration-slow) var(--ease-out),
              min-width var(--duration-slow) var(--ease-out);
}

/* Nav items: smoother interaction */
.nav-item,
.nav-pipeline {
  transition: all var(--duration-normal) var(--ease-out);
}

/* Buttons: refined press */
.btn {
  transition: all var(--duration-fast) var(--ease-out);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

/* Cards: subtle lift */
.deal-card:hover,
.settings-card:hover,
.pipeline-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Inputs: better focus ring */
.form-input:focus,
.search-input:focus,
.data-table-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Data cells: tabular nums for alignment */
.data-table td,
.dash-kpi-value,
.card-value,
.pagination-info,
.column-count {
  font-variant-numeric: tabular-nums;
}

/* Modal: shadow handled by master override at end of file */

/* Top bar: cleaner feel */
.top-bar {
  min-height: 48px;
  padding: 8px 24px;
}


/* ─── Dark Mode Toggle Button ─────────────────────────────────────────────── */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  cursor: pointer;
  color: var(--sidebar-text);
  transition: all var(--duration-fast) var(--ease-out);
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: var(--sidebar-text-hover);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
}


/* ─── Phase 2: View Transitions + Stagger Animations ────────────────────── */

/* View enter: fade + slide up */
@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#app.view-entering {
  animation: viewEnter 250ms var(--ease-out) both;
}

/* Stagger children: each child fades in with delay */
@keyframes staggerIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-item {
  opacity: 0;
  animation: staggerIn 300ms var(--ease-out) both;
}

/* Reduced Motion: respect system preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  #app.view-entering {
    animation: none;
    opacity: 1;
  }

  .stagger-item {
    animation: none;
    opacity: 1;
  }
}


/* ─── Phase 3: Toast Notifications ──────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  min-width: 280px;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 300ms cubic-bezier(0.2, 0, 0, 1);
}

.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-exit {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 150ms;
}
.toast-close:hover {
  color: var(--text-primary);
}

.theme-dark .toast {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}


/* ─── Phase 4: Collapsible Sidebar ──────────────────────────────────────── */

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  cursor: pointer;
  color: var(--sidebar-text);
  transition: all 150ms ease;
  padding: 0;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--sidebar-text-hover);
}
.sidebar-collapse-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 200ms ease;
}

/* Collapsed state */
.sidebar.collapsed {
  width: 60px !important;
  min-width: 60px !important;
}

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

/* Hide ALL text in collapsed sidebar */
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-pipeline-name,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed #sidebar-user-name,
.sidebar.collapsed .sidebar-logout-btn {
  display: none !important;
}

/* Nav items: hide text nodes via font-size trick, keep icons */
.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-pipeline,
.sidebar.collapsed .nav-item-sub,
.sidebar.collapsed .nav-item-settings {
  font-size: 0 !important;
  justify-content: center !important;
  padding: 10px 0 !important;
  overflow: hidden !important;
  gap: 0 !important;
}

.sidebar.collapsed .nav-item .nav-icon,
.sidebar.collapsed .nav-pipeline .nav-icon {
  margin-right: 0 !important;
  width: 20px !important;
  height: 20px !important;
}

/* Hide section titles + settings toggle completely */
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-section-toggle {
  display: none !important;
}

/* Hide settings sub-items in collapsed mode */
.sidebar.collapsed #sidebar-settings-items {
  display: none !important;
}

/* Footer: stack actions vertically */
.sidebar.collapsed .sidebar-footer {
  padding: 10px 6px !important;
}

.sidebar.collapsed .sidebar-user {
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
}

.sidebar.collapsed .sidebar-user-info {
  display: none !important;
}

.sidebar.collapsed .sidebar-user-actions {
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-nav {
  padding: 0 6px;
}

.sidebar.collapsed .sidebar-section {
  padding: 0;
}

/* Logo: just icon, no text */
.sidebar.collapsed .sidebar-logo a span {
  display: none !important;
}

/* Adjust main content when sidebar is collapsed */
.sidebar.collapsed + .main-content,
.sidebar.collapsed ~ .main-content {
  margin-left: 60px;
}

/* Tooltip on hover for collapsed items */
.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-pipeline {
  position: relative;
}

.sidebar.collapsed .nav-item:hover::after,
.sidebar.collapsed .nav-pipeline:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #0F172A;
  color: #F1F5F9;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  pointer-events: none;
}

.theme-dark .sidebar.collapsed .nav-item:hover::after,
.theme-dark .sidebar.collapsed .nav-pipeline:hover::after {
  background: #1E293B;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}


/* ─── Modal: positioning handled by master override at end of file ────── */


/* ─── Phase 5b: Skeleton Loading ────────────────────────────────────────── */

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

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.skeleton-cell {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
}

.skeleton-cell-sm { width: 60px; }
.skeleton-cell-md { width: 120px; }
.skeleton-cell-lg { width: 200px; flex: 1; }
.skeleton-cell-xl { width: 280px; }

.theme-dark .skeleton-cell {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 800px 100%;
}


/* ─── Phase 5c: Sticky Table Headers ────────────────────────────────────── */

.data-table-wrapper {
  position: relative;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card-bg);
}

.theme-dark .data-table thead th {
  background: var(--card-bg);
}


/* ─── Phase 6: Accessibility ────────────────────────────────────────────── */

/* Focus-visible: only show focus ring on keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Better focus ring for buttons */
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

/* Focus ring for form elements */
.form-input:focus-visible,
.search-input:focus-visible,
.data-table-search:focus-visible,
select.form-input:focus-visible,
textarea.form-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Focus ring for nav items */
.nav-item:focus-visible,
.nav-pipeline:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* Focus ring for cards */
.deal-card:focus-visible,
.settings-card:focus-visible,
.contact-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 100000;
  transition: top 200ms ease;
  text-decoration: none;
}

.skip-to-content:focus {
  top: 16px;
}

/* Sortable column indicator */
.data-table th[aria-sort] {
  cursor: pointer;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   WOW PHASE: Dramatic Visual Overhaul
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Gradient KPI Cards ─────────────────────────────────────────────────── */

.dash-kpi-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1) !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.dash-kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  border-radius: inherit;
}

.dash-kpi-card:hover::before {
  opacity: 1;
}

.dash-kpi-card:hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(59,130,246,0.1) !important;
}

/* Gradient background per KPI card */
.dash-kpi-card:nth-child(1) {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #C7D2FE 100%) !important;
  border-color: rgba(59,130,246,0.15) !important;
}
.dash-kpi-card:nth-child(1)::before {
  background: linear-gradient(135deg, #3B82F6 0%, #818CF8 100%);
}
.dash-kpi-card:nth-child(1):hover {
  box-shadow: 0 20px 40px rgba(59,130,246,0.2), 0 0 60px rgba(59,130,246,0.1) !important;
}
.dash-kpi-card:nth-child(1):hover * { color: white !important; }
.dash-kpi-card:nth-child(1):hover .dash-kpi-icon { background: rgba(255,255,255,0.2) !important; }

.dash-kpi-card:nth-child(2) {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 50%, #A7F3D0 100%) !important;
  border-color: rgba(34,197,94,0.15) !important;
}
.dash-kpi-card:nth-child(2)::before {
  background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
}
.dash-kpi-card:nth-child(2):hover {
  box-shadow: 0 20px 40px rgba(34,197,94,0.2), 0 0 60px rgba(34,197,94,0.1) !important;
}
.dash-kpi-card:nth-child(2):hover * { color: white !important; }
.dash-kpi-card:nth-child(2):hover .dash-kpi-icon { background: rgba(255,255,255,0.2) !important; }

.dash-kpi-card:nth-child(3) {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%) !important;
  border-color: rgba(245,158,11,0.15) !important;
}
.dash-kpi-card:nth-child(3)::before {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}
.dash-kpi-card:nth-child(3):hover {
  box-shadow: 0 20px 40px rgba(245,158,11,0.2), 0 0 60px rgba(245,158,11,0.1) !important;
}
.dash-kpi-card:nth-child(3):hover * { color: white !important; }
.dash-kpi-card:nth-child(3):hover .dash-kpi-icon { background: rgba(255,255,255,0.2) !important; }

.dash-kpi-card:nth-child(4) {
  background: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 50%, #FECDD3 100%) !important;
  border-color: rgba(239,68,68,0.15) !important;
}
.dash-kpi-card:nth-child(4)::before {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}
.dash-kpi-card:nth-child(4):hover {
  box-shadow: 0 20px 40px rgba(239,68,68,0.2), 0 0 60px rgba(239,68,68,0.1) !important;
}
.dash-kpi-card:nth-child(4):hover * { color: white !important; }
.dash-kpi-card:nth-child(4):hover .dash-kpi-icon { background: rgba(255,255,255,0.2) !important; }

.dash-kpi-card:nth-child(5) {
  background: linear-gradient(135deg, #F0FDFA 0%, #CCFBF1 50%, #99F6E4 100%) !important;
  border-color: rgba(6,182,212,0.15) !important;
}
.dash-kpi-card:nth-child(5)::before {
  background: linear-gradient(135deg, #38BDF8 0%, #0891B2 100%);
}
.dash-kpi-card:nth-child(5):hover {
  box-shadow: 0 20px 40px rgba(6,182,212,0.2), 0 0 60px rgba(6,182,212,0.1) !important;
}
.dash-kpi-card:nth-child(5):hover * { color: white !important; }
.dash-kpi-card:nth-child(5):hover .dash-kpi-icon { background: rgba(255,255,255,0.2) !important; }

/* Dark mode KPI cards — subtle tinted backgrounds */
.theme-dark .dash-kpi-card:nth-child(1) {
  background: rgba(59,130,246,0.08) !important;
  border-color: rgba(59,130,246,0.15) !important;
}
.theme-dark .dash-kpi-card:nth-child(2) {
  background: rgba(34,197,94,0.08) !important;
  border-color: rgba(34,197,94,0.15) !important;
}
.theme-dark .dash-kpi-card:nth-child(3) {
  background: rgba(245,158,11,0.08) !important;
  border-color: rgba(245,158,11,0.15) !important;
}
.theme-dark .dash-kpi-card:nth-child(4) {
  background: rgba(239,68,68,0.08) !important;
  border-color: rgba(239,68,68,0.15) !important;
}
.theme-dark .dash-kpi-card:nth-child(5) {
  background: rgba(6,182,212,0.08) !important;
  border-color: rgba(6,182,212,0.15) !important;
}


/* ─── Sidebar Glow Effects ───────────────────────────────────────────────── */

.sidebar {
  background: linear-gradient(180deg, #0F172A 0%, #0B1120 60%, #0D0F1A 100%) !important;
}

.nav-item.active,
.nav-pipeline.active {
  position: relative;
  background: rgba(59,130,246,0.15) !important;
  box-shadow: 0 0 20px rgba(59,130,246,0.15), inset 0 0 20px rgba(59,130,246,0.05);
}

/* Glowing left border on active */
.nav-item.active::before,
.nav-pipeline.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  background: linear-gradient(180deg, #3B82F6, #06B6D4);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px rgba(59,130,246,0.6), 0 0 30px rgba(59,130,246,0.3);
}

/* Subtle hover glow on nav items */
.nav-item:hover,
.nav-pipeline:hover {
  background: rgba(59,130,246,0.08) !important;
  box-shadow: 0 0 15px rgba(59,130,246,0.08);
}

/* Sidebar logo glow */
.sidebar-logo svg rect:first-child {
  filter: drop-shadow(0 0 15px rgba(59,130,246,0.4));
}


/* ─── Dashboard Cards: Glass Effect ──────────────────────────────────────── */

.dash-card {
  background: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.5) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04) !important;
  border-color: rgba(59,130,246,0.15) !important;
}

.theme-dark .dash-card {
  background: rgba(30,41,59,0.6) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.1) !important;
}

.theme-dark .dash-card:hover {
  border-color: rgba(59,130,246,0.25) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 30px rgba(59,130,246,0.08) !important;
}


/* ─── Chart Bars: Gradient ───────────────────────────────────────────────── */

.dash-chart-bar {
  background: linear-gradient(180deg, #3B82F6 0%, #38BDF8 50%, #06B6D4 100%) !important;
  border-radius: 6px 6px 2px 2px !important;
  box-shadow: 0 -4px 12px rgba(59,130,246,0.2);
  transition: all 0.3s ease !important;
}

.dash-chart-bar:hover {
  box-shadow: 0 -8px 24px rgba(59,130,246,0.35) !important;
  filter: brightness(1.1);
}


/* ─── Source Bars: Animated Fill ─────────────────────────────────────────── */

.dash-source-bar {
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  animation: barGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes barGrow {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}


/* ─── Progress Bar Segments: Glow ────────────────────────────────────────── */

.dash-progress-seg {
  transition: all 0.3s ease;
  position: relative;
}

.dash-progress-seg:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 12px currentColor;
}


/* ─── Top Bar: Glass Effect ──────────────────────────────────────────────── */

.top-bar {
  background: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.04) !important;
}

.theme-dark .top-bar {
  background: rgba(11,15,26,0.7) !important;
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
}


/* ─── Search Input: Glow on Focus ────────────────────────────────────────── */

.search-input:focus,
.data-table-search:focus {
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15), 0 0 20px rgba(59,130,246,0.08) !important;
}


/* ─── Buttons: Enhanced Primary ──────────────────────────────────────────── */

.btn-primary {
  background: linear-gradient(135deg, #3B82F6 0%, #38BDF8 100%) !important;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3) !important;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(59,130,246,0.4), 0 0 40px rgba(59,130,246,0.1) !important;
}


/* ─── Deal Cards: Hover Glow ─────────────────────────────────────────────── */

.deal-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08), 0 0 0 1px rgba(59,130,246,0.1) !important;
  border-color: rgba(59,130,246,0.15) !important;
}

.theme-dark .deal-card:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.3), 0 0 20px rgba(59,130,246,0.1) !important;
}


/* ─── Contact Cards: Glass + Hover ───────────────────────────────────────── */

.contact-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border: 1px solid var(--border);
}

.contact-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08) !important;
  border-color: rgba(59,130,246,0.15) !important;
}


/* ─── Settings Cards: Glass + Gradient Icon ──────────────────────────────── */

.settings-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.settings-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08), 0 0 0 1px rgba(59,130,246,0.08) !important;
}

.settings-card-icon {
  background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(6,182,212,0.1) 100%) !important;
}


/* ─── Modal: decorative border only (positioning at end of file) ─────────── */


/* ─── Board Columns: Subtle Gradient ─────────────────────────────────────── */

.board-column {
  background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.01) 100%) !important;
  border: 1px solid rgba(0,0,0,0.04) !important;
  border-radius: var(--radius-md) !important;
}

.theme-dark .board-column {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%) !important;
  border: 1px solid rgba(255,255,255,0.04) !important;
}


/* ─── Page Title: Gradient Text ──────────────────────────────────────────── */

.page-title {
  background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-dark .page-title {
  background: linear-gradient(135deg, #F1F5F9 0%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ─── Command Palette ────────────────────────────────────────────────────── */

.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  animation: cmdFadeIn 0.15s ease both;
}

@keyframes cmdFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cmd-palette {
  width: 560px;
  max-width: 90vw;
  background: var(--card-bg);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 16px;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.2),
    0 0 0 1px rgba(0,0,0,0.05),
    0 0 60px rgba(59,130,246,0.08);
  overflow: hidden;
  animation: cmdSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cmdSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cmd-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.cmd-palette-input-wrap svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cmd-palette-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
}

.cmd-palette-input::placeholder {
  color: var(--text-muted);
}

.cmd-palette-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-primary);
}

.cmd-palette-item:hover,
.cmd-palette-item.active {
  background: var(--primary-light);
}

.cmd-palette-item.active {
  background: rgba(59,130,246,0.12);
}

.cmd-palette-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cmd-palette-item.active svg {
  color: var(--primary);
}

.cmd-palette-item-label {
  flex: 1;
  font-size: 0.9rem;
}

.cmd-palette-item-shortcut {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.cmd-palette-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cmd-palette-footer kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.7rem;
  margin: 0 2px;
}

.theme-dark .cmd-palette {
  background: #1E293B;
  border-color: rgba(59,130,246,0.2);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 60px rgba(59,130,246,0.1);
}

/* ─── Search hint in topbar ──────────────────────────────────────────────── */

.search-kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: inherit;
  pointer-events: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.theme-dark .search-kbd-hint {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}


/* ─── Welcome Banner ─────────────────────────────────────────────────────── */

.dash-welcome-banner {
  position: relative;
  overflow: hidden;
  padding: 32px 36px;
  border-radius: 20px;
  background: linear-gradient(135deg, #3B82F6 0%, #38BDF8 40%, #06B6D4 70%, #EC4899 100%);
  margin-bottom: 24px;
  animation: bannerAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes bannerAppear {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dash-welcome-content {
  position: relative;
  z-index: 2;
}

.dash-welcome-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.dash-welcome-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}

.dash-welcome-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.4;
  animation: welcomeOrbFloat 12s ease-in-out infinite alternate;
}

.dash-welcome-orb-1 {
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.3);
  top: -60px; right: 10%;
  animation-delay: 0s;
}
.dash-welcome-orb-2 {
  width: 150px; height: 150px;
  background: rgba(236,72,153,0.4);
  bottom: -40px; right: 30%;
  animation-delay: -4s;
}
.dash-welcome-orb-3 {
  width: 120px; height: 120px;
  background: rgba(59,130,246,0.5);
  top: -30px; left: 60%;
  animation-delay: -8s;
}

@keyframes welcomeOrbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -15px) scale(1.1); }
  100% { transform: translate(-10px, 10px) scale(0.95); }
}

/* Banner pattern overlay (grid lines) */
.dash-welcome-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}


/* ─── Border Beam Effect on KPI Cards ────────────────────────────────────── */

@keyframes borderBeam {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

.dash-kpi-card {
  position: relative;
}

.dash-kpi-card > * {
  position: relative;
  z-index: 1;
}


/* ─── Animated Page Background ───────────────────────────────────────────── */

.page-content {
  position: relative;
}

.page-content::before {
  content: '';
  position: fixed;
  top: -100px;
  right: -100px;
  width: 600px;
  height: 600px;
  clip-path: inset(0);
  background: radial-gradient(circle, rgba(59,130,246,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: bgGlow 15s ease-in-out infinite alternate;
}

@keyframes bgGlow {
  0% { transform: translate(0, 0); opacity: 0.5; }
  50% { transform: translate(-100px, 100px); opacity: 0.8; }
  100% { transform: translate(50px, -50px); opacity: 0.5; }
}

.theme-dark .page-content::before {
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
}


/* ─── Kanban Deal Cards: Enhanced ────────────────────────────────────────── */

.deal-card {
  position: relative;
  border-left: 3px solid var(--primary) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.deal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, transparent 60%);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.deal-card:hover::after {
  opacity: 1;
}


/* ─── Notification Bell Button ────────────────────────────────────────────── */

.notif-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0,0,0,0.04);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  padding: 0;
}

.notif-bell-btn:hover {
  background: rgba(59,130,246,0.08);
  color: var(--primary);
  transform: scale(1.05);
}

.notif-bell-btn:active {
  transform: scale(0.95);
}

.theme-dark .notif-bell-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.theme-dark .notif-bell-btn:hover {
  background: rgba(59,130,246,0.15);
  color: var(--primary);
}

/* Notification Pulse */
@keyframes notifPulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #EF4444;
  border-radius: 100px;
  border: 2px solid var(--card-bg);
  animation: notifPulse 2s ease-in-out infinite;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(15deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-5deg); }
  75% { transform: rotate(2deg); }
}


/* ─── Scrollbar Styling ──────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
}

.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}


/* ─── Period/Filter Buttons: Enhanced ────────────────────────────────────── */

.dash-period-btn {
  transition: all 0.2s ease !important;
}

.dash-period-btn.active {
  background: linear-gradient(135deg, #3B82F6, #38BDF8) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3) !important;
}

.dash-period-btn:not(.active):hover {
  background: rgba(59,130,246,0.08) !important;
  color: var(--primary) !important;
}


/* ─── Loading Spinner ────────────────────────────────────────────────────── */

.dash-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dash-loading::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(59,130,246,0.2);
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}

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


/* ─── Sidebar Avatar ─────────────────────────────────────────────────────── */

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3B82F6, #06B6D4);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.3), 0 2px 8px rgba(59,130,246,0.2);
  animation: avatarGlow 3s ease-in-out infinite alternate;
}

@keyframes avatarGlow {
  0% { box-shadow: 0 0 0 2px rgba(59,130,246,0.3), 0 2px 8px rgba(59,130,246,0.2); }
  100% { box-shadow: 0 0 0 2px rgba(168,85,247,0.4), 0 2px 12px rgba(168,85,247,0.3); }
}

.sidebar.collapsed .sidebar-avatar {
  width: 30px;
  height: 30px;
  font-size: 0.65rem;
}


/* ─── Table Rows: Enhanced ───────────────────────────────────────────────── */

.data-table tbody tr {
  transition: all 0.15s ease !important;
}

.data-table tbody tr:hover {
  background: rgba(59,130,246,0.04) !important;
}

.data-table tbody tr:hover td:first-child {
  color: var(--primary);
}

.theme-dark .data-table tbody tr:hover {
  background: rgba(59,130,246,0.08) !important;
}

/* Zebra stripes */
.data-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.01);
}

.theme-dark .data-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.015);
}

/* Table wrapper shadow */
.data-table-wrapper {
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03) !important;
}

.theme-dark .data-table-wrapper {
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.04) !important;
}


/* ─── Slide-Over Panel: Glassmorphism ────────────────────────────────────── */

.deal-slideover {
  background: var(--card-bg) !important;
  box-shadow: -20px 0 60px rgba(0,0,0,0.15), -4px 0 20px rgba(0,0,0,0.05) !important;
  border-left: 1px solid var(--border) !important;
}

.theme-dark .deal-slideover {
  box-shadow: -20px 0 60px rgba(0,0,0,0.4), -4px 0 20px rgba(0,0,0,0.2) !important;
  border-left: 1px solid rgba(255,255,255,0.06) !important;
}

.deal-slideover-backdrop {
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

/* Slide-over header gradient */
.so-header {
  background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, transparent 100%) !important;
  border-bottom: 1px solid var(--border) !important;
}

.theme-dark .so-header {
  background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, transparent 100%) !important;
}

/* Tabs in slide-over */
.so-tab {
  transition: all 0.2s ease !important;
}

.so-tab.active {
  color: var(--primary) !important;
  border-bottom: 2px solid var(--primary) !important;
}

.so-tab:not(.active):hover {
  color: var(--text-primary) !important;
  background: rgba(59,130,246,0.04);
}


/* ─── Settings Cards: Enhanced Grid ──────────────────────────────────────── */

.settings-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 16px !important;
}

.settings-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  padding: 20px !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.settings-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3B82F6, #06B6D4, #EC4899);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.settings-card:hover::before {
  opacity: 1;
}

.settings-card-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.3rem !important;
  margin-bottom: 12px !important;
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(168,85,247,0.1)) !important;
}

.theme-dark .settings-card {
  border-color: rgba(255,255,255,0.06) !important;
}

.theme-dark .settings-card:hover {
  border-color: rgba(59,130,246,0.2) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3), 0 0 20px rgba(59,130,246,0.08) !important;
}


/* ─── Contact Cards: Enhanced ────────────────────────────────────────────── */

.contact-card {
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3B82F6, #38BDF8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-card:hover::before {
  opacity: 1;
}


/* ─── Board Column Header: Enhanced ──────────────────────────────────────── */

.column-header {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  position: relative;
  overflow: hidden;
}

.column-count {
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  min-width: 24px;
  text-align: center;
  border-radius: 6px !important;
}


/* ─── View Toggle Buttons: Enhanced ──────────────────────────────────────── */

.view-toggle {
  border-radius: 10px !important;
  padding: 3px !important;
  background: rgba(0,0,0,0.04) !important;
}

.view-toggle-btn {
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}

.view-toggle-btn.active {
  background: var(--card-bg) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03) !important;
}

.theme-dark .view-toggle {
  background: rgba(255,255,255,0.06) !important;
}

.theme-dark .view-toggle-btn.active {
  background: rgba(255,255,255,0.1) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}


/* ─── Header Avatar ──────────────────────────────────────────────────────── */

#header-user {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3B82F6, #06B6D4);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


/* ─── Badges: Enhanced ───────────────────────────────────────────────────── */

.badge,
.card-label {
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  border-radius: 6px !important;
}

.badge-gray {
  background: rgba(0,0,0,0.05) !important;
}

.theme-dark .badge-gray {
  background: rgba(255,255,255,0.08) !important;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   WOW PHASE 4: Micro-Interactions & Premium Polish
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Ripple Effect on Buttons ──────────────────────────────────────────── */

.btn-primary,
.btn-secondary,
.dash-period-btn,
.view-toggle-btn,
.empty-state-btn {
  position: relative;
  overflow: hidden;
}

/* Bell button: NO overflow:hidden — notification panel must be visible */
.notif-bell-btn {
  position: relative;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes rippleAnim {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}


/* ─── Card Shine Sweep — REMOVED (Dark Mode artifact) ──────────────────── */


/* ─── Enhanced Modal: decorative only (positioning at end of file) ──────── */

.modal-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3B82F6 0%, #38BDF8 40%, #06B6D4 70%, #EC4899 100%);
  z-index: 10;
}


/* ─── Progress Bar Shimmer ──────────────────────────────────────────────── */

.dash-progress-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 6px !important;
  height: 10px !important;
}

.dash-progress-seg {
  height: 100%;
}

.dash-progress-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.25) 50%,
    transparent 100%
  );
  animation: progressShimmer 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes progressShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}


/* ─── Pulse Dot on Active Sidebar Items ─────────────────────────────────── */

.nav-item.active::after,
.nav-pipeline.active::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #3B82F6;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(59,130,246,0.8);
  animation: sidebarPulse 2s ease-in-out infinite;
}

@keyframes sidebarPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(59,130,246,0.8); }
  50% { opacity: 0.5; box-shadow: 0 0 16px rgba(59,130,246,0.4); }
}


/* ─── Floating Gradient Border on Focused Inputs ────────────────────────── */

input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: #3B82F6 !important;
  box-shadow:
    0 0 0 3px rgba(59,130,246,0.12),
    0 0 20px rgba(59,130,246,0.06) !important;
  transition: all 0.2s ease !important;
}

.theme-dark input:focus,
.theme-dark select:focus,
.theme-dark textarea:focus {
  border-color: #818CF8 !important;
  box-shadow:
    0 0 0 3px rgba(59,130,246,0.2),
    0 0 20px rgba(59,130,246,0.1) !important;
}


/* ─── Animated Gradient Text for Page Titles ────────────────────────────── */

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.page-title {
  background: linear-gradient(135deg, #0F172A, #3B82F6, #06B6D4, #0F172A) !important;
  background-size: 300% 300% !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  animation: gradientShift 8s ease infinite;
}

.theme-dark .page-title {
  background: linear-gradient(135deg, #F1F5F9, #818CF8, #67E8F9, #F1F5F9) !important;
  background-size: 300% 300% !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  animation: gradientShift 8s ease infinite;
}


/* ─── Hover Lift Micro-Interactions ─────────────────────────────────────── */

.btn-secondary {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97) !important;
}


/* ─── Sidebar Section Title: Subtle Glow ────────────────────────────────── */

.nav-section-title {
  text-transform: uppercase !important;
  font-size: 0.65rem !important;
  letter-spacing: 0.1em !important;
  color: rgba(148,163,184,0.6) !important;
  font-weight: 600 !important;
  padding: 8px 16px 4px !important;
}


/* ─── Tooltip Enhancement ───────────────────────────────────────────────── */

.dash-chart-tooltip {
  background: #0F172A !important;
  color: white !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.05) !important;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.theme-dark .dash-chart-tooltip {
  background: #334155 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08) !important;
}


/* ─── Legend Items: Hover ───────────────────────────────────────────────── */

.dash-legend-item {
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
  cursor: default;
}

.dash-legend-item:hover {
  background: rgba(59,130,246,0.06);
}

.dash-legend-dot {
  transition: transform 0.15s ease;
}

.dash-legend-item:hover .dash-legend-dot {
  transform: scale(1.3);
}


/* ─── Source Row Hover ──────────────────────────────────────────────────── */

.dash-source-row {
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.dash-source-row:hover {
  background: rgba(59,130,246,0.04);
}

.theme-dark .dash-source-row:hover {
  background: rgba(59,130,246,0.08);
}


/* ─── City Row Hover ────────────────────────────────────────────────────── */

.dash-city-row {
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.dash-city-row:hover {
  background: rgba(34,197,94,0.04);
}


/* ─── Board Column Hover ────────────────────────────────────────────────── */

.board-column {
  transition: all 0.3s ease !important;
}

.board-column:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
  border-color: rgba(59,130,246,0.1) !important;
}

.theme-dark .board-column:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
  border-color: rgba(59,130,246,0.15) !important;
}


/* ─── Column Header: Phase Color Indicator ──────────────────────────────── */

.column-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--phase-color, var(--primary));
  border-radius: 2px;
  opacity: 0.5;
}


/* ─── Reduced Motion: Disable all fancy animations ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ripple-effect,
  .dash-kpi-card::after,
  .dash-card::after,
  .settings-card::after,
  .contact-card::after,
  .dash-progress-wrap::after,
  .nav-item.active::after,
  .nav-pipeline.active::after {
    animation: none !important;
  }
  .page-title {
    animation: none !important;
  }
  .cardShine,
  .progressShimmer,
  .sidebarPulse,
  .rippleAnim {
    animation: none !important;
  }
}


/* ─── Phase 7: Empty States ─────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  min-height: 300px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.empty-state-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}

.empty-state-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   WOW PHASE 5: Skeleton Loading, Table Headers, Notification Panel,
   Glassmorphism Footer, Kanban Drag, Breadcrumbs
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Skeleton Loading Shimmer ──────────────────────────────────────────── */

.skeleton-cell {
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.04) 25%,
    rgba(0,0,0,0.08) 50%,
    rgba(0,0,0,0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  height: 14px;
}

.skeleton-cell-sm { width: 60px; }
.skeleton-cell-md { width: 100px; }
.skeleton-cell-lg { width: 160px; }
.skeleton-cell-xl { width: 220px; }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.theme-dark .skeleton-cell {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
}

/* Skeleton row for dashboard */
.skeleton-kpi {
  height: 80px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg,
    rgba(0,0,0,0.03) 25%,
    rgba(0,0,0,0.06) 50%,
    rgba(0,0,0,0.03) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.theme-dark .skeleton-kpi {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
}


/* ─── Enhanced Table Header ─────────────────────────────────────────────── */

.data-table thead th {
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%) !important;
  border-bottom: 2px solid rgba(59,130,246,0.1) !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--text-secondary) !important;
  padding: 12px 16px !important;
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background 0.15s ease;
}

.data-table thead th:hover {
  background: linear-gradient(180deg, #EEF2FF 0%, #E0E7FF 100%) !important;
  color: var(--primary) !important;
}

.data-table thead th.sort-asc,
.data-table thead th.sort-desc {
  background: linear-gradient(180deg, #EEF2FF 0%, #E0E7FF 100%) !important;
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

.theme-dark .data-table thead th {
  background: linear-gradient(180deg, #1E293B 0%, #1A2332 100%) !important;
  border-bottom: 2px solid rgba(59,130,246,0.15) !important;
}

.theme-dark .data-table thead th:hover {
  background: linear-gradient(180deg, rgba(59,130,246,0.12) 0%, rgba(59,130,246,0.06) 100%) !important;
}

.theme-dark .data-table thead th.sort-asc,
.theme-dark .data-table thead th.sort-desc {
  background: linear-gradient(180deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.08) 100%) !important;
}


/* ─── Notification Dropdown Panel ───────────────────────────────────────── */

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 440px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.12),
    0 0 0 1px rgba(0,0,0,0.04),
    0 0 40px rgba(59,130,246,0.06);
  z-index: 9999;
  overflow: hidden;
  animation: notifSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(59,130,246,0.03) 0%, transparent 100%);
}

.notif-panel-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.notif-panel-body {
  overflow-y: auto;
  max-height: 340px;
  padding: 8px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.notif-item:hover {
  background: rgba(59,130,246,0.04);
}

.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.notif-item-icon.notif-deal {
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(6,182,212,0.1));
}

.notif-item-icon.notif-contact {
  background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(22,163,74,0.1));
}

.notif-item-icon.notif-system {
  background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(217,119,6,0.1));
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.notif-item-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.notif-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.notif-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.4;
}

.theme-dark .notif-panel {
  background: #1E293B;
  border-color: rgba(255,255,255,0.06);
  box-shadow:
    0 24px 60px rgba(0,0,0,0.4),
    0 0 40px rgba(59,130,246,0.08);
}

.theme-dark .notif-item:hover {
  background: rgba(59,130,246,0.08);
}


/* ─── Sidebar Footer: Clean 2-Row Layout ───────────────────────────────── */

.sidebar-footer {
  background: linear-gradient(180deg, transparent 0%, rgba(59,130,246,0.06) 100%) !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 14px !important;
}

.sidebar-user {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

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

.sidebar-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #3B82F6 0%, #38BDF8 100%) !important;
  color: white !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  letter-spacing: 0.02em;
}

.sidebar-user-name {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,0.85) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.sidebar-logout-btn {
  font-size: 0.68rem !important;
  color: rgba(255,255,255,0.35) !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
  transition: color 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  color: rgba(255,255,255,0.7) !important;
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-action-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  background: rgba(255,255,255,0.04) !important;
  color: rgba(255,255,255,0.5) !important;
  cursor: pointer;
  transition: all 0.15s ease !important;
  padding: 0 !important;
}

.sidebar-action-btn svg {
  width: 15px !important;
  height: 15px !important;
}

.sidebar-action-btn:hover {
  background: rgba(59,130,246,0.12) !important;
  border-color: rgba(59,130,246,0.25) !important;
  color: rgba(255,255,255,0.85) !important;
}


/* ─── Kanban Drag Ghost Card ────────────────────────────────────────────── */

.deal-card.sortable-ghost {
  opacity: 0.4 !important;
  transform: scale(0.95) !important;
  box-shadow: 0 0 0 2px var(--primary) !important;
  border-radius: var(--radius-sm) !important;
}

.deal-card.sortable-drag {
  transform: rotate(2deg) scale(1.05) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 0 0 2px var(--primary) !important;
  z-index: 999 !important;
}

.deal-card.sortable-chosen {
  cursor: grabbing !important;
}


/* ─── Breadcrumb Navigation ─────────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.breadcrumb-item {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
  cursor: pointer;
}

.breadcrumb-item:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.4;
  font-size: 0.65rem;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}


/* ─── Enhanced Sort Arrow ───────────────────────────────────────────────── */

.sort-arrow {
  font-size: 0.6rem !important;
  opacity: 0.3;
  margin-left: 4px;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.data-table thead th.sort-asc .sort-arrow,
.data-table thead th.sort-desc .sort-arrow {
  opacity: 1;
  color: var(--primary);
}

.data-table thead th:hover .sort-arrow {
  opacity: 0.6;
}


/* ─── Table Row Selection Highlight ─────────────────────────────────────── */

.data-table tbody tr.selected {
  background: rgba(59,130,246,0.06) !important;
  box-shadow: inset 3px 0 0 var(--primary);
}

.theme-dark .data-table tbody tr.selected {
  background: rgba(59,130,246,0.12) !important;
}


/* ─── Data Table Toolbar: Enhanced ──────────────────────────────────────── */

.data-table-toolbar {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 12px 16px !important;
}

.data-table-search {
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-size: 0.85rem !important;
  background: var(--page-bg) !important;
  border: 1px solid var(--border) !important;
  transition: all 0.2s ease !important;
}

.theme-dark .data-table-search {
  background: rgba(255,255,255,0.04) !important;
}


/* ─── Pagination: Enhanced ──────────────────────────────────────────────── */

.pagination {
  border-top: 1px solid var(--border) !important;
  padding: 10px 16px !important;
  font-size: 0.8rem !important;
}

.pagination button {
  border-radius: 8px !important;
  min-width: 32px;
  height: 32px;
  transition: all 0.15s ease !important;
}

.pagination button:hover:not(:disabled) {
  background: rgba(59,130,246,0.08) !important;
  color: var(--primary) !important;
}

.pagination button.active,
.pagination button[style*="font-weight: bold"],
.pagination button[style*="font-weight:bold"] {
  background: var(--primary) !important;
  color: white !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(59,130,246,0.25) !important;
}


/* ─── Slide-Over: Enhanced Close Button ─────────────────────────────────── */

.so-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
}

.so-close-btn:hover {
  background: rgba(239,68,68,0.08);
  color: #EF4444;
  transform: rotate(90deg);
}


/* ─── Info Button: Enhanced ─────────────────────────────────────────────── */

.dash-info-btn {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  font-size: 0.6rem !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(6,182,212,0.1)) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(59,130,246,0.15) !important;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dash-info-btn:hover {
  background: var(--primary) !important;
  color: white !important;
  transform: scale(1.1);
}

.dash-info-tooltip {
  display: none;
  position: fixed !important;
  z-index: 9999 !important;
  background: #0F172A !important;
  color: white !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-size: 0.78rem !important;
  line-height: 1.4 !important;
  max-width: 320px !important;
  pointer-events: none !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.05) !important;
}

.theme-dark .dash-info-tooltip {
  background: #334155 !important;
}


/* ─── Tag / Chip Styling ────────────────────────────────────────────────── */

.card-label {
  padding: 2px 8px !important;
  font-size: 0.65rem !important;
  border-radius: 100px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  transition: all 0.15s ease;
}

.card-label:hover {
  transform: scale(1.05);
  filter: brightness(0.95);
}


/* ─── Column Count Badge: Enhanced ──────────────────────────────────────── */

.column-count {
  background: rgba(255,255,255,0.9) !important;
  border: 1px solid rgba(0,0,0,0.06);
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  padding: 2px 8px !important;
}

.theme-dark .column-count {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.06);
}


/* ─── Phase Filter Pills (Pipeline View) ───────────────────────────────── */

.phase-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
}

.phase-filter-pill:hover {
  border-color: rgba(59,130,246,0.2);
  background: rgba(59,130,246,0.04);
}

.phase-filter-pill.active {
  border-color: var(--phase-pill-color, var(--primary));
  background: var(--phase-pill-bg, rgba(59,130,246,0.08));
  color: var(--phase-pill-color, var(--primary));
  font-weight: 600;
  box-shadow: 0 2px 8px var(--phase-pill-shadow, rgba(59,130,246,0.15));
}

.phase-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-filter-pill.active .phase-filter-dot {
  box-shadow: 0 0 6px currentColor;
}

.theme-dark .phase-filter-pill {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}

.theme-dark .phase-filter-pill:hover {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.2);
}


/* ─── Quick Stats Mini Bar (Pipeline Header) ────────────────────────────── */

.pipeline-quick-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.pipeline-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.pipeline-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pipeline-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}


/* ─── @Mention Autocomplete Dropdown ────────────────────────────────────── */

.mention-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 60px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  z-index: 100;
  overflow: hidden;
  animation: mentionSlideIn 0.15s ease both;
}

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

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s ease;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.mention-item:hover,
.mention-item.active {
  background: rgba(59,130,246,0.06);
}

.mention-item.active {
  background: rgba(59,130,246,0.1);
}

.mention-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3B82F6, #06B6D4);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-dark .mention-dropdown {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.theme-dark .mention-item:hover,
.theme-dark .mention-item.active {
  background: rgba(59,130,246,0.12);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   WOW PHASE 6: Comments, Activity Timeline, Kanban Cards, Avatars
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Comment @Mention Highlight ────────────────────────────────────────── */

.comment-mention {
  color: var(--primary);
  font-weight: 600;
  background: rgba(59,130,246,0.08);
  padding: 1px 4px;
  border-radius: 4px;
}

.theme-dark .comment-mention {
  background: rgba(59,130,246,0.15);
}


/* ─── Comment Avatar ────────────────────────────────────────────────────── */

.comment-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #3B82F6, #06B6D4);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 4px;
  vertical-align: middle;
}


/* ─── Comment Item: Enhanced ────────────────────────────────────────────── */

.comment-item {
  padding: 10px 12px !important;
  border-radius: 10px !important;
  margin-bottom: 6px !important;
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.03);
  transition: all 0.15s ease;
}

.comment-item:hover {
  background: rgba(59,130,246,0.03);
  border-color: rgba(59,130,246,0.06);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.comment-author {
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.7rem !important;
  color: var(--text-muted) !important;
  margin-left: auto;
}

.comment-text {
  font-size: 0.825rem !important;
  line-height: 1.4 !important;
  color: var(--text-secondary);
  padding-left: 26px;
}

.comment-delete {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.comment-item:hover .comment-delete {
  opacity: 0.5;
}

.comment-delete:hover {
  opacity: 1 !important;
  background: rgba(239,68,68,0.08);
  color: #EF4444;
}

.theme-dark .comment-item {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.03);
}


/* ─── Activity Timeline: Vertical Line ──────────────────────────────────── */

.so-activity-item {
  position: relative;
  padding-left: 12px !important;
}

.so-activity-item::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 40px;
  bottom: -8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(59,130,246,0.2) 0%, transparent 100%);
  z-index: 0;
}

.so-activity-item:last-child::before {
  display: none;
}

.so-activity-avatar {
  background: linear-gradient(135deg, #3B82F6, #06B6D4) !important;
  box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 4px rgba(59,130,246,0.15);
  z-index: 1;
  position: relative;
}

.so-activity-badge.so-badge-reached {
  background: rgba(34,197,94,0.1) !important;
  color: #16A34A !important;
  border: 1px solid rgba(34,197,94,0.2);
}

.so-activity-badge.so-badge-not-reached {
  background: rgba(239,68,68,0.08) !important;
  color: #DC2626 !important;
  border: 1px solid rgba(239,68,68,0.15);
}


/* ─── Kanban: Column Value ──────────────────────────────────────────────── */

.column-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}


/* ─── Kanban Card: Contact Avatar ───────────────────────────────────────── */

.card-contact {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.card-contact-avatar {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, #3B82F6, #38BDF8);
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


/* ─── Kanban Card: Footer Row ───────────────────────────────────────────── */

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.04);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-comment-count {
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 500;
}

.card-date {
  font-variant-numeric: tabular-nums;
}

.theme-dark .card-footer-row {
  border-top-color: rgba(255,255,255,0.04);
}


/* ─── Kanban Card: Enhanced Value ───────────────────────────────────────── */

.card-value {
  font-weight: 700 !important;
  color: var(--primary) !important;
  font-size: 0.85rem !important;
  font-variant-numeric: tabular-nums;
}


/* ─── Kanban Card: Hover Quick Info ─────────────────────────────────────── */

.deal-card {
  cursor: pointer;
}

.deal-card .card-name {
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  line-height: 1.3;
  color: var(--text-primary);
}

.deal-card:hover .card-name {
  color: var(--primary);
}


/* ─── Inline Add Button: Enhanced ───────────────────────────────────────── */

.inline-add-btn {
  border: 1px dashed rgba(59,130,246,0.2) !important;
  color: var(--text-muted) !important;
  background: transparent !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px !important;
  font-size: 0.8rem !important;
  transition: all 0.15s ease !important;
  width: 100%;
  cursor: pointer;
}

.inline-add-btn:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: rgba(59,130,246,0.04) !important;
}


/* ─── Ad/Situation Tag ──────────────────────────────────────────────────── */

.card-ad-situation {
  font-size: 0.7rem !important;
  color: var(--text-muted) !important;
  background: rgba(0,0,0,0.03);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.theme-dark .card-ad-situation {
  background: rgba(255,255,255,0.04);
}


/* ═══════════════════════════════════════════════════════════════════════════
   WOW PHASE 7 — Contacts View Polish, Enhanced Inputs, Status Indicators
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Contact Card: Avatar Header ──────────────────────────────────────── */

.contact-card {
  position: relative;
  overflow: hidden;
  padding-top: 14px !important;
}

.contact-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 50%, #EC4899 100%);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
  letter-spacing: 0.5px;
  flex-shrink: 0;
  position: relative;
}

.contact-card-avatar::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent 60%);
  pointer-events: none;
}

.contact-card .card-name {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  line-height: 1.25;
  margin-bottom: 2px;
}

.contact-card .card-contact {
  font-size: 0.78rem !important;
  color: var(--text-secondary) !important;
  opacity: 0.85;
}

.contact-card .card-ad-situation {
  font-size: 0.68rem !important;
  letter-spacing: 0.2px;
}

/* Card hover: subtle lift */
.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(59,130,246,0.15) !important;
  border-color: rgba(59,130,246,0.2) !important;
}

/* Answered questions: collapsible teaser */
.contact-card .card-answered-questions {
  font-size: 0.72rem !important;
  color: var(--text-muted) !important;
  line-height: 1.35;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.04);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theme-dark .contact-card .card-answered-questions {
  border-top-color: rgba(255,255,255,0.04);
}


/* ─── Contacts Grid: Better Layout ─────────────────────────────────────── */

.contacts-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 16px !important;
}

@media (min-width: 1400px) {
  .contacts-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  }
}


/* ─── Situation Filter: Colored Pill Style ─────────────────────────────── */

.phase-filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-bottom: 16px !important;
  padding: 10px 14px !important;
  background: var(--card-bg) !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
}

.phase-filter-btn {
  padding: 5px 14px !important;
  border-radius: 20px !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  border: 1px solid var(--border) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  cursor: pointer;
  transition: all 0.15s ease !important;
  white-space: nowrap;
}

.phase-filter-btn:hover {
  background: rgba(59,130,246,0.06) !important;
  border-color: rgba(59,130,246,0.3) !important;
  color: var(--primary) !important;
}

.phase-filter-btn.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}


/* ─── Enhanced Search Input ────────────────────────────────────────────── */

.search-enhanced {
  position: relative;
  max-width: 360px;
}

.search-enhanced .form-input {
  padding-left: 36px !important;
  border-radius: 20px !important;
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  transition: all 0.2s ease !important;
  font-size: 0.82rem !important;
}

.search-enhanced .form-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1), 0 2px 8px rgba(59,130,246,0.08) !important;
}

.search-enhanced-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}


/* ─── Form Inputs: Global Enhancement ──────────────────────────────────── */

.form-input,
.form-select,
select.form-input {
  border-radius: var(--radius-sm) !important;
  font-size: 0.84rem !important;
  padding: 8px 12px !important;
  border: 1.5px solid var(--border) !important;
  background: var(--card-bg) !important;
  color: var(--text-primary) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.form-input:focus,
.form-select:focus,
select.form-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1) !important;
  outline: none !important;
}

.form-input::placeholder {
  color: var(--text-muted) !important;
  font-weight: 400;
}

.form-label {
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  margin-bottom: 4px !important;
}


/* ─── View Toggle: Modern Segmented Control ────────────────────────────── */

.view-toggle {
  display: inline-flex !important;
  background: var(--hover-bg) !important;
  border-radius: var(--radius-sm) !important;
  padding: 2px !important;
  gap: 0 !important;
  border: 1px solid var(--border) !important;
}

.view-toggle-btn {
  padding: 5px 10px !important;
  border-radius: calc(var(--radius-sm) - 2px) !important;
  font-size: 0.85rem !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  transition: all 0.15s ease !important;
  line-height: 1;
}

.view-toggle-btn:hover {
  color: var(--text-primary) !important;
}

.view-toggle-btn.active {
  background: var(--card-bg) !important;
  color: var(--primary) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
  font-weight: 600 !important;
}


/* ─── Badge Enhancements ───────────────────────────────────────────────── */

.badge {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 10px !important;
  letter-spacing: 0.3px;
}

.badge-gray {
  background: rgba(59,130,246,0.08) !important;
  color: var(--primary) !important;
}


/* ─── Contact Quick Stats Bar ──────────────────────────────────────────── */

.contacts-stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.contacts-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 140px;
  transition: all 0.15s ease;
}

.contacts-stat-item:hover {
  border-color: rgba(59,130,246,0.25);
  box-shadow: 0 2px 8px rgba(59,130,246,0.06);
}

.contacts-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.contacts-stat-icon.stat-total {
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(168,85,247,0.1));
  color: #3B82F6;
}

.contacts-stat-icon.stat-new {
  background: rgba(34,197,94,0.08);
  color: #16A34A;
}

.contacts-stat-icon.stat-hot {
  background: rgba(239,68,68,0.08);
  color: #EF4444;
}

.contacts-stat-icon.stat-source {
  background: rgba(245,158,11,0.08);
  color: #D97706;
}

.contacts-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.contacts-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}


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

.contacts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 0;
}

.contacts-pagination .btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px !important;
  border-radius: 10px !important;
  font-size: 0.8rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.contacts-pagination .page-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}


/* ─── Status Indicator Dots ────────────────────────────────────────────── */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.status-online {
  background: #22C55E;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
}

.status-dot.status-away {
  background: #F59E0B;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
}

.status-dot.status-offline {
  background: #94A3B8;
  box-shadow: 0 0 0 2px rgba(148,163,184,0.2);
}

.status-dot-pulse {
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.2); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0.1), 0 0 12px rgba(34,197,94,0.15); }
}


/* ─── Card Label: Glossy Chip ──────────────────────────────────────────── */

.card-labels {
  margin-bottom: 6px !important;
}

.card-label {
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  border-radius: 12px !important;
  color: white !important;
  letter-spacing: 0.3px;
}


/* ─── Page Header: Enhanced Layout ─────────────────────────────────────── */

.page-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
}

.page-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap;
}


/* ─── Button Enhancement: Consistent Rounded Style ─────────────────────── */

.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  font-size: 0.82rem !important;
  transition: all 0.15s ease !important;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  box-shadow: 0 2px 8px rgba(59,130,246,0.25) !important;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(59,130,246,0.35) !important;
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid var(--border) !important;
  background: var(--card-bg) !important;
}

.btn-secondary:hover {
  border-color: rgba(59,130,246,0.3) !important;
  color: var(--primary) !important;
  background: rgba(59,130,246,0.04) !important;
}


/* ─── Empty State: Enhanced ────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px !important;
}

.empty-state-icon {
  width: 64px !important;
  height: 64px !important;
  margin: 0 auto 16px !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(168,85,247,0.06)) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.empty-state-title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.82rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 16px;
}


/* ─── Dark Mode: Phase 7 Additions ─────────────────────────────────────── */

.theme-dark .contacts-stat-item {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
}

.theme-dark .phase-filters {
  background: rgba(255,255,255,0.03) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

.theme-dark .phase-filter-btn {
  border-color: rgba(255,255,255,0.08) !important;
  color: var(--text-secondary) !important;
}

.theme-dark .view-toggle {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

.theme-dark .view-toggle-btn.active {
  background: rgba(255,255,255,0.08) !important;
}

.theme-dark .form-input,
.theme-dark .form-select {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

.theme-dark .badge-gray {
  background: rgba(59,130,246,0.15) !important;
}

.theme-dark .contact-card::before {
  opacity: 0;
}

.theme-dark .contact-card:hover::before {
  opacity: 0.08;
}


/* ─── Reduced Motion: Phase 7 ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .contact-card:hover { transform: none; }
  .btn-primary:hover { transform: none; }
  .status-dot-pulse { animation: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   WOW PHASE 8 — Custom Scrollbars, Slide-Over Polish, Dashboard Cards,
                  Sidebar Collapse, Top Bar, Global Polish
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Custom Scrollbars ────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.22);
}

.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
}

.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}

.theme-dark * {
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}


/* ─── Top Bar: Glassmorphism ───────────────────────────────────────────── */

.top-bar {
  background: rgba(255,255,255,0.75) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.04) !important;
  position: sticky;
  top: 0;
  z-index: 40;
}

.theme-dark .top-bar {
  background: rgba(11,15,26,0.8) !important;
  border-bottom-color: rgba(255,255,255,0.04) !important;
}


/* ─── Global Search: Enhanced ──────────────────────────────────────────── */

.search-container {
  position: relative;
}

.search-input {
  background: var(--hover-bg) !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  padding: 7px 12px 7px 34px !important;
  font-size: 0.82rem !important;
  transition: all 0.2s ease !important;
  width: 260px !important;
}

.search-input:focus {
  background: var(--card-bg) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08) !important;
  width: 340px !important;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 340px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}

.theme-dark .search-results {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}


/* ─── Slide-Over: Premium Panel ────────────────────────────────────────── */

.slide-over-backdrop {
  background: rgba(0,0,0,0.3) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.slide-over-panel {
  box-shadow: -8px 0 40px rgba(0,0,0,0.12), -2px 0 8px rgba(0,0,0,0.06) !important;
  border-left: 1px solid var(--border) !important;
}

.theme-dark .slide-over-panel {
  background: #0F172A !important;
  border-left-color: rgba(255,255,255,0.06) !important;
  box-shadow: -8px 0 40px rgba(0,0,0,0.4) !important;
}

/* Slide-over header */
.so-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid var(--border) !important;
  background: var(--card-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.theme-dark .so-header {
  background: #0F172A;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

/* Slide-over tabs */
.so-tabs {
  border-bottom: 1px solid var(--border) !important;
  background: var(--card-bg);
  position: sticky;
  top: 56px;
  z-index: 9;
  gap: 0 !important;
}

.so-tab {
  padding: 10px 16px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
  border-bottom: 2px solid transparent !important;
  transition: all 0.15s ease !important;
  cursor: pointer;
}

.so-tab:hover {
  color: var(--text-primary) !important;
}

.so-tab.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
  font-weight: 600 !important;
}

.theme-dark .so-tabs {
  background: #0F172A;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}


/* ─── Slide-Over: Field Groups ─────────────────────────────────────────── */

.so-field-group {
  padding: 12px 20px !important;
}

.so-field-label {
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
  margin-bottom: 3px;
}

.so-field-value {
  font-size: 0.84rem !important;
  color: var(--text-primary) !important;
}

.so-section-title {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 20px 6px !important;
  border-top: 1px solid var(--border);
}


/* ─── Dashboard Card: Section Headers ──────────────────────────────────── */

.dash-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 20px 12px !important;
  border-bottom: 1px solid var(--border);
}

.dash-card-title {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.2px;
}

.dash-card-body {
  padding: 12px 20px 16px !important;
}


/* ─── Dashboard: Source Rows ───────────────────────────────────────────── */

.dash-source-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 0 !important;
  transition: background 0.1s ease;
  border-radius: var(--radius-sm);
  margin: 0 -4px;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.dash-source-row:hover {
  background: rgba(59,130,246,0.04);
}

.dash-source-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 3px !important;
  flex-shrink: 0;
}

.dash-source-name {
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  min-width: 90px;
}

.dash-source-bar-wrap {
  flex: 1;
  height: 6px !important;
  background: var(--hover-bg) !important;
  border-radius: 3px !important;
  overflow: hidden;
}

.dash-source-bar {
  height: 100%;
  border-radius: 3px !important;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-source-count {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}


/* ─── Dashboard: Period Buttons ────────────────────────────────────────── */

.dash-period-btns {
  display: flex !important;
  gap: 4px !important;
  background: var(--hover-bg);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.dash-period-btn {
  padding: 5px 12px !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  cursor: pointer;
  transition: all 0.15s ease !important;
  white-space: nowrap;
}

.dash-period-btn:hover {
  background: rgba(59,130,246,0.06) !important;
  color: var(--primary) !important;
}

.dash-period-btn.active {
  background: var(--card-bg) !important;
  color: var(--primary) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
  font-weight: 600 !important;
}

.theme-dark .dash-period-btns {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}

.theme-dark .dash-period-btn.active {
  background: rgba(59,130,246,0.15) !important;
}


/* ─── Dashboard: Date Range Inputs ─────────────────────────────────────── */

.dash-date-range {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.dash-date-label {
  font-size: 0.72rem !important;
  color: var(--text-muted) !important;
  font-weight: 500;
}

.dash-date-input {
  padding: 5px 8px !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  background: var(--card-bg) !important;
  color: var(--text-primary) !important;
  transition: border-color 0.15s ease !important;
}

.dash-date-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.1) !important;
  outline: none;
}

.dash-date-reset {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: rgba(239,68,68,0.08);
  color: #EF4444;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.dash-date-reset:hover {
  background: rgba(239,68,68,0.15);
}

.dash-date-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
}


/* ─── Sidebar: Collapsed Mode (main rules in section above) ────────────── */

.sidebar.collapsed + .main-wrapper {
  margin-left: 60px !important;
}

.sidebar.collapsed .sidebar-logo a {
  justify-content: center !important;
}


/* ─── Notification Bell: Enhanced ──────────────────────────────────────── */

.notif-bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.notif-bell-btn:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

.notif-badge {
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #EF4444 !important;
  color: white !important;
  font-size: 0.6rem !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--card-bg);
}


/* ─── Notification Panel ───────────────────────────────────────────────── */

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  z-index: 100;
  animation: notifSlideIn 0.2s ease-out;
}

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

.theme-dark .notif-panel {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

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

.notif-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-panel-body {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

.notif-item:hover {
  background: rgba(59,130,246,0.04);
}

.notif-item.unread {
  background: rgba(59,130,246,0.03);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.theme-dark .notif-item {
  border-bottom-color: rgba(255,255,255,0.03);
}

.theme-dark .notif-item:hover {
  background: rgba(255,255,255,0.04);
}


/* ─── Dashboard Grid: Gap Enhancement ──────────────────────────────────── */

.dash-grid-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  margin-bottom: 16px !important;
}

@media (max-width: 900px) {
  .dash-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

.dash-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 24px !important;
}


/* ─── Filter Area: Flex Layout ─────────────────────────────────────────── */

.dash-filter-area {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap;
  margin-left: auto;
}


/* ─── Header Avatar: Enhanced ──────────────────────────────────────────── */

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3B82F6, #06B6D4);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}


/* ─── Loading State ────────────────────────────────────────────────────── */

.dash-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}


/* ─── Dark Mode: Phase 8 ──────────────────────────────────────────────── */

.theme-dark .dash-source-row:hover {
  background: rgba(255,255,255,0.03);
}

.theme-dark .dash-source-bar-wrap {
  background: rgba(255,255,255,0.06) !important;
}

.theme-dark .dash-date-input {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

.theme-dark .search-input {
  background: rgba(255,255,255,0.06) !important;
}

.theme-dark .search-input:focus {
  background: rgba(255,255,255,0.08) !important;
}

.theme-dark .sidebar-collapse-btn {
  background: rgba(255,255,255,0.03);
}


/* ─── Reduced Motion: Phase 8 ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .notif-panel { animation: none; }
  .search-input { transition: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   WOW PHASE 9 — Chart Polish, Pipeline Search, Perf Table, Kanban Glow,
                  Progress Bars, City Rows, Pipeline Sections
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Daily Chart: Premium Bar Chart ───────────────────────────────────── */

.dash-chart-wrap {
  display: flex !important;
  gap: 8px !important;
  min-height: 200px;
  padding: 8px 0 !important;
}

.dash-chart-y {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  font-size: 0.65rem !important;
  color: var(--text-muted) !important;
  text-align: right;
  min-width: 28px;
  font-variant-numeric: tabular-nums;
  padding: 2px 0;
}

.dash-chart-bars {
  flex: 1 !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: 2px !important;
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-bottom: 20px;
}

.dash-chart-col {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  min-width: 0;
  position: relative;
}

.dash-chart-bar {
  width: 100% !important;
  max-width: 24px;
  border-radius: 4px 4px 0 0 !important;
  background: linear-gradient(180deg, #3B82F6 0%, #818CF8 100%) !important;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 2px;
}

.dash-chart-bar:hover {
  background: linear-gradient(180deg, #4F46E5 0%, #3B82F6 100%) !important;
  box-shadow: 0 -4px 12px rgba(59,130,246,0.3);
  transform: scaleX(1.15);
}

.dash-chart-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: white;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dash-chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #0F172A;
}

.dash-chart-bar:hover .dash-chart-tooltip {
  display: block;
}

.dash-chart-label {
  position: absolute;
  bottom: -18px;
  font-size: 0.6rem !important;
  color: var(--text-muted) !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.theme-dark .dash-chart-bar {
  background: linear-gradient(180deg, #818CF8 0%, #3B82F6 100%) !important;
}

.theme-dark .dash-chart-bar:hover {
  box-shadow: 0 -4px 16px rgba(59,130,246,0.4);
}

.theme-dark .dash-chart-tooltip {
  background: #1E293B;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.theme-dark .dash-chart-tooltip::after {
  border-top-color: #1E293B;
}


/* ─── Performance Table: Clean Design ──────────────────────────────────── */

.dash-perf-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 0.8rem !important;
}

.dash-perf-table thead th {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  padding: 8px 10px !important;
  border-bottom: 1px solid var(--border) !important;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
}

.dash-perf-table tbody td {
  padding: 8px 10px !important;
  border-bottom: 1px solid rgba(0,0,0,0.03) !important;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.dash-perf-table tbody tr {
  transition: background 0.1s ease;
}

.dash-perf-table tbody tr:hover {
  background: rgba(59,130,246,0.03);
}

.dash-perf-table tbody tr:last-child td {
  border-bottom: none !important;
}

.theme-dark .dash-perf-table thead th {
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

.theme-dark .dash-perf-table tbody td {
  border-bottom-color: rgba(255,255,255,0.03) !important;
}

.theme-dark .dash-perf-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}


/* ─── Pipeline Progress Bars: Rounded + Polished ───────────────────────── */

.dash-progress-wrap {
  display: flex !important;
  height: 8px !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  background: var(--hover-bg) !important;
  margin: 8px 0 !important;
  gap: 1px;
}

.dash-progress-seg {
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.dash-progress-seg:first-child {
  border-radius: 4px 0 0 4px;
}

.dash-progress-seg:last-child {
  border-radius: 0 4px 4px 0;
}

.dash-progress-seg:only-child {
  border-radius: 4px;
}

.theme-dark .dash-progress-wrap {
  background: rgba(255,255,255,0.06) !important;
}


/* ─── Pipeline Phase Legend: Better Layout ──────────────────────────────── */

.dash-phase-legend {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px 14px !important;
  margin-top: 6px;
}

.dash-legend-item {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 0.72rem !important;
  color: var(--text-secondary) !important;
}

.dash-legend-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 3px !important;
  flex-shrink: 0;
}


/* ─── Pipeline Section Header ──────────────────────────────────────────── */

.dash-pipeline-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.dash-pipeline-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.dash-pipeline-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 4px;
}

.dash-pipeline-name {
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

.dash-pipeline-meta {
  font-size: 0.72rem !important;
  color: var(--text-muted) !important;
  font-variant-numeric: tabular-nums;
}

.theme-dark .dash-pipeline-section {
  border-bottom-color: rgba(255,255,255,0.04);
}


/* ─── City Analytics Rows ──────────────────────────────────────────────── */

.dash-city-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 0 !important;
}

.dash-city-info {
  min-width: 120px;
  flex-shrink: 0;
}

.dash-city-name {
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  display: block;
}

.dash-city-deals {
  font-size: 0.68rem !important;
  color: var(--text-muted) !important;
}

.dash-city-value {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  min-width: 70px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dash-city-unknown {
  font-size: 0.72rem !important;
  color: var(--text-muted) !important;
  margin-top: 8px;
  font-style: italic;
}

.dash-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 24px 0;
}

.dash-empty-small {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 8px 0;
}


/* ─── Pipeline Search Input ────────────────────────────────────────────── */

.pipeline-filter-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.pipeline-search-input {
  padding: 7px 12px 7px 12px !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  background: var(--card-bg) !important;
  color: var(--text-primary) !important;
  width: 260px !important;
  transition: all 0.2s ease !important;
}

.pipeline-search-input::placeholder {
  color: var(--text-muted);
}

.pipeline-search-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08) !important;
  outline: none;
  width: 320px !important;
}

.theme-dark .pipeline-search-input {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.08) !important;
}


/* ─── Kanban Board: Premium ────────────────────────────────────────────── */

.board-container {
  display: flex !important;
  gap: 12px !important;
  overflow-x: auto !important;
  padding-bottom: 8px;
  align-items: flex-start !important;
}

.board-column {
  min-width: 260px !important;
  max-width: 300px !important;
  flex-shrink: 0;
  background: var(--hover-bg) !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
  transition: border-color 0.15s ease;
}

.board-column:hover {
  border-color: rgba(59,130,246,0.15);
}

.column-header {
  padding: 10px 14px !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  border-bottom: 1px solid rgba(0,0,0,0.04) !important;
}

.column-count {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.06);
}

.column-cards {
  padding: 8px !important;
  display: flex;
  flex-direction: column;
  gap: 6px !important;
  min-height: 60px;
}

.theme-dark .board-column {
  background: rgba(255,255,255,0.03) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

.theme-dark .board-column:hover {
  border-color: rgba(59,130,246,0.15);
}

.theme-dark .column-header {
  border-bottom-color: rgba(255,255,255,0.04) !important;
}

.theme-dark .column-count {
  background: rgba(255,255,255,0.08);
}


/* ─── Deal Cards in Kanban: Compact + Clean ────────────────────────────── */

.deal-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 12px !important;
  border-left: 3px solid !important;
  transition: all 0.15s ease !important;
}

.deal-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
  transform: translateY(-2px);
}


/* ─── Breadcrumb: Enhanced ─────────────────────────────────────────────── */

.breadcrumb {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
  font-size: 0.78rem !important;
}

.breadcrumb-item {
  color: var(--text-muted) !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: color 0.15s ease;
}

.breadcrumb-item:hover {
  color: var(--primary) !important;
}

.breadcrumb-sep {
  color: var(--text-muted) !important;
  font-size: 0.9rem;
}

.breadcrumb-current {
  color: var(--text-primary) !important;
  font-weight: 500;
}


/* ─── Kanban Drag States ───────────────────────────────────────────────── */

.deal-card.sortable-ghost {
  opacity: 0.4 !important;
  border: 1px dashed var(--primary) !important;
  background: rgba(59,130,246,0.04) !important;
}

.deal-card.sortable-chosen {
  box-shadow: 0 8px 24px rgba(59,130,246,0.2) !important;
  transform: rotate(1deg) scale(1.02);
}

.board-column.sortable-drag-over {
  background: rgba(59,130,246,0.04) !important;
  border-color: rgba(59,130,246,0.25) !important;
}


/* ─── Reduced Motion: Phase 9 ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .dash-chart-bar:hover { transform: none; }
  .deal-card:hover { transform: none; }
  .deal-card.sortable-chosen { transform: none; }
  .dash-progress-seg { transition: none; }
}


/* Dark Mode: style.css now uses var(--card-bg) — no master override needed */


/* ═══════════════════════════════════════════════════════════════════════════
   WOW PHASE 10 — Slide-Over Premium, Settings Cards, Data Table,
                   Inline Add, Section Dividers, Form Rows
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Slide-Over: Full Premium Redesign ────────────────────────────────── */

.slideover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* .slideover-panel positioning: uses original style.css centered overlay */

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

.slideover-title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin: 0;
}

.slideover-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--hover-bg);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.slideover-close:hover {
  background: rgba(239,68,68,0.08);
  color: #EF4444;
}

.so-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Slide-over tabs */
.slideover-tabs {
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  flex-shrink: 0;
}

.slideover-tabs-inner {
  display: flex;
  gap: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.slideover-tab {
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.slideover-tab:hover {
  color: var(--text-primary);
}

.slideover-tab.active {
  color: var(--primary);
  background: transparent;
  border-bottom-color: var(--primary);
  font-weight: 600;
  box-shadow: none;
}

/* Slide-over body */
.slideover-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}


/* ─── Section Dividers in Slide-Over ───────────────────────────────────── */

.so-section {
  border-bottom: 1px solid var(--border);
}

.so-section:last-child {
  border-bottom: none;
}

.so-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 6px;
  cursor: pointer;
}

.so-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.so-section-body {
  padding: 0 20px 14px;
}


/* ─── Slide-Over: Design Polish ────────────────────────────────────────── */

/* Panel — refined shadow & bg */
.slideover-panel {
  background: var(--card-bg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  border-radius: 16px;
}

/* Header — cleaner */
.slideover-header {
  background: var(--card-bg);
  border-radius: 16px 16px 0 0;
}

/* Close button — SVG centered */
.slideover-close {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
}

/* Tabs — hover hint underline */
.slideover-tab:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(59,130,246,0.25);
}

.slideover-tab.active {
  color: var(--primary);
  background: transparent;
  border-bottom-color: var(--primary);
  font-weight: 600;
  box-shadow: none;
}

/* Sections — flat divider style, no card borders */
.slideover-section {
  margin-bottom: 0;
  padding: 16px 20px;
  background: transparent;
  border-radius: 0;
  border: none;
  border-bottom: 2px solid var(--border);
}

.slideover-section:last-child {
  border-bottom: none;
}

.slideover-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

.slideover-section-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.15s ease;
}

.slideover-section-header:hover .slideover-section-chevron {
  color: var(--text-primary);
}

.slideover-section-body {
  margin-top: 12px;
}

/* Sub-tabs — polished segmented control */
.so-subtabs {
  background: rgba(0,0,0,0.04);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  margin: 20px 18px !important;
}

.so-subtab {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all 0.18s ease;
}

.so-subtab:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.03);
}

.so-subtab.active {
  color: var(--text-primary);
  background: var(--card-bg);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.so-subtab-icon {
  width: 15px;
  height: 15px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.so-subtab.active .so-subtab-icon {
  opacity: 0.9;
}

/* Form inputs — refined */
.slideover-section .form-input,
.so-subtab-content .form-input {
  padding: 9px 12px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.slideover-section .form-input:focus,
.so-subtab-content .form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
  outline: none;
}

/* Form labels — subtle */
.slideover-section .form-label,
.so-subtab-content .form-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* Email action buttons — polished */
.so-email-btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.so-email-btn-primary {
  background: var(--primary);
  box-shadow: 0 1px 3px rgba(59,130,246,0.25);
}

.so-email-btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
  transform: translateY(-1px);
}

.so-email-btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59,130,246,0.04);
}

/* Reached buttons — always filled with color */
.so-reached-btn {
  border-radius: 8px;
  transition: all 0.18s ease;
}

.so-reached-ja {
  background: rgba(34,197,94,0.12) !important;
  color: #22C55E !important;
  border-color: rgba(34,197,94,0.3) !important;
  font-weight: 600 !important;
}

.so-reached-ja:hover {
  background: rgba(34,197,94,0.2) !important;
  border-color: rgba(34,197,94,0.5) !important;
}

.so-reached-nein {
  background: rgba(239,68,68,0.1) !important;
  color: #EF4444 !important;
  border-color: rgba(239,68,68,0.25) !important;
  font-weight: 600 !important;
}

.so-reached-nein:hover {
  background: rgba(239,68,68,0.18) !important;
  border-color: rgba(239,68,68,0.4) !important;
}

.so-reached-ja.active,
.so-reached-nein.active {
  transform: scale(1.02);
}

.so-reached-ja.active {
  background: #22C55E !important;
  color: white !important;
  border-color: #22C55E !important;
}

.so-reached-nein.active {
  background: #EF4444 !important;
  color: white !important;
  border-color: #EF4444 !important;
}

/* Empty state — nicer */
.so-empty-state {
  padding: 32px 20px;
}

.so-empty-icon {
  opacity: 0.25;
  margin-bottom: 12px;
}

.so-empty-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.so-empty-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Activity items — refined */
.so-activity-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.so-activity-item:last-child {
  border-bottom: none;
}

.so-activity-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.75rem;
  background: rgba(59,130,246,0.08);
  color: var(--primary);
}

.so-activity-badge {
  font-size: 0.675rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
}

/* Footer save button — polished */
.slideover-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 0 0 16px 16px;
}

.slideover-footer .btn-primary,
.slideover-footer button[type="submit"] {
  width: 100%;
  padding: 11px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.18s ease;
}

.slideover-footer .btn-primary:hover,
.slideover-footer button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}

/* Compose email modal — polished */
.so-compose-modal {
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.05);
}

.so-compose-header {
  border-radius: 16px 16px 0 0;
}

.so-compose-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.so-compose-footer {
  border-radius: 0 0 16px 16px;
}

/* Signature area — polished */
.so-compose-signature {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--hover-bg);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.so-compose-signature iframe {
  border-color: var(--border) !important;
  border-radius: 6px !important;
}

/* WhatsApp send button — keep green */
.so-wa-btn-primary {
  background: #25D366 !important;
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(37,211,102,0.25);
  transition: all 0.18s ease;
}

.so-wa-btn-primary:hover {
  background: #20BD5A !important;
  box-shadow: 0 2px 8px rgba(37,211,102,0.3);
  transform: translateY(-1px);
}

/* WhatsApp chips — polished */
.so-wa-chip {
  border-radius: 16px;
  font-size: 0.75rem;
  padding: 6px 12px;
  border: 1px solid rgba(37,211,102,0.2);
  color: #1A9B4B;
  background: rgba(37,211,102,0.05);
  transition: all 0.15s ease;
}

.so-wa-chip:hover {
  background: rgba(37,211,102,0.1);
  border-color: rgba(37,211,102,0.35);
}

/* Dark mode adjustments */
html.theme-dark .slideover-panel {
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
}

html.theme-dark .slideover-tabs {
  background: #0F172A !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

html.theme-dark .slideover-tabs-inner {
  background: rgba(255,255,255,0.06) !important;
}

html.theme-dark .slideover-tab {
  color: rgba(255,255,255,0.5) !important;
}

html.theme-dark .slideover-tab:hover {
  color: rgba(255,255,255,0.8) !important;
}

html.theme-dark .slideover-tab.active {
  color: var(--primary) !important;
}

html.theme-dark .so-subtabs {
  background: rgba(255,255,255,0.06) !important;
}

html.theme-dark .so-subtab {
  color: rgba(255,255,255,0.5) !important;
}

html.theme-dark .so-subtab.active {
  background: rgba(255,255,255,0.1) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

html.theme-dark .slideover-section {
  border-bottom-color: rgba(255,255,255,0.06);
}

html.theme-dark .so-compose-modal {
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);
}


/* ─── Form Rows: Two-Column Grid ───────────────────────────────────────── */

.form-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-row .form-group:only-child {
  grid-column: 1 / -1;
}


/* ─── Settings Cards: Premium Grid ─────────────────────────────────────── */

.settings-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 14px !important;
}

.settings-card {
  padding: 20px !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-card:hover {
  border-color: rgba(59,130,246,0.25) !important;
  box-shadow: 0 8px 24px rgba(59,130,246,0.08) !important;
  transform: translateY(-2px);
}

.settings-card-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.3rem !important;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(168,85,247,0.06)) !important;
}

.settings-card-title {
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

.settings-card-desc {
  font-size: 0.76rem !important;
  color: var(--text-muted) !important;
  line-height: 1.4;
}


/* ─── Data Table: Premium ──────────────────────────────────────────────── */

.data-table-wrapper {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.data-table-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--border) !important;
  gap: 10px;
}

.data-table-search {
  padding: 6px 10px !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  background: var(--hover-bg) !important;
  color: var(--text-primary) !important;
  width: 220px !important;
  transition: all 0.15s ease !important;
}

.data-table-search:focus {
  background: var(--card-bg) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.08) !important;
  outline: none;
  width: 280px !important;
}

.data-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 0.82rem !important;
}

.data-table th {
  padding: 8px 12px !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  border-bottom: 1px solid var(--border) !important;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--card-bg);
}

.data-table td {
  padding: 8px 12px !important;
  border-bottom: 1px solid rgba(0,0,0,0.03) !important;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.1s ease;
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: rgba(59,130,246,0.03) !important;
}

.data-table tbody tr.selected {
  background: rgba(59,130,246,0.06) !important;
}

.data-table tbody tr:last-child td {
  border-bottom: none !important;
}

/* Cell types */
.cell-name {
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

.cell-phone a {
  color: var(--primary) !important;
  text-decoration: none;
}

.cell-phone a:hover {
  text-decoration: underline;
}


/* ─── Pagination: Clean ────────────────────────────────────────────────── */

.pagination-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 14px !important;
  border-top: 1px solid var(--border) !important;
  font-size: 0.78rem;
}

.pagination-btn {
  padding: 5px 10px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border) !important;
  background: var(--card-bg) !important;
  color: var(--text-secondary) !important;
  font-size: 0.76rem !important;
  cursor: pointer;
  transition: all 0.15s ease !important;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}


/* ─── Bulk Actions Bar ─────────────────────────────────────────────────── */

.dt-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(59,130,246,0.06);
  border-radius: 8px;
  animation: fadeIn 0.15s ease;
}

.bulk-count {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary);
}


/* ─── Inline Add Input (Kanban) ────────────────────────────────────────── */

.inline-add-input-wrapper {
  padding: 4px 8px;
  margin-bottom: 6px;
}

.inline-add-input-wrapper input {
  width: 100%;
  border: 1.5px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  font-size: 0.82rem !important;
  background: var(--card-bg) !important;
  color: var(--text-primary) !important;
  outline: none;
  transition: border-color 0.15s ease;
}

.inline-add-input-wrapper input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}


/* ─── Label Chips in Slide-Over ────────────────────────────────────────── */

.so-labels-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.so-label-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
}

.so-label-add-btn {
  border-radius: 12px !important;
}


/* ─── Document Rows ────────────────────────────────────────────────────── */

.so-doc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.1s ease;
}

.so-doc-row:hover {
  background: var(--hover-bg);
}


/* ─── Column Resizer ──────────────────────────────────────────────────── */

.th-resizer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s ease;
}

.th-resizer:hover,
.th-resizer.active {
  background: var(--primary);
}


/* ─── Dark Mode: Phase 10 Additions ────────────────────────────────────── */

html.theme-dark .slideover-panel {
  background: #0F172A !important;
  border-left-color: rgba(255,255,255,0.06) !important;
  box-shadow: -12px 0 48px rgba(0,0,0,0.4) !important;
}

html.theme-dark .slideover-header,
html.theme-dark .slideover-tabs {
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

html.theme-dark .slideover-close {
  background: rgba(255,255,255,0.06);
}

html.theme-dark .settings-card {
  background: #1E293B !important;
  border-color: rgba(255,255,255,0.06) !important;
}

html.theme-dark .settings-card:hover {
  border-color: rgba(59,130,246,0.25) !important;
}

html.theme-dark .settings-card-icon {
  background: rgba(59,130,246,0.12) !important;
}

html.theme-dark .data-table-wrapper {
  border-color: rgba(255,255,255,0.06) !important;
}

html.theme-dark .data-table td {
  border-bottom-color: rgba(255,255,255,0.03) !important;
}

html.theme-dark .data-table tbody tr:hover {
  background: rgba(255,255,255,0.03) !important;
}

html.theme-dark .data-table-toolbar {
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

html.theme-dark .pagination-wrapper {
  border-top-color: rgba(255,255,255,0.06) !important;
}

html.theme-dark .pagination-btn {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

html.theme-dark .inline-add-input-wrapper input {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

html.theme-dark .so-section {
  border-bottom-color: rgba(255,255,255,0.06);
}


/* ─── Dark Mode: Comprehensive Overrides ──────────────────────────────── */

/* Force dark backgrounds on all main containers */
html.theme-dark .main-wrapper {
  background: var(--page-bg) !important;
}

html.theme-dark .page-content {
  background: var(--page-bg) !important;
}

/* Page header buttons */
html.theme-dark .btn-secondary {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-secondary) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

html.theme-dark .btn-secondary:hover {
  background: rgba(255,255,255,0.1) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .btn-icon:hover {
  background: rgba(255,255,255,0.06) !important;
}

/* Data table — ensure dark backgrounds */
html.theme-dark .data-table-wrapper {
  background: var(--card-bg) !important;
}

html.theme-dark .data-table th {
  background: rgba(255,255,255,0.03) !important;
  color: var(--text-secondary) !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

html.theme-dark .data-table-search {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

html.theme-dark .data-table-search::placeholder {
  color: var(--text-muted) !important;
}

/* Board columns (pipeline kanban) */
html.theme-dark .board-column {
  background: rgba(255,255,255,0.03) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* Deal cards */
html.theme-dark .board-card,
html.theme-dark .deal-card {
  background: var(--card-bg) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* Contact cards */
html.theme-dark .contact-card {
  background: var(--card-bg) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* Modal */
html.theme-dark .modal {
  background: var(--card-bg) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

html.theme-dark .modal-header,
html.theme-dark .modal-footer {
  border-color: rgba(255,255,255,0.06) !important;
}

/* Form elements in dark mode */
html.theme-dark .form-input,
html.theme-dark .form-select,
html.theme-dark textarea,
html.theme-dark select {
  background: rgba(255,255,255,0.04) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

html.theme-dark .form-input::placeholder,
html.theme-dark textarea::placeholder {
  color: var(--text-muted) !important;
}

/* Pagination */
html.theme-dark .pagination-wrapper {
  background: var(--card-bg) !important;
}

html.theme-dark .pagination-info {
  color: var(--text-secondary) !important;
}

/* Phase filter buttons */
html.theme-dark .phase-filter-btn {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-secondary) !important;
}

html.theme-dark .phase-filter-btn:hover,
html.theme-dark .phase-filter-btn.active {
  background: rgba(59,130,246,0.15) !important;
  color: var(--primary) !important;
}

/* View toggle */
html.theme-dark .view-toggle {
  background: rgba(255,255,255,0.04) !important;
}

html.theme-dark .view-toggle-btn {
  color: var(--text-secondary) !important;
}

html.theme-dark .view-toggle-btn.active {
  background: var(--card-bg) !important;
  color: var(--text-primary) !important;
}

/* Inline add button */
html.theme-dark .inline-add-btn {
  color: var(--text-muted) !important;
}

html.theme-dark .inline-add-btn:hover {
  background: rgba(255,255,255,0.04) !important;
  color: var(--text-secondary) !important;
}

/* Column header count badge */
html.theme-dark .column-count {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text-secondary) !important;
}

/* KPI cards background */
html.theme-dark .dash-kpi-card {
  background: var(--card-bg) !important;
}

/* Dashboard cards */
html.theme-dark .dash-card {
  background: var(--card-bg) !important;
}

/* Search results dropdown */
html.theme-dark .search-results {
  background: var(--card-bg) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

/* Labels / badges */
html.theme-dark .badge-gray {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text-secondary) !important;
}

/* ─── Reduced Motion: Phase 10 ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .slideover-panel { animation: none; }
  .slideover-backdrop { animation: none; }
  .settings-card:hover { transform: none; }
  .data-table-search { transition: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 11: Micro-Interactions, Hover Effects & Visual Polish
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Sidebar: Hover Glow (active bar already defined in Phase 8) ────── */

.sidebar-nav a {
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}


/* ─── KPI Cards: Hover Lift + Subtle Border Glow ─────────────────────── */

.dash-kpi-card {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s ease !important;
  border: 1px solid var(--border) !important;
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.1),
              0 4px 10px -3px rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(99, 102, 241, 0.15) !important;
}

html.theme-dark .dash-kpi-card:hover {
  box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.15),
              0 4px 10px -3px rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
}


/* ─── Contact Cards: Hover with Accent Border Top ────────────────────── */

.contact-card {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.2s ease !important;
  border-top: 3px solid transparent !important;
  overflow: hidden;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(99, 102, 241, 0.12),
              0 4px 8px -2px rgba(0, 0, 0, 0.04) !important;
  border-top-color: var(--primary) !important;
}

html.theme-dark .contact-card:hover {
  box-shadow: 0 10px 30px -8px rgba(99, 102, 241, 0.2),
              0 4px 8px -2px rgba(0, 0, 0, 0.3) !important;
}


/* ─── Deal Cards (Kanban): Hover Elevation ───────────────────────────── */

.deal-card {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.deal-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.08),
              0 2px 6px -1px rgba(0, 0, 0, 0.03) !important;
}

html.theme-dark .deal-card:hover {
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.3),
              0 2px 6px -1px rgba(0, 0, 0, 0.15) !important;
}


/* ─── Buttons: Press Effect ──────────────────────────────────────────── */

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-sm:active {
  transform: scale(0.97) !important;
  transition: transform 0.08s ease !important;
}


/* ─── Table Rows: Smooth Hover with Left Accent ──────────────────────── */

.data-table tbody tr {
  position: relative;
  transition: background 0.15s ease !important;
}

.data-table tbody tr::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 2px 2px 0;
}

.data-table tbody tr:hover::after {
  transform: scaleY(1);
}


/* ─── Tooltip-Style Badge Pulse on KPI Values ────────────────────────── */

.kpi-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}


/* ─── Input Focus Ring: Indigo Glow ──────────────────────────────────── */

.form-input:focus,
.form-select:focus,
textarea:focus,
.search-input:focus,
.data-table-search:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

html.theme-dark .form-input:focus,
html.theme-dark .form-select:focus,
html.theme-dark textarea:focus,
html.theme-dark .search-input:focus,
html.theme-dark .data-table-search:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}


/* ─── Dashboard Section Headers: Subtle Divider Line ─────────────────── */

.dash-card-header {
  position: relative;
  padding-bottom: 12px !important;
}

.dash-card-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0.15;
}


/* ─── Notification Bell: Pulse Animation on Badge ────────────────────── */

@keyframes bellPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.notification-badge {
  animation: bellPulse 2s ease-in-out infinite;
}


/* ─── Slide-Over: Smooth Backdrop Blur ───────────────────────────────── */

.slideover-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}


/* ─── Pipeline Column Headers: Count Badge ───────────────────────────── */

.kanban-col-header {
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.01em;
}


/* ─── Settings Cards: Icon Hover Rotate ──────────────────────────────── */

.settings-card:hover .settings-card-icon {
  transform: rotate(-5deg) scale(1.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ─── Global Selection Color ─────────────────────────────────────────── */

::selection {
  background: rgba(99, 102, 241, 0.2);
  color: inherit;
}


/* ─── Smooth Scrollbar Thumb for Kanban Columns ──────────────────────── */

.kanban-col-body::-webkit-scrollbar {
  width: 4px;
}

.kanban-col-body::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-col-body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.15);
  border-radius: 4px;
}

.kanban-col-body::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.3);
}


/* ─── Filter Pills: Active State Polish ──────────────────────────────── */

.situation-filter-pill.active {
  box-shadow: 0 2px 8px -2px rgba(99, 102, 241, 0.25) !important;
  transform: translateY(-1px);
}


/* ─── Top Bar: Subtle Bottom Shadow ──────────────────────────────────── */

.top-bar {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04),
              0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

html.theme-dark .top-bar {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2),
              0 1px 2px rgba(0, 0, 0, 0.15) !important;
}


/* ─── Page Transition: Content Fade-In ───────────────────────────────── */

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

#app > div {
  animation: contentFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}


/* ─── Breadcrumb Separator: Animated Chevron ─────────────────────────── */

.breadcrumb-separator {
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.breadcrumb:hover .breadcrumb-separator {
  opacity: 0.7;
}


/* ─── Loading Spinner Polish ─────────────────────────────────────────── */

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

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinnerRotate 0.6s linear infinite;
}


/* ─── Dark Mode: Phase 11 Additions ──────────────────────────────────── */

html.theme-dark .dash-card-header::after {
  opacity: 0.25;
}

html.theme-dark .data-table tbody tr::after {
  background: #818CF8;
}

html.theme-dark .kanban-col-body::-webkit-scrollbar-thumb {
  background: rgba(129, 140, 248, 0.15);
}

html.theme-dark .kanban-col-body::-webkit-scrollbar-thumb:hover {
  background: rgba(129, 140, 248, 0.3);
}


/* ─── Dashboard Sort Select: Dark Mode Compatible ────────────────────── */

.dash-sort-select {
  font-size: 0.75rem !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  cursor: pointer !important;
  color: var(--text-primary) !important;
  background: var(--card-bg) !important;
  font-family: inherit !important;
  transition: border-color 0.15s ease !important;
  outline: none;
}

.dash-sort-select:hover {
  border-color: rgba(99, 102, 241, 0.3) !important;
}

.dash-sort-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
}

html.theme-dark .dash-sort-select {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

html.theme-dark .dash-sort-select option {
  background: #1E293B;
  color: #F1F5F9;
}


/* ─── Period Buttons: Centered ───────────────────────────────────────── */

.dash-period-btns {
  justify-content: center !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MODAL MASTER OVERRIDE — This is the ONLY place modal positioning lives.
   All other modal rules above are decorative only (::before, dark mode).
   ═══════════════════════════════════════════════════════════════════════════ */

#modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100 !important;
  display: grid !important;
  place-items: center !important;
  padding: 20px !important;
  background: rgba(0,0,0,0.5) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

#modal-backdrop.hidden {
  display: none !important;
}

#modal-container {
  position: relative !important;
  background: var(--card-bg) !important;
  border-radius: 16px !important;
  box-shadow: 0 32px 80px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.05) !important;
  width: 100% !important;
  max-height: calc(100vh - 40px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

html.theme-dark #modal-backdrop {
  background: rgba(0,0,0,0.7) !important;
}

html.theme-dark #modal-container {
  background: #1E293B !important;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 60px rgba(59,130,246,0.08) !important;
  border: 1px solid rgba(59,130,246,0.15) !important;
}


/* Slideover: Original zentriertes Overlay aus style.css wird genutzt */


/* ─── Table Row Borders: etwas dicker im Light-Mode ──────────────────── */

.data-table tbody tr {
  border-bottom: 1.5px solid var(--border) !important;
}


/* ─── Reduced Motion: Phase 11 ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .dash-kpi-card:hover,
  .contact-card:hover,
  .deal-card:hover { transform: none !important; }
  .btn:active,
  .btn-primary:active { transform: none !important; }
  .notification-badge { animation: none !important; }
  #app > div { animation: none !important; }
  .data-table tbody tr::after { transition: none !important; }
  .sidebar-nav a::before { transition: none !important; }
  .settings-card:hover .settings-card-icon { transform: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   TOP-NAV LAYOUT — Sidebar → Horizontal Top Navigation
   Remove this entire block to revert to sidebar layout.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Foundation: Fixed viewport — only page-content scrolls vertically ── */

html, body {
  height: 100% !important;
  overflow: hidden !important;  /* Body never scrolls — page-content does */
  max-width: 100vw;
}

body {
  flex-direction: column !important;
}

.main-wrapper {
  margin-left: 0 !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.page-content {
  overflow-y: auto !important;   /* Vertical scroll here only */
  overflow-x: hidden !important; /* Never horizontal */
  height: 100% !important;
  box-sizing: border-box !important;
}

/* ─── Sidebar → Top Nav Bar ────────────────────────────────────────────── */

.sidebar {
  width: 100% !important;
  min-width: 100% !important;
  height: auto !important;
  position: sticky !important;
  top: 0 !important;
  flex-direction: row !important;
  align-items: center !important;
  padding: 12px 20px !important;
  z-index: 40 !important;
  border-right: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  overflow: visible !important;
  background: #0F172A !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06) !important;
}

/* ─── Logo ─────────────────────────────────────────────────────────────── */

.sidebar-logo {
  padding: 0 20px 0 0 !important;
  border-bottom: none !important;
  flex-shrink: 0;
  margin-right: 4px;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo a {
  gap: 9px !important;
}

.sidebar-logo svg {
  width: 26px !important;
  height: 26px !important;
}

.sidebar-logo .text-lg {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  color: rgba(255,255,255,0.9) !important;
}

/* ─── Nav Container ────────────────────────────────────────────────────── */

.sidebar-nav {
  flex-direction: row !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 4px !important;
  overflow: visible !important;
  overflow-y: visible !important;
  gap: 2px;
  flex: 1;
  height: 100%;
}

/* ─── Nav Items — clean horizontal links ───────────────────────────────── */

.nav-item {
  display: flex !important;
  align-items: center !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  gap: 7px !important;
  color: rgba(255,255,255,0.55) !important;
  transition: all 0.15s ease !important;
  position: relative;
}

.nav-item:hover {
  color: rgba(255,255,255,0.9) !important;
  background: rgba(255,255,255,0.06) !important;
}

.nav-item.active {
  color: white !important;
  background: rgba(59,130,246,0.15) !important;
  box-shadow: none !important;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.nav-icon {
  width: 16px !important;
  height: 16px !important;
  opacity: 0.7;
}

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

/* ─── Pipeline Section ─────────────────────────────────────────────────── */

.nav-section {
  margin-top: 0 !important;
  display: flex !important;
  align-items: center !important;
  position: relative;
  height: 100%;
}

/* Divider before pipeline section */
.nav-section:first-of-type {
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.06);
}

/* Section titles — hide "PIPELINES" label in top-nav, not needed */
.nav-section:first-of-type > .nav-section-title {
  display: none !important;
}

/* Generic section title (used by Settings) */
.nav-section-title {
  padding: 6px 10px !important;
  font-size: 0.62rem !important;
  font-weight: 600 !important;
  margin: 0 !important;
  white-space: nowrap;
  color: rgba(255,255,255,0.3) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
}

/* Pipeline items — horizontal */
#sidebar-pipelines {
  display: flex !important;
  flex-direction: row !important;
  gap: 1px;
}

/* Pipeline links */
.nav-pipeline,
.nav-item.nav-item-sub {
  padding: 8px 13px !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  color: rgba(255,255,255,0.55) !important;
  transition: all 0.15s ease !important;
  position: relative;
}

.nav-pipeline:hover,
.nav-item.nav-item-sub:hover {
  color: rgba(255,255,255,0.9) !important;
  background: rgba(255,255,255,0.06) !important;
}

.nav-pipeline.active,
.nav-item.nav-item-sub.active {
  color: white !important;
  background: rgba(59,130,246,0.15) !important;
  box-shadow: none !important;
}

.nav-pipeline.active::after,
.nav-item.nav-item-sub.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.nav-pipeline-dot {
  width: 7px !important;
  height: 7px !important;
}

/* ─── Settings Section — hidden in top-nav (moved to top-bar right) ───── */

.nav-section:last-child {
  display: none !important;
}

.nav-section:last-child .nav-section-title {
  padding: 7px 12px !important;
  font-size: 0.78rem !important;
  text-transform: none !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,0.55) !important;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-section:last-child .nav-section-title:hover {
  color: rgba(255,255,255,0.9) !important;
  background: rgba(255,255,255,0.06);
}

.nav-section:last-child .nav-icon {
  width: 14px !important;
  height: 14px !important;
}

/* Settings dropdown */
#sidebar-settings-items {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  background: #1E293B !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04) !important;
  padding: 6px !important;
  min-width: 200px !important;
  max-height: 70vh !important;
  overflow-y: auto !important;
  z-index: 100 !important;
  flex-direction: column !important;
}

#sidebar-settings-items::-webkit-scrollbar {
  width: 4px;
}

#sidebar-settings-items::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

#sidebar-settings-items .nav-item {
  width: 100% !important;
  border-radius: 7px !important;
  padding: 8px 12px !important;
  font-size: 0.78rem !important;
}

#sidebar-settings-items .nav-item .nav-icon {
  width: 14px !important;
  height: 14px !important;
}

#sidebar-settings-items .nav-item:hover {
  background: rgba(255,255,255,0.06) !important;
}

/* Settings arrow */
#settings-arrow {
  font-size: 0.55rem !important;
  transition: transform 0.2s ease !important;
  opacity: 0.5;
}

/* ─── Sidebar Footer — hidden ─────────────────────────────────────────── */

.sidebar-footer {
  display: none !important;
}

/* ─── Top-Nav Right Actions (inside sidebar bar) ──────────────────────── */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.08);
  height: 100%;
  flex-shrink: 0;
}

.topbar-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.topbar-nav-btn:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.08);
}

.topbar-nav-btn svg {
  width: 16px;
  height: 16px;
}

/* User badge in dark nav */
.topbar-user-badge {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  cursor: default;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  margin-left: 4px;
  white-space: nowrap;
}

.topbar-user-badge:hover {
  background: rgba(255,255,255,0.12);
}

.header-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ─── Hide unnecessary elements ────────────────────────────────────────── */

.sidebar-hamburger {
  display: none !important;
}

.sidebar-overlay {
  display: none !important;
}

/* Hide the old top-bar completely */
.top-bar {
  display: none !important;
}

/* ─── Main Wrapper — offset by sidebar width ───────────────────────────── */

.main-wrapper {
  margin-left: 0 !important;
  width: 100% !important;
}

/* Also override collapsed-sidebar margin */
.sidebar.collapsed + .main-wrapper,
.sidebar.collapsed ~ .main-wrapper,
.sidebar.collapsed + .main-content,
.sidebar.collapsed ~ .main-content {
  margin-left: 0 !important;
}

/* Page content — full width, vertical scroll only */
.page-content {
  width: 100%;
  padding: 24px 32px !important;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .page-content {
    padding: 16px !important;
  }
}

/* Pipeline board — horizontal scroll with grab cursor */
.board-container {
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.board-container:active {
  cursor: grabbing;
}

.board-container::-webkit-scrollbar {
  height: 6px;
}

.board-container::-webkit-scrollbar-track {
  background: transparent;
}

.board-container::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

.board-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}

html.theme-dark .board-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
}

html.theme-dark .board-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* (old top-bar styles removed — actions now in sidebar nav bar) */

/* ─── Scrollbar hidden on nav ──────────────────────────────────────────── */

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.sidebar-nav {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ─── Dark Mode ────────────────────────────────────────────────────────── */

html.theme-dark .sidebar {
  background: #0B1120 !important;
  border-bottom-color: rgba(255,255,255,0.04) !important;
}

html.theme-dark #sidebar-settings-items {
  background: #162032 !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* ─── Tablet (769px – 1024px) ─────────────────────────────────────────── */

@media (max-width: 1024px) {
  .sidebar {
    padding: 12px 14px !important;
  }

  .nav-item,
  .nav-pipeline,
  .nav-item.nav-item-sub {
    padding: 7px 10px !important;
    font-size: 0.75rem !important;
    gap: 5px !important;
  }

  .sidebar-logo .text-lg {
    font-size: 0.72rem !important;
  }

  .topbar-actions {
    gap: 1px;
    padding-left: 8px;
  }

  .topbar-nav-btn {
    width: 30px;
    height: 30px;
  }

  /* KPI grid: 3 columns on tablet */
  .dash-kpi-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Page content tighter padding */
  .page-content {
    padding: 20px 20px !important;
  }

  /* Pipeline board columns smaller */
  .board-column {
    min-width: 240px !important;
  }

  /* Slide-over narrower */
  .slideover-panel {
    max-width: 85vw !important;
  }

  /* ── Phase 7: Tablet-Feinschliff ─────────────────────────────────────── */
  .page-actions {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .dash-filter-area {
    flex-wrap: wrap !important;
  }
  .contacts-stats-bar {
    flex-wrap: wrap !important;
  }
  .phase-filters {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }
  /* iOS-Zoom Prevention auch auf Tablet */
  .form-input,
  .data-table-search {
    font-size: 16px !important;
  }
  .th-resizer {
    width: 8px !important;
  }
  .settings-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  }
}

/* ─── Mobile Top Bar (hidden on desktop) ─────────────────────────────── */

.mobile-topbar {
  display: none;
}

.mobile-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}
.mobile-hamburger:active { background: rgba(255,255,255,0.08); }
.mobile-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #94a3b8;
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}
.mobile-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: #fff; }
.mobile-hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: #fff; }

.mobile-topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.mobile-topbar-logo span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: #fff;
}

.mobile-topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.mobile-topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
}
.mobile-topbar-btn:active { background: rgba(255,255,255,0.08); color: #fff; }

/* ─── Mobile (≤ 768px) ────────────────────────────────────────────────── */

@media (max-width: 768px) {

  /* ── 1. Scroll-Fix ─────────────────────────────────────────────────── */
  html {
    overflow: auto !important;
    overflow-y: auto !important;
    height: auto !important;
  }

  body {
    min-height: auto !important;
    overflow: auto !important;
    height: auto !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    padding-top: 54px !important;
    min-height: auto !important;
    height: auto !important;
    overflow-y: visible !important;
  }

  .page-content {
    padding: 14px !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* ── 2. Mobile Top Bar ─────────────────────────────────────────────── */
  .mobile-topbar {
    display: flex !important;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    padding: 0 12px;
    background: var(--sidebar-bg, #0f172a);
    border-bottom: 1px solid var(--sidebar-border, rgba(255,255,255,0.06));
    z-index: 50;
    gap: 10px;
  }

  /* ── 3. Sidebar Drawer ─────────────────────────────────────────────── */
  .sidebar {
    width: 280px !important;
    min-width: 280px !important;
    height: 100vh !important;
    height: 100dvh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
    z-index: 60 !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    border-right: 1px solid var(--sidebar-border) !important;
    border-bottom: none !important;
  }

  .sidebar.sidebar-open {
    transform: translateX(0) !important;
  }

  /* Hide desktop elements in sidebar */
  .sidebar .topbar-actions { display: none !important; }
  .sidebar-hamburger { display: none !important; }

  /* ── 4. Sidebar Overlay ────────────────────────────────────────────── */
  .sidebar-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    z-index: 55 !important;
    display: none !important;
  }

  .sidebar-overlay.active {
    display: block !important;
  }

  /* ── 5. Sidebar Logo ───────────────────────────────────────────────── */
  .sidebar-logo {
    padding: 16px 16px 14px !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    border-right: none !important;
  }

  /* ── 6. Sidebar Nav — vertical ─────────────────────────────────────── */
  .sidebar-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    overflow-y: auto !important;
    padding: 8px 12px !important;
    flex: 1 !important;
    gap: 2px !important;
  }

  .nav-item,
  .nav-pipeline,
  .nav-item.nav-item-sub {
    padding: 11px 14px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    white-space: normal !important;
  }

  .nav-icon {
    display: flex !important;
    width: 18px !important;
    height: 18px !important;
  }

  /* ── 7. Nav Sections — vertical ────────────────────────────────────── */
  .nav-section {
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    margin-top: 4px !important;
  }

  .nav-section:first-of-type {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
  }

  /* Show "Pipelines" label in drawer */
  .nav-section:first-of-type > .nav-section-title {
    display: block !important;
  }

  .nav-section-title {
    padding: 8px 14px 4px !important;
    font-size: 0.65rem !important;
  }

  /* Pipelines vertical */
  #sidebar-pipelines {
    flex-direction: column !important;
    gap: 2px !important;
  }

  /* ── 8. Settings Section — visible in drawer ───────────────────────── */
  .nav-section:last-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
  }

  /* Settings dropdown → inline list in drawer */
  #sidebar-settings-items {
    position: static !important;
    top: auto !important;
    right: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-width: auto !important;
    max-height: none !important;
    z-index: auto !important;
  }

  /* ── 9. Sidebar Footer — visible in drawer ─────────────────────────── */
  .sidebar-footer {
    display: block !important;
    padding: 12px 16px !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
    margin-top: auto !important;
  }

  /* ── 10. Page Layout ───────────────────────────────────────────────── */
  .page-header {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  .page-header .flex {
    flex-wrap: wrap;
    gap: 6px;
  }

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

  .dash-kpi-card {
    padding: 12px !important;
  }

  /* Data table: horizontal scroll */
  .data-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 600px;
  }

  /* Board columns */
  .board-column {
    min-width: 240px !important;
    max-width: 280px !important;
  }

  /* Slide-over: full width */
  .slideover-panel {
    max-width: 100vw !important;
    width: 100vw !important;
  }

  /* Dashboard grid: single column */
  .dash-grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* ── Phase 1: iOS-Fixes & Touch-Targets ──────────────────────────────── */

  /* 1.1 Safe Area Insets */
  .mobile-topbar {
    padding-top: env(safe-area-inset-top) !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
  }
  .main-wrapper {
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
  .sidebar {
    padding-bottom: env(safe-area-inset-bottom) !important;
  }

  /* 1.2 Input Zoom Prevention — iOS Safari zoomt bei font-size < 16px */
  .form-input,
  .form-select,
  select,
  textarea,
  .data-table-search,
  .page-size-select,
  .pipeline-search-input,
  .search-enhanced .form-input {
    font-size: 16px !important;
  }

  /* 1.3 Touch Targets — Minimum 44px */
  .btn,
  .phase-filter-btn,
  .pagination-btn,
  .view-toggle-btn,
  .dash-period-btn {
    min-height: 44px !important;
  }
  .slideover-close,
  .so-close-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.3rem !important;
  }
  .mobile-topbar-btn {
    width: 44px !important;
    height: 44px !important;
  }
  .row-checkbox {
    width: 20px !important;
    height: 20px !important;
  }

  /* 1.4 Momentum Scrolling */
  .dt-table-scroll,
  .board-container,
  .phase-filters,
  .dash-period-btns,
  .slideover-tabs-inner {
    -webkit-overflow-scrolling: touch !important;
  }

  /* 1.5 Slideover Dynamic Viewport */
  .slideover-panel {
    max-height: 100dvh !important;
  }

  /* ── Phase 2: DataTable Touch-Optimierung ────────────────────────────── */

  /* 2.1 Toolbar Stacking */
  .data-table-toolbar {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .data-table-search {
    width: 100% !important;
    min-height: 44px !important;
  }
  .dt-bulk-actions {
    width: 100% !important;
  }

  /* 2.2 Tabellen-Zellen für Touch */
  .data-table td {
    padding: 10px 8px !important;
    font-size: 0.82rem !important;
  }
  .data-table th {
    padding: 10px 8px !important;
    font-size: 0.75rem !important;
  }

  /* 2.3 Column Resizer vergrößern */
  .th-resizer {
    width: 12px !important;
    right: -4px !important;
  }

  /* 2.4 Pagination Touch-Friendly */
  .pagination {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
  }
  .pagination-info {
    width: 100% !important;
    text-align: center !important;
    font-size: 0.82rem !important;
  }
  .pagination-buttons {
    display: flex !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .pagination-btn {
    min-width: 40px !important;
    min-height: 40px !important;
    font-size: 0.85rem !important;
  }
  .page-size-select {
    min-height: 40px !important;
  }

  /* ── Phase 3: Kontakte View ──────────────────────────────────────────── */

  /* 3.2 Situation-/Phase-Filter Horizontal Scroll */
  .phase-filters {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important;
  }
  .phase-filters::-webkit-scrollbar {
    display: none;
  }
  .phase-filter-btn {
    flex-shrink: 0 !important;
  }

  /* 3.3 Stats Bar Responsive */
  .contacts-stats-bar {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .contacts-stats-bar > * {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
  }

  /* 3.4 Search Bar Full Width */
  .search-enhanced {
    max-width: 100% !important;
    width: 100% !important;
  }
  .search-enhanced .form-input {
    min-height: 44px !important;
  }

  /* 3.5 Page Actions Stacking */
  .page-actions {
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 6px !important;
  }
  .page-actions .btn {
    flex: 1 1 auto !important;
    min-height: 44px !important;
    font-size: 0.82rem !important;
    padding: 8px 12px !important;
  }
  .page-actions .view-toggle {
    width: 100% !important;
    justify-content: center !important;
  }
  .page-actions .btn-primary {
    order: -1 !important;
    flex: 1 1 100% !important;
  }

  /* ── Phase 4: Pipeline Detail ────────────────────────────────────────── */

  /* 4.4 Slide-Over Tabs Horizontal Scroll */
  .slideover-tabs-inner {
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
  .slideover-tabs-inner::-webkit-scrollbar {
    display: none;
  }
  .slideover-tab {
    flex-shrink: 0 !important;
    min-height: 44px !important;
    padding: 10px 14px !important;
  }

  /* Formulare im Slide-Over */
  .slideover-section .form-input,
  .so-subtab-content .form-input {
    min-height: 44px !important;
  }
  .slideover-section .form-label,
  .so-subtab-content .form-label {
    font-size: 0.8rem !important;
  }

  /* 4.5 Pipeline Search Input */
  .pipeline-search-input {
    width: 100% !important;
    min-height: 44px !important;
  }

  /* ── Phase 5: Dashboard ──────────────────────────────────────────────── */

  /* 5.1 Period-Filter Horizontal Scroll */
  .dash-period-btns {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
  }
  .dash-period-btns::-webkit-scrollbar {
    display: none;
  }
  .dash-period-btn {
    flex-shrink: 0 !important;
  }

  /* 5.2 Date Range Pickers Stacking */
  .dash-filter-area {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    margin-left: 0 !important;
  }
  .dash-date-range {
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .dash-date-input {
    flex: 1 !important;
    min-width: 0 !important;
    min-height: 44px !important;
  }

  /* 5.4 Chart Labels Responsive */
  .dash-chart-label {
    font-size: 0.55rem !important;
  }
  .dash-section {
    overflow: hidden !important;
  }

  /* 5.6 Plattform-Performance Tabelle — mobile-optimiert */
  .dash-perf-table {
    font-size: 0.72rem !important;
  }
  .dash-perf-table thead th {
    font-size: 0.62rem !important;
    padding: 6px 6px !important;
    white-space: nowrap !important;
  }
  .dash-perf-table tbody td {
    padding: 7px 6px !important;
    font-size: 0.72rem !important;
  }
  .dash-sort-select {
    font-size: 16px !important;
    min-height: 36px !important;
    padding: 4px 8px !important;
  }
  .dash-card-body {
    padding: 10px 12px 14px !important;
  }
  .dash-card-header {
    padding: 10px 12px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .dash-card-title {
    font-size: 0.82rem !important;
  }

  /* 5.7 Top-Städte — mobile-optimiert */
  .dash-city-row {
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
    padding: 8px 0 !important;
  }
  .dash-city-info {
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }
  .dash-city-name {
    font-size: 0.75rem !important;
  }
  .dash-city-deals {
    font-size: 0.65rem !important;
  }
  .dash-source-bar-wrap {
    flex: 1 !important;
    min-width: 0 !important;
  }
  .dash-city-value {
    font-size: 0.72rem !important;
    min-width: 60px !important;
  }

  /* ── Phase 6: Settings Views ─────────────────────────────────────────── */

  /* 6.1 Settings Hub Grid */
  .settings-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .settings-card {
    padding: 14px !important;
  }
  .settings-card-icon {
    width: 36px !important;
    height: 36px !important;
  }

  /* 6.2 Settings Tabs Horizontal Scroll */
  .settings-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none !important;
  }
  .settings-tabs::-webkit-scrollbar {
    display: none;
  }

  /* 6.3 Formular-Rows 1-Column */
  .form-row,
  .form-row-2col {
    grid-template-columns: 1fr !important;
  }

  /* 6.4 Settings Sections Padding */
  .settings-section,
  .settings-section-content {
    padding: 12px !important;
  }
}

/* ─── Small Mobile (≤ 480px) ──────────────────────────────────────────── */

@media (max-width: 480px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .page-content {
    padding: 10px !important;
  }

  /* Kanban Snap-Scroll */
  .board-container {
    scroll-snap-type: x mandatory !important;
  }
  .board-column {
    min-width: 85vw !important;
    max-width: 85vw !important;
    scroll-snap-align: center;
  }

  .mobile-topbar-logo span {
    display: none !important;
  }

  .sidebar {
    width: 260px !important;
    min-width: 260px !important;
  }

  /* KPI Overflow-Fix */
  .dash-kpi-value {
    font-size: 1.3rem !important;
    word-break: break-all !important;
  }
  .dash-kpi-label {
    font-size: 0.7rem !important;
  }

  /* Stats Bar 1-Column */
  .contacts-stats-bar > * {
    flex: 1 1 100% !important;
  }

  /* Contact Cards 1-Column */
  .contacts-grid {
    grid-template-columns: 1fr !important;
  }

  /* Settings Grid 1-Column */
  .settings-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   MIGRATED FROM style.css — Fehlende Komponenten
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Button Danger ────────────────────────────────────────────────────────── */

.btn-danger {
  background: rgba(239,68,68,0.08);
  color: #EF4444;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.14);
}

.theme-dark .btn-danger {
  background: rgba(239,68,68,0.15);
  color: #F87171;
}
.theme-dark .btn-danger:hover {
  background: rgba(239,68,68,0.25);
}

/* ─── Badge Color Variants ────────────────────────────────────────────────── */

.badge-blue { background: rgba(59,130,246,0.1); color: #3B82F6; }
.badge-green { background: rgba(34,197,94,0.1); color: #16A34A; }
.badge-red { background: rgba(239,68,68,0.1); color: #EF4444; }

.theme-dark .badge-blue { background: rgba(59,130,246,0.2); color: #60A5FA; }
.theme-dark .badge-green { background: rgba(34,197,94,0.2); color: #4ADE80; }
.theme-dark .badge-red { background: rgba(239,68,68,0.2); color: #F87171; }

/* ─── Activity Items ──────────────────────────────────────────────────────── */

.activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.035));
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 34px;
  height: 34px;
  background: rgba(59,130,246,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.activity-content { flex: 1; min-width: 0; }

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

.activity-type { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.activity-date { font-size: 0.7rem; color: var(--text-muted); }

.activity-notes {
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin-top: 2px;
  line-height: 1.45;
}

.activity-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }

.theme-dark .activity-icon {
  background: rgba(99,102,241,0.2);
}

/* ─── Column Footer ───────────────────────────────────────────────────────── */

.column-footer {
  padding: 4px 14px;
  text-align: right;
}

/* ─── Card Footer & Assigned Badge ────────────────────────────────────────── */

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.card-assigned-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(99,102,241,0.12);
  color: #4338CA;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  cursor: default;
}

.theme-dark .card-assigned-badge {
  background: rgba(129,140,248,0.2);
  color: #A5B4FC;
}

/* ─── Checkbox ────────────────────────────────────────────────────────────── */

.checkbox-cell {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  text-align: center;
  overflow: hidden;
  padding-left: 12px !important;
  padding-right: 0 !important;
}
.checkbox-cell::before,
.checkbox-cell::after,
.row-checkbox::before,
.row-checkbox::after {
  content: none !important;
  display: none !important;
}
.row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary, #3B82F6);
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

/* ─── Color Preset Grid (Label Editor) ────────────────────────────────────── */

.color-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.color-preset {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.color-preset:hover { transform: scale(1.1); }
.color-preset.active { border-color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════════════════════
   Sales Controlling (migriert + Dark Mode)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Tab Bar */
.ctrl-tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  margin-bottom: 20px;
}
.ctrl-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}
.ctrl-tab:hover { color: #1e293b; background: rgba(255,255,255,0.6); }
.ctrl-tab.active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}

/* Filter Row */
.ctrl-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.ctrl-filter-select,
.ctrl-filter-date {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #fff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s;
}
.ctrl-filter-select:focus,
.ctrl-filter-date:focus { border-color: #6366f1; }
.ctrl-date-sep { color: #94a3b8; font-weight: 500; }

/* Loading */
.ctrl-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px;
  justify-content: center;
  color: #64748b;
}
.ctrl-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: ctrl-spin 0.7s linear infinite;
}
@keyframes ctrl-spin { to { transform: rotate(360deg); } }

/* KPI Grid */
.ctrl-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.ctrl-kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s;
}
.ctrl-kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.ctrl-kpi-ring { flex-shrink: 0; }
.ctrl-kpi-info { min-width: 0; }
.ctrl-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ctrl-kpi-label {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}
.ctrl-trend {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.ctrl-trend-up { color: #16a34a; background: #f0fdf4; }
.ctrl-trend-down { color: #dc2626; background: #fef2f2; }

/* AI Sales Coach Box */
.ctrl-ai-box {
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}
.ctrl-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e7ff;
}
.ctrl-ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #4338ca;
}
.ctrl-ai-refresh {
  padding: 6px 16px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.ctrl-ai-refresh:hover { background: #4f46e5; }
.ctrl-ai-body { padding: 20px; }
.ctrl-ai-placeholder {
  color: #64748b;
  font-size: 0.875rem;
  margin: 0;
}
.ctrl-ai-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin: 0;
}
.ctrl-ai-section {
  margin-bottom: 16px;
}
.ctrl-ai-section:last-child { margin-bottom: 0; }
.ctrl-ai-section h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}
.ctrl-ai-text {
  font-size: 0.875rem;
  color: #1e293b;
  line-height: 1.6;
  white-space: pre-line;
}
.ctrl-ai-alerts ul {
  margin: 0;
  padding-left: 20px;
}
.ctrl-ai-alerts li {
  font-size: 0.875rem;
  color: #dc2626;
  margin-bottom: 4px;
}

/* AI Skeleton */
.ctrl-ai-skeleton { display: flex; flex-direction: column; gap: 12px; }
.ctrl-skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: ctrl-skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
  width: 100%;
}
.ctrl-skeleton-line.short { width: 60%; }
.ctrl-skeleton-line.medium { width: 80%; }
@keyframes ctrl-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Employee Table */
.ctrl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.ctrl-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.ctrl-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.ctrl-table tbody tr:hover { background: #f8fafc; }
.ctrl-cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.ctrl-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.ctrl-cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ctrl-cell-phase { min-width: 120px; }
.ctrl-totals-row { background: #f8fafc; }
.ctrl-totals-row td {
  border-top: 2px solid #e2e8f0;
  border-bottom: none;
}

/* Phase Bar */
.ctrl-phase-bar {
  display: flex;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  gap: 1px;
  min-width: 100px;
}
.ctrl-phase-seg {
  transition: width 0.4s ease;
  cursor: default;
  border-radius: 2px;
}

/* Daily Chart */
.ctrl-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  padding-top: 10px;
}
.ctrl-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.ctrl-chart-bar-outer {
  width: 100%;
  max-width: 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 130px;
  justify-content: flex-end;
}
.ctrl-chart-bar {
  border-radius: 3px 3px 0 0;
  transition: height 0.4s ease;
  min-height: 0;
}
.ctrl-chart-bar.reached { background: #22c55e; border-radius: 0 0 3px 3px; }
.ctrl-chart-bar.not-reached { background: #e2e8f0; }
.ctrl-chart-label {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 6px;
  white-space: nowrap;
}

/* Conversion Funnel */
.ctrl-funnel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.ctrl-funnel-step {
  text-align: center;
  padding: 16px 24px;
  border-top: 3px solid #64748b;
  background: #f8fafc;
  border-radius: 0 0 8px 8px;
  min-width: 80px;
}
.ctrl-funnel-value {
  font-size: 1.5rem;
  font-weight: 700;
}
.ctrl-funnel-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ctrl-funnel-arrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

/* Sortable Table Headers */
.ctrl-th-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.ctrl-th-sortable:hover { color: #1e293b; }
.ctrl-th-sorted { color: #3b82f6; }

/* Ranking Badges */
.ctrl-cell-rank {
  width: 36px;
  text-align: center;
}
.ctrl-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
}
.ctrl-rank-gold {
  color: #92400e;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  box-shadow: 0 1px 3px rgba(251,191,36,0.3);
}
.ctrl-rank-silver {
  color: #475569;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  box-shadow: 0 1px 3px rgba(148,163,184,0.3);
}
.ctrl-rank-bronze {
  color: #78350f;
  background: linear-gradient(135deg, #fed7aa, #fdba74);
  box-shadow: 0 1px 3px rgba(251,146,60,0.3);
}

/* Revenue Cell */
.ctrl-cell-revenue {
  color: #16a34a;
  font-weight: 600;
}

/* Export */
.ctrl-export-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ─── Controlling Dark Mode ───────────────────────────────────────────────── */

.theme-dark .ctrl-tab-bar { background: #1E293B; }
.theme-dark .ctrl-tab { color: #94A3B8; }
.theme-dark .ctrl-tab:hover { color: #E2E8F0; background: rgba(255,255,255,0.06); }
.theme-dark .ctrl-tab.active {
  background: #334155;
  color: #F1F5F9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.theme-dark .ctrl-filter-select,
.theme-dark .ctrl-filter-date {
  background: #1E293B;
  border-color: #334155;
  color: #E2E8F0;
}
.theme-dark .ctrl-filter-select:focus,
.theme-dark .ctrl-filter-date:focus { border-color: #818CF8; }

.theme-dark .ctrl-loading { color: #94A3B8; }
.theme-dark .ctrl-spinner {
  border-color: #334155;
  border-top-color: #818CF8;
}

.theme-dark .ctrl-kpi-card {
  background: #1E293B;
  border-color: #334155;
}
.theme-dark .ctrl-kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.theme-dark .ctrl-kpi-value { color: #F1F5F9; }
.theme-dark .ctrl-kpi-label { color: #94A3B8; }
.theme-dark .ctrl-trend-up { color: #4ADE80; background: rgba(34,197,94,0.15); }
.theme-dark .ctrl-trend-down { color: #F87171; background: rgba(239,68,68,0.15); }

.theme-dark .ctrl-ai-box {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
  border-color: #4338CA;
}
.theme-dark .ctrl-ai-header { border-bottom-color: #4338CA; }
.theme-dark .ctrl-ai-title { color: #A5B4FC; }
.theme-dark .ctrl-ai-refresh { background: #6366F1; }
.theme-dark .ctrl-ai-refresh:hover { background: #818CF8; }
.theme-dark .ctrl-ai-placeholder { color: #94A3B8; }
.theme-dark .ctrl-ai-error { color: #F87171; }
.theme-dark .ctrl-ai-section h4 { color: #A5B4FC; }
.theme-dark .ctrl-ai-text { color: #E2E8F0; }
.theme-dark .ctrl-ai-alerts li { color: #F87171; }

.theme-dark .ctrl-skeleton-line {
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  background-size: 200% 100%;
}

.theme-dark .ctrl-table th {
  color: #94A3B8;
  border-bottom-color: #334155;
}
.theme-dark .ctrl-table td {
  color: #E2E8F0;
  border-bottom-color: #1E293B;
}
.theme-dark .ctrl-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.theme-dark .ctrl-totals-row { background: rgba(255,255,255,0.02); }
.theme-dark .ctrl-totals-row td { border-top-color: #334155; }

.theme-dark .ctrl-chart-bar.not-reached { background: #334155; }
.theme-dark .ctrl-chart-label { color: #64748B; }

.theme-dark .ctrl-funnel {
  background: #1E293B;
  border-color: #334155;
}
.theme-dark .ctrl-funnel-step {
  background: #0F172A;
  border-top-color: #94A3B8;
}
.theme-dark .ctrl-funnel-value { color: #F1F5F9; }
.theme-dark .ctrl-funnel-label { color: #94A3B8; }
.theme-dark .ctrl-funnel-arrow { color: #64748B; }

.theme-dark .ctrl-th-sortable:hover { color: #E2E8F0; }
.theme-dark .ctrl-th-sorted { color: #818CF8; }

.theme-dark .ctrl-rank-badge { color: #94A3B8; background: #334155; }
.theme-dark .ctrl-cell-revenue { color: #4ADE80; }

/* ─── Controlling Responsive ──────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .ctrl-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .ctrl-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .ctrl-filter-row { flex-direction: column; align-items: stretch; }
  .ctrl-tab-bar { overflow-x: auto; }
  .ctrl-funnel { gap: 8px; }
  .ctrl-funnel-step { padding: 12px 16px; min-width: 60px; }
  .ctrl-funnel-value { font-size: 1.2rem; }
}
@media (max-width: 480px) {
  .ctrl-kpi-grid { grid-template-columns: 1fr; }
}

/* ─── Calendar View ────────────────────────────────────────────────────────── */

.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.cal-current-label {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0 8px;
}
.cal-body { min-height: 400px; }

/* Month Grid */
.cal-grid-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card-bg);
}
.cal-weekday {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border);
}
.cal-weekday.cal-weekend { color: var(--text-tertiary); }
.cal-day {
  min-height: 100px;
  padding: 4px 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: default;
  transition: background 0.15s;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: var(--surface-secondary); }
.cal-day.cal-other-month { opacity: 0.4; }
.cal-day.cal-today { background: rgba(59, 130, 246, 0.06); }
.cal-day.cal-today .cal-day-num {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-day-num {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-block;
  margin-bottom: 2px;
}
.cal-day-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event {
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.68rem;
  line-height: 1.3;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: transform 0.1s, box-shadow 0.1s;
}
.cal-event:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.cal-ev-task {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  border-left: 2px solid var(--primary);
}
.cal-ev-call {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-left: 2px solid #10B981;
}
.cal-ev-done { opacity: 0.5; text-decoration: line-through; }
.cal-ev-time {
  font-weight: 600;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.cal-ev-title {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev-more {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  padding: 1px 5px;
  cursor: pointer;
}
.cal-ev-more:hover { color: var(--primary); }

/* Week Grid */
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-week-day {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  min-height: 200px;
  overflow: hidden;
}
.cal-week-day.cal-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-week-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border);
}
.cal-week-day-name { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.cal-week-day-num { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.cal-week-day-events { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-event-wide {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  flex-wrap: wrap;
  white-space: normal;
  position: relative;
}
.cal-ev-sub {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  display: block;
  margin-top: 1px;
}
.cal-ev-badge {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.cal-empty-hint {
  padding: 12px 8px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* Day View */
.cal-day-view {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}
.cal-day-view-header {
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border);
}
.cal-day-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text-tertiary);
}
.cal-day-event {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.cal-day-event:last-child { border-bottom: none; }
.cal-day-event:hover { background: var(--surface-secondary); }
.cal-day-event-main { display: flex; align-items: center; gap: 10px; }
.cal-day-event-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 50px;
}
.cal-day-event-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}
.cal-day-event-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
  padding-left: 60px;
}
.cal-day-event.cal-ev-task { border-left: 3px solid var(--primary); }
.cal-day-event.cal-ev-call { border-left: 3px solid #10B981; }
.cal-day-event.cal-ev-done { opacity: 0.5; }

/* Calendar Responsive */
@media (max-width: 768px) {
  .cal-grid-month { font-size: 0.7rem; }
  .cal-day { min-height: 60px; padding: 2px 3px; }
  .cal-event { font-size: 0.6rem; padding: 1px 3px; }
  .cal-week-grid { grid-template-columns: 1fr; }
  .cal-week-day { min-height: auto; }
  .cal-day-event-meta { padding-left: 0; }
}

/* ─── Reports View ──────────────────────────────────────────────────────────── */

.reports-content { max-width: 900px; margin: 0 auto; }

.report-header {
  text-align: center;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.report-company {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.report-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.report-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.report-kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.report-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.report-kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.report-pipeline-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.report-pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.report-pipeline-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.report-pipeline-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.report-phase-row {
  display: grid;
  grid-template-columns: 180px 1fr 100px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.report-phase-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.report-phase-name {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-phase-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
.report-phase-bar-wrap {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}
.report-phase-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.report-phase-value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

/* Print styles for PDF export */
@media print {
  body { background: white !important; }
  .sidebar, .mobile-topbar, .topbar-actions, .sidebar-overlay,
  .view-header, #modal-backdrop { display: none !important; }
  .main-wrapper { margin: 0 !important; padding: 0 !important; }
  .page-content { padding: 0 !important; }
  .reports-content { max-width: 100%; }
  .report-header { padding-top: 0; }
  .report-kpi-card, .report-pipeline-card {
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}

@media (max-width: 768px) {
  .report-kpi-row { grid-template-columns: 1fr; }
  .report-phase-row { grid-template-columns: 1fr; gap: 4px; }
  .report-phase-value { text-align: left; }
  .report-pipeline-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}
