:root {
    --sidebar-width: 280px;
    --surface: #f3f6fb;
    --primary: #1d4ed8;
    --slate-900: #0f172a;
    --slate-700: #334155;
    --slate-500: #64748b;
    --border-soft: #e2e8f0;
    --danger-soft: rgba(239, 68, 68, 0.10);
    --warning-soft: rgba(245, 158, 11, 0.14);
    --success-soft: rgba(34, 197, 94, 0.14);
    --primary-soft: rgba(37, 99, 235, 0.12);
    --bg-page: #f3f6fb;
    --bg-elevated: rgba(255, 255, 255, 0.92);
    --bg-surface: rgba(255, 255, 255, 0.94);
    --bg-soft: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-strong: rgba(226, 232, 240, 0.9);
}

html[data-theme='theme-dark'] {
    --surface: #020617;
    --primary: #60a5fa;
    --slate-900: #f8fafc;
    --slate-700: #cbd5e1;
    --slate-500: #94a3b8;
    --border-soft: rgba(51, 65, 85, 0.9);
    --danger-soft: rgba(248, 113, 113, 0.16);
    --warning-soft: rgba(251, 191, 36, 0.18);
    --success-soft: rgba(74, 222, 128, 0.18);
    --primary-soft: rgba(96, 165, 250, 0.18);
    --bg-page: #020617;
    --bg-elevated: rgba(15, 23, 42, 0.88);
    --bg-surface: rgba(15, 23, 42, 0.92);
    --bg-soft: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-strong: rgba(51, 65, 85, 0.9);
}

html {
    font-size: 14px;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg-page) 100%);
    color: var(--text-primary);
    transition: background-color .25s ease, color .25s ease, background .25s ease;
}

body.theme-dark {
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 28%),
        linear-gradient(180deg, #020617 0%, var(--bg-page) 100%);
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-elevated);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--border-soft);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width .25s ease, padding .25s ease;
    overflow: hidden;
}

.sidebar-toggle {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.22);
    flex-shrink: 0;
    padding: 0;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-soft) 100%);
    color: var(--slate-700);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
    transition: all .2s ease;
}

.sidebar-toggle:hover {
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.24);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.sidebar-toggle i {
    font-size: 1rem;
    transition: transform .2s ease;
}

.sidebar-collapsed {
    width: 92px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-nav .nav-link span,
.sidebar-collapsed .sidebar-footer-label,
.sidebar-collapsed .sidebar-footer-value {
    display: none;
}

.sidebar-collapsed .sidebar-header-row {
    justify-content: center !important;
}

.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding-left: .75rem;
    padding-right: .75rem;
}

.sidebar-collapsed .sidebar-footer {
    display: flex;
    justify-content: center;
}

.sidebar-collapsed .sidebar-toggle-bottom {
    width: 42px;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sidebar-toggle-bottom {
    margin-left: auto;
    margin-top: .25rem;
}

.sidebar-nav .nav-link {
    color: var(--slate-700);
    display: flex;
    align-items: center;
    gap: .75rem;
    border-radius: .875rem;
    padding: .85rem 1rem;
    font-weight: 500;
    transition: all .2s ease;
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link:hover {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
    transform: translateX(2px);
}

.content-wrapper {
    flex: 1;
    min-width: 0;
}

.page-content {
    max-width: 1600px;
}

.topbar {
    background: color-mix(in srgb, var(--bg-elevated) 90%, transparent) !important;
    backdrop-filter: blur(14px);
}

.kpi-card,
.chart-card,
.report-card,
.summary-card,
.insight-card,
.hero-card,
.filter-surface {
    border: 0;
    border-radius: 1.5rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.premium-card {
    background: var(--bg-surface);
    backdrop-filter: blur(18px);
}

.executive-dashboard {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hero-card {
    background: linear-gradient(135deg, var(--bg-surface) 0%, color-mix(in srgb, var(--primary) 10%, var(--bg-surface)) 52%, color-mix(in srgb, #f59e0b 10%, var(--bg-surface)) 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: auto -120px -120px auto;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 70%);
    border-radius: 50%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
    color: var(--primary);
    font-weight: 700;
    font-size: .82rem;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    color: var(--slate-900);
    font-weight: 800;
    letter-spacing: -.03em;
}

.hero-subtitle {
    font-size: 1.02rem;
    color: var(--slate-500);
    max-width: 780px;
}

.hero-metrics {
    margin-top: 1.25rem;
}

.hero-metric-label {
    color: var(--slate-500);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .35rem;
}

.hero-metric-value {
    font-size: 1.15rem;
    font-weight: 800;
}

.anomaly-callout {
    background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
    border: 1px solid rgba(239, 68, 68, 0.16);
    border-radius: 1.35rem;
    padding: 1.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.anomaly-icon,
.insight-side-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.anomaly-icon {
    background: var(--danger-soft);
    color: #dc2626;
}

.anomaly-pill,
.chart-note,
.trend-pill,
.table-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border-radius: 999px;
    font-weight: 600;
}

.anomaly-pill {
    padding: .55rem .9rem;
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.filter-surface {
    background: var(--bg-elevated);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-strong);
}

.executive-filter-form {
    background: var(--bg-soft);
    padding: .75rem .9rem;
    border-radius: 1rem;
    border: 1px solid var(--border-soft);
}

.region-select {
    min-width: 220px;
    border-radius: .85rem;
    border-color: #cbd5e1;
    font-weight: 600;
}

.section-eyebrow {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .76rem;
    font-weight: 800;
    margin-bottom: .5rem;
}

.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    opacity: .95;
}

.accent-primary::before {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.accent-success::before {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.accent-danger::before {
    background: linear-gradient(90deg, #ef4444, #fb7185);
}

.accent-warning::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.kpi-label {
    font-size: .85rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .55rem;
    font-weight: 700;
}

.kpi-value {
    font-size: clamp(1.65rem, 2vw, 2.15rem);
    line-height: 1.1;
    font-weight: 800;
    color: var(--slate-900);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.1rem;
    font-size: 1.35rem;
}

.accent-bg-primary {
    background: var(--primary-soft);
    color: #1d4ed8;
}

.accent-bg-success {
    background: var(--success-soft);
    color: #15803d;
}

.accent-bg-danger {
    background: var(--danger-soft);
    color: #dc2626;
}

.accent-bg-warning {
    background: var(--warning-soft);
    color: #d97706;
}

.trend-pill {
    padding: .45rem .8rem;
    font-size: .82rem;
}

.trend-up {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.trend-down {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.trend-neutral {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
}

.chart-container {
    position: relative;
    height: 320px;
}

.tall-chart {
    height: 390px;
}

.chart-note {
    padding: .6rem .9rem;
    font-size: .82rem;
}

.danger-note {
    background: rgba(239, 68, 68, 0.10);
    color: #b91c1c;
}

.neutral-note {
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
}

.summary-card {
    background: linear-gradient(180deg, var(--bg-surface) 0%, color-mix(in srgb, #f59e0b 8%, var(--bg-surface)) 100%);
}

.anomaly-stat-list {
    display: grid;
    gap: .85rem;
}

.anomaly-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .95rem 1rem;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.85);
}

.anomaly-stat-item span {
    color: var(--slate-500);
    font-weight: 600;
}

.anomaly-stat-item strong {
    color: var(--slate-900);
    font-size: 1rem;
}

.anomaly-stat-item.highlight {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.18);
}

.insight-card {
    background: linear-gradient(135deg, color-mix(in srgb, #f59e0b 8%, var(--bg-surface)) 0%, var(--bg-surface) 55%, color-mix(in srgb, var(--primary) 8%, var(--bg-surface)) 100%);
}

.insight-summary {
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--slate-700);
}

.insight-supporting-text {
    color: #b45309;
    font-weight: 700;
}

.insight-side-panel {
    background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
    border-radius: 1.25rem;
    padding: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--border-soft) 90%, transparent);
}

.insight-side-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.executive-table thead th {
    background: #eff6ff;
    border-bottom: 0;
    color: #334155;
    font-weight: 700;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.executive-table tbody td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-color: #eef2f7;
}

.table-pill {
    padding: .35rem .7rem;
    font-size: .8rem;
}

.table-pill.success {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.table-pill.warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.table-pill.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.filter-card {
    border-radius: 1rem;
    border: 1px solid var(--border-soft);
}

.insight-banner {
    background: linear-gradient(135deg, color-mix(in srgb, #f59e0b 12%, var(--bg-surface)), color-mix(in srgb, #fb923c 10%, var(--bg-surface)));
    border: 1px solid color-mix(in srgb, #fb923c 40%, var(--border-soft));
    border-radius: 1rem;
}

.card,
.modal-content,
.dropdown-menu,
.list-group-item,
.toast,
.offcanvas,
.popover,
.tooltip-inner,
.table,
.form-control,
.form-select,
.input-group-text {
    transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

body.theme-dark .card,
body.theme-dark .modal-content,
body.theme-dark .dropdown-menu,
body.theme-dark .list-group-item,
body.theme-dark .offcanvas,
body.theme-dark .popover,
body.theme-dark .table,
body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .input-group-text,
body.theme-dark .toast {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-soft);
}

body.theme-dark .text-secondary,
body.theme-dark .small.text-secondary,
body.theme-dark .sidebar-footer-label,
body.theme-dark .sidebar-footer-value {
    color: var(--text-secondary) !important;
}

body.theme-dark .table thead th,
body.theme-dark .executive-table thead th {
    background: #0f172a;
    color: var(--text-primary);
}

body.theme-dark .table tbody td,
body.theme-dark .executive-table tbody td {
    border-color: rgba(51, 65, 85, 0.6);
    color: var(--text-primary);
}

body.theme-dark .summary-card,
body.theme-dark .hero-card,
body.theme-dark .insight-card,
body.theme-dark .premium-card,
body.theme-dark .filter-surface,
body.theme-dark .sidebar {
    box-shadow: 0 18px 40px rgba(2, 6, 23, .45);
}

.marketing-summary-callout {
    max-width: 420px;
}

.neutral-pill {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
}

.marketing-selected-campaign-pill {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem 1rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-soft) 84%, transparent);
    border: 1px solid var(--border-soft);
    font-weight: 700;
    color: var(--slate-700);
}

.marketing-table thead th {
    white-space: nowrap;
}

.funnel-chart-container {
    min-height: 300px;
}

.marketing-side-panel {
    background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
    border: 1px solid var(--border-soft);
    border-radius: 1.25rem;
    padding: 1.25rem;
}

body.theme-dark .neutral-pill {
    color: #93c5fd;
}

body.theme-dark .marketing-selected-campaign-pill,
body.theme-dark .marketing-side-panel {
    color: var(--slate-200);
}

.settings-page {
    --settings-ring: rgba(37, 99, 235, 0.16);
}

.settings-page .card,
.settings-page .rounded-4.border,
.settings-page .form-select,
.settings-page .input-group-text,
.settings-page .btn,
.settings-page .alert,
.settings-page .badge {
    border-radius: 1rem;
}

.settings-hero {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--bg-surface)) 0%, var(--bg-surface) 56%, color-mix(in srgb, #8b5cf6 10%, var(--bg-surface)) 100%);
    border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent);
}

.settings-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.settings-title {
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--slate-900);
}

.settings-subtitle {
    max-width: 62ch;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.75;
}

.settings-status-panel {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-soft);
    background: color-mix(in srgb, var(--bg-surface) 94%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.settings-status-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.settings-status-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.settings-status-item strong {
    color: var(--slate-900);
    font-size: .95rem;
}

.settings-form-card,
.settings-preview-card {
    background: color-mix(in srgb, var(--bg-surface) 96%, transparent);
    border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent);
}

.settings-badge {
    padding: .7rem 1rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.settings-badge-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.22);
}

.settings-badge-neutral {
    background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
    color: var(--text-secondary);
    border-color: var(--border-soft);
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.settings-field .form-label {
    margin-bottom: 0;
    font-weight: 700;
    color: var(--slate-900);
}

.settings-input-shell {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .3rem .3rem .3rem .9rem;
    border-radius: 1.15rem;
    border: 1px solid var(--border-soft);
    background: color-mix(in srgb, var(--bg-soft) 94%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.settings-input-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    flex-shrink: 0;
}

.settings-input {
    border: 0;
    background: transparent;
    min-height: 3.25rem;
    padding-left: 0;
    padding-right: .85rem;
    box-shadow: none !important;
    font-weight: 600;
    color: var(--slate-900);
}

.settings-input:focus {
    border: 0;
    box-shadow: none;
}

.settings-input-shell:focus-within {
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border-soft));
    box-shadow: 0 0 0 .25rem var(--settings-ring);
}

.settings-live-preview {
    border-radius: 1.6rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 96%, transparent) 0%, color-mix(in srgb, var(--primary) 6%, var(--bg-surface)) 100%);
    border: 1px solid color-mix(in srgb, var(--border-soft) 92%, transparent);
}

.settings-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

.settings-preview-kicker {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
    font-weight: 800;
    margin-bottom: .4rem;
}

.settings-preview-title {
    color: var(--slate-900);
    font-size: 1.25rem;
    font-weight: 800;
}

.settings-preview-copy {
    color: var(--text-secondary);
    line-height: 1.7;
}

.settings-theme-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: .65rem .9rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    font-weight: 800;
}

.settings-preview-metric {
    height: 100%;
    padding: 1rem 1.1rem;
    border-radius: 1.15rem;
    background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent);
}

.settings-preview-metric span,
.settings-sample-row span {
    display: block;
    color: var(--text-secondary);
    font-size: .83rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.settings-preview-metric strong,
.settings-sample-row strong {
    color: var(--slate-900);
    font-size: 1rem;
    font-weight: 800;
}

.settings-preview-samples {
    display: grid;
    gap: .85rem;
    margin-top: 1.25rem;
}

.settings-sample-row {
    padding: 1rem 1.1rem;
    border-radius: 1.15rem;
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
    border: 1px dashed color-mix(in srgb, var(--primary) 24%, var(--border-soft));
}

.settings-side-note {
    display: flex;
    gap: 1rem;
    align-items: start;
    padding: 1.1rem 1.15rem;
    border-radius: 1.25rem;
    background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
    border: 1px solid var(--border-soft);
}

.settings-side-note-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--success-soft) 90%, transparent);
    color: #16a34a;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.settings-toast-container {
    z-index: 1085;
}

.settings-toast {
    background: linear-gradient(135deg, #0f766e 0%, #0f9f8f 100%);
    color: white;
    min-width: 320px;
    box-shadow: 0 18px 45px rgba(15, 118, 110, 0.32);
}

.settings-toast .btn-close {
    filter: invert(1);
}

.settings-toast.settings-toast-error {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    box-shadow: 0 18px 45px rgba(185, 28, 28, 0.28);
}

body.theme-dark .settings-hero,
body.theme-dark .settings-form-card,
body.theme-dark .settings-preview-card,
body.theme-dark .settings-live-preview,
body.theme-dark .settings-status-panel,
body.theme-dark .settings-preview-metric,
body.theme-dark .settings-sample-row,
body.theme-dark .settings-side-note,
body.theme-dark .settings-input-shell {
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
    border-color: var(--border-soft);
}

body.theme-dark .settings-title,
body.theme-dark .settings-field .form-label,
body.theme-dark .settings-status-item strong,
body.theme-dark .settings-preview-title,
body.theme-dark .settings-preview-metric strong,
body.theme-dark .settings-sample-row strong,
body.theme-dark .settings-input {
    color: var(--text-primary);
}

body.theme-dark .settings-badge-neutral {
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-secondary);
}

body.theme-dark .settings-badge-warning {
    background: rgba(245, 158, 11, 0.16);
    color: #fde68a;
}

body.theme-dark .settings-page .rounded-4.border,
body.theme-dark .settings-page .alert,
body.theme-dark .settings-page .badge.text-bg-light,
body.theme-dark .settings-page .bg-body-tertiary {
    background: #0f172a !important;
    color: var(--text-primary) !important;
    border-color: var(--border-soft) !important;
}

body.theme-dark .settings-page .badge.text-bg-warning-subtle {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

body.theme-dark .btn-outline-secondary {
    color: var(--text-primary);
    border-color: var(--border-soft);
}

body.theme-dark .btn-outline-secondary:hover {
    background: #1e293b;
    border-color: #334155;
}

.table thead th {
    background: #eff6ff;
    border-bottom: 0;
    color: #334155;
    font-weight: 600;
}

@media (max-width: 1199.98px) {
    .settings-status-panel {
        margin-top: .5rem;
    }

    .settings-preview-header {
        flex-direction: column;
    }

    .settings-theme-pill {
        min-width: 0;
        width: fit-content;
    }

    .hero-card {
        padding: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .topbar {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .chart-container,
    .tall-chart {
        height: 300px;
    }
}

@media (max-width: 575.98px) {

    .settings-live-preview,
    .settings-status-panel,
    .settings-preview-metric,
    .settings-sample-row,
    .settings-side-note {
        padding: 1rem;
    }

    .settings-title {
        font-size: 1.8rem;
    }

    .page-content {
        padding: 1rem !important;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .executive-filter-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    .region-select {
        min-width: 0;
        width: 100%;
    }
}