/**
 * CMBE — mode CLAIR professionnel (presentation soignee)
 */

/* ─── Fond & structure pages ─── */
[data-theme="light"] body {
    background: var(--app-bg) !important;
    color: var(--app-text) !important;
}

[data-theme="light"] .app-main {
    background: transparent;
}

[data-theme="light"] .app-shell {
    color: var(--app-text);
}

[data-theme="light"] .app-topbar {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    box-shadow: var(--app-shadow-sm) !important;
    backdrop-filter: none;
}

[data-theme="light"] .app-topbar h4 {
    color: var(--app-text) !important;
}

[data-theme="light"] .topbar-search {
    background: var(--app-surface-muted) !important;
    border: 1px solid var(--app-border) !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
}

[data-theme="light"] .topbar-search .btn-dark {
    background: var(--app-navy) !important;
    border-color: var(--app-navy) !important;
    color: #fff !important;
}

[data-theme="light"] .user-pill {
    background: var(--app-surface-muted) !important;
    border: 1px solid var(--app-border) !important;
    color: var(--app-text-secondary) !important;
}

[data-theme="light"] .card {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    box-shadow: var(--app-shadow-sm) !important;
    color: var(--app-text) !important;
}

[data-theme="light"] .card-header {
    background: var(--app-surface-muted) !important;
    border-bottom: 1px solid var(--app-border) !important;
    color: var(--app-text) !important;
    font-weight: 700;
}

[data-theme="light"] .page-toolbar h5,
[data-theme="light"] .app-main h5,
[data-theme="light"] .app-main h4 {
    color: var(--app-text) !important;
}

/* ─── Formulaires & boutons ─── */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background: var(--app-input-bg) !important;
    border-color: var(--app-border-strong) !important;
    color: var(--app-text) !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    border-color: var(--app-primary) !important;
    box-shadow: 0 0 0 3px var(--app-primary-glow-soft) !important;
}

[data-theme="light"] .btn-outline-dark {
    color: var(--app-navy) !important;
    border-color: var(--app-border-strong) !important;
    background: var(--app-surface) !important;
}

[data-theme="light"] .btn-outline-dark:hover {
    background: var(--app-surface-muted) !important;
    border-color: var(--app-navy) !important;
    color: var(--app-navy) !important;
}

[data-theme="light"] .btn-dark {
    background: var(--app-navy) !important;
    border-color: var(--app-navy) !important;
    color: #fff !important;
}

[data-theme="light"] .btn-outline-secondary {
    color: var(--app-text-secondary) !important;
    border-color: var(--app-border-strong) !important;
    background: var(--app-surface) !important;
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-success {
    color: #fff !important;
}

/* ─── Tableaux ─── */
[data-theme="light"] .table {
    color: var(--app-text) !important;
    border-color: var(--app-border) !important;
}

[data-theme="light"] .table thead th {
    background: var(--app-table-head) !important;
    color: var(--app-text-secondary) !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--app-border-strong) !important;
}

[data-theme="light"] .table tbody td {
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

[data-theme="light"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--app-table-stripe) !important;
    color: var(--app-text) !important;
}

[data-theme="light"] .table-hover > tbody > tr:hover > * {
    background-color: var(--app-table-hover) !important;
}

/* ─── Dashboard ─── */
[data-theme="light"] .dashboard-page {
    background: var(--dash-surface) !important;
    border: 1px solid var(--dash-border) !important;
    box-shadow: var(--dash-shadow-lg) !important;
    color: var(--dash-text) !important;
}

[data-theme="light"] .dashboard-page::before {
    background: linear-gradient(90deg, var(--app-primary), var(--app-accent), var(--app-primary));
    opacity: 1;
}

[data-theme="light"] .situation-board {
    background: var(--dash-surface) !important;
    border: 1px solid var(--dash-border) !important;
    box-shadow: var(--dash-shadow) !important;
}

[data-theme="light"] .situation-board .p-2,
[data-theme="light"] .situation-board .p-md-3 {
    background: var(--dash-surface-muted) !important;
}

[data-theme="light"] .details-board {
    background: var(--dash-surface) !important;
    border: 1px solid var(--dash-border) !important;
    box-shadow: var(--dash-shadow) !important;
}

[data-theme="light"] .details-board .board-body {
    background: var(--dash-surface-muted) !important;
}

[data-theme="light"] .perf-ultra-card:not(.is-hero),
[data-theme="light"] .kpi-card,
[data-theme="light"] .kpi-card-ultra,
[data-theme="light"] .section-card,
[data-theme="light"] .left-stack-card,
[data-theme="light"] .situation-metric:not(.is-lead),
[data-theme="light"] .gauge-box,
[data-theme="light"] .broadcast-chart-panel,
[data-theme="light"] .party-detail-board,
[data-theme="light"] .stat-mini-box,
[data-theme="light"] .quick-counter-box {
    background: var(--dash-surface) !important;
    border: 1px solid var(--dash-border) !important;
    color: var(--dash-text) !important;
    box-shadow: var(--dash-shadow-sm) !important;
}

[data-theme="light"] .section-card .card-header,
[data-theme="light"] .dashboard-page .details-board .section-card .card-header {
    background: var(--dash-surface-muted) !important;
    border-bottom: 1px solid var(--dash-border) !important;
    color: var(--dash-text) !important;
}

[data-theme="light"] .dashboard-page .table-tight thead th {
    background: var(--app-table-head) !important;
    color: var(--app-text-secondary) !important;
    border-bottom: 2px solid var(--app-border-strong) !important;
}

[data-theme="light"] .dashboard-page .table-tight tbody td {
    border-color: var(--dash-border) !important;
    color: var(--dash-text) !important;
    background: var(--dash-surface) !important;
}

[data-theme="light"] .dashboard-page .table-tight tbody tr:nth-child(even) td {
    background: var(--app-table-stripe) !important;
}

[data-theme="light"] .dashboard-page .table-tight tbody tr:hover td {
    background: var(--app-table-hover) !important;
}

[data-theme="light"] .leader-spotlight {
    border: 1px solid var(--dash-border) !important;
    background: linear-gradient(135deg, var(--dash-surface) 0%, var(--dash-blue-soft) 100%) !important;
    box-shadow: var(--dash-shadow-sm) !important;
}

[data-theme="light"] .podium-item {
    border: 1px solid var(--dash-border) !important;
    background: var(--dash-surface) !important;
}

[data-theme="light"] .party-detail-item {
    background: var(--dash-surface) !important;
    border-right-color: var(--dash-border) !important;
}

[data-theme="light"] .party-detail-item .label,
[data-theme="light"] .party-detail-item .meta {
    color: var(--dash-muted) !important;
}

[data-theme="light"] .party-detail-item .value {
    color: var(--dash-text) !important;
}

[data-theme="light"] .nb-board {
    background: var(--dash-surface) !important;
    border: 1px solid var(--dash-border-strong) !important;
    box-shadow: var(--dash-shadow-lg) !important;
}

[data-theme="light"] .nb-kpi-strip {
    background: var(--dash-surface-muted) !important;
}

[data-theme="light"] .nb-kpi,
[data-theme="light"] .nb-table tbody td,
[data-theme="light"] .nb-detail-block {
    background: var(--dash-surface) !important;
}

[data-theme="light"] .nb-table thead th {
    background: var(--app-table-head) !important;
    color: var(--app-text-secondary) !important;
}

[data-theme="light"] .dashboard-page .badge.text-bg-light {
    background: var(--dash-surface-muted) !important;
    color: var(--app-text-secondary) !important;
    border: 1px solid var(--dash-border) !important;
}

[data-theme="light"] .text-muted {
    color: var(--app-muted) !important;
}

[data-theme="light"] .broadcast-footer {
    background: var(--dash-surface-muted) !important;
    border-top-color: var(--dash-border) !important;
    color: var(--dash-muted) !important;
}

/* ─── Pages Resultats / BV / Controle ─── */
[data-theme="light"] .stat-card,
[data-theme="light"] .mini-chart-card,
[data-theme="light"] .party-stats-card,
[data-theme="light"] .seat-card,
[data-theme="light"] .control-card,
[data-theme="light"] .collection-card,
[data-theme="light"] .filter-card,
[data-theme="light"] .table-wrap,
[data-theme="light"] .column-controls,
[data-theme="light"] .results-table-wrap {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    box-shadow: var(--app-shadow-sm) !important;
    color: var(--app-text) !important;
}

[data-theme="light"] .stat-card .label,
[data-theme="light"] .stat-card .trend-neutral,
[data-theme="light"] .seat-meta,
[data-theme="light"] .bulk-meta,
[data-theme="light"] .muted-kpi,
[data-theme="light"] .control-card .label,
[data-theme="light"] .collection-card .label,
[data-theme="light"] .filter-meta,
[data-theme="light"] .mini-legend-item {
    color: var(--app-muted) !important;
}

[data-theme="light"] .stat-card .value,
[data-theme="light"] .seat-card-head h6,
[data-theme="light"] .party-stats-head h6,
[data-theme="light"] .mini-chart-card h6,
[data-theme="light"] .control-card .value,
[data-theme="light"] .collection-card .value,
[data-theme="light"] .source-kv dd,
[data-theme="light"] .seat-formula strong {
    color: var(--app-text) !important;
}

[data-theme="light"] .stat-card .icon {
    background: var(--app-info-soft) !important;
    color: var(--app-accent) !important;
}

[data-theme="light"] .party-stats-head,
[data-theme="light"] .seat-card-head {
    border-bottom-color: var(--app-border) !important;
    background: var(--app-surface-muted) !important;
}

[data-theme="light"] .seat-formula {
    background: var(--app-surface-muted) !important;
    border-bottom-color: var(--app-border) !important;
    color: var(--app-text-secondary) !important;
}

[data-theme="light"] .party-toggle-group {
    border-color: var(--app-border-strong) !important;
}

[data-theme="light"] .party-toggle-btn {
    background: var(--app-surface) !important;
    color: var(--app-text-secondary) !important;
}

[data-theme="light"] .party-toggle-btn.is-active {
    background: var(--app-info-soft) !important;
    color: var(--app-accent) !important;
}

[data-theme="light"] .party-chip {
    background: var(--app-info-soft) !important;
    color: var(--app-accent) !important;
}

[data-theme="light"] .result-table tbody tr:nth-child(even),
[data-theme="light"] .table-pro tbody tr:nth-child(even) {
    background: var(--app-table-stripe) !important;
}

[data-theme="light"] .result-detail-list li {
    background: var(--app-surface-muted) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

[data-theme="light"] .result-detail-list li.empty {
    background: var(--app-surface) !important;
    color: var(--app-muted) !important;
}

[data-theme="light"] .vote-pill,
[data-theme="light"] .top-candidate-pill,
[data-theme="light"] .active-filter-chip {
    background: var(--app-surface-muted) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text-secondary) !important;
}

[data-theme="light"] .vote-pill strong,
[data-theme="light"] .top-candidate-pill {
    color: var(--app-accent) !important;
}

[data-theme="light"] .mini-track,
[data-theme="light"] .rate-track {
    background: var(--app-border) !important;
}

[data-theme="light"] .section-toolbar,
[data-theme="light"] .table-pro thead th {
    background: var(--app-table-head) !important;
    color: var(--app-text-secondary) !important;
    border-color: var(--app-border) !important;
}

[data-theme="light"] .column-control-item {
    color: var(--app-text-secondary) !important;
}

/* Badges statut */
[data-theme="light"] .status-badge.soft-success {
    color: var(--app-primary-deep) !important;
    background: var(--app-success-soft) !important;
    border-color: rgba(11, 104, 68, .2) !important;
}

[data-theme="light"] .status-badge.soft-warning {
    color: #92400e !important;
    background: var(--app-warning-soft) !important;
    border-color: rgba(217, 119, 6, .25) !important;
}

[data-theme="light"] .trend-badge.up {
    background: var(--app-success-soft) !important;
    color: var(--app-primary-deep) !important;
}

[data-theme="light"] .trend-badge.down {
    background: var(--app-danger-soft) !important;
    color: #991b1b !important;
}

[data-theme="light"] .trend-badge.neutral {
    background: var(--app-surface-muted) !important;
    color: var(--app-text-secondary) !important;
    border: 1px solid var(--app-border);
}

[data-theme="light"] .rank-badge {
    background: var(--app-info-soft) !important;
    color: var(--app-accent) !important;
    border: 1px solid rgba(30, 64, 175, .15);
}

/* Login */
[data-theme="light"] body.guest-layout .card {
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-lg) !important;
}

[data-theme="light"] body.guest-layout h3 {
    color: var(--app-text) !important;
}

[data-theme="light"] .cmbe-theme-fab {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border-strong) !important;
    box-shadow: var(--app-shadow-lg) !important;
}

[data-theme="light"] .alert-success {
    background: var(--app-success-soft) !important;
    color: var(--app-primary-deep) !important;
    border-color: rgba(11, 104, 68, .2) !important;
}

[data-theme="light"] .alert-danger {
    background: var(--app-danger-soft) !important;
    color: #991b1b !important;
}

[data-theme="light"] .alert-info {
    background: var(--app-info-soft) !important;
    color: var(--app-accent) !important;
}
