/* ===========================================================================
   CRM CAPROIN — THEME: CRM MODERNO v1.0
   Premium SaaS · Coral Primary #FF5C35 · Light Canvas · Dark Sidebar
   Activado con: <html data-theme="crm-modern">
   =========================================================================== */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] {
  /* Backgrounds */
  --bg-base:      #F6F9FC;
  --bg-surface:   #FFFFFF;
  --bg-elevated:  #EEF3F8;
  --bg-overlay:   #E5EDF5;
  --bg-hover:     #DDE7F0;

  /* Brand — coral/orange SaaS */
  --primary:         #FF5C35;
  --primary-hover:   #E8502B;
  --primary-light:   rgba(255,92,53,0.10);
  --primary-glow:    rgba(255,92,53,0.16);
  --primary-glow-lg: rgba(255,92,53,0.26);

  /* Accent */
  --accent:         #FF5C35;
  --accent-light:   rgba(255,92,53,0.10);
  --accent-glow:    rgba(255,92,53,0.18);

  /* Status */
  --success:        #22C55E;
  --success-light:  rgba(34,197,94,0.10);
  --success-glow:   rgba(34,197,94,0.18);
  --warning:        #F59E0B;
  --warning-light:  rgba(245,158,11,0.10);
  --danger:         #EF4444;
  --danger-light:   rgba(239,68,68,0.10);
  --danger-glow:    rgba(239,68,68,0.18);

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #546E7A;
  --text-muted:     #78909C;
  --text-on-dark:   #FFFFFF;

  /* Borders */
  --border:         rgba(0,0,0,0.07);
  --border-medium:  rgba(0,0,0,0.11);
  --border-strong:  rgba(0,0,0,0.18);

  /* Shadows — clean elevation system */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07);
  --shadow:     0 2px 12px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.05);
  --shadow-lg:  0 4px 24px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.05);
  --shadow-xl:  0 8px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
  --glow-primary: 0 0 20px rgba(255,92,53,0.22);
  --glow-success: 0 0 16px rgba(34,197,94,0.16);

  /* Sidebar — dark navy, coral accent */
  --sidebar-bg:           #1B2A3B;
  --sidebar-item:         rgba(255,255,255,0.04);
  --sidebar-active-bg:    rgba(255,92,53,0.16);
  --sidebar-active-border:#FF5C35;

  /* Color aliases */
  --color-primary:       #FF5C35;
  --color-primary-hover: #E8502B;
  --color-primary-text:  #FF5C35;
  --color-secondary-text:#546E7A;

  /* Surface aliases */
  --surface-0: #F6F9FC;
  --surface-1: #FFFFFF;
  --surface-2: #EEF3F8;
  --surface-3: #E5EDF5;
  --surface-4: #DDE7F0;
}

/* ── Body & Layout ─────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] body {
  background: #F6F9FC !important;
  color: #0F172A !important;
}
[data-theme="crm-modern"] .app-container,
[data-theme="crm-modern"] .app-shell,
[data-theme="crm-modern"] .app-wrapper,
[data-theme="crm-modern"] .layout-root {
  background: #F6F9FC !important;
}
[data-theme="crm-modern"] .main-content,
[data-theme="crm-modern"] .content-body {
  background: #F6F9FC !important;
  color: #0F172A !important;
}

/* ── Sidebar — dark navy stays, coral accents ─────────────────────────────── */
[data-theme="crm-modern"] .sidebar {
  background: #1B2A3B !important;
  border-right: none !important;
  box-shadow: 2px 0 16px rgba(0,0,0,0.18) !important;
}
[data-theme="crm-modern"] .sidebar::before {
  display: none !important;
}
[data-theme="crm-modern"] .sidebar-logo {
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}
[data-theme="crm-modern"] .sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  background: rgba(0,0,0,0.12) !important;
}
[data-theme="crm-modern"] .sidebar-scroll {
  background: transparent !important;
}
[data-theme="crm-modern"] .nav-section,
[data-theme="crm-modern"] .nav-section-label {
  color: rgba(255,255,255,0.35) !important;
}
[data-theme="crm-modern"] .nav-item {
  color: rgba(255,255,255,0.72) !important;
  border-color: transparent !important;
}
[data-theme="crm-modern"] .nav-item i {
  color: rgba(255,255,255,0.48) !important;
}
[data-theme="crm-modern"] .nav-item:hover {
  background: rgba(255,92,53,0.10) !important;
  color: #FFFFFF !important;
  border-color: rgba(255,92,53,0.20) !important;
}
[data-theme="crm-modern"] .nav-item:hover i {
  color: #FF5C35 !important;
}
[data-theme="crm-modern"] .nav-item.active {
  background: rgba(255,92,53,0.16) !important;
  color: #FFFFFF !important;
  border-color: rgba(255,92,53,0.35) !important;
  font-weight: 600 !important;
}
[data-theme="crm-modern"] .nav-item.active i {
  color: #FF5C35 !important;
}
[data-theme="crm-modern"] .nav-item.active::before {
  background: #FF5C35 !important;
  box-shadow: 0 0 8px rgba(255,92,53,0.50) !important;
}
[data-theme="crm-modern"] .nav-submenu {
  background: rgba(0,0,0,0.12) !important;
  border-left: 2px solid rgba(255,92,53,0.20) !important;
}
[data-theme="crm-modern"] .nav-label {
  color: inherit !important;
}
[data-theme="crm-modern"] .sync-status {
  color: rgba(255,255,255,0.40) !important;
}
[data-theme="crm-modern"] .btn-sync {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.72) !important;
}
[data-theme="crm-modern"] .sidebar-toggle {
  background: #1B2A3B !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.55) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.20) !important;
}
[data-theme="crm-modern"] .config-section-divider {
  border-color: rgba(255,255,255,0.08) !important;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] .top-bar {
  background: #FFFFFF !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06) !important;
  backdrop-filter: none !important;
}
[data-theme="crm-modern"] .top-bar * {
  color: #0F172A;
}
[data-theme="crm-modern"] .top-bar input,
[data-theme="crm-modern"] .search-container input,
[data-theme="crm-modern"] .search-bar,
[data-theme="crm-modern"] .search-box {
  background: #F6F9FC !important;
  border-color: rgba(0,0,0,0.10) !important;
  color: #0F172A !important;
}
[data-theme="crm-modern"] .search-container i {
  color: #94A3B8 !important;
}
[data-theme="crm-modern"] .notif-btn,
[data-theme="crm-modern"] .icon-btn,
[data-theme="crm-modern"] .topbar-btn,
[data-theme="crm-modern"] .theme-toggle-btn {
  color: #546E7A !important;
  background: #F0F4F8 !important;
  border-color: rgba(0,0,0,0.08) !important;
}
[data-theme="crm-modern"] .top-bar-actions .notifications i {
  color: #546E7A !important;
}
[data-theme="crm-modern"] .badge {
  background: #FF5C35 !important;
  color: #fff !important;
}
[data-theme="crm-modern"] .user-name {
  color: #0F172A !important;
}
[data-theme="crm-modern"] .user-role {
  color: #546E7A !important;
}
[data-theme="crm-modern"] .breadcrumb-container {
  color: #78909C !important;
  background: transparent !important;
}
[data-theme="crm-modern"] .breadcrumb-container span:last-child {
  color: #0F172A !important;
}
[data-theme="crm-modern"] .breadcrumb-container i {
  color: #94A3B8 !important;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] .card,
[data-theme="crm-modern"] [class*="-card"],
[data-theme="crm-modern"] [class*="card-"] {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.07) !important;
  color: #0F172A !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
}
[data-theme="crm-modern"] .card::before,
[data-theme="crm-modern"] [class*="card"]::before {
  background: none !important;
  display: none !important;
}
[data-theme="crm-modern"] .card-header,
[data-theme="crm-modern"] [class*="card-header"] {
  background: #F6F9FC !important;
  border-bottom-color: rgba(0,0,0,0.07) !important;
  color: #0F172A !important;
}
[data-theme="crm-modern"] .card-title,
[data-theme="crm-modern"] [class*="card-title"] {
  color: #0F172A !important;
}
[data-theme="crm-modern"] .card-subtitle,
[data-theme="crm-modern"] [class*="card-sub"] {
  color: #546E7A !important;
}

/* ── Headings & Text ────────────────────────────────────────────────────── */
[data-theme="crm-modern"] h1,
[data-theme="crm-modern"] h2,
[data-theme="crm-modern"] h3,
[data-theme="crm-modern"] h4,
[data-theme="crm-modern"] h5,
[data-theme="crm-modern"] h6 {
  color: #0F172A !important;
}
[data-theme="crm-modern"] label {
  color: #46637A !important;
}
[data-theme="crm-modern"] p,
[data-theme="crm-modern"] span:not(.badge):not([class*="status"]) {
  color: inherit;
}
[data-theme="crm-modern"] .text-muted,
[data-theme="crm-modern"] .muted,
[data-theme="crm-modern"] [class*="text-muted"] {
  color: #78909C !important;
}
[data-theme="crm-modern"] .text-secondary,
[data-theme="crm-modern"] [class*="text-secondary"] {
  color: #546E7A !important;
}
[data-theme="crm-modern"] .section-title,
[data-theme="crm-modern"] .view-title,
[data-theme="crm-modern"] .page-title {
  color: #0F172A !important;
}
[data-theme="crm-modern"] .subtitle,
[data-theme="crm-modern"] .section-subtitle {
  color: #546E7A !important;
}

/* ── Inputs & Forms ─────────────────────────────────────────────────────── */
[data-theme="crm-modern"] input:not([type=checkbox]):not([type=radio]),
[data-theme="crm-modern"] textarea,
[data-theme="crm-modern"] select {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.12) !important;
  color: #0F172A !important;
  color-scheme: light !important;
}
[data-theme="crm-modern"] input::placeholder,
[data-theme="crm-modern"] textarea::placeholder {
  color: #94A3B8 !important;
}
[data-theme="crm-modern"] .form-group,
[data-theme="crm-modern"] .form-field,
[data-theme="crm-modern"] .field-group {
  background: transparent !important;
}
[data-theme="crm-modern"] .input-icon-wrapper {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.12) !important;
}
[data-theme="crm-modern"] .input-icon-wrapper i {
  color: #94A3B8 !important;
}
[data-theme="crm-modern"] input:focus,
[data-theme="crm-modern"] textarea:focus,
[data-theme="crm-modern"] select:focus {
  border-color: #FF5C35 !important;
  box-shadow: 0 0 0 3px rgba(255,92,53,0.12) !important;
}
[data-theme="crm-modern"] select option {
  background: #FFFFFF !important;
  color: #0F172A !important;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] table {
  background: #FFFFFF !important;
  color: #0F172A !important;
}
[data-theme="crm-modern"] thead,
[data-theme="crm-modern"] thead tr,
[data-theme="crm-modern"] .table-header {
  background: #F6F9FC !important;
}
[data-theme="crm-modern"] th {
  color: #546E7A !important;
  border-bottom-color: rgba(0,0,0,0.08) !important;
  font-weight: 600 !important;
}
[data-theme="crm-modern"] td {
  color: #0F172A !important;
  border-bottom-color: rgba(0,0,0,0.05) !important;
}
[data-theme="crm-modern"] tr:hover td {
  background: #F6F9FC !important;
}
[data-theme="crm-modern"] .table-wrapper,
[data-theme="crm-modern"] .table-container {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.07) !important;
}

/* ── Modals & Overlays ──────────────────────────────────────────────────── */
[data-theme="crm-modern"] .modal,
[data-theme="crm-modern"] .modal-content,
[data-theme="crm-modern"] .dialog,
[data-theme="crm-modern"] .popup,
[data-theme="crm-modern"] .drawer,
[data-theme="crm-modern"] .panel-modal,
[data-theme="crm-modern"] .side-panel {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.10) !important;
  color: #0F172A !important;
}
[data-theme="crm-modern"] .modal-header,
[data-theme="crm-modern"] .dialog-header,
[data-theme="crm-modern"] .panel-header {
  background: #F6F9FC !important;
  border-bottom-color: rgba(0,0,0,0.08) !important;
  color: #0F172A !important;
}
[data-theme="crm-modern"] .modal-footer,
[data-theme="crm-modern"] .dialog-footer,
[data-theme="crm-modern"] .panel-footer {
  background: #F6F9FC !important;
  border-top-color: rgba(0,0,0,0.08) !important;
}
[data-theme="crm-modern"] .modal-overlay,
[data-theme="crm-modern"] .overlay,
[data-theme="crm-modern"] .backdrop {
  background: rgba(15,23,42,0.50) !important;
}
[data-theme="crm-modern"] .modal-title,
[data-theme="crm-modern"] .dialog-title {
  color: #0F172A !important;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] .btn-primary,
[data-theme="crm-modern"] .btn-main,
[data-theme="crm-modern"] .btn[class*="primary"] {
  background: #FF5C35 !important;
  color: #FFFFFF !important;
  border-color: #FF5C35 !important;
}
[data-theme="crm-modern"] .btn-primary:hover,
[data-theme="crm-modern"] .btn-main:hover {
  background: #E8502B !important;
  border-color: #E8502B !important;
}
[data-theme="crm-modern"] .btn-secondary,
[data-theme="crm-modern"] .btn-outline,
[data-theme="crm-modern"] .btn-ghost,
[data-theme="crm-modern"] .btn-default,
[data-theme="crm-modern"] .btn {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.12) !important;
  color: #546E7A !important;
}
[data-theme="crm-modern"] .btn-secondary:hover,
[data-theme="crm-modern"] .btn-outline:hover,
[data-theme="crm-modern"] .btn-ghost:hover,
[data-theme="crm-modern"] .btn:hover {
  background: #F6F9FC !important;
  color: #FF5C35 !important;
  border-color: rgba(255,92,53,0.25) !important;
}
[data-theme="crm-modern"] .btn-danger,
[data-theme="crm-modern"] .btn-delete,
[data-theme="crm-modern"] .btn[class*="danger"] {
  background: #EF4444 !important;
  color: #FFFFFF !important;
  border-color: #EF4444 !important;
}

/* ── Dropdowns ──────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] .dropdown,
[data-theme="crm-modern"] .dropdown-menu,
[data-theme="crm-modern"] .context-menu,
[data-theme="crm-modern"] .popover,
[data-theme="crm-modern"] .select-dropdown,
[data-theme="crm-modern"] .search-results-popover {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.10) !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
}
[data-theme="crm-modern"] .dropdown-item,
[data-theme="crm-modern"] .menu-item,
[data-theme="crm-modern"] .context-item,
[data-theme="crm-modern"] .option-item {
  color: #0F172A !important;
  background: transparent !important;
}
[data-theme="crm-modern"] .dropdown-item:hover,
[data-theme="crm-modern"] .menu-item:hover {
  background: #F6F9FC !important;
  color: #FF5C35 !important;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] .tab,
[data-theme="crm-modern"] .tab-btn,
[data-theme="crm-modern"] .tab-item {
  color: #78909C !important;
  background: transparent !important;
  border-color: transparent !important;
}
[data-theme="crm-modern"] .tab.active,
[data-theme="crm-modern"] .tab-btn.active,
[data-theme="crm-modern"] .tab-item.active,
[data-theme="crm-modern"] [class*="tab-active"],
[data-theme="crm-modern"] [class*="active-tab"] {
  background: #FF5C35 !important;
  color: #FFFFFF !important;
  border-color: #FF5C35 !important;
}
[data-theme="crm-modern"] .tabs-bar,
[data-theme="crm-modern"] .tabs-header,
[data-theme="crm-modern"] [class*="tabs-wrapper"] {
  background: #F6F9FC !important;
  border-bottom-color: rgba(0,0,0,0.08) !important;
}

/* ── KPI / Metric Cards ─────────────────────────────────────────────────── */
[data-theme="crm-modern"] [class*="kpi-card"],
[data-theme="crm-modern"] [class*="metric-card"],
[data-theme="crm-modern"] .stat-card,
[data-theme="crm-modern"] .kpi-item {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.07) !important;
  color: #0F172A !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
}
[data-theme="crm-modern"] [class*="kpi-label"],
[data-theme="crm-modern"] [class*="kpi-sub"],
[data-theme="crm-modern"] [class*="metric-label"] {
  color: #78909C !important;
}
[data-theme="crm-modern"] [class*="kpi-value"],
[data-theme="crm-modern"] [class*="kpi-amount"],
[data-theme="crm-modern"] [class*="metric-value"] {
  color: #0F172A !important;
}
[data-theme="crm-modern"] [class*="kpi-trend"],
[data-theme="crm-modern"] [class*="trend-up"] {
  color: #22C55E !important;
}
[data-theme="crm-modern"] [class*="trend-down"] {
  color: #EF4444 !important;
}

/* ── Kanban / Pipeline ──────────────────────────────────────────────────── */
[data-theme="crm-modern"] .kanban-col,
[data-theme="crm-modern"] .kanban-column,
[data-theme="crm-modern"] .pipeline-col,
[data-theme="crm-modern"] .pipeline-stage {
  background: #EEF3F8 !important;
  border-color: rgba(0,0,0,0.07) !important;
}
[data-theme="crm-modern"] .kanban-col-header,
[data-theme="crm-modern"] .pipeline-stage-header {
  color: #0F172A !important;
  background: #E5EDF5 !important;
}
[data-theme="crm-modern"] .kanban-card,
[data-theme="crm-modern"] .deal-card,
[data-theme="crm-modern"] .pipeline-card {
  background: #FFFFFF !important;
  color: #0F172A !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
  border-color: rgba(0,0,0,0.07) !important;
}

/* ── Filter / Toolbar ───────────────────────────────────────────────────── */
[data-theme="crm-modern"] .filter-toolbar,
[data-theme="crm-modern"] .filter-bar,
[data-theme="crm-modern"] .toolbar,
[data-theme="crm-modern"] .action-bar {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.08) !important;
  color: #0F172A !important;
}
[data-theme="crm-modern"] .filter-toolbar label,
[data-theme="crm-modern"] .toolbar label {
  color: #546E7A !important;
}

/* ── Badges / Status ────────────────────────────────────────────────────── */
[data-theme="crm-modern"] .badge-success,
[data-theme="crm-modern"] [class*="status-active"] {
  background: #D1FAE5 !important;
  color: #065F46 !important;
}
[data-theme="crm-modern"] .badge-warning,
[data-theme="crm-modern"] [class*="status-pending"] {
  background: #FEF3C7 !important;
  color: #92400E !important;
}
[data-theme="crm-modern"] .badge-danger,
[data-theme="crm-modern"] [class*="status-inactive"] {
  background: #FEE2E2 !important;
  color: #991B1B !important;
}
[data-theme="crm-modern"] .badge-info,
[data-theme="crm-modern"] [class*="status-info"] {
  background: rgba(255,92,53,0.10) !important;
  color: #E8502B !important;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] .toast,
[data-theme="crm-modern"] [class*="toast-"] {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.10) !important;
  color: #0F172A !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
}

/* ── Scrollbars ─────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] ::-webkit-scrollbar-track {
  background: #F0F4F8 !important;
}
[data-theme="crm-modern"] ::-webkit-scrollbar-thumb {
  background: #B0BEC5 !important;
}

/* ── Misc ───────────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] hr,
[data-theme="crm-modern"] .divider,
[data-theme="crm-modern"] .separator,
[data-theme="crm-modern"] [class*="divider"] {
  border-color: rgba(0,0,0,0.08) !important;
}
[data-theme="crm-modern"] .empty-state,
[data-theme="crm-modern"] .no-data {
  color: #78909C !important;
}

/* ── Inline-style overrides (dark hex values hardcoded in JS-generated HTML) */
[data-theme="crm-modern"] [style*="background:#0c1422"],
[data-theme="crm-modern"] [style*="background: #0c1422"] {
  background: #FFFFFF !important;
}
[data-theme="crm-modern"] [style*="background:#070c14"],
[data-theme="crm-modern"] [style*="background: #070c14"] {
  background: #F6F9FC !important;
}
[data-theme="crm-modern"] [style*="background:#111d30"],
[data-theme="crm-modern"] [style*="background: #111d30"] {
  background: #EEF3F8 !important;
}
[data-theme="crm-modern"] [style*="background:#172340"],
[data-theme="crm-modern"] [style*="background: #172340"] {
  background: #E5EDF5 !important;
}
[data-theme="crm-modern"] [style*="background:#0c1a2e"],
[data-theme="crm-modern"] [style*="background: #0c1a2e"] {
  background: #F6F9FC !important;
}
[data-theme="crm-modern"] [style*="color:#a0b0c8"],
[data-theme="crm-modern"] [style*="color: #a0b0c8"] {
  color: #546E7A !important;
}
[data-theme="crm-modern"] [style*="color:#e2ecff"],
[data-theme="crm-modern"] [style*="color: #e2ecff"] {
  color: #0F172A !important;
}
[data-theme="crm-modern"] [style*="color:#94a3b8"],
[data-theme="crm-modern"] [style*="color: #94a3b8"] {
  color: #546E7A !important;
}
[data-theme="crm-modern"] [style*="color:#7b8fa8"],
[data-theme="crm-modern"] [style*="color: #7b8fa8"] {
  color: #78909C !important;
}

/* ── DASHBOARD VENTAS (neuro-theme.css overrides) ─────────────────────────── */
[data-theme="crm-modern"] .neuro-shell {
  background: #F6F9FC !important;
}

[data-theme="crm-modern"] .neuro-sidebar {
  background: #1B2A3B !important;
  box-shadow: 2px 0 16px rgba(0,0,0,0.18) !important;
}

[data-theme="crm-modern"] .sidebar-logo {
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

[data-theme="crm-modern"] .sidebar-label {
  color: rgba(255,255,255,0.35) !important;
}

[data-theme="crm-modern"] .sidebar-nav li a {
  color: rgba(255,255,255,0.72) !important;
}

[data-theme="crm-modern"] .sidebar-nav li a:hover {
  background: rgba(255,92,53,0.10) !important;
}

[data-theme="crm-modern"] .sidebar-nav li.active a {
  background: rgba(255,92,53,0.16) !important;
  border-left: 3px solid #FF5C35;
  color: #FFFFFF !important;
}

[data-theme="crm-modern"] .sidebar-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

[data-theme="crm-modern"] .sidebar-card h4 {
  color: #FFFFFF !important;
}

[data-theme="crm-modern"] .sidebar-card p {
  color: rgba(255,255,255,0.60) !important;
}

[data-theme="crm-modern"] .sidebar-card-btn {
  background: #FF5C35 !important;
}

[data-theme="crm-modern"] .sidebar-card-btn:hover {
  background: #E8502B !important;
}

[data-theme="crm-modern"] .sidebar-btn-main {
  background: #FF5C35 !important;
  box-shadow: 0 4px 12px rgba(255,92,53,0.30) !important;
}

[data-theme="crm-modern"] .sidebar-btn-main:hover {
  background: #E8502B !important;
  box-shadow: 0 6px 16px rgba(255,92,53,0.45) !important;
}

[data-theme="crm-modern"] .sidebar-btn-sub {
  background: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.75) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

[data-theme="crm-modern"] .sidebar-btn-sub:hover {
  background: rgba(255,92,53,0.12) !important;
  color: #FFFFFF !important;
}

[data-theme="crm-modern"] .neuro-main,
[data-theme="crm-modern"] .neuro-body {
  background: #F6F9FC !important;
  color: #0F172A !important;
}

[data-theme="crm-modern"] .neuro-section-label {
  color: #78909C !important;
}

[data-theme="crm-modern"] .neuro-section-label::after {
  background: #FF5C35 !important;
}

[data-theme="crm-modern"] h2 {
  color: #0F172A !important;
}

/* ── Chat Container (IA Análisis) ─────────────────────────────────────────── */
[data-theme="crm-modern"] .chat-container {
  background: #FFFFFF !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

[data-theme="crm-modern"] .chat-messages {
  background: #F6F9FC !important;
}

[data-theme="crm-modern"] .message.user {
  background: #FF5C35 !important;
  box-shadow: 0 4px 12px rgba(255,92,53,0.30) !important;
}

[data-theme="crm-modern"] .message.ai {
  background: #FFFFFF !important;
  color: #0F172A !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

[data-theme="crm-modern"] .chat-input-area {
  background: #FFFFFF !important;
  border-top-color: rgba(0,0,0,0.08) !important;
}

[data-theme="crm-modern"] #chat-input {
  background: #F6F9FC !important;
  border-color: rgba(0,0,0,0.12) !important;
  color: #0F172A !important;
}

[data-theme="crm-modern"] #chat-input::placeholder {
  color: #94A3B8 !important;
}

[data-theme="crm-modern"] #chat-input:focus {
  box-shadow: 0 0 0 3px rgba(255,92,53,0.12) !important;
}

[data-theme="crm-modern"] .send-btn {
  background: #FF5C35 !important;
  box-shadow: 0 4px 12px rgba(255,92,53,0.30) !important;
}

[data-theme="crm-modern"] .send-btn:hover {
  background: #E8502B !important;
}

[data-theme="crm-modern"] .send-btn:disabled {
  background: #CBD5E1 !important;
  box-shadow: none !important;
}

[data-theme="crm-modern"] .ai-chart-container {
  background: #F6F9FC !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06) !important;
}

[data-theme="crm-modern"] .typing-dot {
  background: #94A3B8 !important;
}

[data-theme="crm-modern"] .api-key-banner {
  background: #FEF3C7 !important;
  border-color: rgba(245,158,11,0.30) !important;
}

[data-theme="crm-modern"] .api-key-input {
  background: #FFFFFF !important;
  border-color: rgba(245,158,11,0.40) !important;
  color: #0F172A !important;
}

[data-theme="crm-modern"] .ai-badge {
  background: rgba(255,92,53,0.10) !important;
  color: #FF5C35 !important;
}

/* ── Tables in dashboard_ventas ─────────────────────────────────────────────── */
[data-theme="crm-modern"] .table-exec {
  background: #FFFFFF !important;
  color: #0F172A !important;
}

[data-theme="crm-modern"] .table-exec th {
  color: #546E7A !important;
  border-bottom-color: rgba(0,0,0,0.08) !important;
}

[data-theme="crm-modern"] .table-exec td {
  color: #0F172A !important;
  border-bottom-color: rgba(0,0,0,0.05) !important;
}

[data-theme="crm-modern"] .table-exec tr:hover {
  background: rgba(255,92,53,0.03) !important;
}

[data-theme="crm-modern"] .table-exec .text-dim {
  color: #78909C !important;
}

/* ── ApexCharts in dashboard_ventas ─────────────────────────────────────────── */
/* Note: ApexCharts colors are set in js/app.js renderReportCharts() and already check isDark */

/* ── Footer ───────────────────────────────────────────────────────────────── */
[data-theme="crm-modern"] .exec-footer {
  background: #1B2A3B !important;
  border-top-color: rgba(255,255,255,0.08) !important;
}

[data-theme="crm-modern"] .exec-footer-left span {
  color: rgba(255,255,255,0.72) !important;
}

[data-theme="crm-modern"] .live-dot {
  background: #22C55E !important;
}

[data-theme="crm-modern"] .live-label {
  color: rgba(255,255,255,0.80) !important;
}

/* ==========================================================================
   DATA FLOW UI — tema visual inspirado en interfaces de relaciones vivas
   ========================================================================== */
[data-theme="crm-modern"] {
  color-scheme: dark;
  --bg-base: #050812;
  --bg-surface: rgba(10, 16, 30, 0.82);
  --bg-elevated: rgba(14, 24, 44, 0.88);
  --bg-overlay: rgba(17, 28, 50, 0.94);
  --bg-hover: rgba(34, 211, 238, 0.10);
  --primary: #22d3ee;
  --primary-hover: #67e8f9;
  --primary-light: rgba(34, 211, 238, 0.14);
  --accent: #8b5cf6;
  --accent-light: rgba(139, 92, 246, 0.18);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --text-primary: #f8fbff;
  --text-secondary: #b9c7dc;
  --text-muted: #7488a8;
  --border: rgba(148, 163, 184, 0.16);
  --border-medium: rgba(34, 211, 238, 0.22);
  --border-strong: rgba(103, 232, 249, 0.34);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.44), 0 0 34px rgba(34, 211, 238, 0.08);
  --glow-primary: 0 0 28px rgba(34, 211, 238, 0.32);
  --sidebar-bg: rgba(3, 7, 18, 0.96);
  --sidebar-active-bg: rgba(34, 211, 238, 0.13);
  --sidebar-active-border: #22d3ee;
  --color-primary: #22d3ee;
  --color-primary-hover: #67e8f9;
  --color-primary-text: #67e8f9;
  --surface-0: #050812;
  --surface-1: rgba(10, 16, 30, 0.82);
  --surface-2: rgba(14, 24, 44, 0.88);
  --surface-3: rgba(22, 34, 58, 0.92);
  --surface-4: rgba(34, 211, 238, 0.12);
}

[data-theme="crm-modern"] body,
[data-theme="crm-modern"] .app-container,
[data-theme="crm-modern"] .main-content,
[data-theme="crm-modern"] .content-body,
[data-theme="crm-modern"] .neuro-shell,
[data-theme="crm-modern"] .neuro-main,
[data-theme="crm-modern"] .neuro-body {
  background:
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.18), transparent 28%),
    radial-gradient(circle at 82% 4%, rgba(139, 92, 246, 0.18), transparent 32%),
    linear-gradient(135deg, #050812 0%, #091120 44%, #07131d 100%) !important;
  color: var(--text-primary) !important;
}

.data-flow-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
}

[data-theme="crm-modern"] .data-flow-layer { opacity: 1; }

.data-flow-svg {
  width: 100%;
  height: 100%;
}

.flow-line {
  fill: none;
  stroke: url(#flowGradient);
  stroke-width: 1.4;
  stroke-dasharray: 9 17;
  filter: url(#flowGlow);
  opacity: 0.34;
  animation: flowTrace 8s linear infinite;
}

.flow-line-b { animation-duration: 10s; opacity: 0.24; }
.flow-line-c { animation-duration: 12s; opacity: 0.18; }
.flow-nodes circle {
  fill: #dffbff;
  opacity: 0.76;
  filter: url(#flowGlow);
  animation: nodePulse 2.8s ease-in-out infinite;
}

.crm-relation-orbit {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(14px, 2vw, 28px);
  width: 168px;
  height: 168px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
}

[data-theme="crm-modern"] .crm-relation-orbit { opacity: 0.72; }

.orbit-core,
.orbit-node,
.orbit-ring {
  position: absolute;
  border-radius: 999px;
}

.orbit-core {
  inset: 58px;
  background: radial-gradient(circle, rgba(248, 251, 255, 0.92), rgba(34, 211, 238, 0.42) 44%, rgba(139, 92, 246, 0.12) 70%);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.48);
  animation: nodePulse 3.2s ease-in-out infinite;
}

.orbit-ring {
  inset: 18px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow: inset 0 0 28px rgba(34, 211, 238, 0.08);
  animation: orbitSpin 18s linear infinite;
}

.orbit-ring-b {
  inset: 38px;
  border-color: rgba(139, 92, 246, 0.30);
  animation-duration: 13s;
  animation-direction: reverse;
}

.orbit-node {
  width: 9px;
  height: 9px;
  background: #9bf3ff;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.72);
}

.orbit-node-1 { left: 80px; top: 15px; }
.orbit-node-2 { right: 20px; top: 56px; background: #c4b5fd; }
.orbit-node-3 { right: 42px; bottom: 25px; background: #86efac; }
.orbit-node-4 { left: 25px; bottom: 42px; background: #fde68a; }
.orbit-node-5 { left: 34px; top: 42px; background: #9bf3ff; }

[data-theme="crm-modern"] .app-container,
[data-theme="crm-modern"] .main-content,
[data-theme="crm-modern"] .neuro-shell {
  position: relative;
  z-index: 1;
}

[data-theme="crm-modern"] .sidebar,
[data-theme="crm-modern"] .neuro-sidebar {
  background: linear-gradient(180deg, rgba(3, 7, 18, 0.98), rgba(8, 14, 28, 0.94)) !important;
  border-right: 1px solid rgba(34, 211, 238, 0.16) !important;
  box-shadow: 12px 0 46px rgba(0, 0, 0, 0.42) !important;
}

[data-theme="crm-modern"] .top-bar,
[data-theme="crm-modern"] .neuro-topnav,
[data-theme="crm-modern"] .breadcrumb-container,
[data-theme="crm-modern"] .filter-toolbar,
[data-theme="crm-modern"] .toolbar,
[data-theme="crm-modern"] .action-bar {
  background: rgba(6, 12, 24, 0.72) !important;
  border-color: rgba(34, 211, 238, 0.16) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(18px) saturate(140%) !important;
}

[data-theme="crm-modern"] .top-bar {
  min-width: 0;
  gap: 18px;
}

[data-theme="crm-modern"] .search-container {
  flex: 0 1 460px;
  max-width: min(460px, 42vw);
  min-width: 280px;
}

[data-theme="crm-modern"] .top-bar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

[data-theme="crm-modern"] .user-profile {
  flex: 0 0 auto;
  min-width: 180px;
  justify-content: flex-end;
}

[data-theme="crm-modern"] .user-info {
  min-width: 84px;
}

[data-theme="crm-modern"] .user-name,
[data-theme="crm-modern"] .user-role {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 118px;
}

[data-theme="crm-modern"] .card,
[data-theme="crm-modern"] [class*="-card"],
[data-theme="crm-modern"] [class*="card-"],
[data-theme="crm-modern"] .modal-card,
[data-theme="crm-modern"] .kanban-column,
[data-theme="crm-modern"] .pipeline-stage,
[data-theme="crm-modern"] .panel,
[data-theme="crm-modern"] .stat,
[data-theme="crm-modern"] .db-stat,
[data-theme="crm-modern"] .options-card,
[data-theme="crm-modern"] .family-item,
[data-theme="crm-modern"] .welcome-state {
  background: linear-gradient(145deg, rgba(12, 20, 36, 0.88), rgba(7, 13, 26, 0.78)) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  position: relative;
  overflow: hidden;
}

[data-theme="crm-modern"] [data-flow-node]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.14), transparent),
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.16), transparent 32%);
  opacity: 0.42;
  pointer-events: none;
  transform: translateX(-65%);
  animation: panelScan 5.4s ease-in-out infinite;
  animation-delay: var(--flow-delay, 0ms);
}

[data-theme="crm-modern"] [data-flow-node]:hover {
  border-color: rgba(34, 211, 238, 0.44) !important;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(34, 211, 238, 0.18) !important;
  transform: translateY(-1px);
}

[data-theme="crm-modern"] h1,
[data-theme="crm-modern"] h2,
[data-theme="crm-modern"] h3,
[data-theme="crm-modern"] h4,
[data-theme="crm-modern"] h5,
[data-theme="crm-modern"] h6,
[data-theme="crm-modern"] .page-title,
[data-theme="crm-modern"] .section-title,
[data-theme="crm-modern"] .view-title,
[data-theme="crm-modern"] .db-kpi-value,
[data-theme="crm-modern"] .stat-val,
[data-theme="crm-modern"] .stat-value,
[data-theme="crm-modern"] .metric-value {
  color: var(--text-primary) !important;
  letter-spacing: 0 !important;
}

[data-theme="crm-modern"] p,
[data-theme="crm-modern"] label,
[data-theme="crm-modern"] td,
[data-theme="crm-modern"] .text-secondary,
[data-theme="crm-modern"] .muted,
[data-theme="crm-modern"] .page-sub,
[data-theme="crm-modern"] .db-kpi-sub,
[data-theme="crm-modern"] .stat-sub {
  color: var(--text-secondary) !important;
}

[data-theme="crm-modern"] .text-muted,
[data-theme="crm-modern"] th,
[data-theme="crm-modern"] .db-kpi-label,
[data-theme="crm-modern"] .stat-lbl {
  color: var(--text-muted) !important;
}

[data-theme="crm-modern"] input:not([type=checkbox]):not([type=radio]),
[data-theme="crm-modern"] textarea,
[data-theme="crm-modern"] select,
[data-theme="crm-modern"] .input-icon-wrapper,
[data-theme="crm-modern"] .search-container input,
[data-theme="crm-modern"] .form-input,
[data-theme="crm-modern"] .form-select {
  background: rgba(3, 7, 18, 0.62) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: var(--text-primary) !important;
  border-radius: 8px !important;
}

[data-theme="crm-modern"] input:focus,
[data-theme="crm-modern"] textarea:focus,
[data-theme="crm-modern"] select:focus {
  border-color: rgba(34, 211, 238, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14), 0 0 24px rgba(34, 211, 238, 0.16) !important;
}

[data-theme="crm-modern"] .btn-primary,
[data-theme="crm-modern"] .btn-main,
[data-theme="crm-modern"] .btn[class*="primary"],
[data-theme="crm-modern"] .sidebar-card-btn,
[data-theme="crm-modern"] .send-btn {
  background: linear-gradient(135deg, #22d3ee, #8b5cf6) !important;
  border-color: rgba(103, 232, 249, 0.5) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.22) !important;
}

[data-theme="crm-modern"] .btn,
[data-theme="crm-modern"] .btn-secondary,
[data-theme="crm-modern"] .btn-outline,
[data-theme="crm-modern"] .theme-toggle-btn,
[data-theme="crm-modern"] .icon-btn,
[data-theme="crm-modern"] .sidebar-btn-sub {
  background: rgba(12, 20, 36, 0.78) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: var(--text-secondary) !important;
  border-radius: 8px !important;
}

[data-theme="crm-modern"] .btn:hover,
[data-theme="crm-modern"] .nav-item:hover,
[data-theme="crm-modern"] .sidebar-nav li a:hover {
  background: rgba(34, 211, 238, 0.12) !important;
  color: #ffffff !important;
  border-color: rgba(34, 211, 238, 0.32) !important;
}

[data-theme="crm-modern"] .nav-item.active,
[data-theme="crm-modern"] .sidebar-nav li.active a,
[data-theme="crm-modern"] .tab.active,
[data-theme="crm-modern"] .tab-btn.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.16)) !important;
  border-color: rgba(34, 211, 238, 0.42) !important;
  color: #ffffff !important;
}

[data-theme="crm-modern"] table,
[data-theme="crm-modern"] .table-wrapper,
[data-theme="crm-modern"] .table-container {
  background: rgba(7, 13, 26, 0.72) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
}

[data-theme="crm-modern"] thead,
[data-theme="crm-modern"] thead tr,
[data-theme="crm-modern"] .table-header {
  background: rgba(34, 211, 238, 0.08) !important;
}

[data-theme="crm-modern"] tr:hover td {
  background: rgba(34, 211, 238, 0.07) !important;
}

[data-theme="crm-modern"] .apexcharts-canvas text,
[data-theme="crm-modern"] .apexcharts-legend-text {
  fill: var(--text-secondary) !important;
  color: var(--text-secondary) !important;
}

[data-theme="crm-modern"] .badge,
[data-theme="crm-modern"] [class*="status"],
[data-theme="crm-modern"] .tag {
  border-radius: 999px !important;
  border: 1px solid rgba(34, 211, 238, 0.24) !important;
  background: rgba(34, 211, 238, 0.12) !important;
  color: #9bf3ff !important;
}

@keyframes flowTrace { to { stroke-dashoffset: -260; } }
@keyframes nodePulse {
  0%, 100% { transform: scale(0.92); opacity: 0.42; }
  50% { transform: scale(1.24); opacity: 0.96; }
}
@keyframes panelScan {
  0%, 22% { transform: translateX(-75%); opacity: 0; }
  42% { opacity: 0.42; }
  72%, 100% { transform: translateX(75%); opacity: 0; }
}
@keyframes orbitSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .flow-line,
  .flow-nodes circle,
  .orbit-core,
  .orbit-ring,
  [data-theme="crm-modern"] [data-flow-node]::before {
    animation: none !important;
  }
}

/* ==========================================================================
   SOURCE MAP LIFT — identidad visual basada en el recorrido de datos real
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Libre+Baskerville:wght@400;700&display=swap');

[data-theme="crm-modern"] {
  --bg-base: #050605;
  --bg-surface: rgba(18, 18, 17, 0.88);
  --bg-elevated: rgba(26, 26, 24, 0.92);
  --bg-overlay: rgba(32, 31, 28, 0.96);
  --bg-hover: rgba(238, 225, 184, 0.10);
  --primary: #eee1b8;
  --primary-hover: #fff1c8;
  --primary-light: rgba(238, 225, 184, 0.14);
  --accent: #78dce8;
  --accent-light: rgba(120, 220, 232, 0.14);
  --success: #75d78b;
  --warning: #d7a94f;
  --danger: #e06f5f;
  --text-primary: #f5f0df;
  --text-secondary: #b8b1a1;
  --text-muted: #756f63;
  --border: rgba(238, 225, 184, 0.13);
  --border-medium: rgba(238, 225, 184, 0.24);
  --border-strong: rgba(238, 225, 184, 0.42);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.54), inset 0 1px 0 rgba(255, 248, 220, 0.045);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.68), 0 0 40px rgba(238, 225, 184, 0.07);
  --font-primary: 'Inter', system-ui, sans-serif;
  --font-display: 'Libre Baskerville', Georgia, serif;
}

[data-theme="crm-modern"] body,
[data-theme="crm-modern"] .app-container,
[data-theme="crm-modern"] .main-content,
[data-theme="crm-modern"] .content-body,
[data-theme="crm-modern"] .neuro-shell,
[data-theme="crm-modern"] .neuro-main,
[data-theme="crm-modern"] .neuro-body {
  background:
    radial-gradient(circle at 12% 8%, rgba(238, 225, 184, 0.09), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(199, 166, 91, 0.12), transparent 34%),
    radial-gradient(circle at 78% 78%, rgba(120, 220, 232, 0.08), transparent 34%),
    linear-gradient(135deg, #050605 0%, #0b0c0b 48%, #060807 100%) !important;
}

[data-theme="crm-modern"] .content-body {
  position: relative;
  padding-top: 28px !important;
}

[data-theme="crm-modern"] body.crm-flow-map-enabled .content-body {
  padding-right: calc(min(300px, 22vw) + 24px) !important;
}

[data-theme="crm-modern"] .sidebar,
[data-theme="crm-modern"] .neuro-sidebar {
  background:
    linear-gradient(180deg, rgba(8, 8, 7, 0.98), rgba(15, 15, 13, 0.96)),
    radial-gradient(circle at top, rgba(238, 225, 184, 0.10), transparent 46%) !important;
  border-right: 1px solid rgba(238, 225, 184, 0.16) !important;
}

[data-theme="crm-modern"] .sidebar-logo img,
[data-theme="crm-modern"] .logo-img {
  background: rgba(245, 240, 223, 0.88) !important;
  border-radius: 8px !important;
  padding: 6px 9px !important;
  filter: saturate(0.92) contrast(1.04) !important;
}

[data-theme="crm-modern"] h1,
[data-theme="crm-modern"] h2,
[data-theme="crm-modern"] h3,
[data-theme="crm-modern"] .page-title,
[data-theme="crm-modern"] .view-title,
[data-theme="crm-modern"] .section-title,
[data-theme="crm-modern"] .db-chart-title,
[data-theme="crm-modern"] .card-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

[data-theme="crm-modern"] em,
[data-theme="crm-modern"] i:not(.fas):not(.far):not(.fab) {
  color: #e1c878 !important;
}

[data-theme="crm-modern"] .card,
[data-theme="crm-modern"] [class*="-card"],
[data-theme="crm-modern"] [class*="card-"],
[data-theme="crm-modern"] .modal-card,
[data-theme="crm-modern"] .modal-box,
[data-theme="crm-modern"] .kanban-column,
[data-theme="crm-modern"] .pipeline-stage,
[data-theme="crm-modern"] .panel,
[data-theme="crm-modern"] .stat,
[data-theme="crm-modern"] .db-stat,
[data-theme="crm-modern"] .family-item,
[data-theme="crm-modern"] .options-card,
[data-theme="crm-modern"] .welcome-state,
[data-theme="crm-modern"] .hubspot-card {
  background:
    linear-gradient(180deg, rgba(30, 30, 28, 0.92), rgba(16, 16, 15, 0.92)) !important;
  border-color: rgba(238, 225, 184, 0.13) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
}

[data-theme="crm-modern"] [data-flow-node] {
  isolation: isolate;
}

[data-theme="crm-modern"] [data-flow-record] {
  position: relative;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

[data-theme="crm-modern"] [data-flow-record]:hover {
  background: rgba(238, 225, 184, 0.08) !important;
  box-shadow: inset 3px 0 0 rgba(238, 225, 184, 0.72);
  transform: translateX(2px);
}

[data-theme="crm-modern"] .db-kpi-value,
[data-theme="crm-modern"] .stat-val,
[data-theme="crm-modern"] .stat-value,
[data-theme="crm-modern"] .metric-value,
[data-theme="crm-modern"] [class*="kpi-value"] {
  font-family: var(--font-display) !important;
  color: #f7ecd0 !important;
}

[data-theme="crm-modern"] body.theme-neuro h1,
[data-theme="crm-modern"] body.theme-neuro h2,
[data-theme="crm-modern"] body.theme-neuro h3,
[data-theme="crm-modern"] body.theme-neuro .page-title,
[data-theme="crm-modern"] body.theme-neuro .view-title,
[data-theme="crm-modern"] body.theme-neuro .section-title,
[data-theme="crm-modern"] body.theme-neuro .db-chart-title,
[data-theme="crm-modern"] body.theme-neuro .card-title,
[data-theme="crm-modern"] body.theme-neuro .chart-box-header h3,
[data-theme="crm-modern"] body.theme-neuro .neuro-kpi-value,
[data-theme="crm-modern"] body.theme-neuro [class*="kpi-value"],
[data-theme="crm-modern"] .neuro-shell h1,
[data-theme="crm-modern"] .neuro-shell h2,
[data-theme="crm-modern"] .neuro-shell h3,
[data-theme="crm-modern"] .neuro-shell .page-title,
[data-theme="crm-modern"] .neuro-shell .view-title,
[data-theme="crm-modern"] .neuro-shell .section-title,
[data-theme="crm-modern"] .neuro-shell .db-chart-title,
[data-theme="crm-modern"] .neuro-shell .card-title,
[data-theme="crm-modern"] .neuro-shell .chart-box-header h3,
[data-theme="crm-modern"] .neuro-shell .neuro-kpi-value,
[data-theme="crm-modern"] .neuro-shell [class*="kpi-value"] {
  font-family: var(--font-primary) !important;
}

[data-theme="crm-modern"] .btn-primary,
[data-theme="crm-modern"] .btn-main,
[data-theme="crm-modern"] .btn[class*="primary"],
[data-theme="crm-modern"] .sidebar-card-btn,
[data-theme="crm-modern"] .send-btn {
  background: linear-gradient(135deg, #6f35f5, #a44dff) !important;
  border-color: rgba(201, 167, 255, 0.56) !important;
  color: #fff !important;
  box-shadow: 0 0 22px rgba(127, 75, 255, 0.34) !important;
}

[data-theme="crm-modern"] .badge,
[data-theme="crm-modern"] [class*="status"],
[data-theme="crm-modern"] .tag,
[data-theme="crm-modern"] .catalog-brand-btn,
[data-theme="crm-modern"] .tab,
[data-theme="crm-modern"] .tab-btn {
  background: rgba(238, 225, 184, 0.09) !important;
  border-color: rgba(238, 225, 184, 0.20) !important;
  color: #ead9a4 !important;
}

[data-theme="crm-modern"] .nav-item.active,
[data-theme="crm-modern"] .sidebar-nav li.active a,
[data-theme="crm-modern"] .tab.active,
[data-theme="crm-modern"] .tab-btn.active {
  background: rgba(238, 225, 184, 0.13) !important;
  border-color: rgba(238, 225, 184, 0.40) !important;
  color: #fff5d0 !important;
}

[data-theme="crm-modern"] .flow-line {
  stroke-width: 1.8;
  opacity: 0.46;
}

[data-theme="crm-modern"] .flow-line-b {
  opacity: 0.38;
}

[data-theme="crm-modern"] .flow-line-c {
  opacity: 0.30;
}

.crm-source-rail {
  position: fixed;
  top: 96px;
  right: 20px;
  bottom: 24px;
  width: min(270px, 21vw);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 0;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px);
  transition: opacity 260ms ease, transform 260ms ease, visibility 260ms ease;
}

.crm-live-flow-svg {
  position: fixed;
  inset: 0;
  z-index: 35;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.crm-flow-toggle {
  display: none !important;
}

[data-theme="crm-modern"] .crm-flow-toggle {
  display: inline-flex !important;
}

.live-flow-path {
  fill: none;
  stroke: url(#liveFlowWarm);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 8 14;
  filter: url(#liveFlowGlow);
  opacity: 0.92;
  animation: liveFlowTrace 4.8s linear infinite;
  animation-delay: calc(var(--flow-index, 0) * -120ms);
}

.live-flow-packet {
  fill: #f7efd3;
  filter: url(#liveFlowGlow);
  opacity: 1;
  stroke: rgba(120, 220, 232, 0.82);
  stroke-width: 1.2;
}

[data-theme="crm-modern"] body.crm-flow-map-enabled .crm-source-rail {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

[data-theme="crm-modern"] body.crm-flow-map-enabled .crm-live-flow-svg {
  opacity: 1;
  visibility: visible;
}

[data-theme="crm-modern"] .crm-flow-toggle.active {
  color: #fff5d0 !important;
  border-color: rgba(238, 225, 184, 0.48) !important;
  background: rgba(238, 225, 184, 0.16) !important;
  box-shadow: 0 0 18px rgba(238, 225, 184, 0.16) !important;
}

.source-rail-title,
.source-group-label {
  color: rgba(238, 225, 184, 0.48);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.source-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  gap: 1px 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(238, 225, 184, 0.10);
  border-radius: 9px;
  background: rgba(20, 20, 18, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 248, 220, 0.03);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.source-item::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(117, 111, 99, 0.72);
  box-shadow: none;
  transform: translateY(-50%);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.source-item span {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(120, 220, 232, 0.18);
  color: #d8fbff;
  font-size: 0.68rem;
  font-weight: 800;
}

.source-item strong {
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
}

.source-item small {
  color: var(--text-muted);
  font-size: 0.62rem;
}

.source-item.is-active {
  border-color: rgba(238, 225, 184, 0.22);
  opacity: 0.9;
}

.source-item.has-data strong {
  color: #ddd3b9;
}

.source-item.is-linked-now {
  border-color: rgba(238, 225, 184, 0.48);
  background: linear-gradient(180deg, rgba(37, 36, 32, 0.92), rgba(18, 18, 16, 0.9));
  box-shadow: 0 0 24px rgba(238, 225, 184, 0.09), inset 0 1px 0 rgba(255, 248, 220, 0.07);
  transform: translateX(-3px);
}

.source-item.is-linked-now::before {
  background: #f7efd3;
  box-shadow: 0 0 14px rgba(238, 225, 184, 0.82);
}

.source-item.is-linked-now span {
  box-shadow: 0 0 18px rgba(120, 220, 232, 0.24);
}

.source-item:nth-child(3n) span { background: rgba(238, 225, 184, 0.17); color: #f4df9f; }
.source-item:nth-child(4n) span { background: rgba(117, 215, 139, 0.16); color: #b5f0bf; }

[data-theme="crm-modern"] .crm-relation-orbit {
  display: none;
}

@media (max-width: 1280px) {
  [data-theme="crm-modern"] body.crm-flow-map-enabled .content-body {
    padding-right: var(--content-padding, 24px) !important;
  }
  .crm-source-rail {
    display: none;
  }
  .crm-live-flow-svg {
    display: none;
  }
}

@keyframes liveFlowTrace {
  to { stroke-dashoffset: -180; }
}
