/* Automazy Commercial Light — UI-only visual system matching Dark Mode hierarchy and soothing, non-glaring light palette. */
:root {
  --bg-primary: #e8edf4;
  --bg-secondary: #f4f8fc;
  --bg-tertiary: #edf2f8;
  --card-bg: #f4f8fc;
  --border-color: #d2deeb;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent-primary: #2563eb;
  --accent-secondary: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --danger: #ef4444;
  --warning: #f59e0b;
  --workspace-bg: #e8edf4;
  --workspace-surface: #f4f8fc;
  --workspace-surface-raised: #f8fafc;
  --workspace-surface-soft: #edf2f8;
  --workspace-border: #d2deeb;
  --workspace-border-strong: #c2d2e4;
  --workspace-text: #1e293b;
  --workspace-text-secondary: #475569;
  --workspace-text-muted: #64748b;
  --workspace-accent: #2563eb;
  --workspace-accent-strong: #1d4ed8;
  --workspace-accent-soft: #e0ecfb;
  --workspace-success: #10b981;
  --workspace-warning: #f59e0b;
  --workspace-danger: #ef4444;
  --workspace-radius-lg: 14px;
  --workspace-radius-md: 10px;
  --workspace-shadow: 0 4px 18px rgba(15, 23, 42, .04);
}
.hidden { display: none !important; }

body.light-theme {
  background: radial-gradient(ellipse 80% 58% at 67% -20%, rgba(210, 226, 245, .4), transparent 72%), #e8edf4 !important;
  color: #1e293b !important;
  color-scheme: light;
}

body.light-theme ::selection { background: #cfe3ff; color: #0b306e; }
body.light-theme * { scrollbar-color: #c5d1df transparent; }
body.light-theme *::-webkit-scrollbar { width: 8px; height: 8px; }
body.light-theme *::-webkit-scrollbar-track { background: transparent; }
body.light-theme *::-webkit-scrollbar-thumb { background: #c5d1df; border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
body.light-theme *::-webkit-scrollbar-thumb:hover { background: #aebdce; background-clip: padding-box; }

.app-layout { background: transparent !important; }
.main-wrapper { background: transparent !important; }
.content-container { padding: 28px 30px !important; background: transparent !important; }

/* Navigation: exact structural match to Dark Mode (256px width, 89px brand, 43px nav-btn). */
.sidebar {
  width: 256px !important;
  background: #edf2f8 !important;
  border-right: 1px solid #d2deeb !important;
  box-shadow: 2px 0 12px rgba(15, 23, 42, .03) !important;
}
.sidebar-brand {
  min-height: 89px !important;
  padding: 27px 24px 26px !important;
  gap: 12px !important;
  border-bottom: 1px solid #d8e2ee !important;
}
.brand-icon {
  width: 42px !important;
  height: 42px !important;
  background: #e0ecfb !important;
  color: #2563eb !important;
  box-shadow: none !important;
}
.brand-text h2 { color: #0f172a !important; font-size: 20px !important; font-weight: 700 !important; }
.brand-text span { color: #64748b !important; }
.sidebar-section-label,
.nav-divider { color: #64748b !important; }
.sidebar-section-label span,
.nav-divider span:last-child { color: #94a3b8 !important; }
.sidebar-menu { scrollbar-color: #cbd5e1 transparent; }
.sidebar .nav-btn {
  min-height: 43px !important;
  padding: 10px 13px !important;
  font-size: 12px !important;
  color: #475569 !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  font-weight: 500 !important;
  transition: background .18s, color .18s, border-color .18s;
}
.sidebar .nav-btn svg { stroke: #64748b !important; }
.sidebar .nav-btn:hover {
  background: #e2ebf6 !important;
  color: #0f172a !important;
}
.sidebar .nav-btn.active {
  background: linear-gradient(90deg, rgba(37,99,235,0.12), rgba(37,99,235,0.03)) !important;
  border-color: rgba(37,99,235,0.2) !important;
  color: #1d4ed8 !important;
  box-shadow: inset 2px 0 #2563eb !important;
  font-weight: 600 !important;
}
.sidebar .nav-btn.active svg { stroke: #1d4ed8 !important; }
.sidebar .badge {
  background: #2563eb !important;
  color: #fff !important;
  box-shadow: none !important;
}
.sidebar-footer { background: #e6edf6 !important; border-top-color: #d8e2ee !important; }
.sidebar-footer-heading { color: #64748b !important; }
.model-badge { background: #edf3fa !important; border: 1px solid #d2deeb !important; color: #475569 !important; }
.model-badge .dot { background: #10b981 !important; box-shadow: none !important; }

/* Top navigation: exact structural match to Dark Mode (76px min-height, 13px 34px padding). */
.topbar {
  min-height: 76px !important;
  padding: 13px 34px !important;
  background: rgba(237, 242, 248, .94) !important;
  border-bottom: 1px solid #d2deeb !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .03) !important;
  backdrop-filter: blur(16px) !important;
}
.topbar-kicker { color: #64748b !important; }
.topbar-kicker span { color: #94a3b8 !important; }
.topbar-left h1 { color: #0f172a !important; font-weight: 700 !important; }
.tenant-selector-wrap,
.profile-menu,
.toggle-pill,
.btn-topbar-sound,
.btn-topbar-pwa {
  background: #f4f8fc !important;
  border-color: #d0dceb !important;
  color: #1e293b !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .03) !important;
}
.tenant-select { background: #f4f8fc !important; color: #1e293b !important; }
.tenant-select option { background: #ffffff !important; color: #1e293b !important; }
.status-connected { background: #edf9f4 !important; color: #088a59 !important; border-color: #cdeedf !important; }
.state-active { color: #078757 !important; }
.btn-agent-test {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .2) !important;
}

/* Shared surfaces — soft soothing pearl-slate, eliminating harsh blinding white glare */
.card,
.provider-card,
.tenant-card,
.analytics-metric-card,
.pipeline-col,
.calendar-card,
.calendar-header-card,
.recovery-header-card,
.cal-kpi-card,
.cal-main-calendar-card,
.cal-day-detail-card,
.cal-all-appts-card,
.setup-panel,
.impact-card,
.dashboard-intro,
.dashboard-card,
.attention-panel,
.agent-status-panel,
.knowledge-layout,
.agent-config-card {
  background: #f4f8fc !important;
  border-color: #d2deeb !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .04) !important;
}
.card:hover,
.impact-card:hover,
.calendar-card:hover,
.cal-kpi-card:hover {
  border-color: #b8cde4 !important;
  box-shadow: 0 6px 22px rgba(15, 23, 42, .06) !important;
}
.workspace-view h1,
.workspace-view h2,
.workspace-view h3,
.workspace-view h4,
.dashboard-view h1,
.dashboard-view h2,
.dashboard-view h3,
.card h2,
.card h3,
.card h4 { color: #0f172a !important; }
.workspace-eyebrow { color: #146ef5 !important; letter-spacing: .09em !important; }
.workspace-view p,
.card p { color: #6f7d94 !important; }

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .2) !important;
}
.btn-primary:hover { background: #1d4ed8 !important; border-color: #1d4ed8 !important; transform: translateY(-1px); }
.btn-secondary {
  background: #eef3f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: none !important;
}
.btn-secondary:hover { background: #e2e8f0 !important; border-color: #94a3b8 !important; color: #0f172a !important; }

input,
textarea,
select,
.form-control {
  background: #fbfcfd !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
  box-shadow: none !important;
}
input::placeholder,
textarea::placeholder { color: #94a3b8 !important; }
input:focus,
textarea:focus,
select:focus,
.form-control:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
}
label { color: #334155 !important; }

/* Dashboard: outcome-first, clear analytics. */
.dashboard-intro {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 2px 0 10px !important;
}
.dashboard-intro h2 { color: #0f172a !important; }
.dashboard-intro em { color: #2563eb !important; }
.impact-heading h3 { color: #0f172a !important; }
.impact-source { color: #64748b !important; }
#view-dashboard .impact-card {
  min-height: 126px !important;
  background: #f4f8fc !important;
  border: 1px solid #d2deeb !important;
  border-radius: 14px !important;
  padding: 18px !important;
}
.impact-icon { background: #e0ecfb !important; border-color: #cfe0f5 !important; color: #2563eb !important; }
.impact-card .stat-value { color: #0f172a !important; }
.impact-card .stat-label { color: #475569 !important; font-size: 10px !important; }
.impact-card small { color: #64748b !important; }

/* Conversation workspace — matches dark mode structural elegance. */
.chat-container {
  height: calc(100vh - 153px) !important;
  background: #f4f8fc !important;
  border: 1px solid #d2deeb !important;
  box-shadow: 0 7px 28px rgba(15, 23, 42, .05) !important;
}
.chat-sidebar { background: #edf2f8 !important; border-right-color: #d2deeb !important; }
.chat-sidebar-header { background: #edf2f8 !important; border-bottom-color: #d2deeb !important; }
.chat-brand-tag { color: #0f172a !important; }
.chat-search { background: #e4ebf5 !important; border-color: #cbd5e1 !important; }
.chat-search input { background: transparent !important; color: #1e293b !important; }
.filter-chip { background: #e8edf4 !important; border-color: #cbd5e1 !important; color: #475569 !important; border-radius: 8px !important; }
.filter-chip:hover { background: #dbeafe !important; color: #2563eb !important; }
.filter-chip.active { background: #2563eb !important; border-color: #2563eb !important; color: #fff !important; }
.conv-list { background: #edf2f8 !important; }
.conv-item { background: #edf2f8 !important; border-bottom-color: #dbe4ef !important; }
.conv-item:hover { background: #e2ebf6 !important; }
.conv-item.active { background: #dbeafe !important; box-shadow: inset 3px 0 #2563eb !important; }
.conv-name { color: #0f172a !important; }
.conv-preview, .conv-time { color: #64748b !important; }
.conv-avatar { background: #e0ecfb !important; color: #2563eb !important; border-radius: 50% !important; }
.chat-main, .chat-empty-panel { background: #f8fafc !important; }
.chat-header { background: #edf2f8 !important; border-bottom-color: #d2deeb !important; }
.chat-contact-info h4 { color: #0f172a !important; }
.phone-tag, .online-indicator, .chat-contact-subline { color: #64748b !important; }
.chat-messages {
  background-color: #f8fafc !important;
  background-image: radial-gradient(rgba(37, 99, 235, .04) 1px, transparent 1px) !important;
  background-size: 25px 25px !important;
}
.bubble { box-shadow: 0 3px 10px rgba(15, 23, 42, .04) !important; }
.bubble-user { background: #fff !important; border-color: #e1e8f1 !important; color: #213451 !important; }
.bubble-agent { background: #eaf4ff !important; border-color: #c9e1ff !important; color: #173f76 !important; }
.bubble-human { background: #eef9f5 !important; border-color: #cdeee0 !important; color: #185c47 !important; }
.chat-input-bar { background: #fff !important; border-top-color: #dfe7f1 !important; }
.chat-input-bar input { background: #fff !important; border-color: #dbe5f0 !important; color: #203451 !important; }
.chat-tool-btn { color: #61728d !important; }
.chat-send-btn { background: #146ef5 !important; color: #fff !important; }

/* Light mode voice recording and preview */
.chat-recording-bar {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}
.btn-rec-cancel {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}
.btn-rec-cancel:hover {
  background: #ef4444 !important;
  color: #fff !important;
}
.recording-timer {
  color: #b91c1c !important;
}
.recording-hint {
  color: #64748b !important;
}
.btn-rec-stop {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
.btn-rec-stop:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
.chat-media-preview-bar {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
.media-filename {
  color: #0f172a !important;
}
.media-caption-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
.media-caption-input:focus {
  border-color: #146ef5 !important;
}

/* Pipeline */
.pipeline-metrics-bar,
.pipeline-copilot-card { background: #fff !important; border-color: #e2e9f2 !important; box-shadow: 0 5px 18px rgba(28,50,88,.04) !important; }
.pipe-metric-box { background: #fff !important; border-color: #e2e9f2 !important; box-shadow: 0 4px 16px rgba(31,53,87,.045) !important; }
.pipe-metric-box .lbl { color: #607291 !important; font-weight: 600 !important; }
.pipe-metric-box .val { color: #101b3b !important; font-weight: 700 !important; }

/* Dedicated high-contrast styling per metric card */
.pipe-metric-box.pipe-metric-hot { background: #fff5f5 !important; border-color: #fecaca !important; }
.pipe-metric-box.pipe-metric-hot .lbl { color: #b91c1c !important; }
.pipe-metric-box.pipe-metric-hot .val { color: #dc2626 !important; }

.pipe-metric-box.pipe-metric-qualifying { background: #f0f9ff !important; border-color: #bae6fd !important; }
.pipe-metric-box.pipe-metric-qualifying .lbl { color: #0369a1 !important; }
.pipe-metric-box.pipe-metric-qualifying .val { color: #0284c7 !important; }

.pipe-metric-box.pipe-metric-negotiation { background: #fefce8 !important; border-color: #fef08a !important; }
.pipe-metric-box.pipe-metric-negotiation .lbl { color: #a16207 !important; }
.pipe-metric-box.pipe-metric-negotiation .val { color: #ca8a04 !important; }

.pipe-metric-box.pipe-metric-customer { background: #f0fdf4 !important; border-color: #bbf7d0 !important; }
.pipe-metric-box.pipe-metric-customer .lbl { color: #15803d !important; }
.pipe-metric-box.pipe-metric-customer .val { color: #16a34a !important; }

.pipe-metric-box.pipe-metric-human { background: #fff7ed !important; border-color: #fed7aa !important; }
.pipe-metric-box.pipe-metric-human .lbl { color: #c2410c !important; }
.pipe-metric-box.pipe-metric-human .val { color: #ea580c !important; }

.pipe-metric-box.pipe-metric-stalled { background: #f8fafc !important; border-color: #e2e8f0 !important; }
.pipe-metric-box.pipe-metric-stalled .lbl { color: #475569 !important; }
.pipe-metric-box.pipe-metric-stalled .val { color: #64748b !important; }

.pipe-metric-box.pipe-metric-value { background: #eff6ff !important; border-color: #bfdbfe !important; }
.pipe-metric-box.pipe-metric-value .lbl { color: #1d4ed8 !important; }
.pipe-metric-box.pipe-metric-value .val { color: #2563eb !important; }

.copilot-spark { background: #eaf3ff !important; color: #146ef5 !important; }
.copilot-content h4 { color: #152442 !important; }
.copilot-alert-pill { color: #66758d !important; }
.pipeline-board { gap: 12px !important; }
#view-leads .pipeline-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: 0 !important;
  overflow: visible !important;
  padding-bottom: 16px !important;
  align-items: start !important;
}
#view-leads .pipeline-col { min-width: 0 !important; width: auto !important; max-width: none !important; height: clamp(360px, calc(100vh - 390px), 620px) !important; background: #f6f8fb !important; border-color: #dce5ef !important; box-shadow: none !important; }
.pipeline-col-header { background: #fff !important; border-bottom-color: #e5ebf3 !important; }
.pipeline-col-header .col-title { color: #243452 !important; }
.pipeline-col-header .col-sum { color: #66758e !important; }
#view-leads .pipeline-col-header .col-badge { background: #eaf3ff !important; color: #176bd8 !important; }
#view-leads .pipeline-cards-list { padding: 10px !important; gap: 8px !important; }
#view-leads .lead-card-rich { background: #fff !important; border-color: #dbe4ef !important; box-shadow: 0 3px 10px rgba(31,53,87,.045) !important; }
#view-leads .lead-card-rich:hover { border-color: #9fc3ef !important; box-shadow: 0 8px 18px rgba(31,53,87,.09) !important; }
#view-leads .lead-card-name { color: #1c2d49 !important; font-weight: 700 !important; }
#view-leads .lead-card-phone,
#view-leads .lead-timer { color: #61718a !important; }
#view-leads .lead-card-rich [style*="color:#9cb1c2"] { color: #536781 !important; }
#view-leads .lead-card-bottom { border-top-color: #e7edf4 !important; }
#view-leads .lead-val { color: #0b8f5a !important; }
#view-leads .temp-pill.warm { background: #fff6df !important; border-color: #edc56d !important; color: #9a6800 !important; }
#view-leads .temp-pill.hot { background: #fff0f1 !important; border-color: #f0b5bc !important; color: #c43d4d !important; }
#view-leads .temp-pill.cold { background: #eaf7ff !important; border-color: #abd9f4 !important; color: #176d9e !important; }
#view-leads .lead-agent-badge.ai { background: #e9f8f4 !important; color: #087e64 !important; }
#view-leads .lead-agent-badge.human { background: #fff0f2 !important; color: #c43e52 !important; }
#view-leads .kb-cat-chip { background: #fff !important; border-color: #d7e1ed !important; color: #586a84 !important; }
#view-leads .kb-cat-chip.active,
#view-leads .kb-cat-chip:hover { background: #eaf3ff !important; border-color: #9ec2ef !important; color: #146ef5 !important; }
#view-leads .kb-actions-right .btn-secondary { background: #fff !important; border-color: #d5e0ec !important; color: #344967 !important; }
#view-leads .kb-actions-right .btn-primary { background: #146ef5 !important; border-color: #146ef5 !important; color: #fff !important; }

/* LEAD DETAIL DRAWER & CRM MODALS (COMMERCIAL LIGHT) */
.drawer-backdrop { background: rgba(15, 23, 42, 0.45) !important; backdrop-filter: blur(6px) !important; }
.drawer-panel {
  background: #ffffff !important;
  border-left: 1px solid #dce5f0 !important;
  box-shadow: -12px 0 40px rgba(16, 27, 59, 0.12) !important;
  color: #101b3b !important;
}
.drawer-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e3eaf3 !important;
  padding: 18px 24px !important;
}
.drawer-header h3 { color: #101b3b !important; font-weight: 700 !important; font-size: 18px !important; }
.drawer-header p { color: #687795 !important; font-size: 12.5px !important; }
.drawer-subbar {
  background: #f6f8fc !important;
  border-bottom: 1px solid #e3eaf3 !important;
  padding: 14px 24px !important;
  display: flex !important;
  gap: 14px !important;
  align-items: flex-end !important;
  flex-wrap: wrap !important;
}
.drawer-subbar-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #4b5d7e !important;
  display: block !important;
  margin-bottom: 5px !important;
}
.drawer-subbar select,
.drawer-subbar input {
  background: #ffffff !important;
  border: 1px solid #d7e1ed !important;
  color: #101b3b !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
}
.drawer-tabs {
  background: #f0f4f9 !important;
  border-bottom: 1px solid #e3eaf3 !important;
  padding: 8px 24px !important;
  gap: 6px !important;
}
.drawer-tab-btn {
  color: #607291 !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  transition: all 0.15s ease !important;
}
.drawer-tab-btn:hover {
  color: #146ef5 !important;
  background: rgba(20, 110, 245, 0.06) !important;
}
.drawer-tab-btn.active {
  background: #ffffff !important;
  border-color: #cbdcf4 !important;
  color: #146ef5 !important;
  box-shadow: 0 2px 8px rgba(20, 110, 245, 0.08) !important;
}
.drawer-body {
  background: #ffffff !important;
  color: #101b3b !important;
  padding: 24px !important;
}
.drawer-box {
  background: #f7f9fc !important;
  border: 1px solid #e1e9f4 !important;
  border-radius: 12px !important;
  padding: 16px !important;
  box-shadow: 0 2px 8px rgba(20, 40, 70, 0.02) !important;
}
.drawer-box-title {
  color: #146ef5 !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  margin-bottom: 10px !important;
}
.drawer-footer {
  background: #f7f9fc !important;
  border-top: 1px solid #e3eaf3 !important;
  padding: 16px 24px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.timeline-stream::before { background: #e2eaf4 !important; }
.timeline-dot { background: #ffffff !important; border: 2px solid #146ef5 !important; }
.timeline-card {
  background: #f8fafc !important;
  border: 1px solid #e2eaf4 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  box-shadow: 0 2px 6px rgba(20, 40, 70, 0.02) !important;
}
.timeline-card-header strong { color: #101b3b !important; font-size: 13px !important; font-weight: 700 !important; }
.timeline-card-header span { color: #7889a2 !important; font-size: 11.5px !important; }
.timeline-card p { color: #364866 !important; font-size: 12.5px !important; margin: 4px 0 0 0 !important; line-height: 1.5 !important; }

.task-item-row {
  background: #f8fafc !important;
  border: 1px solid #e2eaf4 !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  margin-bottom: 8px !important;
  box-shadow: 0 2px 6px rgba(20, 40, 70, 0.02) !important;
}
.task-item-row .task-title { color: #101b3b !important; font-size: 13px !important; font-weight: 600 !important; }
.task-item-row .task-due { color: #6b7c96 !important; font-size: 11px !important; display: block !important; margin-top: 2px !important; }
.task-item-row .task-notes { color: #7889a2 !important; font-size: 11.5px !important; display: block !important; }
.task-item-row.done { opacity: 0.65 !important; background: #f1f5fa !important; }
.task-item-row.done .task-title { text-decoration: line-through !important; color: #7889a2 !important; }

.drawer-field-group label { color: #2e3f5e !important; font-size: 12px !important; font-weight: 600 !important; }
.drawer-field-input {
  background: #ffffff !important;
  border: 1px solid #dce5f0 !important;
  color: #101b3b !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 12.5px !important;
  width: 100% !important;
}
.drawer-empty-state {
  color: #73849e !important;
  font-size: 12.5px !important;
  text-align: center !important;
  padding: 22px 16px !important;
  background: #f8fafc !important;
  border-radius: 10px !important;
  border: 1px dashed #dce5f0 !important;
}
.drawer-note-item {
  background: #f8fafc !important;
  border: 1px solid #e2eaf4 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  margin-bottom: 10px !important;
}
.drawer-note-item span { color: #7889a2 !important; font-size: 11px !important; }
.drawer-note-item p { color: #1d2c47 !important; font-size: 13px !important; margin: 4px 0 0 0 !important; line-height: 1.5 !important; }

.modal-form-box {
  background: #f7f9fc !important;
  border: 1px solid #e1e9f4 !important;
  border-radius: 12px !important;
  padding: 16px !important;
}
.modal-form-box-title { color: #146ef5 !important; font-size: 13.5px !important; font-weight: 700 !important; margin-bottom: 10px !important; }
#stages-manager-list > div,
#custom-fields-list > div {
  background: #f8fafc !important;
  border: 1px solid #e2eaf4 !important;
  border-radius: 10px !important;
  color: #101b3b !important;
  margin-bottom: 8px !important;
}
#stages-manager-list strong,
#custom-fields-list strong { color: #101b3b !important; }
#stages-manager-list small,
#custom-fields-list small { color: #687795 !important; }

/* Contacts: explicit contrast to prevent dark-theme inline values from disappearing. */
#view-contacts .card { padding: 20px 22px !important; }
#view-contacts .table-header { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 16px !important; flex-wrap: wrap !important; margin-bottom: 15px !important; }
#view-contacts .table-header h3 { color: #152442 !important; font-size: 19px !important; }
#view-contacts #contact-search { width: min(100%, 340px) !important; min-height: 40px !important; padding: 9px 12px !important; background: #fff !important; border: 1px solid #d5e0ec !important; border-radius: 9px !important; color: #223651 !important; }
#view-contacts #contact-search::placeholder { color: #8391a6 !important; opacity: 1 !important; }
#view-contacts .table-responsive { overflow-x: auto !important; border: 1px solid #e0e8f1 !important; border-radius: 10px !important; }
#view-contacts .data-table { min-width: 900px !important; }
#view-contacts .data-table th { background: #f3f6fa !important; color: #586981 !important; border-bottom-color: #dce5ef !important; }
#view-contacts .data-table td { color: #4f6078 !important; border-bottom-color: #e5ebf2 !important; }
#view-contacts .data-table tbody tr:hover { background: #f8fbff !important; }
#view-contacts .data-table td strong,
#view-contacts .data-table td span[style*="color:#e9edef"] { color: #1d2f4c !important; }
#view-contacts .pill-stage { background: #eaf3ff !important; border-color: #c8dcf7 !important; color: #1768cf !important; }
#view-contacts .badge-lid-sm { background: #eaf8ff !important; border-color: #b8ddf1 !important; color: #1676a9 !important; }
#view-contacts .btn-table-action { background: #edf9f5 !important; border-color: #bce3d4 !important; color: #07845d !important; }
#view-contacts .data-table .btn-secondary { background: #fff !important; border-color: #ccdaea !important; color: #314965 !important; }
#view-contacts .data-table .btn-secondary:hover { background: #edf5ff !important; border-color: #9bbfec !important; color: #146ef5 !important; }

/* Calendar — soft soothing tones, perfect layout alignment with Dark Mode */
#view-calendar .calendar-header-card,
#view-campaigns .calendar-header-card {
  background: #f4f8fc !important;
  border: 1px solid #d2deeb !important;
}
#view-calendar .cal-kpi-card {
  background: #f4f8fc !important;
  border: 1px solid #d2deeb !important;
  border-radius: 13px !important;
}
#view-calendar .cal-kpi-val { color: #0f172a !important; }
#view-calendar .cal-kpi-label { color: #475569 !important; }
#view-calendar .cal-kpi-icon { background: #e0ecfb !important; color: #2563eb !important; border-color: #cfe0f5 !important; }

#view-calendar .cal-main-calendar-card,
#view-calendar .cal-day-detail-card,
#view-calendar .cal-all-appts-card {
  background: #f4f8fc !important;
  border: 1px solid #d2deeb !important;
}

.cal-nav-bar { border-bottom-color: #d2deeb !important; }
.cal-nav-buttons { background: #e4ebf5 !important; border: 1px solid #cbd5e1 !important; }
.cal-nav-btn { color: #334155 !important; }
.cal-nav-btn:hover { background: #dbeafe !important; color: #1d4ed8 !important; }
.cal-nav-today-btn { border-left-color: #cbd5e1 !important; border-right-color: #cbd5e1 !important; }

.cal-weekday,
#view-calendar .cal-weekdays-grid { color: #64748b !important; font-weight: 700 !important; }

#view-calendar .cal-day-cell {
  background: #edf2f8 !important;
  border-color: #d8e3ef !important;
  color: #1e293b !important;
}
#view-calendar .cal-day-cell:hover {
  background: #e2ebf6 !important;
  border-color: #93c5fd !important;
}
#view-calendar .cal-day-cell.selected {
  background: #dbeafe !important;
  border-color: #3b82f6 !important;
  box-shadow: inset 0 0 0 1.5px #2563eb !important;
}
#view-calendar .cal-day-number { color: #475569 !important; font-weight: 700 !important; }
#view-calendar .cal-day-cell.other-month { background: #e8edf4 !important; opacity: .5 !important; }
#view-calendar .cal-day-cell.other-month .cal-day-number { color: #94a3b8 !important; }
#view-calendar .cal-day-cell.selected .cal-day-number { color: #1d4ed8 !important; }
#view-calendar .cal-day-cell.today .cal-day-number { background: #2563eb !important; color: #fff !important; }

#view-calendar .cal-section-box {
  background: #edf3fa !important;
  border-color: #d2deeb !important;
}
#view-calendar .cal-slot-btn {
  background: #fbfcfd !important;
  border-color: #cbd5e1 !important;
  color: #2563eb !important;
}
.cal-slot-btn:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

.cal-day-appt-card {
  background: #edf3fa !important;
  border: 1px solid #d0deee !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}
.cal-day-appt-card:hover {
  background: #e4edf7 !important;
  border-color: #b8cde4 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08) !important;
}
body.light-theme .cal-appt-time-pill {
  background: #e0ecfb !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}
body.light-theme .cal-appt-status-badge.is-confirmed {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}
body.light-theme .cal-appt-status-badge.is-other {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
}
body.light-theme .cal-appt-lead-name {
  color: #0f172a !important;
}
body.light-theme .cal-appt-lead-meta,
body.light-theme .cal-appt-lead-phone {
  color: #475569 !important;
}
body.light-theme .cal-appt-summary-chip {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

.cal-appt-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

body.light-theme .cal-appt-btn-cancel {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fcd34d !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
}
body.light-theme .cal-appt-btn-cancel:hover {
  background: #fde68a !important;
  color: #92400e !important;
  border-color: #f59e0b !important;
}
body.light-theme .cal-appt-btn-delete {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
}
body.light-theme .cal-appt-btn-delete:hover {
  background: #fecaca !important;
  color: #991b1b !important;
  border-color: #ef4444 !important;
}
body.light-theme .cal-day-appt-card .meet-link-btn {
  background: #e0ecfb !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
}
body.light-theme .cal-day-appt-card .meet-link-btn:hover {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}
body.light-theme #cal-selected-day-title,
body.light-theme #cal-current-month-label { color: #0f172a !important; }
#view-calendar .calendar-header-card .btn-primary { background: #2563eb !important; border-color: #2563eb !important; }

/* Table action buttons in Light Mode */
body.light-theme .text-action {
  cursor: pointer !important;
  font-weight: 600 !important;
  transition: opacity 0.15s ease !important;
}
body.light-theme .text-action:hover {
  opacity: 0.8 !important;
  text-decoration: underline !important;
}

/* Universal Confirm Dialog Light Theme overrides */
body.light-theme #modal-app-confirm,
body.light-theme .app-confirm-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
body.light-theme .app-confirm-backdrop.hidden {
  display: none !important;
}
body.light-theme .app-confirm-dialog {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22) !important;
  color: #0f172a !important;
}
body.light-theme .app-confirm-title { color: #0f172a !important; }
body.light-theme .app-confirm-message { color: #475569 !important; }
body.light-theme .app-confirm-btn-cancel {
  background: #eef3f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
body.light-theme .app-confirm-btn-cancel:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Recovery: soft soothing tones and clear hierarchy */
#view-recovery .recovery-card { background: #f4f8fc !important; border-color: #d2deeb !important; box-shadow: 0 4px 18px rgba(15, 23, 42, .04) !important; }
#view-recovery .recovery-card-header { background: #edf2f8 !important; border-bottom-color: #d2deeb !important; }
#view-recovery .recovery-card-header h4 { color: #0f172a !important; font-size: 14px !important; }
#view-recovery .recovery-card-header > span[style] { color: #64748b !important; }
#view-recovery .step-number { background: #e0ecfb !important; border-color: #bfdbfe !important; color: #2563eb !important; }
#view-recovery .recovery-card-body > p[style] { color: #475569 !important; }
#view-recovery .recovery-delay-panel { background: #edf3fa !important; border-color: #d2deeb !important; }
#view-recovery .recovery-delay-panel strong[style] { color: #0f172a !important; }
#view-recovery .recovery-delay-panel span[style] { color: #64748b !important; }
#view-recovery .recovery-textarea,
#view-recovery input,
#view-recovery select { background: #fbfcfd !important; border-color: #cbd5e1 !important; color: #1e293b !important; }
#view-recovery .recovery-textarea::placeholder,
#view-recovery input::placeholder { color: #94a3b8 !important; opacity: 1 !important; }
#view-recovery .recovery-url-box { background: #edf3fa !important; border-color: #d2deeb !important; }
#view-recovery .recovery-url-box input { color: #1d4ed8 !important; }
#view-recovery .mode-radio-card { background: #f4f8fc !important; border-color: #d2deeb !important; }
#view-recovery .mode-radio-card:has(input:checked) { background: #e0edfe !important; border-color: #60a5fa !important; }
#view-recovery .mode-radio-card strong[style],
#view-recovery #recovery-ai-config-pane > label[style] { color: #0f172a !important; }
#view-recovery .mode-radio-card span[style],
#view-recovery #recovery-ai-config-pane > span[style] { color: #64748b !important; }
#view-recovery .btn-primary { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important; border-color: #1d4ed8 !important; color: #fff !important; }
#view-recovery .btn-secondary { background: #eef3f9 !important; border-color: #cbd5e1 !important; color: #334155 !important; }
#view-recovery .btn-secondary:hover { background: #e2e8f0 !important; border-color: #94a3b8 !important; color: #0f172a !important; }
#view-recovery .plat-badge { background: #edf2f8 !important; border-color: #d2deeb !important; color: #475569 !important; }
#view-recovery .btn-link-action { color: #2563eb !important; }

/* Conversation header: preserve readable identity and actions at narrower desktop widths. */
.chat-header { min-height: 70px !important; height: auto !important; padding: 10px 14px !important; gap: 12px !important; }
.chat-header-user { min-width: 0 !important; flex: 1 1 230px !important; overflow: hidden !important; }
.chat-contact-info { min-width: 0 !important; overflow: hidden !important; }
.chat-contact-info h4 { color: #0f172a !important; font-weight: 700 !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.chat-contact-subline { min-width: 0 !important; overflow: hidden !important; white-space: nowrap !important; }
.phone-tag { min-width: 0 !important; overflow: hidden !important; text-overflow: ellipsis !important; color: #64748b !important; }
.chat-controls { min-width: 0 !important; display: flex !important; justify-content: flex-end !important; align-items: center !important; gap: 7px !important; flex-wrap: wrap !important; }
.chat-controls .btn { min-height: 36px !important; padding: 7px 12px !important; white-space: nowrap !important; }
.attendant-pill { max-width: 190px !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }

@media (max-width: 1600px) and (min-width: 901px) {
  .chat-header-user { max-width: 245px !important; }
  .chat-controls .pill-stage,
  .chat-controls .pill-ai { display: none !important; }
  .chat-controls .attendant-pill { max-width: 160px !important; }
}

/* Installation remains available in the header without covering operational content. */
.pwa-mobile-banner { display: none !important; }

/* Campaigns, recovery and knowledge */
#view-campaigns .campaign-monitoring-grid .calendar-card { background: #f4f8fc !important; border-color: #d2deeb !important; box-shadow: 0 4px 18px rgba(15, 23, 42, .04) !important; }
#view-campaigns .campaign-monitoring-grid .calendar-card:hover { border-color: #b8cde4 !important; }
#view-campaigns .campaign-monitoring-grid .calendar-card > div[style] { color: #0f172a !important; }
#view-campaigns .calendar-header-card .btn-primary { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important; border-color: #1d4ed8 !important; color: #fff !important; }
#view-campaigns #campaign-live-hud { background: #f4f8fc !important; border-color: #d2deeb !important; box-shadow: 0 4px 18px rgba(15, 23, 42, .04) !important; }
#view-campaigns #campaign-live-hud h4[style] { color: #0f172a !important; }
#view-campaigns #campaign-live-hud span[style] { color: #64748b !important; }
#view-campaigns .mode-selector-group { background: #edf2f8 !important; border: 1px solid #d2deeb !important; }
#view-campaigns .mode-pill-btn { background: transparent !important; color: #64748b !important; }
#view-campaigns .mode-pill-btn.active { background: #e0ecfb !important; color: #2563eb !important; }
#view-campaigns .calendar-card-header,
#view-campaigns .calendar-card-header[style] { background: #edf2f8 !important; border-bottom-color: #d2deeb !important; }
#view-campaigns .calendar-card-header h4[style] { color: #0f172a !important; }
#view-campaigns .recovery-table thead tr[style],
#view-campaigns .recovery-table th { background: #edf2f8 !important; border-color: #d2deeb !important; color: #475569 !important; }
.campaign-ai-builder { background: #edf3fa !important; border-color: #d0deee !important; }
.campaign-ai-builder h4,
.campaign-review-head h4 { color: #0f172a !important; }
.campaign-ai-builder p { color: #64748b !important; }
.campaign-idea-chips button,
.campaign-advanced-toggle { background: #fbfcfd !important; border-color: #cbd5e1 !important; color: #475569 !important; }
.campaign-idea-chips button:hover { border-color: #3b82f6 !important; color: #2563eb !important; }
.knowledge-layout,
.knowledge-list,
.knowledge-editor { background: #f4f8fc !important; border-color: #d2deeb !important; }
.knowledge-item { background: #edf2f8 !important; border-color: #d2deeb !important; }
.knowledge-item:hover, .knowledge-item.active { background: #e0ecfb !important; border-color: #93c5fd !important; }

/* Tables */
.table-responsive { background: #f4f8fc !important; border-color: #d2deeb !important; }
.recovery-table,
.workspace-view .recovery-table { background: #f4f8fc !important; color: #334155 !important; }
.recovery-table thead tr,
.workspace-view .recovery-table thead tr { background: #edf2f8 !important; }
.recovery-table th,
.workspace-view .recovery-table th { color: #475569 !important; border-bottom-color: #d2deeb !important; }
.recovery-table td,
.workspace-view .recovery-table td { color: #334155 !important; border-bottom-color: #e2e8f0 !important; }
.workspace-view .recovery-table tr:hover td { background: #eef4fb !important; }

/* Modals */
.modal-backdrop { background: rgba(15, 23, 42, .48) !important; backdrop-filter: blur(8px) !important; }
.modal-card {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .22) !important;
}
.modal-header { background: #edf2f8 !important; border-bottom-color: #d2deeb !important; }
.modal-header h3 { color: #0f172a !important; }
.modal-header p { color: #64748b !important; }
.modal-body { background: #f8fafc !important; }
.modal-body > div[style*="background:#090e15"],
.modal-body div[style*="background:#090e15"] { background: #edf3fa !important; border-color: #d2deeb !important; }
.modal-body h4 { color: #0f172a !important; }
.close-btn { color: #64748b !important; }

/* Neutralize common dark inline declarations inside operational views. */
.workspace-view [style*="color:#f8fafc"],
.workspace-view [style*="color:#f1f5f9"],
.workspace-view [style*="color:#e2e8f0"],
.workspace-view [style*="color:#cbd5e1"],
#view-agent-center [style*="color:#f8fafc"],
#view-agent-center [style*="color:#f1f5f9"],
#view-agent-center [style*="color:#edf5fc"],
#view-agent-center [style*="color:#e2e8f0"],
#view-agent-center [style*="color:#e2f0fb"],
#view-agent-center [style*="color:#cbd5e1"],
.modal-card [style*="color:#f8fafc"],
.modal-card [style*="color:#f1f5f9"],
.modal-card [style*="color:#e2e8f0"],
.modal-card [style*="color:#cbd5e1"] { color: #0f172a !important; }

.workspace-view [style*="color:#94a3b8"],
.workspace-view [style*="color:#8fa6b8"],
#view-agent-center [style*="color:#94a3b8"],
#view-agent-center [style*="color:#8fa6b8"],
#view-agent-center [style*="color:#64748b"],
.modal-card [style*="color:#94a3b8"],
.modal-card [style*="color:#8fa6b8"] { color: #334155 !important; }

@media (max-width: 980px) {
  .content-container { padding: 18px !important; }
  .topbar { min-height: 66px !important; }
  #view-calendar .cal-interactive-layout,
  #view-recovery .recovery-grid { grid-template-columns: 1fr !important; }
  #view-calendar .cal-month-days-grid { grid-auto-rows: 62px !important; }
}

@media (max-width: 1200px) and (min-width: 901px) {
  .topbar { min-height: 70px !important; padding: 9px 16px !important; gap: 10px !important; }
  .topbar-left { min-width: 0 !important; flex-wrap: nowrap !important; gap: 9px !important; }
  .topbar-kicker,
  .tenant-label,
  #btn-pwa-install,
  #wa-status-pill,
  #global-ai-toggle,
  .user-meta-info,
  .btn-logout { display: none !important; }
  .topbar-left h1 { flex: 0 1 auto !important; max-width: 170px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  .tenant-selector-wrap { min-width: 0 !important; margin-left: 0 !important; padding: 4px 5px !important; }
  .tenant-select { width: 150px !important; min-width: 150px !important; max-width: 150px !important; }
  #btn-new-tenant { display: none !important; }
  .topbar-right { flex: 0 0 auto !important; gap: 7px !important; }
  .user-profile-pill { padding: 4px !important; min-width: 40px !important; }
}

@media (max-width: 900px) {
  #page-title { color: #172443 !important; }
  .btn-mobile-menu { background: #172443 !important; border-color: #172443 !important; color: #fff !important; }
  .sidebar-tenant-box { background: #f5f8fc !important; border-color: #dce5ef !important; }
  .sidebar-tenant-label { color: #68778f !important; }
  .sidebar-btn-new-tenant { background: #eaf3ff !important; border-color: #c7dcf8 !important; color: #146ef5 !important; }
  .sidebar-tenant-select { background: #fff !important; border-color: #d4dfec !important; color: #223451 !important; }
  #view-conversations .chat-header { min-height: 64px !important; max-height: none !important; height: auto !important; background: #fff !important; border-bottom-color: #dfe7f1 !important; padding: 8px 10px !important; }
  #view-conversations .btn-chat-back { background: #f3f6fa !important; border-color: #d7e1ed !important; color: #334966 !important; }
  #view-conversations .chat-header-user { max-width: calc(100% - 150px) !important; }
  #view-conversations .chat-contact-info h4,
  #view-conversations .chat-contact-subline { max-width: 100% !important; }
  #view-conversations .chat-controls .pill-stage,
  #view-conversations .chat-controls .pill-ai,
  #view-conversations .chat-controls .attendant-pill,
  #view-conversations #btn-transfer-conv { display: none !important; }
  #view-conversations .chat-controls .btn { min-height: 34px !important; height: 34px !important; padding: 5px 9px !important; font-size: 11px !important; }
  #view-conversations .chat-sidebar,
  #view-conversations .chat-sidebar-header,
  #view-conversations .conv-list { background: #fff !important; }
  #view-conversations .chat-input-bar { background: #fff !important; border-top-color: #dfe7f1 !important; }
}

@media (max-width: 720px) {
  .content-container { padding: 12px !important; }
  .chat-container { height: calc(100vh - 118px) !important; border-radius: 12px !important; }
  .calendar-header-card,
  .recovery-header-card { border-radius: 12px !important; }
  #view-calendar .cal-month-days-grid { grid-auto-rows: 50px !important; }
  #view-calendar .cal-day-cell { min-height: 50px !important; }
  #view-recovery .recovery-header-info > div { flex-direction: column !important; gap: 4px !important; }
}

/* ========================================================================
   Full tab audit — remove remaining dark-theme leakage and low contrast.
   These rules are deliberately scoped per view so application logic and
   reusable components keep their original behavior.
   ======================================================================== */

/* Conversations: empty state was almost white-on-white. */
#view-conversations .chat-main,
#view-conversations .chat-empty-state { background: #f8fafc !important; }
#view-conversations .chat-empty-state h3,
#view-conversations .wa-web-splash h3 { color: #0f172a !important; opacity: 1 !important; }
#view-conversations .chat-empty-state p,
#view-conversations .wa-web-splash p { color: #64748b !important; opacity: 1 !important; }
#view-conversations .chat-empty-icon,
#view-conversations .wa-splash-icon { background: #e0ecfb !important; border-color: #bfdbfe !important; color: #2563eb !important; }
#view-conversations .wa-splash-icon svg { stroke: #2563eb !important; }
#view-conversations .chat-attendant-filter-bar { background: #edf2f8 !important; border-color: #d2deeb !important; }
#view-conversations #conv-attendant-select { background: #fbfcfd !important; border-color: #cbd5e1 !important; color: #1e293b !important; }

/* Team & attendants. */
#view-team .team-grid { grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)) !important; }
#view-team .team-card { background: #f4f8fc !important; border-color: #d2deeb !important; box-shadow: 0 4px 18px rgba(15, 23, 42, .04) !important; min-width: 0 !important; }
#view-team .team-card:hover { border-color: #b8cde4 !important; box-shadow: 0 8px 24px rgba(15, 23, 42, .07) !important; }
#view-team .team-card-avatar { background: #e0ecfb !important; border-color: #bfdbfe !important; color: #2563eb !important; }
#view-team .team-card-info h4,
#view-team .team-card-meta-val { color: #0f172a !important; }
#view-team .team-card-info p,
#view-team .team-card-meta-label { color: #64748b !important; }
#view-team .team-card-body { border-color: #d2deeb !important; }

/* Multi-tenant cards. */
#view-tenants .tenants-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 365px)) !important; }
#view-tenants .tenant-card { background: #f4f8fc !important; border-color: #d2deeb !important; box-shadow: 0 4px 18px rgba(15, 23, 42, .04) !important; min-width: 0 !important; }
#view-tenants .tenant-card.active-tenant { border-color: #3b82f6 !important; box-shadow: 0 0 0 2px rgba(37, 99, 235, .15) !important; }
#view-tenants .tenant-card-title { color: #0f172a !important; }
#view-tenants .tenant-card-slug { color: #64748b !important; }
#view-tenants .tenant-card-details { background: #edf2f8 !important; border-color: #d2deeb !important; color: #475569 !important; }
#view-tenants .tenant-card-details span,
#view-tenants .tenant-card-details strong { color: #1e293b !important; }
#view-tenants .tenant-card-details [style*="color:#38bdf8"] { color: #2563eb !important; }

/* Agent center: professional light workspace and usable tab rail. */
#view-agent-center .agent-center-container { gap: 16px !important; min-width: 0 !important; }
#view-agent-center .agent-header-bar,
#view-agent-center .wizard-hero-box,
#view-agent-center .dynamic-segment-box,
#view-agent-center .menu-option-row { background: #f4f8fc !important; border-color: #d2deeb !important; box-shadow: 0 4px 18px rgba(15, 23, 42, .04) !important; }
#view-agent-center .wizard-hero-box::before { background: radial-gradient(circle, rgba(37, 99, 235, .08), transparent 70%) !important; }
#view-agent-center .agent-header-bar h3,
#view-agent-center .wizard-title,
#view-agent-center .subtab-header h3,
#view-agent-center label[style] { color: #0f172a !important; font-weight: 700 !important; }
#view-agent-center .agent-header-bar span[style*="color:#8fa6b8"],
#view-agent-center .wizard-subtitle,
#view-agent-center .subtab-header p { color: #475569 !important; line-height: 1.5 !important; }
#view-agent-center .mode-selector-group { background: #edf2f8 !important; border-color: #d2deeb !important; }
#view-agent-center .mode-pill-btn { color: #64748b !important; }
#view-agent-center .mode-pill-btn:hover { background: #e0ecfb !important; color: #2563eb !important; }
#view-agent-center .mode-pill-btn.active { background: #e0edfe !important; color: #2563eb !important; border-color: #60a5fa !important; box-shadow: 0 2px 8px rgba(37, 99, 235, .1) !important; }
#view-agent-center .agent-subtabs { border-bottom-color: #d2deeb !important; overflow-x: auto !important; scrollbar-width: thin !important; padding-bottom: 9px !important; }
#view-agent-center .agent-subtab-btn { flex: 0 0 auto !important; background: #edf2f8 !important; border-color: #cbd5e1 !important; color: #475569 !important; }
#view-agent-center .agent-subtab-btn:hover { background: #e0ecfb !important; border-color: #93c5fd !important; color: #2563eb !important; }
#view-agent-center .agent-subtab-btn.active { background: #e0edfe !important; border-color: #3b82f6 !important; color: #1d4ed8 !important; box-shadow: none !important; }
#view-agent-center .wizard-chip-btn { background: #edf2f8 !important; border-color: #cbd5e1 !important; color: #475569 !important; }
#view-agent-center .wizard-chip-btn:hover { background: #e0ecfb !important; border-color: #93c5fd !important; color: #2563eb !important; }
#view-agent-center .wizard-chip-label { color: #64748b !important; }
#view-agent-center .wizard-textarea,
#view-agent-center input,
#view-agent-center select,
#view-agent-center textarea,
#view-agent-center .code-editor { background: #fbfcfd !important; border-color: #cbd5e1 !important; color: #1e293b !important; }
#view-agent-center input::placeholder,
#view-agent-center textarea::placeholder { color: #94a3b8 !important; opacity: 1 !important; }

/* Behavior & delay: settings must not read as disabled. */
#view-behavior .settings-card { background: #f4f8fc !important; border-color: #d2deeb !important; }
#view-behavior .speed-preset-group { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 14px !important; margin-top: 6px !important; }
#view-behavior .preset-card-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  text-align: left !important;
  padding: 14px 16px !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  min-height: 110px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}
#view-behavior .preset-card-btn:hover {
  border-color: #60a5fa !important;
  background: #eef5ff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08) !important;
  transform: translateY(-1px) !important;
}
#view-behavior .preset-card-btn.active {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 1.5px #2563eb, 0 4px 14px rgba(37, 99, 235, 0.12) !important;
}
#view-behavior .preset-card-top {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  margin-bottom: 8px !important;
}
#view-behavior .preset-card-icon { font-size: 20px !important; line-height: 1 !important; }
#view-behavior .preset-badge {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  letter-spacing: 0.3px !important;
}
#view-behavior .preset-badge-instant {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}
#view-behavior .preset-badge-rec {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}
#view-behavior .preset-card-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-bottom: 4px !important;
}
#view-behavior .preset-card-btn.active .preset-card-title {
  color: #1d4ed8 !important;
}
#view-behavior .preset-card-desc {
  font-size: 11.5px !important;
  color: #64748b !important;
  line-height: 1.35 !important;
}

#view-behavior .typing-toggle-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}
#view-behavior .typing-toggle-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}
#view-behavior .toggle-icon-wrap {
  width: 44px !important;
  height: 44px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
#view-behavior .toggle-card-title h4 {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
}
#view-behavior .toggle-card-desc {
  background: transparent !important;
  border-color: transparent !important;
  color: #64748b !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  margin: 4px 0 0 !important;
}
#view-behavior .typing-toggle-card select,
#view-behavior .typing-toggle-card input:not([type="checkbox"]),
#view-behavior .typing-toggle-card textarea {
  background: #fff !important;
  border-color: #ccd9e8 !important;
  color: #263a58 !important;
}
#view-behavior .settings-card[style] { background: #fff !important; }

/* Handoff triggers card & rules */
#view-behavior .handoff-triggers-section {
  border: 1px solid #fee2e2 !important;
  background: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03) !important;
}
#view-behavior .handoff-rule-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
}
#view-behavior .handoff-rule-item:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04) !important;
}
#view-behavior .handoff-rule-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}
#view-behavior .handoff-rule-tag {
  font-size: 11px !important;
  color: #2563eb !important;
  font-family: monospace !important;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
}
#view-behavior .handoff-kw-chip {
  display: inline-block !important;
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  font-family: monospace !important;
}
#view-behavior .handoff-rule-msg-box {
  font-size: 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 3px solid #f59e0b !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  line-height: 1.4 !important;
  margin-top: 4px !important;
}
#view-behavior .quick-preset-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 5px 11px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
#view-behavior .quick-preset-chip:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}
#view-behavior .timing-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
}
#view-behavior .timing-card input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

/* Knowledge base document list. */
#view-knowledge .kb-item-card { background: #fff !important; border-color: #dce5ef !important; }
#view-knowledge .kb-item-card:hover { background: #f5f9ff !important; border-color: #accbf1 !important; }
#view-knowledge .kb-item-card.active { background: #eaf3ff !important; border-color: #78acf0 !important; box-shadow: inset 3px 0 #146ef5 !important; }
#view-knowledge .kb-card-title { color: #1d2f4c !important; }
#view-knowledge .kb-card-meta { color: #6d7d94 !important; }
#view-knowledge .kb-cat-badge { background: #edf4ff !important; color: #176bd8 !important; }
#view-knowledge .knowledge-editor,
#view-knowledge #knowledge-editor { background: #fff !important; color: #263a58 !important; }

/* Telemetry and Master KPIs: retain accents, restore readable surfaces. */
#view-analytics .stat-card { background: #fff !important; border-color: #dce5ef !important; box-shadow: 0 6px 20px rgba(31,53,87,.055) !important; }
#view-analytics .stat-value { color: #172845 !important; }
#view-analytics .stat-label { color: #66778f !important; }
#view-analytics .hero-banner { background: #f6f9fd !important; border-color: #dce6f1 !important; }

/* Master Portal KPI Grid & Cards */
#view-master .stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1100px) {
  #view-master .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  #view-master .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

#view-master .stat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: space-between !important;
  min-height: 136px !important;
  padding: 18px 20px !important;
  background: #ffffff !important;
  border-radius: 14px !important;
  border: 1px solid #dce5ef !important;
  box-shadow: 0 4px 16px rgba(31,53,87,0.06) !important;
  box-sizing: border-box !important;
  position: relative !important;
  gap: 8px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

#view-master .stat-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(31,53,87,0.1) !important;
}

#view-master .stat-card::before {
  display: none !important;
}

#view-master .stat-card > div:first-child {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  margin-bottom: 4px !important;
}

#view-master .stat-card > div:first-child span:first-child {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  color: #61728a !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#view-master .stat-card > div:first-child span:last-child {
  font-size: 18px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  margin-left: 8px !important;
}

#view-master #master-kpi-mrr,
#view-master #master-kpi-tenants,
#view-master #master-kpi-wa,
#view-master #master-kpi-ai-cost {
  font-size: 26px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  margin: 2px 0 2px !important;
  white-space: nowrap !important;
}

#view-master #master-kpi-mrr { color: #07895d !important; }
#view-master #master-kpi-tenants { color: #176bd8 !important; }
#view-master #master-kpi-wa { color: #6557d9 !important; }
#view-master #master-kpi-ai-cost { color: #9a6800 !important; }

#view-master #master-kpi-mrr-sub,
#view-master #master-kpi-tenants-sub,
#view-master #master-kpi-wa-sub,
#view-master #master-kpi-ai-tokens {
  font-size: 12px !important;
  color: #61728a !important;
  line-height: 1.3 !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Prompt & Personality Designer */
#view-prompt .calendar-header-card { background: #fff !important; border-color: #dce5ef !important; }
#view-prompt .calendar-header-info h2 { color: #0f172a !important; }
#view-prompt .calendar-header-info p { color: #64748b !important; }
#view-prompt .card { background: #fff !important; border-color: #dce5ef !important; }
#view-prompt .card h3, #view-prompt .card h4 { color: #0f172a !important; }
#view-prompt .card p { color: #64748b !important; }
#view-prompt input, #view-prompt select, #view-prompt textarea { background: #fff !important; border-color: #cbd5e1 !important; color: #0f172a !important; }

@media (max-width: 900px) {
  #view-team .view-header,
  #view-tenants .view-header { flex-direction: column !important; gap: 12px !important; }
  #view-team .view-header .btn,
  #view-tenants .view-header .btn { width: 100% !important; }
  #view-team .team-grid,
  #view-tenants .tenants-grid { grid-template-columns: 1fr !important; }
  #view-behavior .speed-preset-group { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  #view-behavior .behavior-timing-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 560px) {
  #view-behavior .speed-preset-group { grid-template-columns: 1fr !important; }
  #view-behavior .typing-toggle-card { align-items: flex-start !important; flex-direction: column !important; }
  #view-behavior .toggle-card-left { align-items: flex-start !important; }
  #view-agent-center .agent-header-bar { align-items: flex-start !important; }
}

/* ==========================================================================
   AGENT BUILDER & N8N LIGHT THEME OVERRIDES (CRISP & HIGH CONTRAST)
   ========================================================================== */

.draft-alert-banner {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
}
.draft-alert-text {
  color: #92400e !important;
  font-weight: 700 !important;
}

.agent-mode-choice-banner {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
.agent-mode-choice-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}
.agent-mode-choice-card:hover {
  background: #f8fafc !important;
  border-color: #3b82f6 !important;
}
.agent-mode-choice-card.active {
  background: #f0fdf4 !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25) !important;
}
.agent-mode-choice-card .choice-card-title,
.choice-card-title {
  color: #0f172a !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
}
.agent-mode-choice-card .choice-card-desc,
.choice-card-desc {
  color: #334155 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}
.choice-card-badge {
  background: #e2e8f0 !important;
  color: #334155 !important;
  font-weight: 700 !important;
  font-size: 10.5px !important;
}
.choice-badge-tech {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}
.choice-badge-active {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
.choice-pill {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
}
.agent-mode-choice-card.active .choice-pill {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #86efac !important;
}

.n8n-workspace-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}
.n8n-workflow-canvas {
  background: #f8fafc !important;
  border: 1px dashed #cbd5e1 !important;
}
.n8n-canvas-title,
.n8n-canvas-title span {
  color: #0f172a !important;
  font-weight: 700 !important;
}
.n8n-canvas-status,
.n8n-canvas-status span {
  color: #15803d !important;
  background: #dcfce7 !important;
  border: 1px solid #bbf7d0 !important;
  font-weight: 700 !important;
}
.n8n-flow-node {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06) !important;
}
.n8n-flow-node.active {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}
.n8n-node-info strong {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.n8n-node-info span {
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
}
.n8n-node-subtag {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
  font-weight: 700 !important;
}
.n8n-node-meta {
  color: #475569 !important;
  font-weight: 500 !important;
}
.n8n-node-meta code {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
  border: 1px solid #e2e8f0 !important;
  font-weight: 600 !important;
}
.n8n-subnode-pill {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}
.n8n-subnode-pill.tool-rag {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}
.n8n-subnode-pill.tool-rag strong {
  color: #15803d !important;
  font-weight: 700 !important;
}
.n8n-subnode-pill.tool-memory {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}
.n8n-subnode-pill.tool-memory strong {
  color: #1e40af !important;
  font-weight: 700 !important;
}
.n8n-flow-connector .connector-line {
  background: #cbd5e1 !important;
}
.n8n-flow-connector .connector-arrow {
  border-left-color: #94a3b8 !important;
}

/* N8N Studio Main Sections */
.n8n-studio-section {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}
.n8n-section-title {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 14px !important;
}
.n8n-section-sub {
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

/* N8N Roteiro Grid */
.n8n-roteiro-section {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
.n8n-roteiro-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}
.n8n-roteiro-card:focus-within {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}
.n8n-roteiro-step-title {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.n8n-roteiro-step-sub {
  color: #475569 !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
}
.n8n-step-textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
}
.n8n-step-textarea:focus {
  border-color: #3b82f6 !important;
}

.n8n-block-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}
.n8n-block-header strong {
  color: #0f172a !important;
  font-weight: 700 !important;
}
.n8n-block-header p {
  color: #475569 !important;
  font-size: 12.5px !important;
}
.n8n-block-num {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 800 !important;
}
.form-label-styled {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.step-content strong {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.step-content p {
  color: #334155 !important;
  font-size: 12.5px !important;
}
.step-content code {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 700 !important;
}
.step-badge {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  font-weight: 700 !important;
}
.n8n-input-control {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-size: 12.5px !important;
}
.n8n-input-control:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}
.n8n-input-control::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}
.guard-toggle-info strong {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.guard-toggle-info span {
  color: #475569 !important;
  font-size: 12px !important;
}
.n8n-guard-toggle {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}
.n8n-guard-toggle:hover {
  background: #f1f5f9 !important;
}

.n8n-rag-highlight-box {
  background: #f0fdf4 !important;
  border: 1px solid #86efac !important;
}
.n8n-rag-title-row strong {
  color: #14532d !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
}
.badge-rag-status {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
  font-weight: 700 !important;
}
.n8n-rag-desc {
  color: #1e293b !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
}
.highlight-count {
  color: #15803d !important;
  font-weight: 800 !important;
}

.n8n-presets-title {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.n8n-presets-sub {
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}
.n8n-template-btn {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
}
.n8n-template-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #3b82f6 !important;
}

.n8n-variables-container {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
.n8n-variables-header strong {
  color: #0369a1 !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.n8n-var-help {
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}
.n8n-var-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0369a1 !important;
  font-weight: 600 !important;
}
.n8n-var-chip:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0c4a6e !important;
}
.n8n-chip-badge {
  background: #ffedd5 !important;
  color: #c2410c !important;
  font-weight: 800 !important;
}
.n8n-chip-badge.badge-var {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  font-weight: 800 !important;
}
.n8n-chip-hint {
  color: #334155 !important;
  font-weight: 600 !important;
}

.n8n-editor-label {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.n8n-char-counter {
  color: #475569 !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}
.n8n-code-wrapper {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}
.n8n-code-wrapper:focus-within {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}
.n8n-code-editor {
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

.n8n-linter-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
.n8n-linter-title {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
}
.n8n-linter-sub {
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}
.linter-check-item {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}
.lint-info strong {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
}
.lint-status-ok {
  color: #15803d !important;
  font-weight: 700 !important;
}
.lint-status-warn {
  color: #b45309 !important;
  font-weight: 700 !important;
}
.form-label-warning {
  color: #991b1b !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.form-label-info {
  color: #1e40af !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.n8n-footer-actions {
  border-top: 1px solid #e2e8f0 !important;
}
.n8n-btn-ai-opt {
  background: #f0fdf4 !important;
  border: 1px solid #86efac !important;
  color: #166534 !important;
  font-weight: 600 !important;
}
.n8n-btn-ai-opt:hover {
  background: #dcfce7 !important;
}

/* ==========================================================================
   CONVERSATIONS MULTI-SELECTION & BULK PURGE (LIGHT THEME)
   ========================================================================== */

#btn-conv-select-mode.active {
  background: #eff6ff !important;
  color: #2563eb !important;
  border-color: #93c5fd !important;
}

.conv-bulk-action-bar {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}
.conv-bulk-count {
  color: #1e40af !important;
}
.btn-bulk-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
.btn-bulk-chip:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}
.btn-bulk-purge {
  background: #dc2626 !important;
  color: #ffffff !important;
}
.btn-bulk-purge:hover {
  background: #b91c1c !important;
}
.btn-bulk-cancel {
  color: #64748b !important;
}
.btn-bulk-cancel:hover {
  color: #ef4444 !important;
}

.conv-checkbox {
  accent-color: #2563eb !important;
}
.conv-item.selected {
  background: #eff6ff !important;
  box-shadow: inset 3px 0 #2563eb !important;
}

.btn-purge-data {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #dc2626 !important;
  font-weight: 600 !important;
}
.btn-purge-data:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

.bulk-purge-preview-list {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
.bulk-preview-chip {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
}
.bulk-preview-chip .chip-name {
  color: #1e293b !important;
}
.bulk-preview-chip .chip-phone {
  color: #dc2626 !important;
}

/* Campaign Detail Modal in Light Theme */
body.light-theme .camp-detail-metrics-funnel {
  background: #f8fafd !important;
  border: 1px solid #e1e8f2 !important;
}
body.light-theme .camp-detail-stat-label {
  color: #475569 !important;
}
body.light-theme .camp-detail-stat-sub {
  color: #64748b !important;
}
body.light-theme #camp-detail-total {
  color: #0f172a !important;
}
body.light-theme .camp-detail-saferate-banner {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}
body.light-theme #camp-detail-window-text,
body.light-theme #camp-detail-saferate-text {
  color: #334155 !important;
}
body.light-theme .camp-detail-directive-label {
  color: #0f172a !important;
}
body.light-theme .camp-detail-prompt-box {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
body.light-theme .camp-detail-recipients-heading {
  color: #0f172a !important;
}
body.light-theme .camp-detail-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
body.light-theme .camp-detail-select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
body.light-theme .camp-detail-table-wrap {
  border: 1px solid #e2e8f0 !important;
}
body.light-theme .camp-detail-table-head-row {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.light-theme .camp-detail-table-head-row th {
  color: #475569 !important;
}
body.light-theme .camp-detail-footer {
  border-top-color: #e2e8f0 !important;
}

/* Calendar Schedule Editor in Light Theme */
body.light-theme .cal-settings-card {
  background: #f8fafd !important;
  border-color: #e1e8f2 !important;
}
body.light-theme .cal-schedule-mode-box {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
body.light-theme .cal-time-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
body.light-theme .cal-day-schedule-card {
  background: #f8fafd !important;
  border-color: #e2e8f0 !important;
}
body.light-theme .cal-day-schedule-card strong {
  color: #0f172a !important;
}
