/* DataGain app-wide full white theme override.
   Loaded after page-local styles so existing layout and behavior stay intact. */

:root {
    --bg: #ffffff !important;
    --bg-color: #ffffff !important;
    --surface: #ffffff !important;
    --panel: #ffffff !important;
    --panel-2: #ffffff !important;
    --panel-soft: #ffffff !important;
    --surface-border: #dbe3ee !important;
    --line: #dbe3ee !important;
    --line-strong: #b8d7f0 !important;
    --line-blue: #b8d7f0 !important;
    --text: #0f172a !important;
    --text-main: #0f172a !important;
    --ink: #0f172a !important;
    --muted: #64748b !important;
    --text-muted: #64748b !important;
    --primary: #0ea5e9 !important;
    --accent: #0ea5e9 !important;
    --blue: #0ea5e9 !important;
    --surface-soft: #ffffff !important;
    --kpi-bg: #ffffff !important;
    --kpi-text: #0f172a !important;
    --chart-grid: #e2e8f0 !important;
    --table-head-bg: #ffffff !important;
    color-scheme: light !important;
}

html,
body {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #0f172a !important;
}

html[data-theme="light"],
html[data-theme="light"] body,
html:not([data-theme="dark"]),
html:not([data-theme="dark"]) body {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #0f172a !important;
}

body,
button,
input,
select,
textarea {
    color-scheme: light !important;
}

.site-topbar,
.topbar {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid #dbe3ee !important;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07) !important;
    backdrop-filter: blur(18px) !important;
}

.brand-title,
.page-title,
.header-title,
.review-title,
.sender-name,
.step-title,
.section-title,
.modal-header h2,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #0f172a !important;
}

.brand-logo {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.09) !important;
}

.brand-block {
    display: grid !important;
    grid-template-columns: 92px minmax(0, auto) !important;
    grid-template-rows: 30px 13px !important;
    align-items: end !important;
    column-gap: 0.42rem !important;
    row-gap: 0 !important;
    min-width: 248px !important;
}

.brand-logo,
.brand-logo-image {
    grid-row: 1 / 3 !important;
    align-self: center !important;
    width: 92px !important;
    height: 46px !important;
    min-width: 92px !important;
    border-radius: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.brand-logo img,
.brand-logo-image img {
    max-width: 100% !important;
    max-height: 44px !important;
    object-fit: contain !important;
}

.brand-title {
    display: block !important;
    margin: 0 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 1.82rem !important;
    line-height: 0.88 !important;
    font-weight: 500 !important;
    letter-spacing: -0.07em !important;
    color: #071a6b !important;
    background: linear-gradient(90deg, #06124f 0%, #071a6b 48%, #074bff 70%, #09a7ff 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.brand-block::after {
    content: "" !important;
    grid-column: 2 !important;
    display: block !important;
    align-self: start !important;
    margin-top: 0 !important;
    color: #64748b !important;
    font-size: 0.64rem !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 0.085em !important;
    text-transform: uppercase !important;
}

.nav-link {
    color: #64748b !important;
}

.nav-link:hover {
    color: #0f172a !important;
    background: #eef6ff !important;
}

.nav-link.active {
    color: #0369a1 !important;
    background: #e0f2fe !important;
}

.page-shell {
    background: #ffffff !important;
    background-image: none !important;
}

.app-shell,
.dashboard-view,
.dashboard-grid,
.intent-page,
.intent-main,
.intent-filter-panel,
.intent-contact-dashboard,
.intent-table-wrap,
.main-content,
main,
section,
aside,
article,
.header-wrap,
.campaign-hero,
.review-hero,
.step-container,
.card,
.filters-panel,
.chart-card,
.intent-panel,
.intent-card,
.report-panel,
.spotlight-card,
.sender-card,
.template-card,
.metric-card,
.readiness-card,
.advanced-card,
.import-panel,
.source-card,
.editor-panel,
.blocks-panel,
.builder-layout,
.modal-box,
.side-card,
.email-preview-shell,
.campaign-table-wrap,
.table-card,
.list-card,
.empty-state,
.public-card,
.meeting-card,
.contact-card,
.kpi-card,
.kpi-card-direct,
.kpi-card-linkedin,
.table-panel,
.table-header,
.filters-header,
.card-head,
.search-box,
.intent-titlebar,
.intent-metric-card,
.intent-distribution-card,
.top-content-card,
.engagement-chart-card,
.intent-contact-row,
.content-row,
.template-thumb,
.template-meta,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.em-modal,
.em-modal-shell,
.em-section,
.em-card,
.em-rail,
.em-profile-panel,
.em-intel-panel,
.em-section-hd,
.em-content-card,
.em-stat,
.profile-summary-card,
.summary-card,
.content-panel,
.interest-panel,
.rail-panel,
.role-card,
[class*="panel"],
[class*="card"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-color: #dbe3ee !important;
    color: #0f172a !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08) !important;
}

.kpi-card span,
.kpi-card h2,
.kpi-card strong,
.intent-metric-card span,
.intent-metric-card strong,
.intent-panel h3,
.intent-titlebar h1,
.intent-titlebar p,
.card-head h3,
.table-header h3,
.filters-header h3 {
    color: #0f172a !important;
}

.kpi-icon,
.intent-metric-card i {
    background: #eff6ff !important;
    color: #0ea5e9 !important;
    border-color: #bfdbfe !important;
}

.chart-body,
.intent-live-chart-wrap,
.intent-donut-wrap,
.intent-panel-layout,
.intent-dash-legend,
.intent-dash-content-list,
.table-wrap,
.pagination-bar {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-color: #dbe3ee !important;
    color: #0f172a !important;
}

.header-wrap::before,
.header-wrap::after,
.campaign-hero::before,
.campaign-hero::after,
.review-hero::before,
.review-hero::after,
.step-container::before,
.step-container::after,
.sender-card::before,
.spotlight-card::before,
.spotlight-card::after {
    opacity: 0 !important;
}

.page-eyebrow,
.eyebrow,
.blocks-section-label,
.message-tools-label,
.advanced-title,
.panel-head h2,
.blocks-panel-title,
.form-label,
.field-label,
label {
    color: #334155 !important;
}

.page-subtitle,
.header-subtitle,
.review-subtitle,
.step-subtitle,
.field-help,
.source-copy,
.meta-row,
.template-actions,
.empty-state p,
.readiness-label,
.message-tools p,
small,
.muted {
    color: #64748b !important;
}

.form-control,
input,
select,
textarea {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #94a3b8 !important;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14) !important;
    outline: none !important;
}

.form-control option,
select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

table,
thead,
tbody,
tr,
td,
th {
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

thead,
.table-head {
    background: #f8fafc !important;
}

tbody tr,
.table-row {
    background: #ffffff !important;
}

tbody tr:hover,
.table-row:hover {
    background: #f8fafc !important;
}

.btn-secondary,
.btn-ghost,
.ghost-button,
.action-btn,
.template-use-link,
.page-link,
.btn-cancel,
.modal-close-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

.btn-secondary:hover,
.btn-ghost:hover,
.ghost-button:hover,
.action-btn:hover,
.template-use-link:hover,
.page-link:hover,
.btn-cancel:hover,
.modal-close-btn:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.btn-primary,
.btn-new,
.btn-save,
.btn-submit,
.primary-button,
.use-template,
.apply-button,
.link-action-button.is-visible {
    background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.22) !important;
}

.btn-logout,
.btn-ghost-danger,
.btn-del {
    background: #fff5f5 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

.status-pill,
.audience-chip,
.sender-badge,
.column-pill,
.source-card.is-active,
.source-card:hover {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #0369a1 !important;
}

.sender-badge.active {
    background: #ecfdf5 !important;
    border-color: #bbf7d0 !important;
    color: #047857 !important;
}

.sender-badge.inactive {
    background: #fff5f5 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

.message-tools,
.editor-header,
.advanced-card,
.import-panel,
.template-panel,
.panel-head,
.canvas-toolbar,
.designer-footer,
.side-body,
.card-actions {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-color: #dbe3ee !important;
}

.builder-layout {
    overflow: hidden !important;
}

.editor-panel,
#editor-container {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
}

#editor-container .ql-editor,
.ql-editor,
#emailStage,
.email-stage,
.preview-frame,
.email-preview,
.email-body,
.public-content {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #dbe3ee !important;
}

.ql-toolbar.ql-snow,
.ql-container.ql-snow {
    background: #ffffff !important;
    border-color: #dbe3ee !important;
}

.ql-snow .ql-stroke {
    stroke: #334155 !important;
}

.ql-snow .ql-fill {
    fill: #334155 !important;
}

.ql-snow .ql-picker {
    color: #334155 !important;
}

.ql-snow .ql-picker-options {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

.drag-block {
    background: #ffffff !important;
    border-color: #dbe3ee !important;
    color: #334155 !important;
}

.drag-block:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #0f172a !important;
}

.blocks-panel,
.blocks-grid,
.template-list,
.designer-shell,
.designer-main,
.designer-canvas,
.canvas-wrap,
.template-panel,
.blocks-sidebar,
.block-list,
.email-stage-wrap,
.right-panel,
.left-panel,
.workspace,
.workspace-panel {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #0f172a !important;
    border-color: #dbe3ee !important;
}

.modal-overlay {
    background: rgba(255, 255, 255, 0.82) !important;
}

.toast {
    background: #ffffff !important;
    border-color: #dbe3ee !important;
    color: #0f172a !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12) !important;
}

.loader-overlay {
    background: rgba(255, 255, 255, 0.92) !important;
}

.loader-card {
    background: #ffffff !important;
    border-color: #dbe3ee !important;
}

.loader-text {
    color: #0f172a !important;
}

canvas {
    color: #0f172a !important;
}

.chart-card canvas,
.intent-panel canvas,
.report-panel canvas {
    background: #ffffff !important;
}

html[data-theme="light"] .world-map-shell {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
    border-color: #dbe3ee !important;
}

html[data-theme="light"] .country-plot,
html[data-theme="light"] .country-plot .main-svg {
    background: transparent !important;
}

/* Dashboard and Intent Signals: beat older high-specificity dark overrides. */
html[data-theme="light"] #chartsSection,
html[data-theme="light"] #kpiSection,
html[data-theme="light"] #tableSection,
html[data-theme="light"] #intentSignalsView.intent-page,
html[data-theme="light"] #intentSignalsView .intent-main,
html[data-theme="light"] #intentSignalsView .intent-filter-panel,
html[data-theme="light"] #intentSignalsView .intent-filter-group,
html[data-theme="light"] #intentSignalsView .intent-chip-stack,
html[data-theme="light"] #intentSignalsView .intent-filter-actions,
html[data-theme="light"] #intentSignalsView .intent-titlebar,
html[data-theme="light"] #intentSignalsView .intent-metric-card,
html[data-theme="light"] #intentSignalsView .intent-panel,
html[data-theme="light"] #intentSignalsView .intent-panel-layout,
html[data-theme="light"] #intentSignalsView .intent-dash-legend-row,
html[data-theme="light"] #intentSignalsView .intent-dash-content-row,
html[data-theme="light"] #intentSignalsView .intent-contact-panel,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection,
html[data-theme="light"] .page-shell,
html[data-theme="light"] .filters-panel,
html[data-theme="light"] .filters-header,
html[data-theme="light"] .search-box,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .kpi-card-direct,
html[data-theme="light"] .kpi-card-linkedin,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .chart-body,
html[data-theme="light"] .table-panel,
html[data-theme="light"] .table-header,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .pagination-bar {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-color: #dbe3ee !important;
    color: #0f172a !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] #intentSignalsView .intent-filter-head,
html[data-theme="light"] #intentSignalsView .intent-contact-head,
html[data-theme="light"] #intentSignalsView .intent-panel-head,
html[data-theme="light"] #intentSignalsView .intent-content-head,
html[data-theme="light"] .card-head {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #dbe3ee !important;
    color: #334155 !important;
}

html[data-theme="light"] #intentSignalsView h1,
html[data-theme="light"] #intentSignalsView h3,
html[data-theme="light"] #intentSignalsView h4,
html[data-theme="light"] #intentSignalsView label,
html[data-theme="light"] #intentSignalsView .intent-titlebar h1,
html[data-theme="light"] #intentSignalsView .intent-titlebar h1 span,
html[data-theme="light"] #intentSignalsView .intent-filter-head h3,
html[data-theme="light"] #intentSignalsView .intent-filter-group h4,
html[data-theme="light"] #intentSignalsView .intent-panel h3,
html[data-theme="light"] #intentSignalsView .intent-metric-card span,
html[data-theme="light"] #intentSignalsView .intent-metric-card strong,
html[data-theme="light"] #intentSignalsView .intent-table td,
html[data-theme="light"] .filters-header h3,
html[data-theme="light"] .card-head h3,
html[data-theme="light"] .table-header h3,
html[data-theme="light"] .kpi-card span,
html[data-theme="light"] .kpi-card h2 {
    color: #0f172a !important;
}

html[data-theme="light"] #intentSignalsView .intent-titlebar p,
html[data-theme="light"] #intentSignalsView .intent-filter-group label,
html[data-theme="light"] #intentSignalsView .intent-content-head,
html[data-theme="light"] #intentSignalsView .intent-dash-legend-row span,
html[data-theme="light"] #intentSignalsView .intent-contact-foot,
html[data-theme="light"] .table-header p,
html[data-theme="light"] .table-note {
    color: #64748b !important;
}

html[data-theme="light"] #intentSignalsView .intent-select-button,
html[data-theme="light"] #intentSignalsView select.intent-select-button,
html[data-theme="light"] #intentSignalsView input.intent-select-button,
html[data-theme="light"] #intentSignalsView .intent-filter-chip,
html[data-theme="light"] #intentSignalsView .intent-title-actions button,
html[data-theme="light"] #intentSignalsView .intent-contact-head button,
html[data-theme="light"] #intentSignalsView .intent-contact-foot button,
html[data-theme="light"] #intentSignalsView .intent-row-actions button,
html[data-theme="light"] #intentSignalsView .intent-reset,
html[data-theme="light"] .filters-panel select,
html[data-theme="light"] .filters-panel input,
html[data-theme="light"] .search-box input {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

html[data-theme="light"] #intentSignalsView .intent-metric-card::after {
    display: none !important;
}

html[data-theme="light"] #intentSignalsView .intent-apply,
html[data-theme="light"] #intentSignalsView .intent-view-all {
    background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

html[data-theme="light"] #intentSignalsView .intent-table th,
html[data-theme="light"] #intentSignalsView .intent-table td,
html[data-theme="light"] .table-panel table th,
html[data-theme="light"] .table-panel table td {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] #intentSignalsView .intent-table tbody tr:nth-child(even),
html[data-theme="light"] .table-panel tbody tr:nth-child(even) {
    background: #ffffff !important;
}

/* Campaigns and reports: force readable text on the full white theme. */
html[data-theme="light"] .campaign-hero,
html[data-theme="light"] .spotlight-card,
html[data-theme="light"] .campaign-card,
html[data-theme="light"] .campaign-row,
html[data-theme="light"] .campaign-table-wrap,
html[data-theme="light"] .campaign-tools,
html[data-theme="light"] .report-shell,
html[data-theme="light"] .dashboard-layout,
html[data-theme="light"] .header-section,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .log-container,
html[data-theme="light"] .recipient-table-wrap,
html[data-theme="light"] .analytics-card,
html[data-theme="light"] .summary-card,
html[data-theme="light"] .filter-panel,
html[data-theme="light"] .report-panel,
html[data-theme="light"] .report-card,
html[data-theme="light"] .activity-card,
html[data-theme="light"] .event-card,
html[data-theme="light"] .chart-container,
html[data-theme="light"] .chart-panel,
html[data-theme="light"] .recipients-section {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-color: #dbe3ee !important;
    color: #0f172a !important;
}

html[data-theme="light"] .campaign-hero *,
html[data-theme="light"] .spotlight-card *,
html[data-theme="light"] .campaign-card *,
html[data-theme="light"] .campaign-row *,
html[data-theme="light"] .campaign-table-wrap *,
html[data-theme="light"] .campaign-tools *,
html[data-theme="light"] .header-section *,
html[data-theme="light"] .kpi-grid *,
html[data-theme="light"] .log-container *,
html[data-theme="light"] .recipient-table-wrap *,
html[data-theme="light"] .analytics-card *,
html[data-theme="light"] .summary-card *,
html[data-theme="light"] .filter-panel *,
html[data-theme="light"] .report-panel *,
html[data-theme="light"] .report-card *,
html[data-theme="light"] .activity-card *,
html[data-theme="light"] .event-card *,
html[data-theme="light"] .chart-container *,
html[data-theme="light"] .chart-panel *,
html[data-theme="light"] .recipients-section * {
    color: #0f172a !important;
    text-shadow: none !important;
}

html[data-theme="light"] .campaign-hero .page-subtitle,
html[data-theme="light"] .spotlight-subject,
html[data-theme="light"] .spotlight-meta,
html[data-theme="light"] .campaign-meta,
html[data-theme="light"] .campaign-date,
html[data-theme="light"] .campaign-subject,
html[data-theme="light"] .campaign-stats,
html[data-theme="light"] .panel-note,
html[data-theme="light"] .report-muted,
html[data-theme="light"] .report-subtitle,
html[data-theme="light"] .metric-label,
html[data-theme="light"] .kpi-label,
html[data-theme="light"] .table-meta,
html[data-theme="light"] .recipient-meta,
html[data-theme="light"] .log-meta,
html[data-theme="light"] .event-meta,
html[data-theme="light"] .empty-state p,
html[data-theme="light"] .date-col,
html[data-theme="light"] .subject-col,
html[data-theme="light"] .meta-col {
    color: #475569 !important;
}

html[data-theme="light"] .campaign-table-wrap table,
html[data-theme="light"] .recipient-table-wrap table,
html[data-theme="light"] .campaign-table-wrap thead,
html[data-theme="light"] .recipient-table-wrap thead,
html[data-theme="light"] .campaign-table-wrap tbody,
html[data-theme="light"] .recipient-table-wrap tbody,
html[data-theme="light"] .campaign-table-wrap tr,
html[data-theme="light"] .recipient-table-wrap tr,
html[data-theme="light"] .campaign-table-wrap th,
html[data-theme="light"] .recipient-table-wrap th,
html[data-theme="light"] .campaign-table-wrap td,
html[data-theme="light"] .recipient-table-wrap td {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .campaign-table-wrap thead,
html[data-theme="light"] .recipient-table-wrap thead,
html[data-theme="light"] .campaign-table-wrap th,
html[data-theme="light"] .recipient-table-wrap th {
    background: #f8fafc !important;
    color: #334155 !important;
}

html[data-theme="light"] .campaign-table-wrap tbody tr:hover,
html[data-theme="light"] .recipient-table-wrap tbody tr:hover,
html[data-theme="light"] .campaign-table-wrap tbody tr:hover td,
html[data-theme="light"] .recipient-table-wrap tbody tr:hover td {
    background: #f8fafc !important;
    color: #0f172a !important;
}

html[data-theme="light"] .btn-primary *,
html[data-theme="light"] .campaign-hero .btn-primary,
html[data-theme="light"] .campaign-actions .btn-primary,
html[data-theme="light"] .hero-actions .btn-primary,
html[data-theme="light"] .header-section .btn-start,
html[data-theme="light"] .report-panel .btn-primary,
html[data-theme="light"] .report-card .btn-primary,
html[data-theme="light"] .btn-start *,
html[data-theme="light"] .btn-new *,
html[data-theme="light"] .btn-save *,
html[data-theme="light"] .btn-submit *,
html[data-theme="light"] .primary-button *,
html[data-theme="light"] .apply-button *,
html[data-theme="light"] .use-template *,
html[data-theme="light"] .search-form button *,
html[data-theme="light"] .campaign-actions .btn-primary *,
html[data-theme="light"] .hero-actions .btn-primary * {
    color: #ffffff !important;
}

html[data-theme="light"] .status-pill,
html[data-theme="light"] .status-draft,
html[data-theme="light"] .status-paused,
html[data-theme="light"] .status-stopped,
html[data-theme="light"] .status-sending,
html[data-theme="light"] .badge,
html[data-theme="light"] .metric-badge {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #0369a1 !important;
}

a {
    color: #0369a1;
}

html[data-theme="light"] .page-shell *,
html[data-theme="light"] .site-topbar *,
html[data-theme="light"] .topbar *,
html:not([data-theme="dark"]) .page-shell *,
html:not([data-theme="dark"]) .site-topbar *,
html:not([data-theme="dark"]) .topbar * {
    text-shadow: none !important;
}

@media (max-width: 768px) {
    .site-topbar,
    .topbar {
        background: #ffffff !important;
    }

    .page-shell {
        width: min(100% - 20px, 1480px) !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Final app light-theme lock: keep remaining legacy dark selectors readable. */
html,
body,
.page-shell,
.dashboard-view,
.intent-page,
.main-content,
.dashboard-layout,
.template-grid,
.template-list,
.step-container,
.step-body,
.advanced-card,
.import-panel,
.source-card,
.message-tools,
.campaign-table-wrap,
.recipient-table-wrap,
#kpiSection,
#tableSection,
#tableSection .table-header,
#tableSection .table-wrap,
#tableSection .pagination-bar,
#intentSignalsView,
#intentSignalsView .intent-main,
#intentSignalsView .intent-contact-panel,
#intentSignalsView #tableSection,
#intentSignalsView #tableSection .table-header,
#intentSignalsView #tableSection .table-wrap,
#intentSignalsView #tableSection .pagination-bar {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-color: #dbe3ee !important;
    color: #0f172a !important;
}

.page-shell,
.dashboard-layout,
.step-container,
.template-card,
#tableSection,
#intentSignalsView #tableSection,
.campaign-table-wrap,
.recipient-table-wrap {
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07) !important;
}

.topbar-nav a,
.topbar-nav a i,
.step-title,
.source-title,
.source-title i,
.advanced-title,
.message-tools-label,
.template-title,
.template-info,
.template-info *,
.campaign-meta h1,
.kpi-card span,
.kpi-card h2,
.kpi-card strong,
#tableSection h3,
#tableSection th,
#tableSection td,
#tableSection .table-head-label,
#tableSection .table-head-label i,
#intentSignalsView #tableSection h3,
#intentSignalsView #tableSection th,
#intentSignalsView #tableSection td,
#intentSignalsView #tableSection .table-head-label,
#intentSignalsView #tableSection .table-head-label i {
    color: #0f172a !important;
    text-shadow: none !important;
}

.header-subtitle,
.step-subtitle,
.source-copy,
.field-help,
.template-desc,
.template-actions span,
#tableSection .table-header p,
#tableSection .table-note,
#intentSignalsView #tableSection .table-header p,
#intentSignalsView #tableSection .table-note {
    color: #475569 !important;
}

.source-card.is-active,
.source-card:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
}

.source-card input {
    accent-color: #0284c7 !important;
}

#tableSection table,
#tableSection thead,
#tableSection tbody,
#tableSection tr,
#tableSection th,
#tableSection td,
#intentSignalsView #tableSection table,
#intentSignalsView #tableSection thead,
#intentSignalsView #tableSection tbody,
#intentSignalsView #tableSection tr,
#intentSignalsView #tableSection th,
#intentSignalsView #tableSection td {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

#tableSection thead,
#tableSection th,
#intentSignalsView #tableSection thead,
#intentSignalsView #tableSection th {
    background: #f8fafc !important;
    color: #334155 !important;
}

#tableSection tbody tr:nth-child(even),
#tableSection tbody tr:nth-child(odd),
#intentSignalsView #tableSection tbody tr:nth-child(even),
#intentSignalsView #tableSection tbody tr:nth-child(odd) {
    background: #ffffff !important;
}

.btn-primary,
.btn-start,
.btn-new,
.btn-save,
.btn-submit,
.primary-button,
.apply-button,
.use-template,
.search-form button,
.hero-actions .btn-primary,
.campaign-actions .btn-primary {
    color: #ffffff !important;
}

.btn-primary *,
.btn-start *,
.btn-new *,
.btn-save *,
.btn-submit *,
.primary-button *,
.apply-button *,
.use-template *,
.search-form button *,
.hero-actions .btn-primary *,
.campaign-actions .btn-primary * {
    color: #ffffff !important;
}

/* Visible numbers and tabs on white backgrounds. */
#audienceCount,
.audience-chip #audienceCount,
.audience-chip span,
.metric-value,
.metric-card .metric-value,
.kpi-value,
.stat-value,
.campaign-count,
.recipient-count {
    color: #0f172a !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.audience-chip,
.audience-chip i,
.audience-chip span {
    color: #0369a1 !important;
}

.metric-label,
.metric-card .metric-label {
    color: #334155 !important;
    opacity: 1 !important;
}

.status-tabs {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.status-tab {
    background: transparent !important;
    color: #0f172a !important;
    opacity: 1 !important;
}

.status-tab.is-active {
    background: #dff3ff !important;
    color: #0369a1 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

/* Final dashboard visual alignment with the supplied reference. */
html[data-theme="light"] body {
    background: #f6f8fd !important;
}

html[data-theme="light"] .site-topbar {
    background: linear-gradient(180deg, #07133a 0%, #02091f 100%) !important;
    box-shadow: 18px 0 40px rgba(2, 9, 31, 0.10) !important;
}

html[data-theme="light"] .site-topbar *,
html[data-theme="light"] .site-topbar .brand-title {
    text-shadow: none !important;
}

html[data-theme="light"] .site-topbar .brand-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-theme="light"] .site-topbar .nav-link {
    color: #9fb0d4 !important;
    background: transparent !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

html[data-theme="light"] .site-topbar .nav-link:hover,
html[data-theme="light"] .site-topbar .nav-link.active {
    color: #ffffff !important;
    background: #233dd2 !important;
}

html[data-theme="light"] .page-shell {
    background: #f6f8fd !important;
}

html[data-theme="light"] .page-shell .card,
html[data-theme="light"] .page-shell .filters-panel,
html[data-theme="light"] .page-shell .chart-card,
html[data-theme="light"] .page-shell .table-panel,
html[data-theme="light"] .page-shell .kpi-card {
    background: #ffffff !important;
    border-color: #edf1f7 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055) !important;
}

html[data-theme="light"] .page-shell .kpi-card span,
html[data-theme="light"] .page-shell .card-head h3,
html[data-theme="light"] .page-shell .filters-header h3,
html[data-theme="light"] .page-shell .table-header h3,
html[data-theme="light"] .page-shell .table-note,
html[data-theme="light"] .page-shell .status-pill,
html[data-theme="light"] .page-shell select,
html[data-theme="light"] .page-shell input,
html[data-theme="light"] .page-shell button,
html[data-theme="light"] .page-shell th,
html[data-theme="light"] .page-shell td {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

html[data-theme="light"] .page-shell .kpi-card span,
html[data-theme="light"] .page-shell .card-head h3,
html[data-theme="light"] .page-shell .filters-header h3,
html[data-theme="light"] .page-shell .table-header h3,
html[data-theme="light"] .page-shell th,
html[data-theme="light"] .page-shell td {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Keep original heading/topbar; only filters live on the left. */
html[data-theme="light"] .site-topbar {
    position: sticky !important;
    inset: auto !important;
    top: 0 !important;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 1rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #ffffff !important;
    border-right: 0 !important;
    border-bottom: 1px solid #dbe3ee !important;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07) !important;
}

html[data-theme="light"] .site-topbar .brand-title {
    color: #071a6b !important;
    -webkit-text-fill-color: transparent !important;
}

html[data-theme="light"] .site-topbar .nav-link {
    color: #64748b !important;
    background: transparent !important;
}

html[data-theme="light"] .site-topbar .nav-link:hover {
    color: #0f172a !important;
    background: #eef6ff !important;
}

html[data-theme="light"] .site-topbar .nav-link.active {
    color: #0369a1 !important;
    background: #e0f2fe !important;
}

html[data-theme="light"] .page-shell {
    margin-left: 0 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 248px minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto !important;
    gap: 14px !important;
    background: #f6f8fd !important;
}

html[data-theme="light"] .page-shell > .filters-panel {
    grid-column: 1 !important;
    grid-row: 1 / span 4 !important;
    position: sticky !important;
    top: 74px !important;
    min-height: 0 !important;
    height: max-content !important;
    align-self: start !important;
}

html[data-theme="light"] .page-shell > #kpiSection,
html[data-theme="light"] .page-shell > #chartsSection,
html[data-theme="light"] .page-shell > #chartsPlaceholder,
html[data-theme="light"] .page-shell > #recentContactsSection {
    grid-column: 2 !important;
}

html[data-theme="light"] .page-shell > #tableSection {
    grid-column: 2 !important;
    min-width: 0 !important;
}

html[data-theme="light"] .page-shell .filters-panel .filters-header,
html[data-theme="light"] .page-shell .filters-panel .filters-right,
html[data-theme="light"] .page-shell .filters-panel .filters-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
}

/* Header reset: preserve original horizontal topbar after all light-theme overrides. */
html[data-theme="light"] .site-topbar,
html:not([data-theme="dark"]) .site-topbar {
    position: sticky !important;
    inset: auto !important;
    top: 0 !important;
    z-index: 200 !important;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 1rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    flex-wrap: nowrap !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-right: 0 !important;
    border-bottom: 1px solid #dbe3ee !important;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07) !important;
    backdrop-filter: blur(18px) !important;
}

html[data-theme="light"] .site-topbar .brand-block,
html:not([data-theme="dark"]) .site-topbar .brand-block {
    display: grid !important;
    grid-template-columns: 92px minmax(0, auto) !important;
    grid-template-rows: 30px 13px !important;
    align-items: end !important;
    column-gap: 0.42rem !important;
    row-gap: 0 !important;
    min-width: 248px !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
}

html[data-theme="light"] .site-topbar .brand-block::after,
html:not([data-theme="dark"]) .site-topbar .brand-block::after {
    content: "" !important;
    grid-column: 2 !important;
    display: block !important;
    align-self: start !important;
    margin-top: 0 !important;
    color: #64748b !important;
    font-size: 0.64rem !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 0.085em !important;
    text-transform: uppercase !important;
}

html[data-theme="light"] .site-topbar .brand-logo,
html:not([data-theme="dark"]) .site-topbar .brand-logo {
    grid-row: 1 / 3 !important;
    align-self: center !important;
    width: 92px !important;
    height: 46px !important;
    min-width: 92px !important;
    border-radius: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

html[data-theme="light"] .site-topbar .brand-logo img,
html:not([data-theme="dark"]) .site-topbar .brand-logo img {
    max-width: 100% !important;
    max-height: 44px !important;
    object-fit: contain !important;
}

html[data-theme="light"] .site-topbar .brand-title,
html:not([data-theme="dark"]) .site-topbar .brand-title {
    display: block !important;
    margin: 0 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 1.82rem !important;
    line-height: 0.88 !important;
    font-weight: 500 !important;
    letter-spacing: -0.07em !important;
    color: #071a6b !important;
    background: linear-gradient(90deg, #06124f 0%, #071a6b 48%, #074bff 70%, #09a7ff 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

html[data-theme="light"] .site-topbar .topbar-nav,
html:not([data-theme="dark"]) .site-topbar .topbar-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    flex: 0 0 auto !important;
    min-width: max-content !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

html[data-theme="light"] .site-topbar .nav-link,
html:not([data-theme="dark"]) .site-topbar .nav-link {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0.38rem 0.72rem !important;
    border-radius: 10px !important;
    color: #64748b !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: normal !important;
    text-decoration: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
}

html[data-theme="light"] .site-topbar .nav-link:hover,
html:not([data-theme="dark"]) .site-topbar .nav-link:hover {
    color: #0f172a !important;
    background: #eef6ff !important;
}

html[data-theme="light"] .site-topbar .nav-link.active,
html:not([data-theme="dark"]) .site-topbar .nav-link.active {
    color: #0369a1 !important;
    background: #e0f2fe !important;
}

html[data-theme="light"] .site-topbar > div:last-child,
html:not([data-theme="dark"]) .site-topbar > div:last-child {
    margin-top: 0 !important;
    min-width: max-content !important;
    width: auto !important;
    display: flex !important;
    flex: 0 0 auto !important;
    gap: 1rem !important;
    align-items: center !important;
}

html[data-theme="light"] .site-topbar .btn-ghost-danger,
html:not([data-theme="dark"]) .site-topbar .btn-ghost-danger {
    width: auto !important;
    min-height: 0 !important;
    padding: 7px 12px !important;
    border-radius: 10px !important;
    background: rgba(255,107,107,0.05) !important;
    border: 1px solid rgba(255,107,107,0.2) !important;
    color: #ff6b6b !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

/* Shared stylesheet guard: dashboard-only layout changes must not affect Campaigns. */
body:not(.dashboard-page) .site-topbar {
    position: sticky !important;
    inset: auto !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 200 !important;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 1rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    flex-wrap: nowrap !important;
    background: #ffffff !important;
    background-image: none !important;
    border-right: 0 !important;
    border-bottom: 1px solid #dbe3ee !important;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07) !important;
}

body:not(.dashboard-page) .site-topbar .brand-block {
    display: flex !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    align-items: center !important;
    gap: 0.7rem !important;
    min-width: max-content !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
}

body:not(.dashboard-page) .site-topbar .brand-block::after {
    content: none !important;
    display: none !important;
}

body:not(.dashboard-page) .site-topbar .brand-logo {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 10px !important;
    padding: 5px !important;
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08) !important;
}

body:not(.dashboard-page) .site-topbar .brand-logo img {
    max-width: 100% !important;
    max-height: 30px !important;
    object-fit: contain !important;
}

body:not(.dashboard-page) .site-topbar .brand-title {
    display: block !important;
    margin: 0 !important;
    font-size: 1.12rem !important;
    line-height: normal !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #0f172a !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
}

body:not(.dashboard-page) .site-topbar .topbar-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    flex: 0 0 auto !important;
    min-width: max-content !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

body:not(.dashboard-page) .site-topbar .nav-link {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0.38rem 0.72rem !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: normal !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

body:not(.dashboard-page) .site-topbar > div:last-child {
    margin-top: 0 !important;
    min-width: max-content !important;
    width: auto !important;
    display: flex !important;
    flex: 0 0 auto !important;
    gap: 1rem !important;
    align-items: center !important;
}

body:not(.dashboard-page) .page-shell {
    display: block !important;
    grid-template-columns: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: min(100% - 32px, 1480px) !important;
}

body:not(.dashboard-page) .filters-panel {
    position: static !important;
    top: auto !important;
    min-height: 0 !important;
}

/* Dashboard brand lock: match the provided logo treatment without affecting Campaigns. */
body.dashboard-page .site-topbar .brand-block {
    display: grid !important;
    grid-template-columns: 74px max-content !important;
    grid-template-rows: 28px 13px !important;
    align-items: end !important;
    column-gap: 10px !important;
    row-gap: 0 !important;
    min-width: 238px !important;
    height: 48px !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
}

body.dashboard-page .site-topbar .brand-logo {
    grid-row: 1 / 3 !important;
    grid-column: 1 !important;
    align-self: center !important;
    justify-self: start !important;
    width: 74px !important;
    height: 46px !important;
    min-width: 74px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

body.dashboard-page .site-topbar .brand-logo img {
    display: block !important;
    width: 74px !important;
    height: 46px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
}

body.dashboard-page .site-topbar .brand-title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    display: block !important;
    margin: 0 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 24px !important;
    line-height: 0.98 !important;
    font-weight: 500 !important;
    letter-spacing: -1.7px !important;
    color: #071a6b !important;
    background: none !important;
    -webkit-text-fill-color: #071a6b !important;
    text-transform: none !important;
    white-space: nowrap !important;
}

body.dashboard-page .site-topbar .brand-block::after {
    content: "" !important;
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    display: block !important;
    margin: 1px 0 0 !important;
    color: #64748b !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 1.3px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

/* Dashboard data view: match the compact analytics reference. */
html[data-theme="light"] body.dashboard-page {
    background: #f7f9fd !important;
}

html[data-theme="light"] body.dashboard-page #kpiSection {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

html[data-theme="light"] body.dashboard-page .kpi-card-extra {
    display: none !important;
}

html[data-theme="light"] body.dashboard-page .dashboard-extra-chart {
    display: block !important;
}

html[data-theme="light"] body.dashboard-page .top-content-card.dashboard-extra-chart {
    grid-column: span 2 !important;
    min-height: 300px !important;
}

html[data-theme="light"] body.dashboard-page .recent-contacts-card {
    grid-column: 1 / -1 !important;
    padding: 17px 18px 12px !important;
    background: #ffffff !important;
    border: 1px solid #e9eef7 !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] #tableSection .table-wrap,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection .table-wrap {
    overflow-x: auto !important;
}

html[data-theme="light"] #tableSection table,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection table {
    min-width: 1320px !important;
    table-layout: fixed !important;
}

html[data-theme="light"] #tableSection th:nth-child(3),
html[data-theme="light"] #tableSection td:nth-child(3) {
    width: 230px !important;
}

html[data-theme="light"] #tableSection td:nth-child(3),
html[data-theme="light"] #tableSection td:nth-child(3) .table-chip {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

html[data-theme="light"] #tableSection td:nth-child(3) .table-chip {
    width: fit-content !important;
    max-width: 100% !important;
    overflow-wrap: normal !important;
}

html[data-theme="light"] body.dashboard-page .kpi-card {
    min-height: 104px !important;
    min-width: 0 !important;
    padding: 16px 12px 14px !important;
    background: #ffffff !important;
    border: 1px solid #e9eef7 !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] body.dashboard-page .kpi-card h2 {
    margin: 7px 0 0 44px !important;
    color: #0f172a !important;
    font-size: clamp(20px, 1.9vw, 28px) !important;
    font-weight: 900 !important;
}

html[data-theme="light"] body.dashboard-page .kpi-card .kpi-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    color: #2563eb !important;
    background: #eff6ff !important;
}

html[data-theme="light"] body.dashboard-page .kpi-card-direct .kpi-icon {
    color: #059669 !important;
    background: #dcfce7 !important;
}

html[data-theme="light"] body.dashboard-page .kpi-card-linkedin .kpi-icon {
    color: #0a66c2 !important;
    background: #e0f2fe !important;
}

html[data-theme="light"] body.dashboard-page .kpi-trend,
html[data-theme="light"] body.dashboard-page .kpi-trend i {
    color: #10b981 !important;
}

html[data-theme="light"] body.dashboard-page .kpi-trend span {
    color: #94a3b8 !important;
}

html[data-theme="light"] body.dashboard-page .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

html[data-theme="light"] body.dashboard-page .chart-card-sm,
html[data-theme="light"] body.dashboard-page .country-map-card {
    grid-column: span 1 !important;
}

html[data-theme="light"] body.dashboard-page .analytics-card {
    min-height: 292px !important;
    padding: 17px 18px 18px !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] body.dashboard-page .analytics-body {
    display: grid !important;
    grid-template-columns: minmax(168px, 0.96fr) minmax(150px, 1.04fr) !important;
    gap: 16px !important;
    justify-content: stretch !important;
    align-items: center !important;
    height: 226px !important;
    min-height: 226px !important;
}

html[data-theme="light"] body.dashboard-page .analytics-map-body {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(160px, 1fr) auto !important;
    gap: 8px !important;
    height: 226px !important;
    min-height: 226px !important;
}

html[data-theme="light"] body.dashboard-page .analytics-card .analytics-label,
html[data-theme="light"] body.dashboard-page .analytics-card .analytics-value,
html[data-theme="light"] body.dashboard-page .analytics-card .analytics-legend-row strong,
html[data-theme="light"] body.dashboard-page .analytics-card .analytics-link,
html[data-theme="light"] body.dashboard-page .analytics-card .analytics-center strong,
html[data-theme="light"] body.dashboard-page .analytics-card .analytics-center span {
    text-shadow: none !important;
}

@media (max-width: 1180px) {
    html[data-theme="light"] body.dashboard-page #kpiSection {
        grid-template-columns: repeat(2, minmax(170px, 1fr)) !important;
    }

    html[data-theme="light"] body.dashboard-page .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    html[data-theme="light"] body.dashboard-page #kpiSection {
        grid-template-columns: 1fr !important;
    }
}

/* Final brand lockup: logo | Datagain, without the powered-by line. */
.site-topbar .brand-block::after,
.topbar .brand-block::after,
body.dashboard-page .site-topbar .brand-block::after,
html[data-theme="light"] .site-topbar .brand-block::after,
html:not([data-theme="dark"]) .site-topbar .brand-block::after {
    content: "" !important;
    display: none !important;
}

.site-topbar .brand-block,
.topbar .brand-block,
html[data-theme="light"] .site-topbar .brand-block,
html:not([data-theme="dark"]) .site-topbar .brand-block {
    display: grid !important;
    grid-template-columns: 74px 1px minmax(0, auto) !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    column-gap: 14px !important;
    min-width: 190px !important;
}

body.dashboard-page .site-topbar .brand-block {
    grid-template-columns: 74px 1px minmax(0, auto) !important;
    min-width: 190px !important;
}

.site-topbar .brand-block::before,
.topbar .brand-block::before {
    content: "" !important;
    display: block !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 1px !important;
    height: 34px !important;
    align-self: center !important;
    background: #cbd5e1 !important;
}

.site-topbar .brand-logo,
.topbar .brand-logo,
.site-topbar .brand-logo-image,
.topbar .brand-logo-image,
body.dashboard-page .site-topbar .brand-logo {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 74px !important;
    height: 46px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.site-topbar .brand-logo img,
.topbar .brand-logo img,
.site-topbar .brand-logo-image img,
.topbar .brand-logo-image img,
body.dashboard-page .site-topbar .brand-logo img {
    width: auto !important;
    max-width: 64px !important;
    height: auto !important;
    max-height: 42px !important;
    object-fit: contain !important;
}

.site-topbar .brand-copy,
.topbar .brand-copy {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: center !important;
}

.site-topbar .brand-title,
.topbar .brand-title,
body.dashboard-page .site-topbar .brand-title,
html[data-theme="light"] .site-topbar .brand-title,
html:not([data-theme="dark"]) .site-topbar .brand-title {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    font-size: 1.55rem !important;
    font-weight: 500 !important;
    letter-spacing: -0.045em !important;
    color: #0b1b54 !important;
    background: linear-gradient(90deg, #0b1b54 0 53%, #0ea5e9 53% 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Final dashboard analytics layout: country card fills the marked right-side area. */
html[data-theme="light"] body.dashboard-page .dashboard-grid {
    grid-template-columns: repeat(13, minmax(0, 1fr)) !important;
}

html[data-theme="light"] body.dashboard-page .sector-chart-card {
    grid-column: span 4 !important;
}

html[data-theme="light"] body.dashboard-page .function-chart-card {
    grid-column: span 4 !important;
}

html[data-theme="light"] body.dashboard-page .country-map-card {
    grid-column: span 5 !important;
}

html[data-theme="light"] body.dashboard-page .sub-sector-wide-card {
    grid-column: span 12 !important;
}

html[data-theme="light"] body.dashboard-page .sector-chart-card .analytics-body,
html[data-theme="light"] body.dashboard-page .function-chart-card .analytics-body {
    grid-template-columns: minmax(142px, 0.88fr) minmax(136px, 1.12fr) !important;
    gap: 12px !important;
    overflow: visible !important;
}

html[data-theme="light"] body.dashboard-page .sector-chart-card .analytics-donut-wrap,
html[data-theme="light"] body.dashboard-page .function-chart-card .analytics-donut-wrap,
html[data-theme="light"] body.dashboard-page .sector-chart-card .analytics-donut-wrap canvas,
html[data-theme="light"] body.dashboard-page .function-chart-card .analytics-donut-wrap canvas {
    width: 158px !important;
    height: 158px !important;
}

html[data-theme="light"] body.dashboard-page .sector-chart-card .analytics-legend-row,
html[data-theme="light"] body.dashboard-page .function-chart-card .analytics-legend-row {
    grid-template-columns: 10px minmax(0, 1fr) minmax(38px, auto) !important;
    gap: 7px !important;
    padding-left: 2px !important;
    overflow: visible !important;
}

html[data-theme="light"] body.dashboard-page .sector-chart-card .analytics-dot,
html[data-theme="light"] body.dashboard-page .function-chart-card .analytics-dot {
    justify-self: center !important;
    flex: 0 0 auto !important;
}

html[data-theme="light"] body.dashboard-page .sector-chart-card .analytics-label,
html[data-theme="light"] body.dashboard-page .function-chart-card .analytics-label {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

html[data-theme="light"] #intentSignalsView .campaign-intent-pill {
    box-shadow: none !important;
}

html[data-theme="light"] #intentSignalsView .intent-donut-center strong,
html[data-theme="light"] body.dashboard-page #intentSignalsView .intent-donut-center strong {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    text-shadow: none !important;
}

html[data-theme="light"] #intentSignalsView .intent-donut-center span,
html[data-theme="light"] body.dashboard-page #intentSignalsView .intent-donut-center span {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    text-shadow: none !important;
}

@media (max-width: 900px) {
    html[data-theme="light"] body.dashboard-page .sector-chart-card,
    html[data-theme="light"] body.dashboard-page .function-chart-card,
    html[data-theme="light"] body.dashboard-page .country-map-card,
    html[data-theme="light"] body.dashboard-page .sub-sector-wide-card {
        grid-column: span 12 !important;
    }
}

/* Intent page final layout: filters end at actions, table spans full width. */
html[data-theme="light"] #intentSignalsView.intent-page {
    grid-template-columns: 285px minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto !important;
    align-items: start !important;
}

html[data-theme="light"] #intentSignalsView .intent-filter-panel {
    grid-column: 1 !important;
    grid-row: 1 / 4 !important;
    height: max-content !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: start !important;
    overflow: visible !important;
}

html[data-theme="light"] #intentSignalsView .intent-main {
    display: contents !important;
}

html[data-theme="light"] #intentSignalsView .intent-titlebar,
html[data-theme="light"] #intentSignalsView .intent-metric-grid,
html[data-theme="light"] #intentSignalsView .intent-analytics-grid {
    grid-column: 2 !important;
    min-width: 0 !important;
}

html[data-theme="light"] #intentSignalsView .intent-titlebar {
    grid-row: 1 !important;
}

html[data-theme="light"] #intentSignalsView .intent-metric-grid {
    grid-row: 2 !important;
}

html[data-theme="light"] #intentSignalsView .intent-analytics-grid {
    grid-row: 3 !important;
}

html[data-theme="light"] #intentSignalsView .intent-contact-panel {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 16px !important;
}

html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection .table-wrap {
    width: 100% !important;
}

@media (max-width: 900px) {
    html[data-theme="light"] #intentSignalsView.intent-page {
        grid-template-columns: 1fr !important;
    }

    html[data-theme="light"] #intentSignalsView .intent-titlebar,
    html[data-theme="light"] #intentSignalsView .intent-metric-grid,
    html[data-theme="light"] #intentSignalsView .intent-analytics-grid,
    html[data-theme="light"] #intentSignalsView .intent-contact-panel {
        grid-column: 1 !important;
    }
}

/* Final contact table readability guard: never clip cell text. */
html[data-theme="light"] #tableSection .table-wrap,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection .table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

html[data-theme="light"] #tableSection table,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection table {
    width: max-content !important;
    min-width: 1720px !important;
    table-layout: auto !important;
}

html[data-theme="light"] #tableSection th,
html[data-theme="light"] #tableSection td,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection th,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection td {
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

html[data-theme="light"] #tableSection .td-strong,
html[data-theme="light"] #tableSection .td-email a,
html[data-theme="light"] #tableSection .table-chip,
html[data-theme="light"] #tableSection .table-head-label,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection .td-strong,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection .td-email a,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection .table-chip,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection .table-head-label {
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

html[data-theme="light"] #tableSection .table-chip,
html[data-theme="light"] #intentSignalsView .intent-contact-panel #tableSection .table-chip {
    width: auto !important;
    min-width: max-content !important;
}

/* Dashboard lower contact table should span the full page width. */
html[data-theme="light"] body.dashboard-page .page-shell > #tableSection {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
}

/* Dashboard recent contacts should also use the full page width. */
html[data-theme="light"] body.dashboard-page .page-shell > #recentContactsSection,
html[data-theme="light"] body.dashboard-page .recent-contacts-card {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
}

html[data-theme="light"] body.dashboard-page .recent-table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

html[data-theme="light"] body.dashboard-page .recent-table {
    width: 100% !important;
    min-width: 1240px !important;
    table-layout: auto !important;
}

html[data-theme="light"] body.dashboard-page .recent-table th,
html[data-theme="light"] body.dashboard-page .recent-table td {
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

html[data-theme="light"] body.dashboard-page .recent-table th:nth-child(1),
html[data-theme="light"] body.dashboard-page .recent-table td:nth-child(1) { width: 150px !important; }
html[data-theme="light"] body.dashboard-page .recent-table th:nth-child(2),
html[data-theme="light"] body.dashboard-page .recent-table td:nth-child(2) { width: 280px !important; }
html[data-theme="light"] body.dashboard-page .recent-table th:nth-child(3),
html[data-theme="light"] body.dashboard-page .recent-table td:nth-child(3) { width: 210px !important; }
html[data-theme="light"] body.dashboard-page .recent-table th:nth-child(4),
html[data-theme="light"] body.dashboard-page .recent-table td:nth-child(4) { width: 250px !important; }
html[data-theme="light"] body.dashboard-page .recent-table th:nth-child(5),
html[data-theme="light"] body.dashboard-page .recent-table td:nth-child(5) { width: 210px !important; }
html[data-theme="light"] body.dashboard-page .recent-table th:nth-child(6),
html[data-theme="light"] body.dashboard-page .recent-table td:nth-child(6) { width: 140px !important; }
html[data-theme="light"] body.dashboard-page .recent-table th:nth-child(7),
html[data-theme="light"] body.dashboard-page .recent-table td:nth-child(7) { width: 96px !important; }
