/* ==========================================================================
   BC 2 Automate - Internal CRM & Revenue Operating System Stylesheet
   Theme: Minimalist, Modern, High-Precision SaaS (Linear / Attio aesthetic)
   ========================================================================== */

:root {
  /* Surface & Canvas Colors */
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #F8FAFC;
  --bg-active: #EFF6FF;

  /* Typography Colors */
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  /* Borders & Dividers */
  --border-subtle: #F1F5F9;
  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #0284C7;

  /* Brand Accents */
  --brand-blue: #0284C7;
  --brand-blue-hover: #0369A1;
  --brand-blue-light: #E0F2FE;
  --brand-primary: #2563EB;
  --brand-primary-light: #EFF6FF;
  --brand-cyan: #00F2FE;

  /* Status Colors */
  --status-emerald-bg: #ECFDF5;
  --status-emerald-text: #059669;
  --status-emerald-border: #A7F3D0;

  --status-blue-bg: #EFF6FF;
  --status-blue-text: #2563EB;
  --status-blue-border: #BFDBFE;

  --status-purple-bg: #FAF5FF;
  --status-purple-text: #7E22CE;
  --status-purple-border: #E9D5FF;

  --status-amber-bg: #FFFBEB;
  --status-amber-text: #D97706;
  --status-amber-border: #FDE68A;

  --status-rose-bg: #FFF1F2;
  --status-rose-text: #E11D48;
  --status-rose-border: #FECDD3;

  --status-slate-bg: #F1F5F9;
  --status-slate-text: #475569;
  --status-slate-border: #E2E8F0;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 48px -8px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-drawer: -8px 0 32px rgba(15, 23, 42, 0.1);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout Measurements */
  --sidebar-width: 260px;
  --header-height: 64px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* App Container Layout */
.crm-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   Left Sidebar Navigation
   ========================================================================== */
.crm-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  user-select: none;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.sidebar-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.85rem;
}

.sidebar-section {
  margin-bottom: 1.65rem;
}

.sidebar-section-title {
  font-size: 0.685rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 0 0.65rem;
  margin-bottom: 0.4rem;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  position: relative;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sidebar-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  font-weight: 600;
}

.sidebar-link-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-link i {
  font-size: 0.925rem;
  width: 18px;
  text-align: center;
  color: inherit;
  opacity: 0.85;
}

.sidebar-pill-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.pill-construction {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pill-soon {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.db-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: default;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #CBD5E1;
  position: relative;
}

.status-dot.connected {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

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

.status-dot.error {
  background: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.settings-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ==========================================================================
   Main Application Viewport & Header
   ========================================================================== */
.crm-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
}

/* Top Header Bar */
.crm-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: var(--text-primary);
  cursor: pointer;
}

.header-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

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

.header-view-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Global Search Trigger Bar */
.global-search-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.825rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 240px;
}

.global-search-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 0.685rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-muted);
  margin-left: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  line-height: 1.25;
}

.btn-primary {
  background: var(--brand-blue);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--brand-blue-hover);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.775rem;
}

.btn-danger {
  background: #EF4444;
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Page Content Views
   ========================================================================== */
.crm-content {
  padding: 2rem 2.25rem 4rem;
  flex: 1;
  max-width: 1600px;
  width: 100%;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* Page Sub-Header */
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title-group h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.page-title-group p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Dashboard Metrics & Layout
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.metric-title {
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.metric-val {
  font-family: var(--font-sans);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.metric-sub {
  font-size: 0.775rem;
  color: var(--text-light);
  margin-top: 0.4rem;
}

/* Dashboard Split Columns */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-panel-header {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-body {
  padding: 1.25rem 1.4rem;
}

/* Status Distribution Bars */
.status-dist-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status-dist-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status-dist-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
}

.status-dist-label {
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dist-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.status-bar-track {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* Recent Activity List */
.activity-feed-list {
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: flex;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.feed-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.feed-content {
  flex: 1;
}

.feed-desc {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feed-meta a {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
}

.feed-meta a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Tables & Filter Toolbars
   ========================================================================== */
.table-toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  min-width: 260px;
}

.search-input-wrap i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.85rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.25rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.filter-select {
  padding: 0.5rem 0.85rem;
  font-size: 0.825rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--brand-blue);
}

.table-responsive {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-xs);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  user-select: none;
}

.data-table th.sortable {
  cursor: pointer;
}

.data-table th.sortable:hover {
  color: var(--text-primary);
}

.data-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

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

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

.clickable-row {
  cursor: pointer;
}

/* Table Pagination & Footer */
.table-footer {
  padding: 0.85rem 1.25rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   Badges, Pills & Indicators
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  line-height: 1.2;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* ICP Status Badges */
.badge-icp-qualified {
  background: var(--status-emerald-bg);
  color: var(--status-emerald-text);
  border: 1px solid var(--status-emerald-border);
}

.badge-icp-review {
  background: var(--status-amber-bg);
  color: var(--status-amber-text);
  border: 1px solid var(--status-amber-border);
}

.badge-icp-unqualified {
  background: var(--status-slate-bg);
  color: var(--status-slate-text);
  border: 1px solid var(--status-slate-border);
}

/* Prospect Status Badges */
.badge-status-new {
  background: var(--status-blue-bg);
  color: var(--status-blue-text);
  border: 1px solid var(--status-blue-border);
}

.badge-status-contacted {
  background: var(--status-purple-bg);
  color: var(--status-purple-text);
  border: 1px solid var(--status-purple-border);
}

.badge-status-replied {
  background: var(--status-emerald-bg);
  color: var(--status-emerald-text);
  border: 1px solid var(--status-emerald-border);
}

.badge-status-in-review {
  background: var(--status-amber-bg);
  color: var(--status-amber-text);
  border: 1px solid var(--status-amber-border);
}

.badge-status-cold {
  background: var(--status-slate-bg);
  color: var(--status-slate-text);
  border: 1px solid var(--status-slate-border);
}

/* ICP Score Pill */
.score-pill {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.score-pending {
  color: var(--text-light);
  font-style: italic;
  font-weight: 500;
  background: transparent;
  border-color: transparent;
}

/* ==========================================================================
   Slide-Over Detail Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 580px;
  max-width: 95vw;
  background: var(--bg-surface);
  box-shadow: var(--shadow-drawer);
  z-index: 210;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.drawer-panel.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-close {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-close:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem;
}

/* Drawer Detail Profile */
.profile-hero {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.profile-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.profile-title-company {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-field-label {
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.meta-field-val {
  font-size: 0.875rem;
  color: var(--text-primary);
  word-break: break-word;
}

/* Timeline */
.timeline-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline {
  position: relative;
  padding-left: 1.75rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-light);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 2px solid var(--brand-blue);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.timeline-type {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-time {
  font-size: 0.725rem;
  color: var(--text-light);
  font-family: var(--font-mono);
}

.timeline-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Notes Placeholder Card */
.notes-placeholder-box {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-top: 1.5rem;
}

.notes-placeholder-box i {
  font-size: 1.5rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.notes-placeholder-box h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.notes-placeholder-box p {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Modals (Dialogs)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 540px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.98);
  transition: transform var(--transition-fast);
}

.modal-backdrop.active .modal-window {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-hint {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Future Feature / Blueprint View (Under Construction)
   ========================================================================== */
.blueprint-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 900px;
  margin: 1rem 0;
}

.blueprint-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 1.25rem;
}

.blueprint-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.blueprint-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 750px;
}

.blueprint-pipeline-diagram {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.diagram-node {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.diagram-arrow {
  color: var(--brand-blue);
  font-size: 0.9rem;
}

.blueprint-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.feature-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.feature-box-icon {
  font-size: 1.25rem;
  color: var(--brand-blue);
  margin-bottom: 0.5rem;
}

.feature-box h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.feature-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Global Search Overlay Palette
   ========================================================================== */
.search-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-palette-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.search-palette-window {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 600px;
  max-width: 92vw;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.palette-input-wrap {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  gap: 0.85rem;
}

.palette-input-wrap i {
  color: var(--brand-blue);
  font-size: 1rem;
}

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

.palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.palette-group-title {
  font-size: 0.685rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  padding: 0.5rem 0.75rem 0.25rem;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.palette-item:hover, .palette-item.selected {
  background: var(--bg-subtle);
}

.palette-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.palette-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.palette-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.palette-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Toasts & Empty States
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 500;
}

.toast {
  background: var(--text-primary);
  color: #FFFFFF;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideUp 0.25s ease;
}

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

.empty-state-box {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

.empty-state-icon {
  font-size: 2.25rem;
  color: var(--text-light);
  margin-bottom: 0.85rem;
}

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

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 1.25rem;
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
  border-radius: 4px;
}

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

/* (Responsive Breakpoints are consolidated at the bottom of this stylesheet) */

/* ==========================================================================
   14. CRM Login Gatekeeper & Authentication
   ========================================================================== */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-gate.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.06), 0 10px 15px -3px rgba(15, 23, 42, 0.03);
  transition: transform 0.2s ease;
}

.login-card.shake {
  animation: loginShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes loginShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  height: 40px;
  width: auto;
  margin: 0 auto 1.25rem;
  display: block;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #DC2626;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-control {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.password-toggle-btn:hover {
  color: var(--text-primary);
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.75rem 0 1.5rem;
}

.remember-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--brand-blue);
}

.btn-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.925rem;
}

.login-footer {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Authenticated User Footer */
.sidebar-user-footer {
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.sidebar-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-email {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.675rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-logout-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   16. Company Documents & Playbooks Section
   ========================================================================== */
.docs-featured-banner {
  position: relative;
  background: linear-gradient(135deg, #FFFFFF 0%, #F0F9FF 50%, #E0F2FE 100%);
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.08), 0 4px 6px -2px rgba(2, 132, 199, 0.04);
  overflow: hidden;
}

.docs-featured-ambient-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.docs-featured-content {
  position: relative;
  z-index: 2;
}

.docs-featured-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.badge-featured-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(2, 132, 199, 0.12);
  color: #0284C7;
  border: 1px solid rgba(2, 132, 199, 0.25);
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-tag-pill {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: #475569;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.badge-security-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.725rem;
  font-weight: 600;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.docs-featured-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
  line-height: 1.25;
}

.docs-featured-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.docs-featured-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.docs-featured-preview {
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.preview-deck-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(2, 132, 199, 0.3);
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.15);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  background: #FFFFFF;
}

.preview-deck-wrapper:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 18px 36px -8px rgba(2, 132, 199, 0.25);
}

.preview-deck-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-deck-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  backdrop-filter: blur(2px);
}

.preview-deck-wrapper:hover .preview-deck-overlay {
  opacity: 1;
}

.preview-play-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.preview-play-text {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* --- Document Management Toolbar --- */
.docs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.docs-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 360px;
}

.docs-search-wrapper i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.85rem;
}

.docs-search-wrapper .form-control {
  padding-left: 2.35rem;
}

.docs-filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  padding: 0.25rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.doc-tab-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.doc-tab-btn.active {
  background: var(--brand-blue);
  color: #FFFFFF;
}

.doc-tab-btn.active span {
  color: #E0F2FE;
}

/* --- Documents Grid & Card --- */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.25rem;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
}

.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.doc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.doc-card-type-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.doc-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.doc-card-meta {
  display: flex;
  flex-direction: column;
}

.doc-category-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.doc-version-pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-light);
}

.doc-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.doc-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.doc-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.doc-tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.doc-card-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

@media (max-width: 900px) {
  .docs-featured-banner {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
}

/* --- File Upload Dropzone in Add Document Modal --- */
.doc-upload-dropzone {
  position: relative;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.doc-upload-dropzone:hover,
.doc-upload-dropzone.dragover {
  border-color: var(--brand-blue);
  background: rgba(2, 132, 199, 0.05);
}

.doc-upload-dropzone.has-file {
  border-style: solid;
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.04);
  padding: 0.85rem;
}

.doc-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.1);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.dropzone-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropzone-selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  gap: 0.75rem;
  position: relative;
  z-index: 10;
}

.selected-file-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  background: rgba(2, 132, 199, 0.1);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.selected-file-details {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex-grow: 1;
  overflow: hidden;
}

.selected-file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-file-meta {
  font-size: 0.725rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-remove-file {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.btn-remove-file:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
}

.btn-link-toggle {
  background: transparent;
  border: none;
  color: var(--brand-blue);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-link-toggle:hover {
  text-decoration: underline;
}

.doc-file-info-badge {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.doc-file-info-badge i {
  color: var(--brand-blue);
}

.doc-file-info-badge span.file-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* ==========================================================================
   AI Strategy & Insights View Styles
   ========================================================================== */
.ai-page-header {
  margin-bottom: 1.5rem;
}

.ai-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ai-timestamp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
}

.ai-timestamp-badge i {
  color: var(--brand-blue);
}

.ai-headline-card {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  color: #FFFFFF;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ai-headline-ambient {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.25) 0%, rgba(147, 51, 234, 0.15) 60%, transparent 80%);
  filter: blur(40px);
  pointer-events: none;
}

.ai-headline-inner {
  position: relative;
  z-index: 2;
}

.ai-headline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.ai-kicker-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(2, 132, 199, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.ai-headline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94A3B8;
}

.ai-headline-text {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: #F8FAFC;
  margin: 0;
}

.ai-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.ai-perf-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.ai-perf-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.ai-perf-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0.35rem 0 0.5rem;
  min-height: 2.8em;
}

.ai-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

@media (min-width: 1200px) {
  .ai-sections-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ai-section-panel {
  display: flex;
  flex-direction: column;
  min-height: 380px;
}

.ai-section-panel .panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.15rem;
}

.ai-panel-badge-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.badge-rose {
  background: rgba(225, 29, 72, 0.1);
  color: #E11D48;
}

.badge-emerald {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.badge-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #2563EB;
}

.ai-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.ai-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  transition: all var(--transition-fast);
  position: relative;
}

.ai-insight-item:hover {
  background: var(--bg-surface);
  border-color: var(--border-light);
  box-shadow: var(--shadow-xs);
}

.ai-insight-item.problem {
  border-left: 3px solid #E11D48;
}

.ai-insight-item.opportunity {
  border-left: 3px solid #059669;
}

.ai-insight-item.priority {
  border-left: 3px solid #2563EB;
}

.ai-item-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.725rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.ai-insight-item.problem .ai-item-icon-wrap {
  background: rgba(225, 29, 72, 0.1);
  color: #E11D48;
}

.ai-insight-item.opportunity .ai-item-icon-wrap {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.ai-insight-item.priority .ai-item-icon-wrap {
  background: rgba(37, 99, 235, 0.1);
  color: #2563EB;
}

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

.ai-item-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.ai-item-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

.ai-item-metric {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--brand-blue);
  background: var(--brand-blue-light);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  margin-top: 0.35rem;
}

.ai-column-empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 2.5rem 1rem;
  text-align: center;
  justify-content: center;
  font-style: italic;
}

.ai-empty-panel,
.ai-error-panel {
  padding: 3.5rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}

.ai-empty-content {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ai-empty-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.1);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.ai-error-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.1);
  color: #E11D48;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.ai-empty-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.ai-empty-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.ai-empty-actions {
  display: flex;
  gap: 0.75rem;
}

/* ==========================================================================
   Elevated AI Insights Sidebar Option with Animated Effects
   ========================================================================== */
.sidebar-link-ai {
  position: relative;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(147, 51, 234, 0.1) 100%);
  border: 1px solid rgba(147, 51, 234, 0.22);
  color: var(--text-primary);
  font-weight: 600;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(147, 51, 234, 0.08);
  transition: all var(--transition-fast);
}

.sidebar-link-ai::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: skewX(-25deg);
  animation: aiShimmer 3.8s infinite;
  pointer-events: none;
}

@keyframes aiShimmer {
  0%, 60% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

.sidebar-link-ai:hover {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15) 0%, rgba(147, 51, 234, 0.18) 100%);
  border-color: rgba(147, 51, 234, 0.45);
  box-shadow: 0 3px 12px rgba(147, 51, 234, 0.18);
  transform: translateX(3px);
  color: var(--text-primary);
}

.sidebar-link-ai.active {
  background: linear-gradient(135deg, #0284C7 0%, #7E22CE 100%) !important;
  border-color: transparent !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(126, 34, 206, 0.3) !important;
}

.sidebar-link-ai.active .ai-sidebar-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.4);
}

.sidebar-link-ai.active .ai-sidebar-icon {
  color: #FFFFFF !important;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

.sidebar-link-ai.active .ai-spark-dot {
  background: #FFFFFF;
  box-shadow: 0 0 8px #FFFFFF;
}

.ai-sidebar-icon {
  color: #9333EA;
  transition: all 0.25s ease;
  filter: drop-shadow(0 0 2px rgba(147, 51, 234, 0.3));
}

.sidebar-link-ai:hover .ai-sidebar-icon {
  transform: scale(1.2) rotate(8deg);
  color: #7E22CE;
}

.ai-sidebar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(147, 51, 234, 0.14);
  color: #7E22CE;
  border: 1px solid rgba(147, 51, 234, 0.3);
  transition: all var(--transition-fast);
}

.ai-spark-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9333EA;
  display: inline-block;
  box-shadow: 0 0 6px #9333EA;
  animation: aiPulse 2s infinite ease-in-out;
}

@keyframes aiPulse {
  0%, 100% {
    transform: scale(0.85);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
    box-shadow: 0 0 10px #7E22CE;
  }
}

/* ==========================================================================
   Dashboard Executive AI Insights Snapshot Card
   ========================================================================== */
.ai-dashboard-panel {
  border-color: rgba(147, 51, 234, 0.25);
  transition: all var(--transition-fast);
}

.ai-dashboard-panel:hover {
  border-color: rgba(147, 51, 234, 0.4);
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.08);
}

.dashboard-ai-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dashboard-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-ai-headline {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-left: 3px solid #9333EA;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.dashboard-ai-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.dashboard-ai-metric {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  line-height: 1.45;
}

.dashboard-ai-metric .meta-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.dashboard-ai-metric .meta-val {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================================================
   Responsive Breakpoints (Consolidated with Top Cascading Priority)
   ========================================================================== */

/* 0. Prevent horizontal viewport overflow on all screen sizes */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

.crm-layout {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* DESKTOP VIEWPORTS (> 1024px) */
@media (min-width: 1025px) {
  .ai-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .ai-sections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

/* ==========================================================================
   Analytics Telemetry & Outreach Intelligence Styles
   ========================================================================== */

/* Telemetry Banner */
.analytics-telemetry-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 3px solid #0284C7;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.analytics-telemetry-icon {
  color: #0284C7;
  font-size: 1.05rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.analytics-telemetry-body {
  flex: 1;
  min-width: 0;
}

.analytics-telemetry-body strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Metrics Grid for Analytics */
.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 1280px) {
  .analytics-metrics-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Funnel Container & Steps */
.analytics-funnel-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.funnel-step-item {
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  transition: all var(--transition-fast);
  position: relative;
}

.funnel-step-item:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xs);
  background: var(--bg-subtle);
}

.funnel-step-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.funnel-step-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.funnel-step-badge-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.12);
  color: #0284C7;
  border: 1px solid rgba(2, 132, 199, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.funnel-step-badge-num.step-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.25);
}

.funnel-step-info {
  min-width: 0;
}

.funnel-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.funnel-step-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.funnel-step-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.funnel-step-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1;
}

.funnel-step-rate-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  white-space: nowrap;
}

.funnel-step-rate-pill.rate-high {
  background: rgba(16, 185, 129, 0.1);
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.25);
}

.funnel-step-rate-pill.rate-mid {
  background: rgba(2, 132, 199, 0.1);
  color: #0284C7;
  border-color: rgba(2, 132, 199, 0.25);
}

.funnel-progress-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.funnel-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #0284C7 0%, #10B981 100%);
  transition: width 0.4s ease;
}

.funnel-divider-arrow {
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  padding: 0.15rem 0;
  opacity: 0.5;
}

/* Activity Trend Breakdown */
.activity-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-breakdown-row {
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.activity-breakdown-row:hover {
  border-color: var(--border-medium);
  background: var(--bg-subtle);
}

.activity-breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.activity-breakdown-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.activity-breakdown-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.activity-breakdown-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-raw-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.activity-breakdown-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.activity-breakdown-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.activity-breakdown-pct {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.activity-mini-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
}

.activity-mini-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--brand-purple);
  transition: width 0.35s ease;
}

/* Activity Recency Snippet in Trend Card */
.activity-recency-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.activity-recency-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.activity-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0;
  font-size: 0.775rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.activity-recent-item:last-child {
  border-bottom: none;
}

.activity-recent-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}

.activity-recent-desc {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-recent-time {
  color: var(--text-light);
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ICP Segment Analytics Card */
.icp-segment-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.icp-segment-card {
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  transition: all var(--transition-fast);
}

.icp-segment-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-subtle);
}

.icp-segment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.icp-segment-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0284C7;
  background: rgba(2, 132, 199, 0.1);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.icp-segment-total {
  font-size: 0.785rem;
  color: var(--text-muted);
}

.icp-segment-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.icp-stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.55rem 0.65rem;
  text-align: center;
}

.icp-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.icp-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.icp-segment-bar {
  width: 100%;
  height: 5px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
}

.icp-segment-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: #10B981;
  transition: width 0.35s ease;
}

/* Campaign Performance Container */
.campaign-status-box {
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.campaign-status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
}

.campaign-status-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.campaign-status-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 580px;
  margin: 0 auto 1.25rem;
}

.campaign-tables-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.campaign-table-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.campaign-table-tag i {
  color: #10B981;
  font-size: 0.65rem;
}

/* ==========================================================================
   Clients Management & Commercial Ledger Styles
   ========================================================================== */

.clients-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
}

.client-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
  position: relative;
}

.client-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.client-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.client-card-title-wrap {
  min-width: 0;
  flex: 1;
}

.client-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-card-contact {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.contract-type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.contract-pill-retainer {
  background: rgba(2, 132, 199, 0.12);
  color: #0284C7;
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.contract-pill-project {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.contract-pill-custom {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border: 1px solid rgba(147, 51, 234, 0.25);
}

.client-commercial-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.85rem;
}

.client-amount-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.client-amount-val.val-retainer {
  color: #0284C7;
}

.client-amount-val.val-project {
  color: #10B981;
}

.client-amount-val.val-custom {
  color: #9333ea;
}

.client-terms-text {
  font-size: 0.785rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.85rem;
}

.client-notes-box {
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.02));
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.55rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-light);
}

.client-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   Commercial Revenue & Money Earned Telemetry Styles
   ========================================================================== */

.revenue-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.revenue-kpi-card {
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.revenue-kpi-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.revenue-kpi-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: #10B981;
  font-family: var(--font-sans);
  line-height: 1.1;
  margin: 0.2rem 0;
}

.revenue-kpi-sub {
  font-size: 0.75rem;
  color: var(--text-light);
}

.revenue-visual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.revenue-breakdown-box,
.revenue-chart-box {
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.revenue-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.revenue-box-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.revenue-box-title i {
  color: #10B981;
}

.revenue-models-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.revenue-model-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.revenue-model-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
}

.revenue-model-name {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.revenue-model-amount {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.revenue-model-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
}

.revenue-model-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* Revenue Timeline Run-Rate Chart */
.revenue-chart-container {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.75rem;
}

.revenue-bars-timeline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 120px;
  padding-top: 1rem;
}

.revenue-timeline-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
  justify-content: flex-end;
}

.revenue-timeline-bar-wrap {
  width: 100%;
  max-width: 38px;
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  height: 100%;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
}

.revenue-timeline-bar {
  width: 100%;
  background: linear-gradient(180deg, #10B981 0%, #0284C7 100%);
  border-radius: var(--radius-xs);
  transition: height 0.4s ease;
  min-height: 4px;
}

.revenue-timeline-val {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.revenue-timeline-label {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* TABLET & MOBILE VIEWPORTS (<= 1024px) */
@media (max-width: 1024px) {
  .crm-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }

  .crm-sidebar.mobile-open,
  .crm-sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.35);
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar-backdrop.mobile-open,
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-sidebar-active {
    overflow: hidden;
  }

  .crm-main {
    margin-left: 0;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
  }

  .mobile-menu-toggle:hover {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
  }

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

  /* CRITICAL: Stack AI Performance Cards vertically ONE BELOW THE OTHER */
  .ai-metrics-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    margin-bottom: 1.25rem !important;
    width: 100% !important;
  }

  .ai-perf-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Stack Problems, Opportunities, Priorities vertically ONE BELOW THE OTHER */
  .ai-sections-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  .ai-section-panel {
    width: 100% !important;
    min-height: auto !important;
    box-sizing: border-box !important;
  }
}

/* SMARTPHONE & NARROW TABLET BREAKPOINT (<= 768px) */
@media (max-width: 768px) {
  /* 1. Header Bar: Compact, clean, zero overlap */
  .crm-header {
    height: 58px;
    padding: 0 0.85rem;
    gap: 0.5rem;
    max-width: 100vw;
    overflow: hidden;
  }

  .header-left {
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .header-title-wrap {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .header-view-title {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: 1.2;
  }

  /* CRITICAL: Hide long header description in sticky bar so it never collides or wraps downward */
  .header-view-desc {
    display: none !important;
  }

  .header-right {
    gap: 0.4rem;
    flex-shrink: 0;
  }

  /* Compact icon-only search button */
  .global-search-btn {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  .global-search-btn span,
  .global-search-btn kbd {
    display: none !important;
  }

  .btn-icon,
  #refreshDataBtn {
    width: 36px;
    height: 36px;
    padding: 0;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* Compact quick add button */
  #quickAddProspectBtn {
    width: 36px;
    height: 36px;
    padding: 0;
    min-width: 36px;
    border-radius: var(--radius-sm);
    justify-content: center;
    flex-shrink: 0;
  }

  #quickAddProspectBtn span {
    display: none !important;
  }

  /* 2. Content Padding & Typography */
  .crm-content {
    padding: 1rem 0.85rem;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .page-title-group h2 {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
  }

  .page-title-group p {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  /* 3. AI Strategy & Insights Mobile Refinements */
  .ai-page-header {
    margin-bottom: 0.85rem;
  }

  .ai-live-indicator {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
  }

  .ai-header-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  #aiRefreshBtn {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
    flex: 1;
    justify-content: center;
  }

  #aiTimestampBadge {
    font-size: 0.72rem;
    padding: 0.35rem 0.6rem;
  }

  .ai-headline-card {
    padding: 1.15rem 1rem;
    margin-bottom: 0.85rem;
    border-radius: var(--radius-md);
  }

  .ai-headline-top {
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
  }

  .ai-kicker-badge {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
  }

  .ai-headline-date {
    font-size: 0.7rem;
  }

  .ai-headline-text {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.01em;
  }

  .ai-perf-card {
    padding: 1.1rem 1.15rem;
  }

  .ai-perf-val {
    font-size: 0.885rem;
    line-height: 1.5;
    min-height: auto;
    margin: 0.35rem 0 0.45rem;
  }

  .ai-perf-sub {
    font-size: 0.72rem;
  }

  .ai-section-panel .panel-header {
    padding: 0.75rem 0.95rem;
  }

  .ai-section-panel .panel-body {
    padding: 0.75rem 0.95rem;
  }

  .ai-items-list {
    gap: 0.65rem;
  }

  .ai-insight-item {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
  }

  .ai-item-title {
    font-size: 0.825rem;
    font-weight: 600;
  }

  .ai-item-desc {
    font-size: 0.775rem;
    line-height: 1.45;
  }

  /* 4. Dashboard View Refinements */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .metric-card:last-child {
    grid-column: span 2;
  }

  .metric-card {
    padding: 0.85rem 0.95rem;
  }

  .metric-val {
    font-size: 1.65rem;
  }

  .metric-title {
    font-size: 0.7rem;
  }

  .metric-sub {
    font-size: 0.7rem;
    margin-top: 0.2rem;
  }

  .metric-icon-wrap {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .dashboard-ai-headline {
    font-size: 0.825rem;
    padding: 0.75rem 0.85rem;
    line-height: 1.45;
  }

  .dashboard-ai-meta {
    padding: 0.65rem 0.75rem;
    gap: 0.4rem;
  }

  .dashboard-ai-metric {
    font-size: 0.775rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  /* 5. Tables & Toolbars */
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
  }

  .toolbar-filters {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }

  .search-input-wrap {
    width: 100%;
    min-width: 0;
  }

  .filter-select {
    width: 100%;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .data-table {
    min-width: 600px;
  }

  .data-table th,
  .data-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.785rem;
  }

  .drawer-panel {
    width: 100%;
  }

  .modal-window {
    width: 100%;
    max-width: calc(100vw - 1.5rem);
  }

  /* 6. Analytics Mobile Responsive Adjustments (No hamburgering, clean stacking) */
  .analytics-telemetry-banner {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
  }

  .analytics-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    margin-bottom: 1.25rem !important;
  }

  .funnel-step-item {
    padding: 0.85rem 0.95rem !important;
  }

  .funnel-step-main {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
  }

  .funnel-step-right {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .funnel-step-count {
    font-size: 1.25rem !important;
  }

  .activity-breakdown-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.45rem !important;
  }

  .activity-breakdown-right {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .icp-segment-top {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.45rem !important;
  }

  .icp-segment-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.45rem !important;
  }

  .icp-stat-box {
    padding: 0.45rem 0.25rem !important;
  }

  .icp-stat-val {
    font-size: 0.9rem !important;
  }

  .icp-stat-lbl {
    font-size: 0.62rem !important;
  }

  .campaign-status-box {
    padding: 1.25rem 1rem !important;
  }

  .campaign-status-desc {
    font-size: 0.785rem !important;
  }

  /* 7. Clients & Revenue Mobile Adjustments */
  .clients-cards-grid {
    grid-template-columns: 1fr !important;
    padding: 0.85rem !important;
    gap: 0.85rem !important;
  }

  .revenue-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }

  .revenue-visual-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

/* ULTRA-COMPACT MOBILE BREAKPOINT (<= 380px) */
@media (max-width: 380px) {
  .crm-header {
    padding: 0 0.65rem;
    gap: 0.35rem;
  }

  .header-view-title {
    max-width: 110px;
    font-size: 0.875rem;
  }

  .metrics-grid,
  .analytics-metrics-grid,
  .revenue-kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .metric-card:last-child {
    grid-column: span 1;
  }

  .icp-segment-stats-grid {
    grid-template-columns: 1fr !important;
  }
}


