/* The presentation layer is opt-in. Keep the existing screen styles as the default. */
.msma-theme-control {
    --theme-control-bg: #fff;
    --theme-control-ink: #1e293b;
    --theme-control-border: #7b8ba1;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto !important;
    max-width: 100%;
    margin: 4px !important;
    padding: 4px 6px;
    border: 1px solid var(--theme-control-border);
    border-radius: 8px;
    background: var(--theme-control-bg);
    color: var(--theme-control-ink);
    font: 600 12px/1.4 system-ui, sans-serif;
}
.msma-theme-control span { white-space: nowrap; }
.msma-theme-control select {
    min-width: 0;
    max-width: min(208px, 56vw);
    min-height: 34px;
    padding: 4px;
    border: 1px solid var(--theme-control-border);
    border-radius: 5px;
    background: var(--theme-control-bg);
    color: var(--theme-control-ink);
    font: inherit;
}
.msma-theme-control:focus-within {
    outline: 2px solid var(--msma-focus, #2563eb) !important;
    outline-offset: 2px;
}
#msma-display-theme:focus {
    outline: 2px solid var(--msma-focus, #2563eb) !important;
    outline-offset: -2px;
}
.msma-theme-control-floating { position: fixed; z-index: 900; inset-inline-end: 12px; bottom: 12px; }
.msma-theme-secondary[hidden], .msma-theme-secondary [hidden] { display: none !important; }

@media print {
    .msma-theme-control, .msma-theme-secondary { display: none !important; }
}

@media screen {
    html[data-msma-theme]:where(:not([data-msma-theme="actuel"])) {
        --msma-bg: #f2f4f9;
        --msma-surface: #fff;
        --msma-ink: #18233a;
        --msma-muted: #4f6078;
        --msma-line: #d8e0ea;
        --msma-control-line: #74859a;
        --msma-brand: #4b50bf;
        --msma-brand-dark: #333899;
        --msma-action: #4146ac;
        --msma-on-action: #fff;
        --msma-theme-tint: #eceeff;
        --msma-focus: #4449b8;
        --msma-nav: #162842;
        --msma-nav-ink: #f0f5ff;
        --msma-nav-active: #334f77;
        --msma-danger: #a12327;
        --msma-danger-surface: #fce8e8;
        --msma-success: #14643f;
        --msma-success-surface: #e6f5eb;
        --msma-report-total: var(--msma-success);
        --msma-warning: #775011;
        --msma-warning-surface: #fff2d7;
        --msma-info: #1f5791;
        --msma-info-surface: #e7f1ff;
        --msma-radius: 8px;
        --msma-shadow: 0 5px 18px rgba(24, 35, 58, .07);
        --msma-theme-spacing: 12px;
        --msma-theme-rail-width: clamp(205px, 18vw, 260px);
        --msma-theme-font: Inter, "Segoe UI", Roboto, Arial, sans-serif;
        color-scheme: light;
    }
    html[data-msma-theme="double-menu"] {
        --msma-bg: #edf2f8;
        --msma-brand: #1858ad;
        --msma-brand-dark: #144789;
        --msma-action: #1858ad;
        --msma-theme-tint: #e5efff;
        --msma-focus: #1858ad;
        --msma-nav: #12253d;
        --msma-nav-active: #25466b;
    }
    html[data-msma-theme="modern"] {
        --msma-bg: #f3f6f8;
        --msma-ink: #172e39;
        --msma-muted: #4f6573;
        --msma-line: #dbe5ea;
        --msma-control-line: #778d98;
        --msma-brand: #116457;
        --msma-brand-dark: #0b5147;
        --msma-action: #116457;
        --msma-theme-tint: #e3f2ed;
        --msma-focus: #145ed0;
        --msma-nav: #192f3a;
        --msma-nav-ink: #e4eef2;
        --msma-nav-active: #294652;
        --msma-shadow: none;
        --msma-theme-spacing: 8px;
        --msma-theme-rail-width: 222px;
        --msma-theme-font: "Segoe UI", Arial, sans-serif;
    }
    html[data-msma-theme="atlas"] {
        --msma-bg: #edf2f8;
        --msma-brand: #1955ba;
        --msma-brand-dark: #143f91;
        --msma-action: #1955ba;
        --msma-theme-tint: #e8f0ff;
        --msma-focus: #1955ba;
        --msma-nav: #102040;
        --msma-nav-active: #25467a;
    }
    html[data-msma-theme="ardoise"] {
        --msma-bg: #171c22;
        --msma-surface: #202933;
        --msma-ink: #f0f5fa;
        --msma-muted: #bac8d5;
        --msma-line: #47576a;
        --msma-control-line: #8196aa;
        --msma-brand: #64dfd2;
        --msma-brand-dark: #94eee4;
        --msma-action: #64dfd2;
        --msma-on-action: #122a29;
        --msma-theme-tint: #224348;
        --msma-focus: #64dfd2;
        --msma-nav: #141e28;
        --msma-nav-active: #2b424f;
        --msma-danger: #ffb8b4;
        --msma-danger-surface: #542c33;
        --msma-success: #9ee9bb;
        --msma-success-surface: #244638;
        --msma-warning: #ffda9e;
        --msma-warning-surface: #513a24;
        --msma-info: #acd4ff;
        --msma-info-surface: #283f5c;
        --msma-shadow: 0 6px 20px rgba(0, 0, 0, .24);
        color-scheme: dark;
    }
    html[data-msma-theme="club-pro"] {
        --msma-bg: #f1f4fa;
        --msma-brand: #1c49b8;
        --msma-brand-dark: #163a93;
        --msma-action: #1c49b8;
        --msma-theme-tint: #e7efff;
        --msma-focus: #1c49b8;
        --msma-nav: #fff;
        --msma-nav-ink: #193456;
        --msma-nav-active: #e7efff;
        --msma-radius: 10px;
    }
    html[data-msma-theme="terrain"] {
        --msma-bg: #eef4f4;
        --msma-ink: #102e34;
        --msma-muted: #405b60;
        --msma-brand: #095a66;
        --msma-brand-dark: #064754;
        --msma-action: #f1ba4f;
        --msma-on-action: #233032;
        --msma-theme-tint: #fff0d0;
        --msma-focus: #075864;
        --msma-nav: #073841;
        --msma-nav-active: #195763;
        --msma-radius: 10px;
    }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body {
        background: var(--msma-bg) !important;
        color: var(--msma-ink) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .container1.div-bar:not(.access-heading) {
        background: var(--msma-heading-bg, #182944) !important;
        color: #fff !important;
    }
    html[data-msma-theme="ardoise"] { --msma-heading-bg: var(--msma-surface); }
    html[data-msma-theme]:not([data-msma-theme="actuel"]):not([dir="rtl"]) body:not(.rtl-page, [dir="rtl"]),
    html[data-msma-theme]:not([data-msma-theme="actuel"]):not([dir="rtl"]) body:not(.rtl-page, [dir="rtl"]) .ui-widget {
        font-family: var(--msma-theme-font) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(main, .ui-widget, .control-label, .ui-outputlabel) {
        color: var(--msma-ink);
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.text-muted, .help-block, .ui-paginator-current) { color: var(--msma-muted) !important; }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-panel, .ui-panel-content, .ui-dialog, .ui-dialog-content,
        .ui-fieldset, .ui-datatable-tablewrapper, .ui-tabs, .ui-tabs-panel, .ui-selectonemenu-panel, .ui-autocomplete-panel,
        .ui-menu, .ui-overlaypanel, .ui-datepicker, .ui-panelgrid-cell, .ui-datalist-content, .content-card, .filter-card,
        .create-card, .container1, .panel, .well, .modal-content, .dropdown-menu, .access-card, .access-tab-shell,
        .adherent-v2-toolbar, .dossier-module, .synthesis-card, .access-form-card, .access-toolbar, .access-panel, .access-form,
        .wa-card, .wa-steps article, .wa-preview, .wa-preview-text, .wa-document, .wa-counters > div, .msma-note-sheet) {
        background: var(--msma-surface) !important;
        border-color: var(--msma-line) !important;
        color: var(--msma-ink) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.content-card, .filter-card, .create-card, .container1,
        .panel, .well, .modal-content, .ui-dialog, .ui-fieldset, .access-card, .access-form-card, .adherent-v2-toolbar) {
        border-radius: var(--msma-radius) !important;
        box-shadow: var(--msma-shadow) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-panel-titlebar, .ui-dialog-titlebar,
        .ui-fieldset-legend, .ui-tabs-nav, .ui-paginator, .panel-heading, .modal-header) {
        background: var(--msma-theme-tint) !important;
        border-color: var(--msma-line) !important;
        color: var(--msma-ink) !important;
        text-shadow: none !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .ui-panel-titlebar .ui-panel-title { color: inherit !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.page-hero, .adherent-v2-hero, .access-heading) {
        background: var(--msma-surface) !important;
        border: 1px solid var(--msma-line) !important;
        border-inline-start: 4px solid var(--msma-brand) !important;
        border-radius: var(--msma-radius) !important;
        box-shadow: var(--msma-shadow) !important;
        color: var(--msma-ink) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.page-hero, .adherent-v2-hero, .access-heading) :is(h1, h2, a, .ui-outputlabel) { color: var(--msma-ink) !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.page-hero, .adherent-v2-hero, .access-heading) :is(p, .ui-outputlabel)::after,
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.page-hero, .adherent-v2-hero, .access-heading) :is(p, .adherent-v2-eyebrow) { color: var(--msma-muted) !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .page-hero::before { background: var(--msma-action); color: var(--msma-on-action); box-shadow: none; }
    html[data-msma-theme="modern"] body :is(.page-hero, .adherent-v2-hero) {
        min-block-size: 0;
        padding-block: 16px !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .msma-selection :is(.buttonClub, .buttonComp) {
        background-color: var(--msma-action) !important;
        color: var(--msma-on-action) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .msma-score-page .score-value { border-radius: var(--msma-radius); }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body.msma-access {
        --surface: var(--msma-surface);
        --ink: var(--msma-ink);
        --muted: var(--msma-muted);
        --border: var(--msma-line);
        --accent: var(--msma-brand);
        --accent-dark: var(--msma-brand-dark);
        --accent-soft: var(--msma-theme-tint);
    }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(input:not([type], [readonly]), input:is([type="text"], [type="search"],
        [type="email"], [type="password"], [type="number"], [type="date"], [type="time"], [type="tel"], [type="url"], [type="datetime-local"]),
        select, textarea, .ui-inputfield, .ui-selectonemenu, .ui-selectonemenu-label, .ui-selectonemenu-trigger, .form-control) {
        background: var(--msma-surface) !important;
        border-color: var(--msma-control-line) !important;
        border-radius: var(--msma-radius) !important;
        box-shadow: none !important;
        color: var(--msma-ink) !important;
        text-shadow: none !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(input, textarea)::placeholder { color: var(--msma-muted) !important; opacity: 1; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--msma-brand); }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-state-error, .has-error .form-control, [aria-invalid="true"]) { border-color: var(--msma-danger) !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(a[href], button, input, select, textarea, [tabindex]):focus-visible {
        outline: 2px solid var(--msma-focus) !important;
        outline-offset: 2px;
    }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.btn, .ui-button, .dossier-submit, .login-button, .access-button):not(.quick-action, [type="image"]) {
        background-color: var(--msma-theme-tint) !important;
        background-image: none !important;
        border-color: var(--msma-control-line) !important;
        border-radius: var(--msma-radius) !important;
        box-shadow: none !important;
        color: var(--msma-ink) !important;
        text-shadow: none !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.btn-primary, .ui-button-primary, .dossier-submit, .login-button,
        .access-button--primary, button[type="submit"], input[type="submit"]):not(.ui-button-danger, .btn-danger, .btn-success, .btn-warning, .btn-default, .ui-button-secondary, .quick-action) {
        background-color: var(--msma-action) !important;
        border-color: var(--msma-action) !important;
        border-radius: var(--msma-radius) !important;
        color: var(--msma-on-action) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.btn, .ui-button, .dossier-submit, .login-button, .access-button):not(.quick-action, [type="image"], :disabled, .ui-state-disabled):hover {
        box-shadow: inset 0 0 0 1px currentColor !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.btn, .ui-button, .form-control):is(:disabled, .ui-state-disabled, [aria-disabled="true"]) {
        background: var(--msma-bg) !important;
        border-color: var(--msma-line) !important;
        color: var(--msma-muted) !important;
        opacity: .8;
    }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-datatable, .table, .myTable, .access-table) thead th {
        background: var(--msma-theme-tint) !important;
        border-color: var(--msma-line) !important;
        color: var(--msma-ink) !important;
        text-shadow: none !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-datatable, .table, .myTable, .access-table) tbody tr,
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-datatable, .table, .myTable, .access-table) tbody :is(td, th) {
        background-color: var(--msma-surface) !important;
        border-color: var(--msma-line) !important;
        color: var(--msma-ink) !important;
        text-shadow: none !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-datatable, .table, .myTable, .access-table) tbody tr:is(:hover, .ui-state-highlight) > :is(td, th) {
        background-color: var(--msma-theme-tint) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-datatable, .table, .myTable, .access-table) :is(th, td) { padding-block: var(--msma-theme-spacing); }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .ui-datatable tbody tr.ui-datatable-empty-message > td {
        background: var(--msma-surface) !important;
        color: var(--msma-muted) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .ui-datatable-reflow > .ui-reflow-label {
        display: inline-block;
        padding: 4px 8px;
        background: var(--msma-surface) !important;
        border-radius: var(--msma-radius);
        color: var(--msma-ink) !important;
        text-shadow: none !important;
    }
    body.msma-access .access-matrix #page-matrix thead th:not(:first-child) {
        padding-inline: 6px !important;
        white-space: nowrap;
        overflow-wrap: normal;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-menuitem-link, .ui-selectonemenu-item, .ui-tabs-anchor, .ui-paginator a, .dropdown-menu a) { color: var(--msma-ink) !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-menuitem-link, .ui-selectonemenu-item):is(:hover, .ui-state-highlight, .ui-state-hover),
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.ui-tabs-nav, .ui-paginator) .ui-state-active {
        background: var(--msma-theme-tint) !important;
        color: var(--msma-ink) !important;
    }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.btn-danger, .ui-button-danger, .label-danger, .badge-danger,
        .ui-messages-error, .ui-message-error, .alert-danger, .access-error) {
        background: var(--msma-danger-surface) !important;
        border-color: var(--msma-danger) !important;
        color: var(--msma-danger) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.btn-success, .ui-button-success, .label-success, .badge-success,
        .ui-messages-info, .ui-message-info, .alert-success) {
        background: var(--msma-success-surface) !important;
        border-color: var(--msma-success) !important;
        color: var(--msma-success) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.btn-warning, .ui-button-warning, .label-warning, .badge-warning,
        .ui-messages-warn, .ui-message-warn, .alert-warning) {
        background: var(--msma-warning-surface) !important;
        border-color: var(--msma-warning) !important;
        color: var(--msma-warning) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.btn-info, .ui-button-info, .label-info, .badge-info, .alert-info) {
        background: var(--msma-info-surface) !important;
        border-color: var(--msma-info) !important;
        color: var(--msma-info) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .ui-button:not(.quick-action) :is(.ui-button-text, .ui-button-icon-left, .ui-button-icon-right),
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .msma-reference-toolbar .ui-button:not(.quick-action) :is(.ui-button-text, .ui-button-icon-left) {
        color: inherit !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .msma-reference-toolbar .ui-button::before { color: inherit !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .adherent-v2-eyebrow::before {
        background: var(--msma-brand);
        box-shadow: 0 0 0 4px var(--msma-theme-tint);
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .msma-reference-toolbar :is(.div-left, .div-right, .container1),
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.adherent-table-section, .coach-table-section) {
        background: var(--msma-surface) !important;
        border-color: var(--msma-line) !important;
        box-shadow: none !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .msma-reference-toolbar :is(.ui-outputlabel, .form-group label) { color: var(--msma-ink) !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.container1, .ui-dialog) .form-group > label,
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .operation-totals .ui-outputlabel {
        color: var(--msma-ink) !important;
        text-shadow: none !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .operation-totals .operation-credit { color: var(--msma-success) !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .operation-totals .operation-debit { color: var(--msma-danger) !important; }
    html[data-msma-theme="actuel"] body .operation-totals .operation-credit { color: #14643f !important; }
    html[data-msma-theme="actuel"] body .operation-totals .operation-debit { color: #a12327 !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(.wa-steps p, .wa-help) { color: var(--msma-muted) !important; }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body.msma-modern-page.performance-page {
        --performance-ink: var(--msma-ink);
        --performance-subtle: var(--msma-muted);
        --performance-canvas: var(--msma-bg);
        --performance-white: var(--msma-surface);
        --performance-line: var(--msma-line);
        --performance-brand: var(--msma-brand);
        --performance-brand-soft: var(--msma-theme-tint);
        --performance-shadow: var(--msma-shadow);
    }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body.presence-historique-page .pointage-module .attendance-history-filters {
        background: var(--msma-surface);
        border-color: var(--msma-line);
        color: var(--msma-ink);
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body.presence-historique-page :is(.pointage-entete p, .presence-historique-vide) {
        color: var(--msma-muted);
    }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) body.examens-page #passage .ui-button {
        background: var(--pg-button-bg, var(--msma-theme-tint)) !important;
        border-color: var(--pg-button-border, var(--msma-control-line)) !important;
        color: var(--pg-button-color, var(--msma-ink)) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body.examens-page #passage .ui-button.pg-danger {
        --pg-button-bg: var(--msma-danger-surface);
        --pg-button-color: var(--msma-danger);
    }
    html[data-msma-theme="actuel"] body.examens-page #passage .ui-button {
        background: var(--pg-button-bg, #0369a1) !important;
    }

    body.payment-list-page .payment-stats-card .payment-stat {
        --payment-status-ink: var(--msma-ink, #344054);
        --payment-status-surface: var(--msma-theme-tint, #eef2f7);
        background: var(--payment-status-surface) !important;
        border: 1px solid var(--payment-status-ink) !important;
        color: var(--payment-status-ink) !important;
    }
    body.payment-list-page .payment-stats-card .payment-stat .ui-outputlabel { color: inherit !important; }
    body.payment-list-page .payment-stats-card .payment-stat-paid {
        --payment-status-ink: var(--msma-success, #14643f);
        --payment-status-surface: var(--msma-success-surface, #e6f5eb);
    }
    body.payment-list-page .payment-stats-card :is(.payment-stat-partial, .payment-stat-absent) {
        --payment-status-ink: var(--msma-warning, #775011);
        --payment-status-surface: var(--msma-warning-surface, #fff2d7);
    }
    body.payment-list-page .payment-stats-card .payment-stat-unpaid {
        --payment-status-ink: var(--msma-danger, #a12327);
        --payment-status-surface: var(--msma-danger-surface, #fce8e8);
    }
    body.payment-list-page .payment-stats-card .payment-stat-total {
        --payment-status-ink: var(--msma-info, #1f5791);
        --payment-status-surface: var(--msma-info-surface, #e7f1ff);
    }
    html[data-msma-theme="actuel"] body.payment-list-page .payment-stats-card .payment-stat-paid { --payment-status-ink: #14643f; }
    html[data-msma-theme="actuel"] body.payment-list-page .payment-stats-card .payment-stat-unpaid { --payment-status-ink: #a12327; }
    html[data-msma-theme="actuel"] body.payment-list-page .payment-stats-card .payment-stat-total { --payment-status-ink: #1f5791; }

    html[data-msma-theme] body.quickpay-page :is(.month-grid, .service-grid) .bt-moi-gr2.ui-button {
        --quickpay-status-color: var(--msma-info, #0284c7);
        background: color-mix(in srgb, var(--quickpay-status-color) 28%, var(--msma-surface, #fff)) !important;
        border: 1px solid var(--msma-control-line, #74859a) !important;
        border-block-end: 4px solid var(--quickpay-status-color) !important;
        color: var(--msma-ink, #17233a) !important;
        text-shadow: none !important;
    }
    html[data-msma-theme] body.quickpay-page :is(.month-grid, .service-grid) .bt-moi-gr2.ui-button:is(:disabled, .ui-state-disabled) {
        background: var(--msma-surface, #fff) !important;
        border-color: var(--msma-line, #d8e0ea) !important;
        color: var(--msma-muted, #475569) !important;
        opacity: 1;
    }
    body.quickpay-page :is(.month-grid, .service-grid) .bt-moi-gr2.ui-button :is(.ui-button-text, .ui-button-icon-left) { color: inherit !important; }
    html[data-msma-theme="actuel"] body.quickpay-page .quick-whatsapp-button.ui-button { background: #0c7231 !important; }
    html[data-msma-theme="actuel"] body.club-settings-page .club-save-button.ui-button { background: #bb4310 !important; }
    html[data-msma-theme="actuel"] body.msma-compact-admin-page .bt-ajouter-gr2.ui-button { background: #147c3e !important; }
    html[data-msma-theme="actuel"] body.msma-compact-admin-page .bt-actualiser-gr.ui-button { background: #1966d4 !important; }
    html[data-msma-theme="actuel"] body.msma-unified-page .msma-action-column .bt-supprimer-gr.ui-button { color: #bc1d34 !important; }
    html[data-msma-theme="actuel"] body.test-page .bt-actualiser-gr { background: #1966d4 !important; }
    html[data-msma-theme="actuel"] body.bilan-page .filter-field .ui-selectonemenu-label { color: #27364c; }
    html[data-msma-theme="actuel"] body .wa-primary.ui-button { background: #12795e !important; }
    html[data-msma-theme="actuel"] body.suivi-page .app-btn.ui-button { background: #176aa0 !important; }
    html[data-msma-theme="actuel"] body.suivi-page .app-btn-primary.ui-button { background: #b44315 !important; }
    html[data-msma-theme="actuel"] body.suivi-page :is(.app-btn-success, .app-btn-green, .app-btn-whatsapp).ui-button { background: #15703d !important; }
    html[data-msma-theme="actuel"] body.suivi-page .app-btn-warning.ui-button { background: #bd242b !important; }
    html[data-msma-theme="actuel"] body.suivi-page .app-btn-cyan.ui-button { background: #106877 !important; }
    html[data-msma-theme="ardoise"] body :is(.ui-selectonemenu-trigger .ui-icon, .ui-sortable-column-icon) { filter: brightness(0) invert(.94); }

    html[data-msma-theme]:not([data-msma-theme="actuel"]) .msma-theme-control {
        --theme-control-bg: var(--msma-surface);
        --theme-control-ink: var(--msma-ink);
        --theme-control-border: var(--msma-control-line);
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) .msma-global-loading-card {
        background: var(--msma-surface);
        border-color: var(--msma-line);
        border-radius: var(--msma-radius);
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) .msma-global-loading-card strong { color: var(--msma-ink); }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) .msma-global-loading-card small { color: var(--msma-muted); }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) .msma-global-loading-spinner {
        border-color: var(--msma-line);
        border-top-color: var(--msma-brand);
        box-shadow: 0 0 0 7px var(--msma-theme-tint);
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(#headform1 #myNavbar, #headform1 .topnav, .access-platform-bar).msma-theme-navigation {
        box-sizing: border-box;
        background: var(--msma-nav) !important;
        border-bottom: 1px solid var(--msma-line) !important;
        color: var(--msma-nav-ink) !important;
        box-shadow: var(--msma-shadow) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(#headform1 #myNavbar, #headform1 .topnav, .access-platform-bar).msma-theme-navigation
        :is(.dropbtn, .dropdown-toggle, .navbar-nav > li > a, .navbar-brand, .access-nav-link, .access-brand, .access-signout, .logout-name a),
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body #headform1 #myNavbar.msma-theme-navigation > a {
        background: transparent !important;
        color: var(--msma-nav-ink) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body #headform1 #myNavbar.msma-theme-navigation .dropdown-content {
        background: var(--msma-surface) !important;
        border-color: var(--msma-line) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body #headform1 #myNavbar.msma-theme-navigation .dropdown-content a { color: var(--msma-ink) !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body :is(#headform1 #myNavbar, #headform1 .topnav, .access-platform-bar).msma-theme-navigation
        :is(.dropbtn:hover, .dropdown-toggle:hover, .navbar-nav > li > a:hover, .access-nav-link:hover, .access-nav-link.is-current, .msma-theme-group-active),
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body #headform1 #myNavbar.msma-theme-navigation > a:hover {
        background: var(--msma-nav-active) !important;
        color: var(--msma-nav-ink) !important;
    }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body .msma-theme-navigation :is(a, button):focus-visible { outline-color: var(--msma-nav-ink) !important; }
    html[data-msma-theme]:not([data-msma-theme="actuel"]) body #headform1 #myNavbar.msma-theme-navigation .dropdown-content a:hover { background: var(--msma-theme-tint) !important; }
    html[data-msma-theme="club-pro"] body #headform1 #myNavbar.msma-theme-navigation .navbar-toggle1 .icon-bar1 { background: var(--msma-nav-ink) !important; }

    @media (min-width: 991px) {
        html[data-msma-theme]:not([data-msma-theme="actuel"], [data-msma-theme="modern"]) body #headform1 #myNavbar.msma-theme-navigation {
            min-height: 60px !important;
            padding: 5px 12px !important;
            row-gap: 2px;
        }
        html[data-msma-theme]:not([data-msma-theme="actuel"], [data-msma-theme="modern"]) body #headform1 #myNavbar.msma-theme-navigation > a,
        html[data-msma-theme]:not([data-msma-theme="actuel"], [data-msma-theme="modern"]) body #headform1 #myNavbar.msma-theme-navigation .dropbtn {
            min-height: 38px !important;
            padding: 7px 8px !important;
        }
        html[data-msma-theme]:not([data-msma-theme="actuel"], [data-msma-theme="modern"]) body #headform1 #myNavbar.msma-theme-navigation .msma-context-button {
            height: 46px;
        }
        html[data-msma-theme]:not([data-msma-theme="actuel"], [data-msma-theme="modern"]) body #headform1 #myNavbar.msma-theme-navigation .msma-theme-control {
            margin-block: 0 !important;
            padding-block: 2px;
        }
        html[data-msma-theme]:not([data-msma-theme="actuel"], [data-msma-theme="modern"]) body #headform1 #myNavbar.msma-theme-navigation .msma-theme-control select {
            max-width: 174px;
        }
    }

    html[data-msma-theme="double-menu"] .msma-theme-secondary {
        padding: 10px;
        border: 1px solid var(--msma-line);
        border-radius: var(--msma-radius);
        background: var(--msma-surface);
        color: var(--msma-ink);
        box-shadow: var(--msma-shadow);
        text-align: start;
    }
    html[data-msma-theme="double-menu"] .msma-theme-secondary-title { padding: 4px 8px 8px; font-weight: 700; }
    html[data-msma-theme="double-menu"] .msma-theme-secondary :is(.dropdown-content, .dropdown-menu, .access-tab-shell, .access-tabs) {
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }
    html[data-msma-theme="double-menu"] .msma-theme-secondary [hidden] { display: none !important; }
    html[data-msma-theme="double-menu"] .msma-theme-secondary a {
        display: block !important;
        float: none !important;
        padding: 8px !important;
        border-radius: 5px;
        background: var(--msma-surface) !important;
        color: var(--msma-ink) !important;
        text-align: start !important;
        white-space: normal !important;
    }
    html[data-msma-theme="double-menu"] .msma-theme-secondary a:is(:hover, .is-current, .msma-theme-current-link) {
        background: var(--msma-theme-tint) !important;
        color: var(--msma-brand-dark) !important;
    }

    @media (min-width: 991px) {
        html[data-msma-theme="double-menu"].msma-theme-has-rail body,
        html[data-msma-theme="modern"].msma-theme-has-navigation body { padding-inline-start: var(--msma-theme-rail-width) !important; }
        html[data-msma-theme="double-menu"].msma-theme-has-rail body :is(#headform1 #myNavbar, #headform1 .topnav, .access-platform-bar).msma-theme-navigation {
            width: calc(100% + var(--msma-theme-rail-width)) !important;
            margin-inline-start: calc(0px - var(--msma-theme-rail-width)) !important;
        }
        html[data-msma-theme="double-menu"] .msma-theme-secondary {
            position: fixed;
            z-index: 950;
            top: var(--msma-sidebar-top, 84px);
            bottom: 12px;
            inset-inline-start: 10px;
            width: calc(var(--msma-theme-rail-width) - 20px);
            overflow: auto;
        }
        html[data-msma-theme="modern"] body :is(#headform1 #myNavbar, #headform1 .topnav, .access-platform-bar).msma-theme-navigation {
            position: fixed !important;
            z-index: 950;
            inset-block: 0 !important;
            inset-inline: 0 auto !important;
            display: flex !important;
            flex-direction: column !important;
            flex-wrap: nowrap !important;
            align-items: stretch !important;
            width: var(--msma-theme-rail-width) !important;
            margin: 0 !important;
            padding: 10px !important;
            overflow: auto !important;
        }
        html[data-msma-theme="modern"] body .msma-theme-navigation :is(.access-primary-nav, .navbar-nav) { display: grid !important; float: none !important; }
        html[data-msma-theme="modern"] body #headform1 #myNavbar.msma-theme-navigation :is(.dropbtn, a) { white-space: normal !important; }
        html[data-msma-theme="modern"] body #headform1 #myNavbar.msma-theme-navigation .dropdown-content,
        html[data-msma-theme="modern"] body .msma-theme-navigation .dropdown-menu {
            position: static !important;
            float: none !important;
            width: 100% !important;
            min-width: 0 !important;
        }
        html[data-msma-theme="modern"] .msma-theme-navigation .msma-theme-control { align-self: stretch; flex-wrap: wrap; }
    }
    @media (max-width: 990px) {
        html[data-msma-theme="double-menu"] .msma-theme-secondary {
            max-height: min(38vh, 320px);
            margin: 8px 12px !important;
            overflow: auto;
        }
    }
    @media (max-width: 767px) {
        html[data-msma-theme="terrain"] body :is(.btn, .ui-button, .ui-inputfield, .form-control):not(.quick-action, [type="image"]) { min-height: 44px; }
        .msma-theme-control-floating { bottom: auto; top: 4px; }
    }
}
