/*
   Theme commun Pro Web.
   Ce fichier donne une base claire/foncee reutilisable entre Mondial Car,
   Universal Concept et Venizi, sans retirer les styles propres a chaque app.
*/
:root {
    --app-bg: #0b1422;
    --app-surface: #122238;
    --app-surface-2: #18314a;
    --app-text: #f6fbff;
    --app-muted: #9fc7ef;
    --app-border: #31506e;
    --app-field-bg: #1b3147;
    --app-field-text: #f8fafc;
    --app-field-border: #58708a;
    --app-primary: #2f7df6;
    --app-secondary: #40566d;
    --app-danger: #c23b1d;
    --app-success: #1f8d52;
    --app-warning: #ffd94d;
    --app-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

html[data-app-theme="light"] {
    --app-bg: #eef4f9;
    --app-surface: #ffffff;
    --app-surface-2: #dfeaf4;
    --app-text: #102033;
    --app-muted: #2f668f;
    --app-border: #b7cadc;
    --app-field-bg: #fff4b8;
    --app-field-text: #071522;
    --app-field-border: #d8c06a;
    --app-primary: #2875dc;
    --app-secondary: #516982;
    --app-danger: #bd2f17;
    --app-success: #18804a;
    --app-warning: #c99700;
    --app-shadow: 0 14px 38px rgba(37, 58, 79, 0.18);
}

html[data-app-theme="dark"] {
    color-scheme: dark;
}

html[data-app-theme="light"] {
    color-scheme: light;
}

html[data-app-theme] body {
    background: var(--app-bg);
    color: var(--app-text);
}

html[data-app-theme] input,
html[data-app-theme] select,
html[data-app-theme] textarea {
    background: var(--app-field-bg);
    color: var(--app-field-text);
    border-color: var(--app-field-border);
}

html[data-app-theme] .panel,
html[data-app-theme] fieldset,
html[data-app-theme] .listbox,
html[data-app-theme] .table-shell,
html[data-app-theme] .form-panel,
html[data-app-theme] .home-reminder-card,
html[data-app-theme] .rights-card {
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

html[data-app-theme] .panel-header,
html[data-app-theme] .table-header,
html[data-app-theme] .signal-table-header,
html[data-app-theme] .home-reminder-header {
    background: var(--app-surface-2);
    border-color: var(--app-border);
    color: var(--app-text);
}

html[data-app-theme] h1,
html[data-app-theme] h2,
html[data-app-theme] h3,
html[data-app-theme] legend,
html[data-app-theme] .panel-header h2,
html[data-app-theme] .page-header h2 {
    color: var(--app-warning);
    letter-spacing: 0;
}

html[data-app-theme] label,
html[data-app-theme] label span,
html[data-app-theme] .muted,
html[data-app-theme] .empty {
    color: var(--app-text);
}

html[data-app-theme="light"] .muted,
html[data-app-theme="light"] .empty,
html[data-app-theme="light"] small {
    color: var(--app-muted);
}

.theme-toggle,
.top-theme-toggle,
[data-theme-toggle] {
    background: var(--app-secondary);
    color: #ffffff;
}

.app-message-dialog,
.app-confirm-dialog,
.theme-modal {
    width: min(460px, calc(100vw - 28px));
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: var(--app-shadow);
}

.app-message-dialog::backdrop,
.app-confirm-dialog::backdrop,
.theme-modal::backdrop {
    background: rgba(4, 10, 18, 0.58);
}

.app-message-card,
.theme-modal-card {
    margin: 0;
    display: grid;
    gap: 0;
    background: var(--app-surface);
    color: var(--app-text);
}

.app-message-head,
.theme-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-warning);
    font-weight: 900;
    text-transform: uppercase;
}

.app-message-body,
.theme-modal-body {
    padding: 14px 16px;
    color: var(--app-text);
}

.app-message-line {
    margin: 0;
    font-weight: 800;
    line-height: 1.35;
}

.app-message-success { color: var(--app-success); }
.app-message-error { color: var(--app-danger); }
.app-message-warning { color: var(--app-warning); }

.app-message-actions,
.theme-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 16px 14px;
}

.app-message-close {
    min-width: 30px;
    min-height: 30px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.global-readonly-note,
.readonly-note {
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px dashed var(--app-danger);
    background: color-mix(in srgb, var(--app-danger) 9%, var(--app-surface));
    color: var(--app-danger);
    font-weight: 900;
    text-transform: uppercase;
}

html[data-app-theme="light"] table th,
html[data-app-theme="light"] .dark-table th {
    color: #06182a;
}

html[data-app-theme="light"] table td,
html[data-app-theme="light"] .dark-table td {
    color: #071522;
}

/* Navigation et boutons communs aux 3 programmes */
html[data-app-theme] .top-main-button,
html[data-app-theme] .top-sub-button,
html[data-app-theme] .top-action-button,
html[data-app-theme] .nav-btn,
html[data-app-theme] .personnel-tab,
html[data-app-theme] .personnel-subnav a,
html[data-app-theme] .vehicle-subnav a,
html[data-app-theme] .signal-subnav a,
html[data-app-theme] .subnav a,
html[data-app-theme] .tab-button,
html[data-app-theme] .btn,
html[data-app-theme] .button,
html[data-app-theme] button,
html[data-app-theme] input[type="submit"] {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    box-shadow: 0 8px 22px rgba(4, 10, 18, 0.18);
}

html[data-app-theme="light"] .top-main-button,
html[data-app-theme="light"] .top-sub-button,
html[data-app-theme="light"] .top-action-button,
html[data-app-theme="light"] .nav-btn,
html[data-app-theme="light"] .personnel-tab,
html[data-app-theme="light"] .personnel-subnav a,
html[data-app-theme="light"] .vehicle-subnav a,
html[data-app-theme="light"] .signal-subnav a,
html[data-app-theme="light"] .subnav a,
html[data-app-theme="light"] .tab-button,
html[data-app-theme="light"] .btn,
html[data-app-theme="light"] .button,
html[data-app-theme="light"] button,
html[data-app-theme="light"] input[type="submit"] {
    border-color: #b8cadc;
    color: #06182a;
    box-shadow: 0 8px 18px rgba(46, 73, 101, 0.14);
}

html[data-app-theme] .top-main-button.is-active,
html[data-app-theme] .top-sub-button.is-active,
html[data-app-theme] .top-action-button.is-active,
html[data-app-theme] .nav-btn.active,
html[data-app-theme] .nav-btn.is-active,
html[data-app-theme] .personnel-tab.is-active,
html[data-app-theme] .personnel-subnav a.is-active,
html[data-app-theme] .vehicle-subnav a.is-active,
html[data-app-theme] .signal-subnav a.is-active,
html[data-app-theme] .subnav a.is-active,
html[data-app-theme] .tab-button.is-active {
    border-color: var(--app-warning);
    outline: 1px solid var(--app-warning);
    outline-offset: -2px;
}

html[data-app-theme] .module-home,
html[data-app-theme] .top-main-acceuil,
html[data-app-theme] .top-main-accueil,
html[data-app-theme] .nav-btn.blue,
html[data-app-theme] .personnel-subnav a:nth-child(1) {
    background: #1e3b5c;
    color: #ffffff;
}

html[data-app-theme] .module-purple,
html[data-app-theme] .nav-btn.purple,
html[data-app-theme] .personnel-subnav a:nth-child(2) {
    background: #8e2fd2;
    color: #ffffff;
}

html[data-app-theme] .module-cyan,
html[data-app-theme] .top-main-statistique,
html[data-app-theme] .nav-btn.cyan {
    background: #239bb6;
    color: #ffffff;
}

html[data-app-theme] .module-orange,
html[data-app-theme] .top-main-vr,
html[data-app-theme] .nav-btn.orange {
    background: #e67d1f;
    color: #ffffff;
}

html[data-app-theme] .module-magenta,
html[data-app-theme] .nav-btn.magenta {
    background: #c823d3;
    color: #ffffff;
}

html[data-app-theme] .module-teal,
html[data-app-theme] .top-main-transport,
html[data-app-theme] .nav-btn.teal {
    background: #0f817b;
    color: #ffffff;
}

html[data-app-theme] .module-gold,
html[data-app-theme] .top-main-pointage,
html[data-app-theme] .top-main-finance,
html[data-app-theme] .nav-btn.gold,
html[data-app-theme] .personnel-subnav a:nth-child(4) {
    background: #b8890f;
    color: #ffffff;
}

html[data-app-theme] .module-red,
html[data-app-theme] .nav-btn.red,
html[data-app-theme] .danger,
html[data-app-theme] button.danger,
html[data-app-theme] .btn-danger {
    background: #bd351c;
    color: #ffffff;
}

html[data-app-theme] .module-green,
html[data-app-theme] .top-main-garanties,
html[data-app-theme] .nav-btn.green,
html[data-app-theme] .btn-success {
    background: #1e8b55;
    color: #ffffff;
}

html[data-app-theme] .module-slate,
html[data-app-theme] .top-main-gestion,
html[data-app-theme] .top-main-signaletique,
html[data-app-theme] .nav-btn.slate,
html[data-app-theme] .theme-toggle,
html[data-app-theme] .top-theme-toggle,
html[data-app-theme] [data-theme-toggle] {
    background: #2f4157;
    color: #ffffff;
}

html[data-app-theme] .top-sub-button,
html[data-app-theme] .signal-subnav a,
html[data-app-theme] .subnav a,
html[data-app-theme] .vehicle-subnav a,
html[data-app-theme] .tab-button {
    background: #2f4157;
    color: #ffffff;
}

html[data-app-theme] .top-sub-button:nth-child(1),
html[data-app-theme] .signal-subnav a:nth-child(1),
html[data-app-theme] .subnav a:nth-child(1),
html[data-app-theme] .vehicle-subnav a:nth-child(1) {
    background: #2f7df6;
}

html[data-app-theme] .top-sub-button:nth-child(3n + 2),
html[data-app-theme] .signal-subnav a:nth-child(3n + 2),
html[data-app-theme] .subnav a:nth-child(3n + 2),
html[data-app-theme] .vehicle-subnav a:nth-child(3n + 2) {
    background: #2f4157;
}

html[data-app-theme] .top-sub-button:nth-child(3n),
html[data-app-theme] .signal-subnav a:nth-child(3n),
html[data-app-theme] .subnav a:nth-child(3n),
html[data-app-theme] .vehicle-subnav a:nth-child(3n) {
    background: #239bb6;
}

html[data-app-theme] .top-sub-button:nth-child(4n),
html[data-app-theme] .signal-subnav a:nth-child(4n),
html[data-app-theme] .subnav a:nth-child(4n),
html[data-app-theme] .vehicle-subnav a:nth-child(4n) {
    background: #c14921;
}

html[data-app-theme] .top-sub-button:nth-child(5n),
html[data-app-theme] .signal-subnav a:nth-child(5n),
html[data-app-theme] .subnav a:nth-child(5n),
html[data-app-theme] .vehicle-subnav a:nth-child(5n) {
    background: #b8890f;
}

html[data-app-theme="light"] .top-main-button,
html[data-app-theme="light"] .top-sub-button,
html[data-app-theme="light"] .top-action-button,
html[data-app-theme="light"] .nav-btn,
html[data-app-theme="light"] .personnel-tab,
html[data-app-theme="light"] .personnel-subnav a,
html[data-app-theme="light"] .vehicle-subnav a,
html[data-app-theme="light"] .signal-subnav a,
html[data-app-theme="light"] .subnav a,
html[data-app-theme="light"] .tab-button,
html[data-app-theme="light"] .theme-toggle,
html[data-app-theme="light"] [data-theme-toggle] {
    color: #ffffff;
}

/* Lisibilite generale en version claire */
html[data-app-theme="light"] body,
html[data-app-theme="light"] .content,
html[data-app-theme="light"] .shell {
    background: #e8f2fa;
    color: #071522;
}

html[data-app-theme="light"] .panel,
html[data-app-theme="light"] fieldset,
html[data-app-theme="light"] .listbox,
html[data-app-theme="light"] .table-shell,
html[data-app-theme="light"] .form-panel,
html[data-app-theme="light"] .home-reminder-card,
html[data-app-theme="light"] .rights-card,
html[data-app-theme="light"] .dashboard-card,
html[data-app-theme="light"] .note-card,
html[data-app-theme="light"] .chat-panel,
html[data-app-theme="light"] .sidebar,
html[data-app-theme="light"] .module-card {
    background: #ffffff;
    border-color: #b8cadc;
    color: #071522;
}

html[data-app-theme="light"] .panel-header,
html[data-app-theme="light"] .table-header,
html[data-app-theme="light"] .signal-table-header,
html[data-app-theme="light"] .home-reminder-header,
html[data-app-theme="light"] thead,
html[data-app-theme="light"] table th {
    background: #cfe0ee;
    color: #071522;
}

html[data-app-theme="light"] table,
html[data-app-theme="light"] .data-table,
html[data-app-theme="light"] .dark-table {
    background: #ffffff;
    color: #071522;
}

html[data-app-theme="light"] table tr:nth-child(even) td,
html[data-app-theme="light"] .data-row:nth-child(even) {
    background: #edf5fb;
}

html[data-app-theme="light"] table tr:nth-child(odd) td,
html[data-app-theme="light"] .data-row:nth-child(odd) {
    background: #dfeef7;
}

html[data-app-theme="light"] a,
html[data-app-theme="light"] .link-like {
    color: #005aa8;
}

html[data-app-theme="light"] .success,
html[data-app-theme="light"] .positive,
html[data-app-theme="light"] .credit-positive,
html[data-app-theme="light"] .status-ok {
    color: #047236;
}

html[data-app-theme="light"] .danger,
html[data-app-theme="light"] .negative,
html[data-app-theme="light"] .debit-negative,
html[data-app-theme="light"] .status-alert {
    color: #a71919;
}

html[data-app-theme="light"] .badge,
html[data-app-theme="light"] .status-badge,
html[data-app-theme="light"] .priority-badge {
    color: #ffffff;
}

/* Bloc utilisateur commun en haut a droite */
html[data-app-theme] .top-user-actions,
html[data-app-theme] .top-shell-actions,
html[data-app-theme] .user-zone {
    display: grid;
    align-content: start;
    justify-items: end;
    gap: 6px;
    margin-left: auto;
    min-width: max-content;
}

html[data-app-theme] .top-user-line {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
}

html[data-app-theme] .top-user-line form {
    margin: 0;
}

html[data-app-theme] .top-user-box,
html[data-app-theme] .top-shell-user,
html[data-app-theme] .user-zone > span {
    display: grid;
    align-content: center;
    min-width: 76px;
    color: var(--app-text);
    line-height: 1.05;
}

html[data-app-theme] .top-user-box strong,
html[data-app-theme] .top-shell-user strong,
html[data-app-theme] .user-zone > span strong {
    color: var(--app-text);
    font-size: 14px;
    font-weight: 900;
}

html[data-app-theme] .top-user-box span,
html[data-app-theme] .top-shell-user span,
html[data-app-theme] .user-zone > span small {
    color: var(--app-muted);
    font-size: 11px;
    font-weight: 700;
}

html[data-app-theme] .top-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 14px;
    text-decoration: none;
    white-space: nowrap;
}

html[data-app-theme] .top-action-danger {
    background: #bd351c !important;
    color: #ffffff !important;
}

html[data-app-theme] .top-export-button {
    background: #148a50 !important;
    color: #ffffff !important;
}

html[data-app-theme] .top-export-menu {
    position: relative;
}

html[data-app-theme] .top-export-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 50;
    display: none;
    min-width: 150px;
    padding: 6px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

html[data-app-theme] .top-export-menu:hover .top-export-dropdown,
html[data-app-theme] .top-export-menu:focus-within .top-export-dropdown {
    display: grid;
    gap: 4px;
}

html[data-app-theme] .top-export-dropdown a {
    display: block;
    padding: 7px 9px;
    color: var(--app-text);
    text-decoration: none;
    font-weight: 800;
}

html[data-app-theme] .top-export-dropdown a:hover {
    background: var(--app-surface-2);
}

/* Header commun strict: memes tailles, meme alignement, meme rendu */
html[data-app-theme] .top-shell,
html[data-app-theme] .topbar {
    min-height: 104px !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 220px minmax(0, 1fr) 238px !important;
    grid-template-rows: 40px 30px !important;
    align-content: center !important;
    align-items: center !important;
    gap: 6px 12px !important;
    padding: 9px 12px !important;
    border-bottom: 1px solid var(--app-border) !important;
    background: linear-gradient(180deg, var(--app-surface) 0%, var(--app-bg) 100%) !important;
    color: var(--app-text) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18) !important;
}

html[data-app-theme="light"] .top-shell,
html[data-app-theme="light"] .topbar {
    background: linear-gradient(180deg, #f8fbff, #eaf2f9) !important;
    color: #102033 !important;
}

html[data-app-theme] .top-logo-link,
html[data-app-theme] .brand {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 220px !important;
    min-width: 220px !important;
    height: 82px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

html[data-app-theme] .top-logo-img,
html[data-app-theme] .brand-logo {
    width: 220px !important;
    height: 82px !important;
    box-sizing: border-box !important;
    display: grid !important;
    place-items: center !important;
    align-content: center !important;
    padding: 6px 14px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    object-fit: contain !important;
    box-shadow: none !important;
}

html[data-app-theme] .brand-logo strong {
    display: block !important;
    margin: 0 !important;
    color: #071522 !important;
    font-size: 34px !important;
    font-weight: 300 !important;
    letter-spacing: 8px !important;
    line-height: 1 !important;
}

html[data-app-theme] .brand-logo span {
    display: block !important;
    margin-top: 8px !important;
    color: #777777 !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    letter-spacing: 6px !important;
}

html[data-app-theme] .top-primary-nav,
html[data-app-theme] .main-nav {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(9, minmax(74px, 1fr)) !important;
    gap: 7px !important;
    align-items: center !important;
    align-self: center !important;
    width: 100% !important;
    margin: 0 !important;
}

html[data-app-theme] .top-secondary-nav,
html[data-app-theme] .subnav,
html[data-app-theme] .signal-subnav {
    grid-column: 2 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    align-items: center !important;
    align-self: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

html[data-app-theme] .top-shell .signal-subnav {
    justify-content: space-between !important;
}

html[data-app-theme] .top-shell .signal-subnav-links,
html[data-app-theme] .top-shell .signal-subnav-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    align-items: center !important;
    margin: 0 !important;
}

html[data-app-theme] .top-shell .signal-subnav-actions form {
    display: inline-flex !important;
    margin: 0 !important;
}

html[data-app-theme] .top-main-button,
html[data-app-theme] .nav-btn {
    min-height: 40px !important;
    height: 40px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 8px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.05 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    white-space: normal !important;
}

html[data-app-theme] .top-sub-button,
html[data-app-theme] .subnav a,
html[data-app-theme] .personnel-tab,
html[data-app-theme] .personnel-subnav a,
html[data-app-theme] .vehicle-subnav a,
html[data-app-theme] .signal-subnav a {
    min-height: 30px !important;
    height: 30px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 11px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1.05 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
}

html[data-app-theme] .top-user-actions,
html[data-app-theme] .top-shell-actions,
html[data-app-theme] .user-zone {
    grid-column: 3 !important;
    grid-row: 1 / span 2 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-content: center !important;
    justify-items: end !important;
    gap: 4px !important;
    width: 238px !important;
    min-width: 238px !important;
    margin: 0 !important;
    color: var(--app-text) !important;
}

html[data-app-theme] .top-user-line {
    display: grid !important;
    grid-template-columns: 150px 78px !important;
    gap: 7px !important;
    align-items: center !important;
    justify-content: end !important;
    width: 100% !important;
}

html[data-app-theme] .top-user-line form {
    width: 100% !important;
    margin: 0 !important;
}

html[data-app-theme] .top-user-line .top-action-button,
html[data-app-theme] .top-user-line button,
html[data-app-theme] .top-user-line a {
    width: 100% !important;
    min-height: 26px !important;
    height: 26px !important;
    box-sizing: border-box !important;
    padding: 0 8px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    font-weight: 900 !important;
}

html[data-app-theme] .top-user-box,
html[data-app-theme] .top-shell-user,
html[data-app-theme] .user-zone > span {
    width: 78px !important;
    min-width: 78px !important;
    text-align: left !important;
}

html[data-app-theme] .top-user-box strong,
html[data-app-theme] .top-shell-user strong,
html[data-app-theme] .user-zone > span strong {
    font-size: 12px !important;
    line-height: 1 !important;
}

html[data-app-theme] .top-user-box span,
html[data-app-theme] .top-shell-user span,
html[data-app-theme] .user-zone > span small {
    font-size: 10px !important;
    line-height: 1 !important;
}

/* Palette commune stricte et vive pour tous les programmes */
html[data-app-theme] {
    --pro-blue: #2478f2;
    --pro-navy: #173653;
    --pro-green: #1f955a;
    --pro-teal: #07877f;
    --pro-cyan: #20a7c3;
    --pro-orange: #f0841f;
    --pro-purple: #9630d7;
    --pro-magenta: #cf22d8;
    --pro-red: #c63b1d;
    --pro-gold: #c19010;
    --pro-slate: #3c4d62;
    --pro-text-on-button: #ffffff;
}

html[data-app-theme] .top-main-button,
html[data-app-theme] .top-sub-button,
html[data-app-theme] .top-action-button,
html[data-app-theme] .nav-btn,
html[data-app-theme] .subnav a,
html[data-app-theme] .personnel-tab,
html[data-app-theme] .personnel-subnav a,
html[data-app-theme] .vehicle-subnav a,
html[data-app-theme] .signal-subnav a,
html[data-app-theme] .button,
html[data-app-theme] .btn,
html[data-app-theme] button {
    color: var(--pro-text-on-button) !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24) !important;
}

html[data-app-theme] .top-main-acceuil,
html[data-app-theme] .top-main-accueil,
html[data-app-theme] .module-home,
html[data-app-theme] .nav-btn.blue {
    background: linear-gradient(180deg, #1f466c, var(--pro-navy)) !important;
}

html[data-app-theme] .top-main-garanties,
html[data-app-theme] .module-green,
html[data-app-theme] .nav-btn.green {
    background: linear-gradient(180deg, #27a96a, var(--pro-green)) !important;
}

html[data-app-theme] .top-main-transport,
html[data-app-theme] .module-teal,
html[data-app-theme] .nav-btn.teal {
    background: linear-gradient(180deg, #0e9a91, var(--pro-teal)) !important;
}

html[data-app-theme] .top-main-vr,
html[data-app-theme] .module-orange,
html[data-app-theme] .nav-btn.orange {
    background: linear-gradient(180deg, #ff982f, var(--pro-orange)) !important;
}

html[data-app-theme] .top-main-pointage,
html[data-app-theme] .top-main-compta,
html[data-app-theme] .module-gold,
html[data-app-theme] .nav-btn.gold {
    background: linear-gradient(180deg, #d4a51b, var(--pro-gold)) !important;
}

html[data-app-theme] .top-main-finance,
html[data-app-theme] .top-main-gestion,
html[data-app-theme] .top-main-signaletique,
html[data-app-theme] .module-slate,
html[data-app-theme] .nav-btn.slate {
    background: linear-gradient(180deg, #4d627b, var(--pro-slate)) !important;
}

html[data-app-theme] .module-cyan,
html[data-app-theme] .top-main-statistique,
html[data-app-theme] .nav-btn.cyan {
    background: linear-gradient(180deg, #2db7d3, var(--pro-cyan)) !important;
}

html[data-app-theme] .module-purple,
html[data-app-theme] .nav-btn.purple {
    background: linear-gradient(180deg, #a93be8, var(--pro-purple)) !important;
}

html[data-app-theme] .module-magenta,
html[data-app-theme] .nav-btn.magenta {
    background: linear-gradient(180deg, #e02ae8, var(--pro-magenta)) !important;
}

html[data-app-theme] .module-red,
html[data-app-theme] .nav-btn.red {
    background: linear-gradient(180deg, #d84a28, var(--pro-red)) !important;
}

html[data-app-theme] .top-sub-button,
html[data-app-theme] .subnav a,
html[data-app-theme] .personnel-tab,
html[data-app-theme] .personnel-subnav a,
html[data-app-theme] .vehicle-subnav a,
html[data-app-theme] .signal-subnav a {
    background: linear-gradient(180deg, #4d627b, var(--pro-slate)) !important;
}

html[data-app-theme] .top-sub-button:nth-child(1),
html[data-app-theme] .subnav a:nth-child(1),
html[data-app-theme] .personnel-subnav a:nth-child(1),
html[data-app-theme] .vehicle-subnav a:nth-child(1),
html[data-app-theme] .signal-subnav a:nth-child(1) {
    background: linear-gradient(180deg, #358bff, var(--pro-blue)) !important;
}

html[data-app-theme] .top-sub-button:nth-child(3n),
html[data-app-theme] .subnav a:nth-child(3n),
html[data-app-theme] .personnel-subnav a:nth-child(3n),
html[data-app-theme] .vehicle-subnav a:nth-child(3n),
html[data-app-theme] .signal-subnav a:nth-child(3n) {
    background: linear-gradient(180deg, #2db7d3, var(--pro-cyan)) !important;
}

html[data-app-theme] .top-sub-button:nth-child(4n),
html[data-app-theme] .subnav a:nth-child(4n),
html[data-app-theme] .personnel-subnav a:nth-child(4n),
html[data-app-theme] .vehicle-subnav a:nth-child(4n),
html[data-app-theme] .signal-subnav a:nth-child(4n) {
    background: linear-gradient(180deg, #d84a28, var(--pro-red)) !important;
}

html[data-app-theme] .top-sub-button:nth-child(5n),
html[data-app-theme] .subnav a:nth-child(5n),
html[data-app-theme] .personnel-subnav a:nth-child(5n),
html[data-app-theme] .vehicle-subnav a:nth-child(5n),
html[data-app-theme] .signal-subnav a:nth-child(5n) {
    background: linear-gradient(180deg, #d4a51b, var(--pro-gold)) !important;
}

html[data-app-theme] .top-sub-button.is-active,
html[data-app-theme] .subnav a.active,
html[data-app-theme] .subnav a.is-active,
html[data-app-theme] .personnel-tab.is-active,
html[data-app-theme] .personnel-subnav a.is-active,
html[data-app-theme] .vehicle-subnav a.is-active,
html[data-app-theme] .signal-subnav a.is-active,
html[data-app-theme] .top-main-button.is-active,
html[data-app-theme] .nav-btn.active {
    border-color: #ffd84d !important;
    outline: 2px solid #ffd84d !important;
    outline-offset: -2px !important;
    filter: saturate(1.18) brightness(1.04) !important;
}

html[data-app-theme] .top-action-button {
    background: linear-gradient(180deg, #358bff, var(--pro-blue)) !important;
}

html[data-app-theme] .top-theme-toggle,
html[data-app-theme] [data-theme-toggle] {
    background: linear-gradient(180deg, #4d627b, var(--pro-slate)) !important;
}

html[data-app-theme] .top-action-danger,
html[data-app-theme] .danger,
html[data-app-theme] .btn-danger {
    background: linear-gradient(180deg, #d84a28, var(--pro-red)) !important;
}

html[data-app-theme="light"] .top-main-button,
html[data-app-theme="light"] .top-sub-button,
html[data-app-theme="light"] .top-action-button,
html[data-app-theme="light"] .nav-btn,
html[data-app-theme="light"] .subnav a,
html[data-app-theme="light"] .personnel-tab,
html[data-app-theme="light"] .personnel-subnav a,
html[data-app-theme="light"] .vehicle-subnav a,
html[data-app-theme="light"] .signal-subnav a,
html[data-app-theme="light"] .button,
html[data-app-theme="light"] .btn,
html[data-app-theme="light"] button {
    color: #ffffff !important;
    border-color: rgba(4, 18, 32, 0.18) !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28) !important;
}

html[data-app-theme="light"] .top-shell .top-sub-button,
html[data-app-theme="light"] .top-shell .top-sub-button *,
html[data-app-theme="light"] .top-shell .subnav a,
html[data-app-theme="light"] .top-shell .subnav a *,
html[data-app-theme="light"] .top-shell .trade-nav a,
html[data-app-theme="light"] .top-shell .trade-nav a *,
html[data-app-theme="light"] .top-shell .degustation-nav a,
html[data-app-theme="light"] .top-shell .degustation-nav a *,
html[data-app-theme="light"] .top-shell .personnel-subnav a,
html[data-app-theme="light"] .top-shell .personnel-subnav a *,
html[data-app-theme="light"] .top-shell .vehicle-subnav a,
html[data-app-theme="light"] .top-shell .vehicle-subnav a *,
html[data-app-theme="light"] .top-shell .signal-subnav a,
html[data-app-theme="light"] .top-shell .signal-subnav a * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.38) !important;
}

html[data-app-theme] .top-export-dropdown button {
    display: block;
    width: 100%;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    text-align: left;
    padding: 8px 12px;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: none !important;
    cursor: pointer;
}

html[data-app-theme] .top-export-dropdown button:hover {
    background: rgba(53, 139, 255, 0.22) !important;
}

/* Couche commune finale: refacturation comme reference visuelle globale */
html[data-app-theme] body {
    background: var(--app-bg) !important;
    color: var(--app-text) !important;
}

html[data-app-theme] .content,
html[data-app-theme] .module-page,
html[data-app-theme] .vehicle-full-panel,
html[data-app-theme] .degustation-summary,
html[data-app-theme] .home-dashboard {
    background: transparent !important;
    color: var(--app-text) !important;
}

html[data-app-theme] .panel,
html[data-app-theme] .list-panel,
html[data-app-theme] .form-panel,
html[data-app-theme] .stats-panel,
html[data-app-theme] .summary-card,
html[data-app-theme] .home-card,
html[data-app-theme] .home-reminder-card,
html[data-app-theme] .table-shell,
html[data-app-theme] .anacom-panel,
html[data-app-theme] .magasins-panel {
    background: var(--app-surface) !important;
    color: var(--app-text) !important;
    border: 1px solid var(--app-border) !important;
    box-shadow: none !important;
}

html[data-app-theme] .panel-header,
html[data-app-theme] .table-header,
html[data-app-theme] .home-reminder-header,
html[data-app-theme] .signal-table-header {
    min-height: 34px !important;
    padding: 7px 10px !important;
    background: var(--app-surface-2) !important;
    color: var(--app-text) !important;
    border-bottom: 1px solid var(--app-border) !important;
}

html[data-app-theme] .panel-header h1,
html[data-app-theme] .panel-header h2,
html[data-app-theme] .panel-header h3,
html[data-app-theme] legend,
html[data-app-theme] .page-title,
html[data-app-theme] .module-title {
    color: var(--app-warning) !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
}

html[data-app-theme] .live-filters,
html[data-app-theme] .vehicle-filters,
html[data-app-theme] .degustation-filters,
html[data-app-theme] .anacom-filters,
html[data-app-theme] .employee-filters,
html[data-app-theme] .magasins-filters,
html[data-app-theme] .caisse-filters,
html[data-app-theme] .personnel-search,
html[data-app-theme] .status-filter {
    background: var(--app-surface) !important;
    color: var(--app-text) !important;
    border: 1px solid var(--app-border) !important;
    padding: 8px !important;
    gap: 8px !important;
}

html[data-app-theme] .live-filters label span,
html[data-app-theme] .vehicle-filters label span,
html[data-app-theme] .degustation-filters label span,
html[data-app-theme] .anacom-filters label span,
html[data-app-theme] .employee-filters label span,
html[data-app-theme] .magasins-filters label span,
html[data-app-theme] .caisse-filters label span {
    color: var(--app-muted) !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
}

html[data-app-theme] input,
html[data-app-theme] select,
html[data-app-theme] textarea,
html[data-app-theme] .dark-table input,
html[data-app-theme] .dark-table select,
html[data-app-theme] .dark-table textarea {
    min-height: 30px !important;
    background: var(--app-field-bg) !important;
    color: var(--app-field-text) !important;
    border: 1px solid var(--app-field-border) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

html[data-app-theme] table,
html[data-app-theme] .dark-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: var(--app-surface) !important;
    color: var(--app-text) !important;
    font-size: 13px !important;
}

html[data-app-theme] table thead th,
html[data-app-theme] .dark-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #1f4b6f !important;
    color: #8fd1ff !important;
    border: 1px solid var(--app-border) !important;
    padding: 7px 8px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
}

html[data-app-theme] table tbody td,
html[data-app-theme] .dark-table tbody td {
    background: transparent !important;
    color: var(--app-text) !important;
    border: 1px solid color-mix(in srgb, var(--app-border) 72%, transparent) !important;
    padding: 6px 8px !important;
    vertical-align: middle !important;
}

html[data-app-theme] table tbody tr:nth-child(odd),
html[data-app-theme] .dark-table tbody tr:nth-child(odd) {
    background: color-mix(in srgb, var(--app-surface-2) 44%, var(--app-surface)) !important;
}

html[data-app-theme] table tbody tr:nth-child(even),
html[data-app-theme] .dark-table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--app-surface-2) 22%, var(--app-surface)) !important;
}

html[data-app-theme] table tbody tr:hover,
html[data-app-theme] .dark-table tbody tr:hover {
    background: color-mix(in srgb, var(--app-primary) 25%, var(--app-surface)) !important;
}

html[data-app-theme] .badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 30px !important;
    min-height: 26px !important;
    padding: 3px 8px !important;
    border: 1px solid #ffd84d !important;
    border-radius: 999px !important;
    background: #ffd84d !important;
    color: #071522 !important;
    font-weight: 900 !important;
}

html[data-app-theme] .status-pill,
html[data-app-theme] .refact-status {
    border-radius: 4px !important;
    padding: 3px 8px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
}

html[data-app-theme] .top-sub-button,
html[data-app-theme] .trade-tab,
html[data-app-theme] .degustation-tab,
html[data-app-theme] .personnel-tab,
html[data-app-theme] .vehicle-tab,
html[data-app-theme] .signal-subnav a,
html[data-app-theme] .subnav a,
html[data-app-theme] .vehicle-subnav a,
html[data-app-theme] .personnel-subnav a,
html[data-app-theme] .trade-subnav a,
html[data-app-theme] .degustation-subnav a {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
}

html[data-app-theme] .top-sub-button *,
html[data-app-theme] .trade-tab *,
html[data-app-theme] .degustation-tab *,
html[data-app-theme] .personnel-tab *,
html[data-app-theme] .vehicle-tab *,
html[data-app-theme] .signal-subnav a *,
html[data-app-theme] .subnav a *,
html[data-app-theme] .vehicle-subnav a *,
html[data-app-theme] .personnel-subnav a *,
html[data-app-theme] .trade-subnav a *,
html[data-app-theme] .degustation-subnav a * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-app-theme="light"] {
    --app-bg: #e8f1f8;
    --app-surface: #f8fbff;
    --app-surface-2: #d7e7f3;
    --app-text: #082039;
    --app-muted: #005f9e;
    --app-border: #a9c2d8;
    --app-field-bg: #fff2b3;
    --app-field-text: #071522;
    --app-field-border: #cfb657;
}

html[data-app-theme="light"] table tbody tr:nth-child(odd),
html[data-app-theme="light"] .dark-table tbody tr:nth-child(odd) {
    background: #eaf4fb !important;
}

html[data-app-theme="light"] table tbody tr:nth-child(even),
html[data-app-theme="light"] .dark-table tbody tr:nth-child(even) {
    background: #dcecf7 !important;
}

html[data-app-theme="light"] table tbody td,
html[data-app-theme="light"] .dark-table tbody td,
html[data-app-theme="light"] table tbody td *,
html[data-app-theme="light"] .dark-table tbody td * {
    color: #082039 !important;
}

html[data-app-theme="light"] .status-pill,
html[data-app-theme="light"] .refact-status,
html[data-app-theme="light"] .status-pill *,
html[data-app-theme="light"] .refact-status * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-app-theme] table .button,
html[data-app-theme] table .btn,
html[data-app-theme] table button,
html[data-app-theme] .dark-table .button,
html[data-app-theme] .dark-table .btn,
html[data-app-theme] .dark-table button,
html[data-app-theme="light"] table .button,
html[data-app-theme="light"] table .btn,
html[data-app-theme="light"] table button,
html[data-app-theme="light"] .dark-table .button,
html[data-app-theme="light"] .dark-table .btn,
html[data-app-theme="light"] .dark-table button {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: linear-gradient(180deg, #358bff, var(--pro-blue)) !important;
}

html[data-app-theme] table .button-danger,
html[data-app-theme] table .btn-danger,
html[data-app-theme] table .danger,
html[data-app-theme="light"] table .button-danger,
html[data-app-theme="light"] table .btn-danger,
html[data-app-theme="light"] table .danger {
    background: linear-gradient(180deg, #d84a28, var(--pro-red)) !important;
}

/* Correctif lisibilite: le theme commun ne doit pas effacer les couleurs metier. */
html[data-app-theme] .anacom-tab,
html[data-app-theme] .anacom-subnav a,
html[data-app-theme] .article-subnav a,
html[data-app-theme] .client-subnav a,
html[data-app-theme] .vehicle-tab,
html[data-app-theme] .vehicle-subnav a,
html[data-app-theme] .personnel-tab,
html[data-app-theme] .personnel-subnav a,
html[data-app-theme] .trade-tab,
html[data-app-theme] .trade-subnav a,
html[data-app-theme] .degustation-tab,
html[data-app-theme] .degustation-subnav a {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45) !important;
}

html[data-app-theme] .anacom-tab *,
html[data-app-theme] .anacom-subnav a *,
html[data-app-theme] .article-subnav a *,
html[data-app-theme] .client-subnav a *,
html[data-app-theme] .vehicle-tab *,
html[data-app-theme] .vehicle-subnav a *,
html[data-app-theme] .personnel-tab *,
html[data-app-theme] .personnel-subnav a *,
html[data-app-theme] .trade-tab *,
html[data-app-theme] .trade-subnav a *,
html[data-app-theme] .degustation-tab *,
html[data-app-theme] .degustation-subnav a * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-app-theme] .anacom-tab,
html[data-app-theme] .anacom-subnav a {
    background: #2f7df6 !important;
    border-color: rgba(255, 217, 77, 0.75) !important;
}

html[data-app-theme] .anacom-tab:not(.is-active),
html[data-app-theme] .anacom-subnav a:not(.is-active) {
    background: #1e3b5c !important;
}

/* Marques degustation: garder une barre laterale contrastée dans les deux themes. */
html[data-app-theme] .brand-link {
    background: #1e3b5c !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: rgba(159, 199, 239, 0.35) !important;
}

html[data-app-theme] .brand-link.is-active,
html[data-app-theme] .brand-link:hover {
    background: #2f7df6 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: #ffd84d !important;
}

html[data-app-theme] .brand-summary,
html[data-app-theme] .brand-summary-row,
html[data-app-theme] .brand-summary-total {
    color: var(--app-text) !important;
}

html[data-app-theme] .brand-summary h3,
html[data-app-theme] .brand-summary-row strong,
html[data-app-theme] .brand-summary-total strong {
    color: var(--app-warning) !important;
    -webkit-text-fill-color: var(--app-warning) !important;
}

html[data-app-theme] .brand-summary-row span,
html[data-app-theme] .brand-summary-total span {
    color: var(--app-text) !important;
    -webkit-text-fill-color: var(--app-text) !important;
}

html[data-app-theme="light"] .brand-summary-row,
html[data-app-theme="light"] .brand-summary-total {
    background: #eaf4fb !important;
}

html[data-app-theme="light"] .brand-summary-row.is-active {
    background: #fff4bf !important;
    border-color: #ffd84d !important;
}

html[data-app-theme="dark"] .brand-summary-row.is-active {
    background: rgba(255, 217, 77, 0.14) !important;
    border-color: rgba(255, 217, 77, 0.65) !important;
}

/* Statuts: fonds et textes explicites, sans laisser le tableau les blanchir. */
html[data-app-theme] .status-pill,
html[data-app-theme] .status-pill *,
html[data-app-theme] .degustation-status,
html[data-app-theme] .degustation-status *,
html[data-app-theme] .action-stock-ok,
html[data-app-theme] .action-stock-ok *,
html[data-app-theme] .action-stock-bas,
html[data-app-theme] .action-stock-bas *,
html[data-app-theme] .action-stock-epuise,
html[data-app-theme] .action-stock-epuise * {
    -webkit-text-fill-color: currentColor !important;
}

html[data-app-theme] .action-stock-ok {
    background: #20a767 !important;
    color: #ffffff !important;
    border-color: #43d18f !important;
}

html[data-app-theme] .action-stock-bas {
    background: #f59e0b !important;
    color: #071522 !important;
    border-color: #ffd84d !important;
}

html[data-app-theme] .action-stock-epuise {
    background: #d93b2f !important;
    color: #ffffff !important;
    border-color: #ff9b92 !important;
}

html[data-app-theme] .status-ok-pill {
    background: #20a767 !important;
    color: #ffffff !important;
}

html[data-app-theme] .degustation-status.status-confirmed,
html[data-app-theme] .degustation-status.status-done {
    background: #198754 !important;
    color: #ffffff !important;
}

html[data-app-theme] .degustation-status.status-to-confirm,
html[data-app-theme] .degustation-status.status-waiting {
    background: #ffd84d !important;
    color: #071522 !important;
}

html[data-app-theme] .degustation-status.status-postponed {
    background: #2563eb !important;
    color: #ffffff !important;
}

html[data-app-theme] .degustation-status.status-cancelled {
    background: #dc2626 !important;
    color: #ffffff !important;
}

html[data-app-theme] .degustation-status.status-neutral {
    background: #475569 !important;
    color: #ffffff !important;
}

/* Vehicules: restaurer les couleurs "depasse / a venir / rdv / ok". */
html[data-app-theme] .vehicle-table .status-danger td {
    background: #7f1d1d !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-bottom-color: #ef4444 !important;
}

html[data-app-theme] .vehicle-table .status-warning td {
    background: #7c5f12 !important;
    color: #fff7d1 !important;
    -webkit-text-fill-color: #fff7d1 !important;
    border-bottom-color: #facc15 !important;
}

html[data-app-theme] .vehicle-table .status-rdv td {
    background: #0b4f8a !important;
    color: #e8f3ff !important;
    -webkit-text-fill-color: #e8f3ff !important;
    border-bottom-color: #38bdf8 !important;
}

html[data-app-theme] .vehicle-table .status-ok td {
    background: #14532d !important;
    color: #eafff1 !important;
    -webkit-text-fill-color: #eafff1 !important;
    border-bottom-color: #22c55e !important;
}

html[data-app-theme] .vehicle-table .status-neutral td {
    background: #334155 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-bottom-color: #64748b !important;
}

html[data-app-theme="light"] .vehicle-table .status-danger td {
    background: #f3c6c1 !important;
    color: #6e160f !important;
    -webkit-text-fill-color: #6e160f !important;
}

html[data-app-theme="light"] .vehicle-table .status-warning td {
    background: #fff0b9 !important;
    color: #5a4100 !important;
    -webkit-text-fill-color: #5a4100 !important;
}

html[data-app-theme="light"] .vehicle-table .status-rdv td {
    background: #cfe8ff !important;
    color: #073c68 !important;
    -webkit-text-fill-color: #073c68 !important;
}

html[data-app-theme="light"] .vehicle-table .status-ok td {
    background: #ccefdc !important;
    color: #084423 !important;
    -webkit-text-fill-color: #084423 !important;
}

html[data-app-theme="light"] .vehicle-table .status-neutral td {
    background: #d7e2ed !important;
    color: #0d2238 !important;
    -webkit-text-fill-color: #0d2238 !important;
}

html[data-app-theme] .vehicle-table .status-danger td *,
html[data-app-theme] .vehicle-table .status-warning td *,
html[data-app-theme] .vehicle-table .status-rdv td *,
html[data-app-theme] .vehicle-table .status-ok td *,
html[data-app-theme] .vehicle-table .status-neutral td * {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
}

/* Universal light mode: Visite PDV and monthly reviews still had legacy dark blocks. */
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-page,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-list,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-row,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-answer,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-shell,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-main {
    background: var(--app-bg) !important;
    color: var(--app-text) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-card,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-form,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-response-card,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-employees-panel,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-form-panel,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-table-panel,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-evaluation-panel {
    background: var(--app-panel) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-card-head,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-description,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-photo-strip,
html[data-theme-app="universal"][data-app-theme="light"] .check-line,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-kpi,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-employee-row,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-evaluation-row {
    background: var(--app-panel-soft) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
    -webkit-text-fill-color: var(--app-text) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-card h3,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-response-card h3,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-employee-row strong,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-evaluation-row strong,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-kpi strong,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-form label span {
    color: var(--app-text) !important;
    -webkit-text-fill-color: var(--app-text) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-card .eyebrow,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-response-card .eyebrow,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-kpi span,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-list-title,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-employee-row span,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-evaluation-row em {
    color: var(--app-muted) !important;
    -webkit-text-fill-color: var(--app-muted) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .reviews-header,
html[data-theme-app="universal"][data-app-theme="light"] .uc-reviews-page-header,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-table-panel .panel-header,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-form-panel .panel-header,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-evaluation-panel .panel-header {
    background: var(--app-panel-strong) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .reviews-header h2,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-header .eyebrow,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-form-panel .panel-header h3,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-table-panel .panel-header h3,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-evaluation-panel .panel-header h3 {
    color: var(--app-warning) !important;
    -webkit-text-fill-color: var(--app-warning) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .reviews-employee-row:hover,
html[data-theme-app="universal"][data-app-theme="light"] .reviews-employee-row.is-active {
    background: #fff4bf !important;
    border-color: var(--app-warning) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .reviews-table .review-positive td {
    background: #e6f7ed !important;
    color: #063f22 !important;
    -webkit-text-fill-color: #063f22 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .reviews-table .review-negative td {
    background: #fff0df !important;
    color: #6d2b00 !important;
    -webkit-text-fill-color: #6d2b00 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .reviews-table .review-positive td:nth-child(3) {
    color: #08783f !important;
    -webkit-text-fill-color: #08783f !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .reviews-table .review-negative td:nth-child(3) {
    color: #b45309 !important;
    -webkit-text-fill-color: #b45309 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-note,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-cancel-note {
    background: #fff4b8 !important;
    border-color: #d6a100 !important;
    color: #071522 !important;
    -webkit-text-fill-color: #071522 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-response-metrics span {
    background: #0f8f64 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-response-metrics .is-cancelled,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-absent-check {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #7f1d1d !important;
    -webkit-text-fill-color: #7f1d1d !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-photo-empty,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-no-photo {
    background: #f8fbff !important;
    border-color: var(--app-border) !important;
    color: var(--app-muted) !important;
    -webkit-text-fill-color: var(--app-muted) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-done-at,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-sale {
    color: #9a6a00 !important;
    -webkit-text-fill-color: #9a6a00 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-tabs .subtab {
    background: #eaf4fb !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
    -webkit-text-fill-color: var(--app-text) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-tabs .subtab.is-active,
html[data-theme-app="universal"][data-app-theme="light"] .visite-pdv-tabs .subtab:hover {
    background: #2f7df6 !important;
    border-color: var(--app-warning) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-dark-workspace,
html[data-theme-app="universal"][data-app-theme="light"] .prime-dark-panel,
html[data-theme-app="universal"][data-app-theme="light"] .prime-form-panel {
    background: var(--app-panel) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
    -webkit-text-fill-color: var(--app-text) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .panel-header,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .panel-header h2 {
    background: var(--app-header) !important;
    color: var(--app-warning) !important;
    -webkit-text-fill-color: var(--app-warning) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .caisse-balance-list {
    background: #f5f9fd !important;
    border-color: var(--app-border) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .caisse-balance-row,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .caisse-balance-total {
    background: #eaf4fb !important;
    border-color: #9fbbd3 !important;
    color: #071522 !important;
    -webkit-text-fill-color: #071522 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .caisse-balance-row span,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .caisse-balance-total span {
    color: #071522 !important;
    -webkit-text-fill-color: #071522 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .caisse-balance-row.is-active {
    background: #fff4bf !important;
    border-color: var(--app-warning) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-positive,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-positive * {
    color: #048849 !important;
    -webkit-text-fill-color: #048849 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-negative,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-negative * {
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
}

/* Prime - en version claire, le detail doit rester dans le style tableau clair du programme. */
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table thead th {
    background: #1f5678 !important;
    color: #d7f0ff !important;
    -webkit-text-fill-color: #d7f0ff !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table tbody td {
    background: #e8f2f9 !important;
    color: #061a2d !important;
    -webkit-text-fill-color: #061a2d !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table tbody tr:nth-child(even) td {
    background: #d6e5f1 !important;
    color: #061a2d !important;
    -webkit-text-fill-color: #061a2d !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table tbody tr:hover td {
    background: #c7d9e7 !important;
    color: #061a2d !important;
    -webkit-text-fill-color: #061a2d !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table .prime-positive,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table .prime-positive *,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table .prime-credit-cell,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table .prime-credit-cell * {
    color: #048849 !important;
    -webkit-text-fill-color: #048849 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table .prime-negative,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table .prime-negative *,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table .prime-debit-cell,
html[data-theme-app="universal"][data-app-theme="light"] .prime-page .prime-dark-table .prime-debit-cell * {
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
}

/* Notes de frais - meme lecture visuelle que Prime en version claire. */
html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .prime-dark-panel,
html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .prime-form-panel,
html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .prime-recap-panel {
    background: var(--app-panel) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
    -webkit-text-fill-color: var(--app-text) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .panel-header,
html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .panel-header h2 {
    background: var(--app-header) !important;
    color: var(--app-warning) !important;
    -webkit-text-fill-color: var(--app-warning) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .caisse-balance-list {
    background: #f5f9fd !important;
    border-color: var(--app-border) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .caisse-balance-row,
html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .caisse-balance-total {
    background: #eaf4fb !important;
    border-color: #9fbbd3 !important;
    color: #071522 !important;
    -webkit-text-fill-color: #071522 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .caisse-balance-row span,
html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .caisse-balance-total span {
    color: #071522 !important;
    -webkit-text-fill-color: #071522 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .caisse-balance-row.is-active {
    background: #fff4bf !important;
    border-color: var(--app-warning) !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .prime-positive,
html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .prime-positive * {
    color: #048849 !important;
    -webkit-text-fill-color: #048849 !important;
}

html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .prime-negative,
html[data-theme-app="universal"][data-app-theme="light"] .caisse-notes-page .prime-negative * {
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
}

/* Shared semantic action buttons - loaded last so table/button defaults cannot override them */
html[data-app-theme] .button.button-orange,
html[data-app-theme] a.button.button-orange,
html[data-app-theme] button.button-orange,
html[data-app-theme] table .button.button-orange,
html[data-app-theme] .dark-table .button.button-orange {
    background: #f59e0b !important;
    border-color: #b7791f !important;
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937 !important;
}

html[data-app-theme] .button.button-purple,
html[data-app-theme] a.button.button-purple,
html[data-app-theme] button.button-purple,
html[data-app-theme] table .button.button-purple,
html[data-app-theme] .dark-table .button.button-purple {
    background: #8b5cf6 !important;
    border-color: #6d28d9 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-app-theme] .button.button-success,
html[data-app-theme] a.button.button-success,
html[data-app-theme] button.button-success,
html[data-app-theme] table .button.button-success,
html[data-app-theme] .dark-table .button.button-success {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-app-theme] .button.button-danger,
html[data-app-theme] a.button.button-danger,
html[data-app-theme] button.button-danger,
html[data-app-theme] table .button.button-danger,
html[data-app-theme] .dark-table .button.button-danger,
html[data-app-theme] [data-action-kind="delete"],
html[data-mondial-theme] [data-action-kind="delete"],
html[data-universal-theme] [data-action-kind="delete"],
html[data-venizi-theme] [data-action-kind="delete"] {
    background: #dc2626 !important;
    border-color: #991b1b !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Mondial Car: bridge VR-specific form classes onto the shared theme tokens. */
html[data-theme-app="mondial"][data-app-theme] .vr-form-workspace,
html[data-theme-app="mondial"][data-app-theme] .vr-side-stack {
    color: var(--app-text) !important;
}

html[data-theme-app="mondial"][data-app-theme] .vr-dark-panel .panel-header {
    margin: 0 0 8px !important;
    background: var(--app-surface-2) !important;
    border-bottom: 1px solid var(--app-border) !important;
    color: var(--app-text) !important;
}

html[data-theme-app="mondial"][data-app-theme] .vr-section,
html[data-theme-app="mondial"][data-app-theme] .vr-history-panel .list-row,
html[data-theme-app="mondial"][data-app-theme] .vr-info-list div {
    background: var(--app-surface) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

html[data-theme-app="mondial"][data-app-theme] .vr-section h4,
html[data-theme-app="mondial"][data-app-theme] .vr-info-list strong,
html[data-theme-app="mondial"][data-app-theme] .vr-history-panel .list-row strong {
    color: var(--app-warning) !important;
}

html[data-theme-app="mondial"][data-app-theme] .vr-compact-form label span,
html[data-theme-app="mondial"][data-app-theme] .vr-selector-row label span,
html[data-theme-app="mondial"][data-app-theme] .vr-check-grid .checkbox-line,
html[data-theme-app="mondial"][data-app-theme] .vr-check-grid .checkbox-line span,
html[data-theme-app="mondial"][data-app-theme] .vr-info-list span,
html[data-theme-app="mondial"][data-app-theme] .vr-history-panel .list-row p {
    color: var(--app-text) !important;
}

html[data-theme-app="mondial"][data-app-theme] .vr-selector-row {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 8px !important;
    padding: 8px !important;
}

html[data-theme-app="mondial"][data-app-theme] .vr-dark-panel .badge {
    background: var(--app-warning) !important;
    border-color: var(--app-warning) !important;
    color: #102033 !important;
}
