/*
 * Pilot Studio — skin desktop personnel.
 *
 * Ce fichier ne change aucune structure ni logique métier. Le scope exige à la
 * fois le choix utilisateur `data-pilot-theme="studio"` et la racine desktop
 * `.pds-admin`.
 */

.studio-sidebar-resizer,
.studio-sidebar-show {
    display: none;
}

html[data-pilot-theme="studio"] body.pds-admin {
    --studio-sidebar-width: var(--studio-user-sidebar-width, 220px);
    --navbar-height: 58px;
    --page-padding: 28px;

    --pds-brand: var(--pds-ref-accent);
    --pds-action: var(--pds-ref-accent);
    --pds-action-hover: var(--pds-ref-accent-hover);
    --pds-brand-deep: var(--pds-ref-link);
    --pds-action-soft: #F1EDFF;
    --pds-action-soft-strong: #E5DEFF;
    --pds-ink: #25232B;
    --pds-ink-soft: #4F4A56;
    --pds-slate: #716B77;
    --pds-muted: #918A96;
    --pds-page: #F5F1EB;
    --pds-surface: #FFFFFF;
    --pds-focus-surface: #2B2733;
    --pds-focus-muted: #D9D3E0;
    --pds-border: #E7E0D8;
    --pds-border-strong: #D4CBC1;
    --pds-divider: rgba(52, 43, 62, 0.09);
    --pds-radius-sm: 10px;
    --pds-radius-md: 14px;
    --pds-radius-lg: 18px;
    --pds-shadow-xs: 0 1px 3px rgba(54, 43, 68, 0.05);
    --pds-shadow-sm: 0 5px 18px rgba(54, 43, 68, 0.07);
    --pds-shadow-md: 0 10px 28px rgba(54, 43, 68, 0.09);
    --pds-shadow-lg: 0 22px 55px rgba(54, 43, 68, 0.14);

    --bg-page: var(--pds-page);
    --bg-surface: var(--pds-surface);
    --text-primary: var(--pds-ink);
    --text-secondary: var(--pds-slate);
    --text-muted: var(--pds-muted);
    --accent: var(--pds-action);
    --accent-hover: var(--pds-action-hover);
    --accent-light: var(--pds-action-soft-strong);
    --brand-700: var(--pds-brand-deep);
    --brand-600: var(--pds-action);
    --brand-500: var(--pds-action);
    --brand-100: var(--pds-action-soft-strong);
    --brand-050: var(--pds-action-soft);
    --border: var(--pds-border);
    --border-hover: var(--pds-border-strong);
    --design-border: var(--pds-border);
    --design-border-strong: var(--pds-border-strong);
    --surface: var(--pds-surface);
    --shadow-sm: var(--pds-shadow-xs);
    --shadow-md: var(--pds-shadow-md);
    --shadow-lg: var(--pds-shadow-lg);
    --radius-sm: var(--pds-radius-sm);
    --radius-md: var(--pds-radius-md);
    --radius-lg: var(--pds-radius-lg);
    --nav-bg: #26232F;
    --nav-hover: rgba(255, 255, 255, 0.1);
    --nav-accent: var(--pds-action);

    background:
        radial-gradient(circle at 96% 2%, rgba(121, 82, 213, 0.1), transparent 25rem),
        var(--pds-page);
    color: var(--pds-ink);
    font-family: Inter, "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Barre supérieure sombre et navigation violette verticale. */
html[data-pilot-theme="studio"] body.pds-admin .navbar {
    height: var(--navbar-height);
    background: #26232F;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 5px 18px rgba(24, 19, 30, 0.14);
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-inner {
    padding: 0 18px 0 0;
    gap: 9px;
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-logo {
    width: var(--studio-sidebar-width);
    height: var(--navbar-height);
    margin: 0;
    padding: 0 22px;
    gap: 11px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.025em;
    transition: width 0.18s ease, padding 0.18s ease, margin 0.18s ease;
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-logo .logo-dot {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--pds-action);
    box-shadow: 0 0 0 5px rgba(118, 87, 232, 0.13);
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-logo .logo-dot::after {
    content: "P";
    color: #FFF;
    font-size: 12px;
    font-weight: 800;
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-links {
    position: fixed;
    z-index: 1099;
    inset: var(--navbar-height) auto 0 0;
    width: var(--studio-sidebar-width);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 18px 12px 20px;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--pds-ref-accent) 0%, var(--pds-ref-accent-hover) 100%);
    box-shadow: 5px 0 22px rgba(64, 43, 123, 0.12);
    visibility: visible;
    transition: width 0.18s ease, transform 0.18s ease, padding 0.18s ease, visibility 0s linear 0s;
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-link {
    min-height: 42px;
    padding: 9px 12px;
    gap: 11px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 550;
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-link:hover {
    color: #FFF;
    background: rgba(39, 26, 86, 0.18);
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-link.active {
    color: #FFF;
    background: rgba(39, 26, 86, 0.32);
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.72);
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-link-icon,
html[data-pilot-theme="studio"] body.pds-admin .navbar-link-icon svg {
    width: 18px;
    height: 18px;
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-notifications,
html[data-pilot-theme="studio"] body.pds-admin .salon-indicator,
html[data-pilot-theme="studio"] body.pds-admin .navbar-profile {
    margin-left: 0 !important;
}

html[data-pilot-theme="studio"] body.pds-admin .salon-indicator {
    order: 1;
    margin-right: 8px;
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-notifications {
    order: 2;
    margin-left: auto !important;
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-profile {
    order: 3;
}

html[data-pilot-theme="studio"] body.pds-admin .notif-bell-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.07) !important;
}

html[data-pilot-theme="studio"] body.pds-admin .profile-btn {
    width: 34px;
    height: 34px;
    background: #EEE8FF;
    color: var(--pds-ref-accent-hover);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Espace de travail. */
html[data-pilot-theme="studio"] body.pds-admin .app-content {
    margin-top: calc(var(--navbar-height) + 20px);
    margin-left: var(--studio-sidebar-width);
    padding: 0 var(--page-padding) 34px;
    transition: margin-left 0.18s ease;
}

/* Poignée de redimensionnement et commandes façon Notion. */
html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer {
    position: fixed;
    z-index: 1102;
    top: var(--navbar-height);
    bottom: 0;
    left: calc(var(--studio-sidebar-width) - 5px);
    width: 10px;
    display: block;
    cursor: col-resize;
    outline: none;
    touch-action: none;
    transition: left 0.18s ease;
}

html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer-line {
    position: absolute;
    inset: 0 auto 0 4px;
    width: 2px;
    background: transparent;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer:hover .studio-sidebar-resizer-line,
html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer:focus .studio-sidebar-resizer-line,
html[data-studio-sidebar-resizing="true"][data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer-line {
    background: #8D74EC;
    box-shadow: 0 0 0 2px rgba(118, 87, 232, 0.13);
}

html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-hide {
    position: absolute;
    top: 18px;
    left: -10px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(83, 59, 178, 0.2);
    border-radius: 9px;
    background: #FFF;
    color: #6247C8;
    box-shadow: 0 4px 14px rgba(47, 34, 88, 0.18);
    cursor: pointer;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer:hover .studio-sidebar-hide,
html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer:focus-within .studio-sidebar-hide,
html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-hide:focus {
    opacity: 1;
    transform: translateX(0);
}

html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-hide:hover {
    background: #F2EEFF;
}

html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-hide svg,
html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-show svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-show {
    position: fixed;
    z-index: 1103;
    top: 12px;
    left: 13px;
    width: 34px;
    height: 34px;
    display: none;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-show:hover {
    background: rgba(255, 255, 255, 0.15);
}

html[data-studio-sidebar-density="compact"][data-pilot-theme="studio"] body.pds-admin .navbar-logo {
    justify-content: center;
    padding: 0;
}

html[data-studio-sidebar-density="compact"][data-pilot-theme="studio"] body.pds-admin .navbar-logo > span:last-child {
    display: none;
}

html[data-studio-sidebar-density="compact"][data-pilot-theme="studio"] body.pds-admin .navbar-links {
    padding-inline: 10px;
}

html[data-studio-sidebar-density="compact"][data-pilot-theme="studio"] body.pds-admin .navbar-link {
    justify-content: center;
    padding-inline: 0;
    gap: 0;
    font-size: 0;
}

html[data-studio-sidebar-density="compact"][data-pilot-theme="studio"] body.pds-admin .navbar-link-icon,
html[data-studio-sidebar-density="compact"][data-pilot-theme="studio"] body.pds-admin .navbar-link-icon svg {
    width: 21px;
    height: 21px;
}

html[data-studio-sidebar="hidden"][data-pilot-theme="studio"] body.pds-admin .navbar-links {
    transform: translateX(-100%);
    visibility: hidden;
    transition: width 0.18s ease, transform 0.18s ease, padding 0.18s ease, visibility 0s linear 0.18s;
}

html[data-studio-sidebar="hidden"][data-pilot-theme="studio"] body.pds-admin .navbar-logo {
    width: auto;
    margin-left: 48px;
    padding-inline: 8px 18px;
}

html[data-studio-sidebar="hidden"][data-pilot-theme="studio"] body.pds-admin .navbar-logo > span:last-child {
    display: inline;
}

html[data-studio-sidebar="hidden"][data-pilot-theme="studio"] body.pds-admin .app-content {
    margin-left: 0;
}

html[data-studio-sidebar="hidden"][data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer {
    display: none;
}

html[data-studio-sidebar="hidden"][data-pilot-theme="studio"] body.pds-admin .studio-sidebar-show {
    display: grid;
}

html[data-pilot-theme="studio"] body.pds-admin #modal-container {
    left: var(--studio-sidebar-width);
    transition: left 0.18s ease;
}

html[data-studio-sidebar="hidden"][data-pilot-theme="studio"] body.pds-admin #modal-container {
    left: 0;
}

html[data-studio-sidebar-resizing="true"][data-pilot-theme="studio"] body.pds-admin .navbar-logo,
html[data-studio-sidebar-resizing="true"][data-pilot-theme="studio"] body.pds-admin .navbar-links,
html[data-studio-sidebar-resizing="true"][data-pilot-theme="studio"] body.pds-admin .app-content,
html[data-studio-sidebar-resizing="true"][data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer {
    transition: none;
}

html[data-pilot-theme="studio"] body.pds-admin .module-frame {
    border: 1px solid var(--pds-border);
    border-radius: var(--pds-radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--pds-shadow-sm);
}

html[data-pilot-theme="studio"] body.pds-admin h1,
html[data-pilot-theme="studio"] body.pds-admin h2,
html[data-pilot-theme="studio"] body.pds-admin h3 {
    color: var(--pds-ink);
    letter-spacing: -0.025em;
}

html[data-pilot-theme="studio"] body.pds-admin .btn,
html[data-pilot-theme="studio"] body.pds-admin .btn-pilot {
    border-radius: 10px;
}

html[data-pilot-theme="studio"] body.pds-admin .btn-primary {
    background: var(--pds-action);
    box-shadow: 0 5px 13px rgba(121, 82, 213, 0.2);
}

html[data-pilot-theme="studio"] body.pds-admin .btn-primary:hover {
    background: var(--pds-action-hover);
    box-shadow: 0 7px 18px rgba(121, 82, 213, 0.27);
}

html[data-pilot-theme="studio"] body.pds-admin .btn-secondary {
    border-color: var(--pds-border);
    background: #FFF;
    box-shadow: var(--pds-shadow-xs);
}

html[data-pilot-theme="studio"] body.pds-admin .card,
html[data-pilot-theme="studio"] body.pds-admin .pds-stat-card,
html[data-pilot-theme="studio"] body.pds-admin .pds-data-panel {
    border-color: var(--pds-border);
    border-radius: 14px;
    background: #FFF;
    box-shadow: var(--pds-shadow-sm);
}

html[data-pilot-theme="studio"] body.pds-admin .pds-focus-card {
    border-color: #2B2733;
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0, rgba(118, 87, 232, 0.32), transparent 50%),
        #2B2733;
    box-shadow: 0 14px 34px rgba(43, 39, 51, 0.18);
}

html[data-pilot-theme="studio"] body.pds-admin table {
    border-color: var(--pds-border);
}

html[data-pilot-theme="studio"] body.pds-admin table th {
    background: #FAF8F5;
    color: var(--pds-slate);
    letter-spacing: 0.035em;
}

html[data-pilot-theme="studio"] body.pds-admin table td {
    border-color: var(--pds-divider);
}

html[data-pilot-theme="studio"] body.pds-admin tbody tr:hover td {
    background: #FAF8FF;
}

html[data-pilot-theme="studio"] body.pds-admin input:not([type="checkbox"]):not([type="radio"]),
html[data-pilot-theme="studio"] body.pds-admin select,
html[data-pilot-theme="studio"] body.pds-admin textarea {
    border-color: var(--pds-border);
    border-radius: 10px;
    background-color: #FFF;
}

html[data-pilot-theme="studio"] body.pds-admin input:focus,
html[data-pilot-theme="studio"] body.pds-admin select:focus,
html[data-pilot-theme="studio"] body.pds-admin textarea:focus {
    border-color: var(--pds-action);
    box-shadow: 0 0 0 3px rgba(118, 87, 232, 0.14);
}

/* Paramètres : le panneau interne reste calme à côté de la navigation globale. */
html[data-pilot-theme="studio"] body.pds-admin .settings-sidebar {
    border-color: var(--pds-border);
    background: #FAF8F5;
}

html[data-pilot-theme="studio"] body.pds-admin .settings-nav-section.active,
html[data-pilot-theme="studio"] body.pds-admin .settings-nav-sub.active {
    color: var(--pds-brand-deep);
    background: var(--pds-action-soft);
}

html[data-pilot-theme="studio"] body.pds-admin .settings-nav-sub.active {
    border-right-color: var(--pds-action);
}

/* Le desktop compact garde la navigation iconique. */
@media (max-width: 1120px) {
    html[data-pilot-theme="studio"] body.pds-admin {
        --studio-sidebar-width: var(--studio-user-sidebar-width, 76px);
        --page-padding: 18px;
    }

}

@media (max-width: 900px) {
    html[data-pilot-theme="studio"] body.pds-admin .cx-custom-period {
        left: calc(var(--studio-sidebar-width) + 12px);
    }

    html[data-studio-sidebar="hidden"][data-pilot-theme="studio"] body.pds-admin .cx-custom-period {
        left: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-pilot-theme="studio"] body.pds-admin .navbar-logo,
    html[data-pilot-theme="studio"] body.pds-admin .navbar-links,
    html[data-pilot-theme="studio"] body.pds-admin .app-content,
    html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer {
        transition: none;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   CONVERGENCE-LOT1 — barre latérale repliable en tablette
   ══════════════════════════════════════════════════════════════════════════

   Le repli existant (`max-width: 1120px`, plus haut) est DÉFAIT dès que
   l'utilisateur a déjà réglé la largeur à la souris : il écrit
   `--studio-user-sidebar-width` en style inline sur <html>, et la règle 1120
   se contente de l'utiliser comme valeur (`var(--studio-user-sidebar-width,
   76px)`) — le repli ne s'applique donc qu'aux utilisateurs SANS préférence
   enregistrée. Sur l'iPad du salon, une barre de 220 px restait à 220 px.

   JUSQU'AU palier tablette paysage INCLUS, la largeur est donc FORCÉE au rail
   iconique de 76 px, préférence comprise : à 1024 px de large, 220 px de barre
   latérale représentent plus d'un cinquième de l'écran.

   Borne : `max-width: 1024px`, donc **1024 est DANS la règle** — c'est la
   largeur exacte de l'iPad paysage, l'appareil visé ; l'en exclure raterait la
   cible. La bande qui conserve le comportement existant est donc **1025 à
   1279**, et le poste du salon (1280+) n'est pas touché.

   La barre reste repliable à la main : le bouton « Masquer » et l'état
   `data-studio-sidebar="hidden"` continuent de fonctionner par-dessus.
*/
@media (max-width: 1024px) {
    html[data-pilot-theme="studio"] body.pds-admin {
        /* Pas de var(--studio-user-sidebar-width) : c'est tout l'objet de la
           règle — la préférence souris ne doit pas survivre au format tablette. */
        --studio-sidebar-width: 76px;
        --page-padding: 16px;
    }

    /* Le redimensionnement à la souris n'a pas de sens sur écran tactile, et
       sa poignée chevauche le contenu une fois la barre au rail. */
    html[data-pilot-theme="studio"] body.pds-admin .studio-sidebar-resizer {
        display: none;
    }
}

/* Skin unifié — palette sombre de la référence validée.
 * Couche de présentation ; exception téléphone documentée en pied. Les sélecteurs restent opt-in Studio
 * ET body.pds-admin, y compris pour les fragments chargés après le document.
 */
html[data-pilot-theme="studio"] body.pds-admin {
    color-scheme: dark;
    /* VIOLET-UNIQUE (lot 1b) : aplats = violet du Planning (#7952d5, texte blanc) ;
       texte et filets violets sur fond sombre = lien du Planning Studio (contraste). */
    --studio-accent: var(--pds-ref-link);
    --studio-accent-hover: var(--pds-ref-accent-hover);
    --studio-accent-fill: var(--pds-ref-accent);
    --studio-on-accent: var(--pds-ref-on-accent);
    --studio-header: #231f32;
    --studio-hover: #302c3b;
    --studio-success-ink: #8bd5b5;
    --studio-warning-ink: #e4bc75;
    --studio-danger-ink: #ffada8;
    --pds-brand: var(--pds-ref-link);
    /* Les composants historiques écrivent du blanc sur action : conserver
     * un violet profond pour ce contrat ; les CTA explicites sont lavande. */
    --pds-action: var(--pds-ref-accent);
    --pds-action-hover: var(--pds-ref-accent-hover);
    --pds-brand-deep: var(--pds-ref-link);
    --pds-action-soft: #34284c;
    --pds-action-soft-strong: #45345e;
    --pds-ink: #f1edf9;
    --pds-ink-soft: #d8d1e5;
    --pds-slate: #b8b1c7;
    --pds-muted: #b8b1c7;
    --pds-page: #191820;
    --pds-surface: #25232e;
    --pds-focus-surface: #34284c;
    --pds-focus-muted: #d8d1e5;
    --pds-border: #51495f;
    --pds-border-strong: #8b819b;
    --pds-divider: #51495f;
    --pds-success: #176b4d;
    --pds-success-soft: #223e33;
    --pds-warning: #97520b;
    --pds-warning-soft: #463722;
    --pds-danger: #a83236;
    --pds-danger-soft: #492a30;
    --pds-focus-ring: 0 0 0 3px var(--pds-ref-link);
    --pds-shadow-xs: 0 1px 3px #0003;
    --pds-shadow-sm: 0 5px 18px #0003;
    --pds-shadow-md: 0 10px 28px #0004;
    --pds-shadow-lg: 0 22px 55px #0005;
    --text-inverse: #ffffff;
    --ink-900: var(--pds-ink);
    --ink-600: var(--pds-ink-soft);
    --ink-400: var(--pds-muted);
    --pilot-text: var(--pds-ink);
    --pilot-text-secondary: var(--pds-slate);
    --pilot-text-muted: var(--pds-muted);
    --pilot-bg: var(--pds-page);
    --pilot-bg-card: var(--pds-surface);
    --pilot-bg-hover: var(--studio-hover);
    --pilot-border: var(--pds-border);
    --pilot-primary: var(--studio-accent);
    --pilot-primary-light: var(--studio-accent-hover);
    --pilot-primary-bg: var(--pds-action-soft);
    --success-700: var(--studio-success-ink);
    --warning-700: var(--studio-warning-ink);
    --bg-navbar: var(--studio-header);
    --nav-bg: var(--studio-header);
    --planning-bg: var(--pds-page);
    --planning-grid-line: var(--pds-border);
    --planning-hour-text: var(--pds-muted);
    --planning-header-bg: var(--pds-surface);
    --planning-header-border: var(--pds-border);
    --ph-violet: var(--studio-accent);
    --ph-ink: var(--pds-ink);
    --ph-muted: var(--pds-muted);
    --ph-line: var(--pds-border);
    --ph-bg: var(--pds-page);
    background: var(--pds-page);
}

/* Coquille : la structure et les commandes de navigation restent celles de
 * la convergence ; seule leur matière visuelle change. */
html[data-pilot-theme="studio"] body.pds-admin .navbar,
html[data-pilot-theme="studio"] body.pds-admin .navbar-links {
    background: var(--studio-header);
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-link {
    color: var(--pds-ink-soft);
}

html[data-pilot-theme="studio"] body.pds-admin .navbar-link.active,
html[data-pilot-theme="studio"] body.pds-admin .navbar-link:hover {
    color: var(--pds-ink);
    background: var(--pds-action-soft);
}

html[data-pilot-theme="studio"] body.pds-admin .module-frame {
    background: var(--pds-page);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .card, .pds-stat-card, .pds-data-panel, .modal-content,
    .profile-dropdown, .notif-dropdown, .settings-sidebar,
    .kpi-card, .db-panel, .cx-kpi, .cx-recap, .cx-sales-wrap, .cx-right,
    .cx-custom-period, .cx-closed-recap, .phone-topbar, .phone-sheet
) {
    background: var(--pds-surface);
    border-color: var(--pds-border);
    color: var(--pds-ink);
}

/* VIOLET-UNIQUE : sur fond sombre, la rubrique affichée prend le violet de lien (7,6:1).
   B-MOBILE-L1 : barre haute et menu remplacent la barre d'onglets. */
html[data-pilot-theme="studio"] body.pds-admin :is(.phone-topbar-name, .phone-topbar-btn, .phone-sheet-item:not(.is-current), .phone-sheet-title, .phone-sheet-close) {
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin {
    --ph-current-bg: var(--pds-action-soft);
    --ph-current-ink: var(--studio-accent);
    --ph-current-sub: var(--pds-ink-soft);
}

html[data-pilot-theme="studio"] body.pds-admin .phone-sheet-sub {
    color: var(--pds-muted);
}

html[data-pilot-theme="studio"] body.pds-admin .phone-sheet-logout {
    color: var(--studio-danger-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(.phone-sheet-close, .phone-sheet-item:active) {
    background: var(--studio-hover);
}

html[data-pilot-theme="studio"] body.pds-admin .pds-alert {
    background: var(--pds-surface);
}

html[data-pilot-theme="studio"] body.pds-admin .pds-alert--success {
    background: var(--pds-success-soft);
    color: var(--studio-success-ink);
}

html[data-pilot-theme="studio"] body.pds-admin .pds-alert--warning,
html[data-pilot-theme="studio"] body.pds-admin #collision-toast {
    background: var(--pds-warning-soft);
    color: var(--studio-warning-ink);
}

html[data-pilot-theme="studio"] body.pds-admin #collision-toast :is(
    .collision-toast-head, .collision-toast-list, .collision-toast-q
) {
    color: var(--studio-warning-ink);
}

html[data-pilot-theme="studio"] body.pds-admin .pds-alert--danger {
    background: var(--pds-danger-soft);
    color: var(--studio-danger-ink);
}

html[data-pilot-theme="studio"] body.pds-admin .pds-focus-card {
    background: var(--pds-focus-surface);
    border-color: var(--pds-border-strong);
}

/* Les liens de navigation et les boutons ont leurs propres couples couleur /
 * fond ; ne pas recolorer toutes les ancres ni les pastilles métier. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .btn-primary, .cx-btn-primary,
    .cx-custom-period button, .ep-shell .epf-btn-primary
) {
    background: var(--studio-accent-fill);
    color: var(--studio-on-accent);
    border-color: var(--studio-accent-fill);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .btn-primary, .cx-btn-primary,
    .cx-custom-period button, .ep-shell .epf-btn-primary
):hover {
    background: var(--studio-accent-hover);
    color: var(--studio-on-accent);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .btn-secondary, .cx-btn-outline, .cx-btn-neutral,
    .cal-month-nav a, .cx-datenav a, .ep-shell .epf-btn-ghost,
    .studio-sidebar-hide, .ep-skip, .epf-layout-row
) {
    background: var(--pds-surface);
    border-color: var(--pds-border-strong);
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .btn-secondary, .cx-btn-outline, .cx-btn-neutral,
    .cal-month-nav a, .cx-datenav a, .ep-shell .epf-btn-ghost,
    .studio-sidebar-hide
):hover {
    background: var(--studio-hover);
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .dashboard-tabs .tab-active, .dashboard-tabs a:hover,
    .cal-manage-link,
    .settings-nav-section.active, .settings-nav-sub.active
) {
    color: var(--studio-accent);
    border-bottom-color: var(--studio-accent);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
    select, textarea
) {
    background-color: var(--pds-surface);
    color: var(--pds-ink);
    border-color: var(--pds-border-strong);
    caret-color: var(--studio-accent);
}

html[data-pilot-theme="studio"] body.pds-admin :is(input, textarea)::placeholder {
    color: var(--pds-muted);
    opacity: 1;
}

html[data-pilot-theme="studio"] body.pds-admin :is(input, select, textarea):disabled,
html[data-pilot-theme="studio"] body.pds-admin :is(input, textarea)[readonly] {
    background-color: var(--studio-hover);
    color: var(--pds-muted);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    a, button, input, select, textarea, summary, [tabindex]
):focus-visible {
    outline: 2px solid var(--studio-accent);
    outline-offset: 2px;
}

html[data-pilot-theme="studio"] body.pds-admin :is(input, select, textarea):focus {
    border-color: var(--studio-accent);
}

/* Tableaux : couleur seulement ; les conteneurs de défilement et l'alignement
 * des montants restent inchangés. */
html[data-pilot-theme="studio"] body.pds-admin table th {
    background: var(--studio-hover);
    color: var(--pds-ink-soft);
}

html[data-pilot-theme="studio"] body.pds-admin table td {
    border-color: var(--pds-divider);
}

html[data-pilot-theme="studio"] body.pds-admin tbody tr:hover td {
    background: var(--studio-hover);
}

/* Dashboard : pas de nouvelle hiérarchie de grille, aucun indicateur retiré. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .kpi-card-value, .indicator-value, .db-panel-title, .cal-month-label
) {
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .kpi-card-label, .kpi-card-sub, .indicator-label, .chart-date,
    .alert-empty, .cal-workdays-info
) {
    color: var(--pds-muted);
}

html[data-pilot-theme="studio"] body.pds-admin :is(.alert-row, .indicator-item) {
    border-color: var(--pds-divider);
}

html[data-pilot-theme="studio"] body.pds-admin .dashboard-kpi .kpi-card:first-child {
    background: var(--pds-action-soft);
    border-color: var(--pds-border-strong);
}

/* Exceptions locales imposées par les couleurs inline historiques, sans
 * modifier leurs conditions Django ni les statuts. Les !important sont
 * limités à ces couleurs, aucun override géométrique. */
html[data-pilot-theme="studio"] body.pds-admin .caisse-banner[style*="#d4edda"] {
    background: var(--pds-success-soft) !important;
    color: var(--studio-success-ink) !important;
}

html[data-pilot-theme="studio"] body.pds-admin .caisse-banner[style*="#fff3cd"] {
    background: var(--pds-warning-soft) !important;
    color: var(--studio-warning-ink) !important;
}

html[data-pilot-theme="studio"] body.pds-admin .caisse-banner a {
    color: inherit !important;
}

html[data-pilot-theme="studio"] body.pds-admin .indicator-value[style*="#1D9E75"] {
    color: var(--studio-success-ink) !important;
}

html[data-pilot-theme="studio"] body.pds-admin .indicator-value[style*="#C0392B"] {
    color: var(--studio-danger-ink) !important;
}

/* Caisse : les états ouvert/fermé et les catégories de paiement restent
 * distincts, le contenu des ventes et les actions ne changent pas. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-kpi-value, .cx-datenav-label, .cx-sale-client, .cx-sale-amount,
    .cx-recap-amount, .cx-recap-row:last-child, .cx-closed-recap-title,
    .cx-summary-table td, .cx-summary-table td:first-child,
    .cx-summary-table tr.cx-row-total td
) {
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-kpi-label, .cx-recap-count, .cx-recap-section-title, .cx-sale-num,
    .cx-sale-time, .cx-sale-items-sub, .cx-sales-empty, .cx-detail-placeholder p,
    .cx-summary-table tr.cx-row-empty td
) {
    color: var(--pds-muted);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-sales-header, .cx-summary-table tr.cx-row-closed td
) {
    background: var(--studio-hover);
    color: var(--pds-muted);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-sale-row, .cx-sales-header, .cx-recap-row:last-child, .cx-recap-tot-row
) {
    border-color: var(--pds-divider);
}

html[data-pilot-theme="studio"] body.pds-admin .cx-recap-divider {
    background: var(--pds-divider);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-sale-row:hover, .cx-sale-row.cx-selected, .cx-kpi-active, .cx-kpi-link:hover,
    .cx-summary-table tr.cx-row-total td
) {
    background: var(--pds-action-soft);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-statusbar.sb-open, .cx-sale-badge-ok
) {
    background: var(--pds-success-soft);
    color: var(--studio-success-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-sale-badge-warn
) {
    background: var(--pds-warning-soft);
    color: var(--studio-warning-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-statusbar.sb-warn, .cx-sale-badge-danger
) {
    background: var(--pds-danger-soft);
    color: var(--studio-danger-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-statusbar.sb-closed, .cx-statusbar.sb-none
) {
    background: var(--studio-hover);
    color: var(--pds-muted);
}

html[data-pilot-theme="studio"] body.pds-admin .cx-action-btn.cx-act-open {
    background: var(--pds-success);
    color: #ffffff;
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cx-action-btn.cx-act-close, .cx-btn-close, .cx-btn-warn
) {
    background: var(--pds-danger);
    color: #ffffff;
}

/* Espace Pierre a ses tokens sur .ep-shell : les raccorder à la même palette
 * sans toucher à la taille/position des widgets ni au menu mobile. */
html[data-pilot-theme="studio"] body.pds-admin .ep-shell {
    --ep-violet: var(--pds-action);
    --ep-violet-dark: var(--studio-accent);
    --ep-violet-deep: var(--pds-action-hover);
    --ep-violet-soft: var(--pds-action-soft);
    --ep-violet-line: var(--pds-border-strong);
    --ep-bg: var(--pds-page);
    --ep-card: var(--pds-surface);
    --ep-text: var(--pds-ink);
    --ep-muted: var(--pds-muted);
    --ep-line: var(--pds-border);
    --ep-field-line: var(--pds-border-strong);
    --ep-green: var(--studio-success-ink);
    --ep-green-soft: var(--pds-success-soft);
    --ep-amber: var(--studio-warning-ink);
    --ep-amber-soft: var(--pds-warning-soft);
    --ep-red: var(--studio-danger-ink);
    --ep-red-soft: var(--pds-danger-soft);
    --ep-shadow: var(--pds-shadow-xs);
}

html[data-pilot-theme="studio"] body.pds-admin .ep-sidebar {
    background: var(--studio-header);
    --ep-violet-dark: #45345e;
}

html[data-pilot-theme="studio"] body.pds-admin :is(.ep-logo, .ep-nav-badge, .ep-menu-toggle) {
    background: var(--studio-accent-fill);
    color: var(--studio-on-accent);
}

html[data-pilot-theme="studio"] body.pds-admin :is(.epf-pill-neutral, .ep-menu-close) {
    background: var(--studio-hover);
    color: var(--pds-ink);
}

/* Le module choisit le lien courant via :target/data-ep-view. Le token local
 * de la sidebar garde un fond violet sombre et le texte reste clair. */
html[data-pilot-theme="studio"] body.pds-admin .ep-shell .ep-nav-item {
    color: var(--pds-ink);
}

/* Les préférences de contraste existantes restent utiles en mode sombre. */
html[data-ui-contrast="high"][data-pilot-theme="studio"] body.pds-admin {
    --pds-muted: #d8d1e5;
    --pds-slate: #d8d1e5;
    --pds-border: #8b819b;
}

html[data-ui-contrast="maximum"][data-pilot-theme="studio"] body.pds-admin {
    --pds-ink: #ffffff;
    --pds-ink-soft: #f1edf9;
    --pds-muted: #f1edf9;
    --pds-slate: #f1edf9;
    --pds-border: #b8b1c7;
    --pds-border-strong: #d8d1e5;
}

/* Assistants RDV, vente et commande fournisseur : étapes et choix, y compris
 * fragments HTMX. Les numéros, états active/completed/done, champs, formulaires
 * et boutons restent pilotés par les vues existantes. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .modal-panel, .pilot-modal, .wz-back-btn, .wz1-suppl-pill,
    .wz1-svc-card, .wz-staff-card, .pwz-type-card, .pwz-staff-card,
    .supplier-card
) {
    background-color: var(--pds-surface);
    border-color: var(--pds-border-strong);
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .wz-back-btn:hover, .wz1-freq-pill:hover, .wz1-svc-card:hover,
    .wz-staff-card:hover, .pwz-type-card:hover, .pwz-staff-card:hover,
    .supplier-card:hover
) {
    background-color: var(--studio-hover);
    border-color: var(--studio-accent);
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .wz1-freq-pill.selected, .wz1-svc-card.selected, .wz-staff-card.selected,
    .pwz-type-card.selected, .pwz-staff-card.selected
) {
    background-color: var(--pds-action-soft);
    border-color: var(--studio-accent);
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .wizard-step.active .wizard-step-num, .wz1-step.active span,
    .wizard-steps .wizard-step.active
) {
    background: var(--studio-accent-fill);
    border-color: var(--studio-accent-fill);
    color: var(--studio-on-accent);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .wizard-step.completed .wizard-step-num, .wizard-steps .wizard-step.done
) {
    background: var(--pds-success-soft);
    border-color: var(--studio-success-ink);
    color: var(--studio-success-ink);
}

html[data-pilot-theme="studio"] body.pds-admin .wizard-step-line.completed {
    background: var(--studio-success-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .wz1-btn-next, .btn-pilot-primary
) {
    background: var(--studio-accent-fill);
    color: var(--studio-on-accent);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .wz1-btn-next:hover, .btn-pilot-primary:hover
) {
    background: var(--studio-accent-hover);
    color: var(--studio-on-accent);
}

/* Plusieurs étapes POS/RDV fixent le vert/violet directement sur leur CTA.
 * Uniquement les boutons primaires dans la fenêtre, pas les pastilles de
 * collaborateurs ni les couleurs des familles de prestations. */
html[data-pilot-theme="studio"] body.pds-admin .modal-panel :is(
    .btn-primary, .btn-pilot-primary
)[style] {
    background-color: var(--studio-accent-fill) !important;
    color: var(--studio-on-accent) !important;
}

html[data-pilot-theme="studio"] body.pds-admin .modal-panel :is(
    .btn-primary, .btn-pilot-primary
)[style]:hover {
    background-color: var(--studio-accent-hover) !important;
}

html[data-pilot-theme="studio"] body.pds-admin .field-error {
    color: var(--studio-danger-ink) !important;
}

html[data-pilot-theme="studio"] body.pds-admin :is(.section-rupture, .stock-rupture) {
    color: var(--studio-danger-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(.section-low, .stock-low) {
    color: var(--studio-warning-ink);
}

/* Récapitulatifs injectés par les assistants : leurs fonds historiques sont
 * fixes, contrairement au formulaire parent qui utilise les tokens. */
html[data-pilot-theme="studio"] body.pds-admin :is(.wz1-recap-row, .p5-recap) {
    background: var(--studio-hover);
    border-color: var(--pds-border);
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(.p5-recap-row, .p5-totals-line) {
    color: var(--pds-ink-soft);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .wz1-recap-title, .p5-remise-link, .p5-remise-link:hover
) {
    color: var(--studio-accent);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .p5-recap-row.p5-disc, .p5-disc-row-sub, .p5-totals-disc
) {
    color: var(--studio-danger-ink);
}

html[data-pilot-theme="studio"] body.pds-admin .p5-total-row {
    color: var(--studio-success-ink);
    border-color: var(--pds-border);
}

html[data-pilot-theme="studio"] body.pds-admin .p5-disc-form {
    background: var(--pds-warning-soft);
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin .p5-disc-form-title {
    color: var(--studio-warning-ink);
}

/* Surfaces historiques : les couleurs fixes de leurs enfants sont raccordées
 * explicitement ci-dessous ; changer le fond seul ne garantit pas le contraste. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .home-card,
    .products-sidebar, .finance-sidebar, .services-sidebar, .staff-sidebar,
    .intel-sidebar, .pcat-body, .inv-pdf-panel, .brand-popover,
    .gvd-card, .gvl-card, .gvc-card, .sdp-payments,
    .av-kpi, .av-card, .av-detail, .ep-card, .ep-rm-kpi, .ep-rm-scroll,
    .product-picker, .service-picker, .encaissement-overlay,
    .encaissement-overlay__cart, .encaissement-overlay--error,
    .encaissement-actions__action, .encaissement-actions__payment-btn,
    .mixed-payments__item, .mixed-payments__summary, .mixed-payments__method-btn,
    .discount-modal, .check-form, .gift-form,
    .encaissement-pack-staff-modal__panel, .encaissement-conflict__card,
    .encaissement-conflict__requested
) {
    background-color: var(--pds-surface);
    border-color: var(--pds-border);
    color: var(--pds-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .finance-nav-link.active, .finance-nav-sub.active,
    .services-nav-link.active, .staff-nav-link.active,
    .products-nav-link.active, .intel-nav-link.active
) {
    background-color: var(--pds-action-soft);
    color: var(--studio-accent);
    border-color: var(--studio-accent);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .product-picker__hint, .encaissement-cart__empty,
    .encaissement-success__breakdown, .ep-card-disabled) {
    background-color: var(--studio-hover);
    color: var(--pds-ink-soft);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .gvd-back, .gvl-back, .gvc-back,
    .sdp-btn-outline, .av-btn, .ep-rm-btn, .ep-rm-move,
    .inv-brand-chip, .stk-filter-btn, .stk-btn,
    .discount-modal__cancel, .collision-btn-cancel,
    #collision-toast .collision-toast-cancel
) {
    background-color: var(--pds-surface);
    color: var(--pds-ink);
    border-color: var(--pds-border-strong);
}

/* Contrastes des alertes et du répertoire, y compris ses cartes téléphone. */
html[data-pilot-theme="studio"] body.pds-admin .alert-text {
    color: var(--pds-ink);
}
html[data-pilot-theme="studio"] body.pds-admin .cl-pill-count {
    color: inherit;
    opacity: 1;
}
html[data-pilot-theme="studio"] body.pds-admin .cx-btn-outline[style*="#C0392B"] {
    color: var(--studio-danger-ink) !important;
}

/* Couleurs fixes des modules historiques, conservant leur mise en page. */
html[data-pilot-theme="studio"] body.pds-admin :is(.home-card-title) { color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(.home-card-desc, .home-cards-section-title) { color: var(--pds-muted); }
html[data-pilot-theme="studio"] body.pds-admin :is(.home-role, .products-tab.active) { color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin .home-caisse-btn { background-color: var(--pds-success); color: #ffffff; }
html[data-pilot-theme="studio"] body.pds-admin .home-caisse-btn-close { background-color: var(--pds-danger); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .services-nav-link:not(.active), .products-nav-link:not(.active),
    .staff-nav-link:not(.active), .finance-nav-link:not(.active), .intel-nav-link:not(.active),
    .svc-toolbar, .svc-table tbody tr, .svc-table tbody td, .svc-edit-link
) { background-color: var(--pds-surface); color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin .cat-badge-sm { color: #ffffff; }
html[data-pilot-theme="studio"] body.pds-admin .stat-card-value[style*="#2471A3"] { color: #8dc9f0 !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(span, a)[style*="color:var(--accent)"] { color: var(--studio-accent) !important; }

html[data-pilot-theme="studio"] body.pds-admin .home-caisse-btn[style*="#00b894"] { background-color: var(--pds-success) !important; }
html[data-pilot-theme="studio"] body.pds-admin .phone-title { background-color: var(--pds-page); }

html[data-pilot-theme="studio"] body.pds-admin :is(.selected-count, .rdv-back-link, .rdv-add-another) { color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin .recap-total-value[style] { color: var(--studio-accent) !important; }
html[data-pilot-theme="studio"] body.pds-admin .btn-wizard-primary { background-color: var(--pds-success); color: #ffffff; }
html[data-pilot-theme="studio"] body.pds-admin .rdv-filter-pill:not(.is-active) { background-color: var(--studio-hover); color: var(--pds-ink); }

html[data-pilot-theme="studio"] body.pds-admin :is(.pos-sidebar, .pos-nav-link:not(.active)) { background-color: var(--pds-surface); color: var(--pds-ink); }

html[data-pilot-theme="studio"] body.pds-admin .pos-nav-link.active { color: var(--studio-accent); background-color: var(--pds-action-soft); }

html[data-pilot-theme="studio"] body.pds-admin :is(#pwz-walkin-btn, #wz-walkin-btn) { background-color: var(--pds-warning) !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(#pwz-new-client-btn, #wz-new-client-btn) { background-color: var(--pds-success) !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(.pwz-svc-cat-card-count, .wz1-fam-card-count) { color: #ffffff; opacity: 1; }

html[data-pilot-theme="studio"] body.pds-admin :is(.pwz-back-link, .pwz-discount-link) { color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin .pwz-bc-link { color: var(--studio-accent) !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(.p5-pay-card, .p5-numpad-display, .p5-numpad button, .p5-remaining-bar) { background-color: var(--pds-surface); color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin .p5-pay-card.selected { background-color: var(--pds-action-soft); color: var(--studio-accent); border-color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin #pwz-remaining[style*="229, 90, 90"] { color: var(--studio-danger-ink) !important; }

html[data-pilot-theme="studio"] body.pds-admin .recap-table tbody td { background-color: var(--pds-surface); color: var(--pds-ink-soft); }
html[data-pilot-theme="studio"] body.pds-admin .wz1-fam-card-initials { color: #ffffff; opacity: 1; }
html[data-pilot-theme="studio"] body.pds-admin .col-stock.stock-out { background-color: var(--pds-danger-soft); color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin .p5-numpad .p5-num-clear { background-color: var(--pds-danger-soft) !important; color: var(--studio-danger-ink); }

html[data-pilot-theme="studio"] body.pds-admin .brand-popover::before { background-color: var(--studio-hover); }
html[data-pilot-theme="studio"] body.pds-admin :is(.mkt-action-card, .mkt-program-card) { background-color: var(--pds-surface); }
html[data-pilot-theme="studio"] body.pds-admin .cx-recap-label { color: var(--pds-ink-soft); }

/* Le skin historique a une spécificité supérieure à phone.css. Sous son
 * breakpoint, restituer les espacements de la coquille téléphone évite de
 * conserver le rail desktop invisible de 76 px à gauche du contenu. */
@media (max-width: 767.98px) {
    html[data-pilot-theme="studio"] body.pds-admin {
        --studio-sidebar-width: 0px;
        --page-padding: 0px;
    }
    html[data-pilot-theme="studio"] body.pds-admin .app-content {
        margin-top: 0;
        margin-left: 0;
        padding: 0 0 var(--ph-navbar-clearance);
    }
    html[data-pilot-theme="studio"] body.pds-admin .modal-panel {
        min-width: 0 !important;
        width: calc(100% - 16px) !important;
    }
    html[data-pilot-theme="studio"] body.pds-admin :is(.wizard-steps, .p5-quick-pay-btns, .products-content .search-bar) {
        flex-wrap: wrap;
    }
    html[data-pilot-theme="studio"] body.pds-admin .home-caisse > div {
        flex-wrap: wrap;
    }
    html[data-pilot-theme="studio"] body.pds-admin .mkt-page {
        margin: 0;
        padding-left: 10px;
        padding-right: 10px;
    }
    html[data-pilot-theme="studio"] body.pds-admin .mkt-actions-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    }
    html[data-pilot-theme="studio"] body.pds-admin :is(.recap-table, .order-table) {
        display: block;
        overflow-x: auto;
    }

}

html[data-pilot-theme="studio"] body.pds-admin .p5-quick-pay { background-color: var(--pds-success-soft); border-color: var(--studio-success-ink); }
html[data-pilot-theme="studio"] body.pds-admin .p5-quick-pay-label { color: var(--studio-success-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(.p5-qp-contactless, .p5-qp-card) { background-color: var(--pds-action-soft); color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin .p5-qp-cash { background-color: var(--pds-success-soft); color: var(--studio-success-ink); }

/* Messages de validation créés après un clic dans les assistants client. */
html[data-pilot-theme="studio"] body.pds-admin :is(#pwz-new-client-errors, #wz-new-client-errors) {
    color: var(--studio-danger-ink) !important;
}


/* Encaissement planning : les fragments HTMX ont des couleurs fixes locales.
 * Raccorder les textes ET leurs fonds, y compris après paiement et en conflit.
 * Aucun changement de position, safe-area, z-index ou couleur de collaborateur. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-overlay__title, .encaissement-success__total,
    .encaissement-cart__payer-name, .encaissement-cart__section-title,
    .encaissement-cart__item-price, .mixed-payments__item-amount,
    .mixed-payments__summary-row--remaining, .product-picker__title,
    .service-picker h3, .discount-modal__title, .check-form__title,
    .gift-form__title, .encaissement-pack-staff-modal h3,
    .encaissement-pack-staff-modal__service
) { color: var(--pds-ink); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-cart__label, .encaissement-cart__payer-empty,
    .encaissement-cart__staff-static, .encaissement-cart__pack-component,
    .encaissement-cart__group-label, .encaissement-cart__item-price--strikethrough,
    .encaissement-actions__label, .encaissement-actions__action small,
    .encaissement-overlay__placeholder, .encaissement-success__mode,
    .encaissement-success__sale-id, .mixed-payments__title, .mixed-payments__empty,
    .mixed-payments__summary-row, .service-picker__eyebrow,
    .service-picker__controls label > span, .service-picker__section-title,
    .service-picker__pack-help, .service-picker__item-copy small,
    .service-picker__empty, .discount-modal__section-label,
    .check-form__optional, .gift-form__opt, .encaissement-conflict__label
) { color: var(--pds-muted); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-cart__item-name, .encaissement-actions__total-row,
    .encaissement-success__breakdown li,
    .encaissement-error__message, .mixed-payments__item-method,
    .check-form__label, .gift-form__label, .discount-modal__hint,
    .encaissement-conflict__intro, .encaissement-conflict__appointment span,
    .encaissement-conflict__requested span, .encaissement-conflict__secondary
) { color: var(--pds-ink-soft); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-overlay__header, .encaissement-conflict__topbar
) { background: var(--studio-header); color: var(--pds-ink); border-color: var(--pds-border); }

html[data-pilot-theme="studio"] body.pds-admin .encaissement-conflict {
    background: var(--pds-page); color: var(--pds-ink);
}
html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-overlay__actions, .encaissement-cart__section,
    .encaissement-conflict__previous
) { background: var(--studio-hover); color: var(--pds-ink); border-color: var(--pds-border); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-actions__action-icon, .service-picker__add,
    .gift-form__notice, .mixed-payments__legacy-gift,
    .encaissement-overlay .encaissement-phone-ticket
) { background: var(--pds-action-soft); color: var(--studio-accent); border-color: var(--pds-border); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-cart__pack-component strong, .encaissement-pack-staff-modal__eyebrow
) { color: var(--studio-accent); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-overlay__backdate, .encaissement-cart__section--products,
    .encaissement-cart__suppressed-pack, .encaissement-conflict__icon,
    .encaissement-conflict__warning, .discount-modal__empty
) { background: var(--pds-warning-soft); color: var(--studio-warning-ink); border-color: var(--studio-warning-ink); }
html[data-pilot-theme="studio"] body.pds-admin .encaissement-cart__suppressed-pack-copy {
    color: var(--studio-warning-ink);
}
html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-error__title, .discount-modal__required,
    .encaissement-actions__total-row--discount
) { color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-cart__item-discount-tag, .encaissement-pack-staff-modal__error
) { background: var(--pds-danger-soft); color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-success__check, .encaissement-success__feedback,
    .encaissement-conflict__eyebrow
) { color: var(--studio-success-ink); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-overlay__close, .product-picker__close, .service-picker__close,
    .discount-modal__close, .check-form__close, .gift-form__close,
    .encaissement-pack-staff-modal__close, .encaissement-cart__pack-staff-edit,
    .encaissement-cart__item-discount-add, .encaissement-success__action-btn,
    .encaissement-conflict__danger, .service-picker__item
) { background: var(--pds-surface); color: var(--pds-ink); border-color: var(--pds-border-strong); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-overlay__close:hover, .product-picker__close:hover,
    .service-picker__close:hover, .discount-modal__close:hover,
    .check-form__close:hover, .gift-form__close:hover,
    .encaissement-pack-staff-modal__close:hover,
    .encaissement-cart__pack-staff-edit:hover,
    .encaissement-cart__item-discount-add:hover,
    .encaissement-success__action-btn:hover, .encaissement-conflict__danger:hover,
    .service-picker__item:hover, .encaissement-actions__action:hover:not(:disabled),
    .encaissement-actions__payment-btn:hover:not(:disabled),
    .mixed-payments__method-btn:hover, .discount-modal__cancel:hover
) { background: var(--studio-hover); color: var(--pds-ink); border-color: var(--studio-accent); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-cart__section-remove, .encaissement-cart__item-remove,
    .encaissement-cart__item-discount-remove, .encaissement-actions__discount-remove,
    .mixed-payments__item-remove
) { color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-cart__section-remove:hover, .encaissement-cart__item-remove:hover,
    .encaissement-cart__item-discount-remove:hover, .encaissement-actions__discount-remove:hover,
    .mixed-payments__item-remove:hover
) { background: var(--pds-danger-soft); color: var(--studio-danger-ink); }

html[data-pilot-theme="studio"] body.pds-admin :is(
    .discount-modal__submit:not(:disabled), .encaissement-pack-staff-modal__save,
    .encaissement-conflict__primary
) { background: var(--studio-accent-fill); color: var(--studio-on-accent); border-color: var(--studio-accent-fill); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .discount-modal__submit:not(:disabled):hover, .encaissement-pack-staff-modal__save:hover,
    .encaissement-conflict__primary:hover
) { background: var(--studio-accent-hover); color: var(--studio-on-accent); }

/* Variantes peu fréquentes : paiement mixte, ancien bon, détail de vente. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .encaissement-overlay .btn-pilot-secondary,
    .encaissement-cart__staff select, .encaissement-pack-staff-modal__service select
) { background: var(--pds-surface); color: var(--pds-ink); border-color: var(--pds-border-strong); }
html[data-pilot-theme="studio"] body.pds-admin .encaissement-success__legacy-gift[style] {
    background: var(--pds-action-soft) !important;
    color: var(--studio-accent) !important;
    border-color: var(--pds-border-strong) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .encaissement-success__legacy-gift > div[style] {
    color: var(--pds-ink-soft) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .gift-form__submit[style] {
    background: var(--pds-action-soft) !important;
    color: var(--studio-accent) !important;
    border-color: var(--studio-accent) !important;
}

/* Même contrat fond/texte pour les cartes historiques de bons cadeaux,
 * le détail de vente et le suivi interne : ne pas supposer un héritage. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .sdp-ticket-num, .sdp-item-name, .sdp-item-amount, .sdp-total-final,
    .gvc-confirm-amount, .gvd-mixrow, .ep-rm-page h1, .ep-rm-kpi-value,
    .ep-rm-new-title, .ep-rm-titre
) { color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .sdp-meta, .sdp-item-qty, .sdp-item-staff, .sdp-tgc, .sdp-notes,
    .gvd-meta, .gvd-label, .gvd-hint, .gvd-kpi-label, .gvd-ev-meta,
    .gvl-empty, .gvc-meta, .gvc-empty, .gvc-back-link,
    .av-kpi small, .av-nm, .ep-rm-sub, .ep-rm-kpi-label, .ep-rm-flabel,
    .ep-rm-row-done .ep-rm-titre, .ep-rm-module-score, .ep-rm-nm, .ep-rm-empty
) { color: var(--pds-muted); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .sdp-total-row, .sdp-pay-row, .sdp-pack-component,
    .av-detail-texts p, .av-legend strong, .ep-rm-desc, table.ep-rm tbody td
) { color: var(--pds-ink-soft); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .sdp-pack-components, .gvd-kpi, .av-donut-hole, .av-chantier,
    .ep-rm-row-done td, .ep-rm-row-editing td, table.ep-rm thead th,
    .gvd-back:hover, .gvl-back:hover, .gvc-back:hover, .gvl-row:hover,
    .ep-rm-btn:hover
) { background: var(--studio-hover); color: var(--pds-ink); border-color: var(--pds-border); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .gvd-pay label:has(input:checked), .gvl-chip, .gvc-select-btn
) { background: var(--pds-action-soft); color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .gvd-kpi-num.bal, .gvl-bal, .gvc-bal
) { color: var(--studio-success-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .gvd-submit, .gvl-search button, .gvc-search button, .gvl-chip.active,
    .ep-rm-btn-save, .ep-rm-btn-save:hover
) { background: var(--studio-accent-fill); color: var(--studio-on-accent); border-color: var(--studio-accent-fill); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .ep-rm-back, .ep-rm-sub a, .ep-rm-module, .ep-rm-btn:not(.ep-rm-btn-save),
    .ep-rm-move:hover:not(:disabled)
) { color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .sdp-discount, .ep-rm-err
) { color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .sdp-btn-danger, .gvd-err, .gvc-err
) { background: var(--pds-danger-soft); color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .sdp-pay-due, .gvd-warn, .gvc-warn
) { background: var(--pds-warning-soft); color: var(--studio-warning-ink); }

/* La rupture reste signalée par son libellé ; atténuer toute la ligne rendait
 * aussi le nom et le prix illisibles alors que le produit reste sélectionnable. */
html[data-pilot-theme="studio"] body.pds-admin .product-picker .product-result-item--pos[style] {
    opacity: 1 !important;
}
html[data-pilot-theme="studio"] body.pds-admin .product-picker .product-result-item--pos [style*="color:#dc2626"] {
    color: var(--studio-danger-ink) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .product-picker .product-result-item--pos [style*="color:#d97706"] {
    color: var(--studio-warning-ink) !important;
}

html[data-pilot-theme="studio"] body.pds-admin .av-shell {
    --av-ink: var(--pds-ink);
    --av-muted: var(--pds-muted);
    --av-line: var(--pds-border);
    --av-soft: var(--studio-hover);
    --av-green: var(--studio-success-ink);
    --av-blue: var(--studio-accent);
    --av-coral: var(--studio-danger-ink);
    --av-gold: var(--studio-warning-ink);
}
html[data-pilot-theme="studio"] body.pds-admin .av-btn-primary {
    background: var(--studio-accent-fill); color: var(--studio-on-accent); border-color: var(--studio-accent-fill);
}
html[data-pilot-theme="studio"] body.pds-admin .av-bugs {
    background: var(--pds-danger); color: #ffffff;
}
html[data-pilot-theme="studio"] body.pds-admin :is(
    .av-poids-moyen, .av-poids-fort, .av-prio-P1, .av-statut-en_cours,
    .ep-rm-prio-P1, .ep-rm-origine-pierre, .ep-rm-statut-en_cours,
    .gvd-status.PARTIELLEMENT_UTILISE, .gvl-status.PARTIELLEMENT_UTILISE
) { background: var(--pds-warning-soft); color: var(--studio-warning-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .av-poids-faible, .av-poids-none, .av-prio-P2, .av-statut-idee,
    .ep-rm-prio-P2, .ep-rm-statut-idee, .gvc-cancelled
) { background: var(--studio-hover); color: var(--pds-muted); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .av-chantiers, .av-statut-livre, .ep-rm-origine-benchmark, .ep-rm-statut-livre,
    .gvd-status.ACTIF, .gvl-status.ACTIF
) { background: var(--pds-success-soft); color: var(--studio-success-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .av-statut-valide, .ep-rm-origine-vision, .ep-rm-statut-valide,
    .gvd-status.CONSUMED, .gvl-status.CONSUMED
) { background: var(--pds-action-soft); color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin :is(
    .av-prio-P0, .ep-rm-prio-P0, .gvd-status.CANCELLED, .gvl-status.CANCELLED
) { background: var(--pds-danger-soft); color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin .ep-rm-new {
    background: var(--pds-surface); color: var(--pds-ink); border-color: var(--pds-border);
}
html[data-pilot-theme="studio"] body.pds-admin .inv-tab.active {
    color: var(--studio-accent); border-bottom-color: var(--studio-accent);
}
html[data-pilot-theme="studio"] body.pds-admin .inv-brand-sep td {
    background: var(--studio-hover); color: var(--pds-ink-soft);
}
html[data-pilot-theme="studio"] body.pds-admin :is(
    .sdp-total-big, .sdp-pack-component strong, .sdp-staff-edit, .sdp-pay-editable:hover
) { color: var(--studio-accent); }

/* r4 — Les encres claires exigent un fond sombre jusque dans les cartes
 * historiques. Les aplats métier (RDV, calendrier, avertissements) gardent
 * leur palette claire et reçoivent explicitement leurs encres sombres. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .rs-card, .rs-preset-btn:not(.active), .oracle-kpi, .oracle-score,
    .oracle-scenario, .staff-order-item, .cat-card, .cat-linked-content,
    .cat-order-btn, .cat-archive-btn, .lcfg-card, .lui-card, .solo-card,
    .supp-empty, .pds-choice, .pds-tab:not([aria-selected="true"]),
    .pds-data-panel-footer, .btn-pilot-secondary
) {
    background-color: var(--pds-surface);
    border-color: var(--pds-border);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .cat-filter-row a, .cat-card-disclose, .cat-linked-content a span,
    .cat-linked-content a:hover, .alert-action, .alert-action a,
    .sort-arrow, .stk-sort-arrow
) {
    color: var(--studio-accent);
}

html[data-pilot-theme="studio"] body.pds-admin .cat-archive-btn:not(:disabled) {
    color: var(--studio-danger-ink);
}

html[data-pilot-theme="studio"] body.pds-admin :is(
    .rs-preset-btn:not(.active):hover, .cat-order-btn:hover:not(:disabled),
    .cat-archive-btn:hover:not(:disabled), .pds-choice:hover, .pds-tab:hover,
    .supp-row:nth-child(even) td
) {
    background-color: var(--studio-hover);
}

html[data-pilot-theme="studio"] body.pds-admin .stk-row-out td {
    background-color: var(--pds-danger-soft);
}
html[data-pilot-theme="studio"] body.pds-admin .stk-row-low td {
    background-color: var(--pds-warning-soft);
}
html[data-pilot-theme="studio"] body.pds-admin :is(.stk-row-out, .stk-row-low):hover td {
    background-color: var(--studio-hover);
}

/* Ces îlots gardent leurs fonds fixes, y compris les couleurs des coiffeurs.
 * Les alias sont redéfinis localement : les var() héritées de body sont déjà
 * résolues et ne suivent pas une simple redéfinition locale de --pds-ink. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .week-apt-block, .week-day-today, .supp-help,
    .finance-content [style*="background:#fff3cd"],
    .finance-content [style*="background: #fff3cd"],
    .staff-content [style*="background:#fff3cd"],
    .staff-content [style*="background: #fff3cd"]
) {
    --pds-ink: #25232b;
    --pds-ink-soft: #4f4a56;
    --pds-slate: #4f4a56;
    --pds-muted: #4f4a56;
    --text-primary: #25232b;
    --text-secondary: #4f4a56;
    --text-muted: #4f4a56;
    --ink-900: #25232b;
    --ink-600: #4f4a56;
    --ink-400: #4f4a56;
    color: var(--pds-ink);
}

/* Les champs couleur natifs restent des témoins clairs, même en color-scheme
 * dark ; leurs valeurs ne doivent pas hériter d'une encre blanche. */
html[data-pilot-theme="studio"] body.pds-admin input[type="color"] {
    color-scheme: light;
    background-color: #ffffff;
    color: #25232b;
}

html[data-pilot-theme="studio"] body.pds-admin .pds-swatch--brand-deep {
    color: var(--pds-ref-canvas);
}
html[data-pilot-theme="studio"] body.pds-admin .pds-stat-meter {
    background-color: var(--studio-hover);
}

html[data-pilot-theme="studio"] body.pds-admin .cal-kpi-row .kpi-card-value[style*="#C0392B"] {
    color: var(--studio-danger-ink) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .cal-kpi-row .kpi-card-value[style*="#1D9E75"] {
    color: var(--studio-success-ink) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .cal-kpi-row .kpi-card-value[style*="#1A1A1A"] {
    color: var(--pds-ink) !important;
}

/* Le sélecteur de salon utilise un bouton blanc inline sans classe. */
html[data-pilot-theme="studio"] body.pds-admin form:has(> input[name="salon_id"]) > button[style*="background: white"] {
    color: #25232b;
    color-scheme: light;
}

/* Le jour courant du calendrier finance est une pastille violet foncé ;
 * ne pas remplacer son blanc inline par l'accent lavande global. */
html[data-pilot-theme="studio"] body.pds-admin .finance-content span[style*="background:var(--accent)"][style*="color:#fff"] {
    color: #ffffff !important;
}

/* En color-scheme dark, les champs numériques natifs dépassent leurs
 * colonnes de 110/70 px. Les borner au parent conserve le formulaire repliable. */
@media (max-width: 767.98px) {
    html[data-pilot-theme="studio"] body.pds-admin :is(#dl-amount, #dl-day) {
        width: 100%;
    }
}

/* Le titre global ne doit pas éclaircir cette alerte de configuration rose. */
html[data-pilot-theme="studio"] body.pds-admin [data-testid="hiring-not-configured"] h2 {
    color: inherit;
}

/* Textes fixes des cartes fidélité et de l'étape équipe désormais sombres. */
html[data-pilot-theme="studio"] body.pds-admin :is(
    .lcfg-row-label, .lcfg-field label, .lui-field label, .solo-card
) {
    color: var(--pds-ink);
}
html[data-pilot-theme="studio"] body.pds-admin .solo-card p {
    color: var(--pds-ink-soft);
}

/* Fidélité à la maquette validée : coquille horizontale en deux rangées.
 * Les préférences de l'ancienne sidebar ne doivent pas masquer les modules.
 * La navigation téléphone continue d'être gérée par phone.css. */
html[data-pilot-theme="studio"] body.pds-admin {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --pds-radius-md: 13px;
}

@media (min-width: 768px) {
    html[data-pilot-theme="studio"] body.pds-admin {
        --studio-sidebar-width: 0px;
        --navbar-height: 124px;
        --page-padding: 30px;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar {
        background: #231f32;
        box-shadow: none;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto auto;
        grid-template-rows: 66px 58px;
        padding: 0;
        gap: 0;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-logo {
        width: auto;
        height: 66px;
        padding: 16px 28px;
        font-size: 23px;
        letter-spacing: -1px;
        background: transparent;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-logo > span:last-child {
        display: inline;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-logo .logo-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #ac90ff;
        box-shadow: none;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar .logo-dot::after {
        content: none;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-links {
        position: static;
        grid-row: 2;
        grid-column: 1 / -1;
        width: 100%;
        height: 58px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 2px;
        padding: 9px 20px;
        background: #25232e;
        border-bottom: 1px solid #3d3748;
        box-shadow: none;
        visibility: visible;
        transform: none;
        overflow: visible;
        transition: none;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-link {
        width: auto;
        min-height: 38px;
        padding: 10px 9px;
        border-radius: 7px;
        color: #b8b1c7;
        font-size: 16px;
        font-weight: 500;
        line-height: 20px;
        justify-content: center;
        white-space: nowrap;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-link.active,
    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-link:hover {
        color: var(--studio-accent);
        background: #34284c;
        font-weight: 650;
        box-shadow: none;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-link-icon {
        display: none;
    }

    html[data-pilot-theme="studio"] body.pds-admin .navbar-profile {
        margin-right: 28px;
    }

    html[data-pilot-theme="studio"] body.pds-admin .app-content {
        margin-left: 0 !important;
        margin-top: var(--navbar-height);
        padding: 29px 30px 26px;
        transition: none;
    }

    html[data-pilot-theme="studio"] body.pds-admin .module-frame {
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    html[data-pilot-theme="studio"] body.pds-admin #modal-container {
        left: 0;
    }

    html[data-pilot-theme="studio"] body.pds-admin .cx-custom-period {
        left: 12px;
    }

    html[data-pilot-theme="studio"] body.pds-admin :is(.studio-sidebar-resizer, .studio-sidebar-show) {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1100px) {
    html[data-pilot-theme="studio"] body.pds-admin {
        --navbar-height: 164px;
    }
    html[data-pilot-theme="studio"] body.pds-admin .navbar-inner {
        grid-template-rows: 66px 98px;
    }
    html[data-pilot-theme="studio"] body.pds-admin .navbar .navbar-links {
        height: 98px;
    }
}

/* Clients (MIGRATION-PDS-clients, 13/10/2026) : en-tête, recherche, puces et
 * tableau suivent les composants pds-* et les jetons, sans règle Studio.
 * Puces de filtre : habillage historique conservé (DETTE-PDS-CLIENTS-PUCES-STATUT-AGE). */
html[data-pilot-theme="studio"] body.pds-admin .clients-content:has(#client-search) .cl-pills {
    margin: 16px 0 18px !important;
}
html[data-pilot-theme="studio"] body.pds-admin .clients-content .cl-pill {
    border-color: #3d3748;
    border-radius: 7px;
    padding: 8px 13px;
    background: #25232e;
    color: #b8b1c7;
}
html[data-pilot-theme="studio"] body.pds-admin .clients-content .cl-pill-active {
    background: #34284c;
    color: var(--studio-accent);
    border-color: #59406b;
}

/* Planning — la couleur attribuée au coiffeur remplit chaque rendez-vous.
 * Mélangée avec du blanc, elle garde sa teinte sans compromettre le texte
 * sombre, même pour une couleur d'équipe très claire ou très foncée.
 * Le repère de bordure conserve la couleur exacte de la fiche Équipe. */
html[data-pilot-theme="studio"] body.pds-admin .appointment-block {
    background: color-mix(in srgb, var(--staff-color, #b79cff) 32%, white);
    border-left: 3px solid var(--staff-color, #b79cff);
}
/* Conserver l'atténuation native des absents et annulés ; encaissé reste lisible. */
html[data-pilot-theme="studio"] body.pds-admin .appointment-block:not(.status-no_show):not(.status-cancelled) {
    opacity: 1;
}
html[data-pilot-theme="studio"] body.pds-admin .appointment-block :is(.rdv-client, .rdv-service, .rdv-time, .apt-status-label) {
    color: #231f32;
}
html[data-pilot-theme="studio"] body.pds-admin .appointment-block .apt-status-icon {
    color: #231f32;
    background: rgb(255 255 255 / 75%);
}
html[data-pilot-theme="studio"] body.pds-admin .appointment-block.rdv-conflict {
    outline: 2px solid #a83236;
    outline-offset: -2px;
}
html[data-pilot-theme="studio"] body.pds-admin .staff-header-col :is(.staff-avatar, .staff-rdv-count:not(.staff-rdv-empty)) {
    background: color-mix(in srgb, var(--staff-hdr-color, #b79cff) 32%, white) !important;
    color: #231f32;
}

/* Formulaire RDV actuel, sur une page : icônes et commandes sur le même axe. */
html[data-pilot-theme="studio"] body.pds-admin .rdv-page :is(.rdv-client-actions button, .rdv-datetime-edit-btn, .rdv-client-selected-clear, .rdv-sel-remove, .rdv-add-another, .rdv-form-actions > *) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
html[data-pilot-theme="studio"] body.pds-admin :is(.rdv-page, .rdv-page-header) svg {
    display: block;
    flex-shrink: 0;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-datetime-edit-btn {
    margin-left: auto;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-client-actions {
    align-items: stretch;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-svc-row {
    gap: 16px;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-svc-row > div {
    min-width: 0;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-svc-price {
    flex-shrink: 0;
    text-align: right;
}

/* Formulaire RDV : contraste renforcé validé par Pierre le 30/09/2026. */
html[data-pilot-theme="studio"] body.pds-admin .rdv-page :is(.rdv-card,.rdv-right) {
    background: #302c3e !important;
    border-color: #696079 !important;
    box-shadow: 0 5px 18px #0003;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page :is(input:not([type=hidden]),textarea,select) {
    background: #423c52 !important;
    color: #fffaff !important;
    border-color: #9486ab !important;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page ::placeholder {
    color: #d6cde4 !important;
    opacity: 1;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page :is(.rdv-card-title,.rdv-client-selected-name,.rdv-svc-name,.rdv-svc-price,.rdv-datetime-text) {
    color: #fffaff !important;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page :is(.rdv-svc-dur,.rdv-search-icon) {
    color: #ded5ec !important;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page :is(.rdv-client-actions button,.rdv-datetime-edit-btn) {
    background: #423c52 !important;
    color: #fffaff !important;
    border-color: #9486ab !important;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-svc-row {
    background: #393345 !important;
    border-color: #696079 !important;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-filter-pills {
    background: #211d2c !important;
    border-color: #696079 !important;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-filter-pill:not(.is-active) {
    background: transparent !important;
    color: #ded5ec !important;
}
html[data-pilot-theme="studio"] body.pds-admin .rdv-page .rdv-filter-pill.is-active {
    background: var(--studio-accent-fill) !important;
    color: var(--studio-on-accent) !important;
}

/* Libellés injectés avec le catalogue et les forfaits : lisibles en Studio. */
html[data-pilot-theme="studio"] body.pds-admin .rdv-page :is(.rdv-section-eyebrow, .rdv-sel-pack-label, .rdv-sel-pack-clear) {
    color: var(--studio-accent) !important;
}

/* #497 — maquettes validées : socle commun et accès rapide, variante B.
 * Opt-in Studio uniquement. Les grilles métier et les états restent en place.
 */
html[data-pilot-theme="studio"] body.pds-admin {
    --pds-surface: #302c3e;
    --pds-ink: #fffaff;
    --pds-ink-soft: #ded5ec;
    --pds-slate: #d6cde4;
    --pds-muted: #d6cde4;
    --pds-border: #696079;
    --pds-border-strong: #9486ab;
}
html[data-pilot-theme="studio"] body.pds-admin :is(
    .edit-card, .service-detail-card, .pack-card, .supplier-card,
    .inv-panel, .inv-history-card, .pcat-card, .remuneration-card,
    .analysis-panel, .budget-panel, .rs-card, .preview-panel,
    .auto-card, .item-card, .review-card, .tpl-card, .lcfg-card,
    .display-setting-card, .display-preview-card, .modal-panel
) {
    background-color: var(--pds-surface);
    border-color: var(--pds-border);
    color: var(--pds-ink);
}
html[data-pilot-theme="studio"] body.pds-admin :is(
    .services-content, .staff-content, .products-content,
    .finance-content, .intel-content, .settings-content
) { min-width: 0; }
html[data-pilot-theme="studio"] body.pds-admin :is(
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
    select, textarea
):not(:disabled):not([readonly]) {
    background-color: #423c52;
    border-color: #9486ab;
    color: #fffaff;
}
html[data-pilot-theme="studio"] body.pds-admin .home-card {
    background: #292632;
    border: 1px solid #696079;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: start;
    gap: 18px;
    padding: 24px;
    min-height: 186px;
}
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    border: 0;
    color: #201c29;
    background: var(--studio-shortcut-tone, #c3a6ef);
}
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon svg { width: 27px; height: 27px; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon--violet { --studio-shortcut-tone: #c3a6ef; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon--green { --studio-shortcut-tone: #a1e5c4; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon--blue { --studio-shortcut-tone: #a5c9f2; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon--amber { --studio-shortcut-tone: #f1d296; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon--red { --studio-shortcut-tone: #f1b0aa; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon--pink { --studio-shortcut-tone: #eab4d3; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-icon--gray { --studio-shortcut-tone: #c8c4d3; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-content { grid-column: 1 / -1; min-width: 0; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-title { font-size: 19px; }
html[data-pilot-theme="studio"] body.pds-admin .home-card-desc { font-size: 13px; margin-top: 5px; }
html[data-pilot-theme="studio"] body.pds-admin .home-card:hover { background: #34303f; border-color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin .home-card::after {
    content: "→";
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    color: #d6cde4;
}
@media (max-width: 767.98px) {
    html[data-pilot-theme="studio"] body.pds-admin .home-cards-grid { grid-template-columns: minmax(0, 1fr); }
    html[data-pilot-theme="studio"] body.pds-admin .home-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        min-height: 100px;
        padding: 18px;
        gap: 16px;
        align-items: center;
    }
    html[data-pilot-theme="studio"] body.pds-admin .home-card-content { grid-column: 2; grid-row: 1; }
    html[data-pilot-theme="studio"] body.pds-admin .home-card::after { grid-column: 3; }
    html[data-pilot-theme="studio"] body.pds-admin .home-card-title { font-size: 17px; }
}
html[data-pilot-theme="studio"] body.pds-admin .home-cards-section + .home-cards-section .home-card {
    display: flex;
    align-items: center;
    min-height: 100px;
    padding: 20px;
}
html[data-pilot-theme="studio"] body.pds-admin .home-cards-section + .home-cards-section .home-card::after { content: none; }

/* Occupation : taux serveur inchangés, palette sémantique validée 60/80. */
html[data-pilot-theme="studio"] body.pds-admin .studio-occupation--low { background: #512b38 !important; color: #ffd5df !important; }
html[data-pilot-theme="studio"] body.pds-admin .studio-occupation--medium { background: #493920 !important; color: #ffe0a6 !important; }
html[data-pilot-theme="studio"] body.pds-admin .studio-occupation--high { background: #244438 !important; color: #c0f1d9 !important; }
html[data-pilot-theme="studio"] body.pds-admin .studio-occupation-legend {
    display: block;
    color: var(--pds-ink-soft);
    margin-top: 12px;
    font-size: .85rem;
}
html[data-pilot-theme="studio"] body.pds-admin .occupation-classic-legend { display: none !important; }
html[data-pilot-theme="studio"] body.pds-admin .studio-chart-peak:not(.studio-occupation):not(.studio-chart-semantic) { background: #a1e5c4 !important; }
html[data-pilot-theme="studio"] body.pds-admin .studio-chart-peak { outline: 2px solid #c0f1d9; outline-offset: -2px; }

/* Cartes et chiffres de l’accueil : même hiérarchie que le lot 1 validé. */
html[data-pilot-theme="studio"] body.pds-admin .home-cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-pilot-theme="studio"] body.pds-admin .home-stat-card {
    background: var(--pds-surface);
    border: 1px solid var(--pds-border);
    box-shadow: none;
}
html[data-pilot-theme="studio"] body.pds-admin .home-stat-card.stat-rdv { background: #34284c; border-color: #8970a8; }
html[data-pilot-theme="studio"] body.pds-admin .home-stat-value { color: var(--pds-ink); font-size: 29px; font-variant-numeric: tabular-nums; }
html[data-pilot-theme="studio"] body.pds-admin .home-stat-label { color: var(--pds-muted); letter-spacing: 1px; }
html[data-pilot-theme="studio"] body.pds-admin .home-caisse.caisse-warning { background: #463722; border: 1px solid #a9884d; animation: none; }
html[data-pilot-theme="studio"] body.pds-admin .home-caisse.caisse-warning .home-caisse-text { color: #ffdb9b; }
html[data-pilot-theme="studio"] body.pds-admin .home-caisse.caisse-open { background: #223e33; border: 1px solid #4d806b; }
html[data-pilot-theme="studio"] body.pds-admin .home-caisse.caisse-open .home-caisse-text { color: #b0efd3; }
html[data-pilot-theme="studio"] body.pds-admin .home-caisse.caisse-closed { background: var(--pds-surface); border: 1px solid var(--pds-border); }
html[data-pilot-theme="studio"] body.pds-admin .home-caisse.caisse-closed .home-caisse-text { color: var(--pds-ink-soft); }
@media (max-width: 767.98px) {
    html[data-pilot-theme="studio"] body.pds-admin .home-cards-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Lot 4 : montant prioritaire, sans changer total ni répartition des paiements. */
html[data-pilot-theme="studio"] body.pds-admin .encaissement-actions__total-block {
    background: #c7afff;
    color: #21172f;
    padding: 22px;
    border-radius: 14px;
}
html[data-pilot-theme="studio"] body.pds-admin .encaissement-actions__total-block :is(p, span) { color: #21172f !important; }
html[data-pilot-theme="studio"] body.pds-admin .encaissement-actions__total-amount {
    font-size: clamp(2rem, 4vw, 5rem);
    line-height: 1.1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* Lot 5 : tableau à droite, formulaire à gauche sur les grandes largeurs.
 * La disposition téléphone déjà adaptative reste prioritaire. */
@media (min-width: 1100px) {
    html[data-pilot-theme="studio"] body.pds-admin .ops-layout { flex-direction: row-reverse; }
    html[data-pilot-theme="studio"] body.pds-admin .ops-left { padding: 0 0 0 24px; border-right: 0; border-left: 1px solid var(--pds-border); }
    html[data-pilot-theme="studio"] body.pds-admin .ops-right { padding: 0 24px 0 0; }
}

/* Lot 6 — toutes les couches du cockpit Marketing, et ses cartes longues. */
html[data-pilot-theme="studio"] body.pds-admin .mkt-page { background: var(--pds-page); margin: 0; padding: 0; min-width: 0; }
html[data-pilot-theme="studio"] body.pds-admin :is(.mkt-section, .mkt-kpi-card) { background: var(--pds-surface); border: 1px solid var(--pds-border); color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin .mkt-page h1 { color: var(--pds-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(.mkt-section-title, .mkt-kpi-label) { color: var(--pds-muted); }
html[data-pilot-theme="studio"] body.pds-admin .mkt-kpi-value { color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin .mkt-kpi-value[style*="#E74C3C" i] { color: var(--studio-danger-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin .mkt-kpi-value[style*="#D4A017" i] { color: var(--studio-warning-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin .mkt-kpi-value[style*="#1D9E75" i] { color: var(--studio-success-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(.mkt-action-card, .mkt-program-card) { min-width: 0; border-color: var(--pds-border); }
html[data-pilot-theme="studio"] body.pds-admin .mkt-page .home-card-title { overflow-wrap: anywhere; font-size: 1rem; }
html[data-pilot-theme="studio"] body.pds-admin .mkt-programs-grid { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
html[data-pilot-theme="studio"] body.pds-admin .mkt-actions-grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }

/* Lot 5 — barres de liste et états des opérations, y compris après filtrage. */
html[data-pilot-theme="studio"] body.pds-admin .ops-layout {
    --header-bg: #302c3e;
    --row-hover-bg: #423c52;
    --row-selected-bg: #45345e;
    --border-color: #696079;
}
html[data-pilot-theme="studio"] body.pds-admin .ops-layout :is(.ops-toolbar, .month-header) { background: var(--pds-surface); color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin .ops-layout .month-name { color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin .ops-layout :is(.month-stats, .stat-count) { color: var(--pds-ink-soft); }
html[data-pilot-theme="studio"] body.pds-admin .ops-layout .month-stats [style*="#e55a5a" i] { color: var(--studio-danger-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin .ops-layout :is(.month-stats, .ops-soldes) [style*="#00b894" i] { color: var(--studio-success-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin .ops-layout :is(#btn-expense, #btn-revenue)[aria-pressed="false"] { background: #423c52 !important; color: #fffaff !important; border-color: #9486ab !important; }
html[data-pilot-theme="studio"] body.pds-admin .intel-content .kpi-trend.up { color: var(--studio-success-ink); }
html[data-pilot-theme="studio"] body.pds-admin .intel-content .kpi-trend.down { color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin .intel-content .kpi-trend.flat { color: var(--pds-muted); }

/* Lots 1–6 : composants secondaires et états chargés par HTMX. */
html[data-pilot-theme="studio"] body.pds-admin :is(.ep-sub, .ep-card p, .cal-legend-item) { color: var(--pds-muted); }
html[data-pilot-theme="studio"] body.pds-admin :is(.ep-card-tag, .lcfg-back, .lui-back, .pack-price-new, .cl-loy-points, .cl-loy-history-pts) { color: var(--studio-accent); }
html[data-pilot-theme="studio"] body.pds-admin .ep-card-tag { background: #45345e; }
html[data-pilot-theme="studio"] body.pds-admin .pack-archived-link { color: var(--studio-accent) !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(.pack-group-summary, .v14-pack-toggles, .cl-loy, .cl-loy-reward, .booking-preview-card) { background: var(--pds-surface); border-color: var(--pds-border); color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin :is(.v14-toggle-warning, .cl-loy-off) { background: #493920; color: #ffe0a6; }
html[data-pilot-theme="studio"] body.pds-admin :is(.staff-tab, .analysis-tab, .budget-tab).active { color: var(--studio-accent) !important; border-bottom-color: var(--studio-accent) !important; }
html[data-pilot-theme="studio"] body.pds-admin .cal-cell { background: var(--pds-surface); border-color: var(--pds-border); }
html[data-pilot-theme="studio"] body.pds-admin .cal-cell:hover { background: #423c52; }
html[data-pilot-theme="studio"] body.pds-admin .cal-cell.closed,
html[data-pilot-theme="studio"] body.pds-admin .cal-cell.empty { background: #25222e; }
html[data-pilot-theme="studio"] body.pds-admin .cal-cell.holiday,
html[data-pilot-theme="studio"] body.pds-admin .cal-holiday { background: #493920; color: #ffe0a6; }
html[data-pilot-theme="studio"] body.pds-admin .cal-cell.ca-above { background: #244438; }
html[data-pilot-theme="studio"] body.pds-admin .cal-cell.ca-below { background: #512b38; }
html[data-pilot-theme="studio"] body.pds-admin .cal-day-num.closed-day { color: var(--pds-muted); }
html[data-pilot-theme="studio"] body.pds-admin .cal-day-num.sunday { color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin .cal-day-badge { background: #c7afff; color: #21172f; }
html[data-pilot-theme="studio"] body.pds-admin .stk-kpi { border: 1px solid var(--pds-border); }
html[data-pilot-theme="studio"] body.pds-admin .stk-kpi-label { opacity: 1; }
html[data-pilot-theme="studio"] body.pds-admin .stk-kpi-rupture { background: #512b38; color: #ffd5df; }
html[data-pilot-theme="studio"] body.pds-admin .stk-kpi-low { background: #493920; color: #ffe0a6; }
html[data-pilot-theme="studio"] body.pds-admin .stk-kpi-value-card { background: #244438; color: #c0f1d9; }
html[data-pilot-theme="studio"] body.pds-admin .stk-kpi-total { background: #45345e; color: #e3d4ff; }
html[data-pilot-theme="studio"] body.pds-admin .price-table .margin-high { color: var(--studio-success-ink); }
html[data-pilot-theme="studio"] body.pds-admin .price-table .margin-mid { color: var(--studio-warning-ink); }
html[data-pilot-theme="studio"] body.pds-admin .price-table .margin-low { color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin .finance-content [style*="background:#00B894" i] { color: #112d26 !important; }
html[data-pilot-theme="studio"] body.pds-admin .finance-content :is(.stat-card-value, .stat-card-label span)[style*="color:#6C5CE7" i] { color: var(--studio-accent) !important; }
html[data-pilot-theme="studio"] body.pds-admin #tab-pnl > [style*="background:#eef0ff" i] { background: #383254 !important; }
html[data-pilot-theme="studio"] body.pds-admin .lcfg-badge.is-off { background: #423c52; color: #d6cde4; }
html[data-pilot-theme="studio"] body.pds-admin .badge-active { background: #244438; color: #c0f1d9; }
html[data-pilot-theme="studio"] body.pds-admin .badge-draft { background: #493920; color: #ffe0a6; }
html[data-pilot-theme="studio"] body.pds-admin .intel-content [style*="color:#e55a5a" i] { color: var(--studio-danger-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin .settings-content [style*="color:#dc2626" i] { color: var(--studio-danger-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin .settings-content [style*="color:#B45309" i] { color: var(--studio-warning-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(.cat-action-btn, .cat-del-btn) { background: #423c52; color: var(--pds-ink); border-color: var(--pds-border); }
html[data-pilot-theme="studio"] body.pds-admin :is(.staff-content, .clients-content, .products-content) { min-width: 0; }
html[data-pilot-theme="studio"] body.pds-admin .staff-tabs { max-width: 100%; overflow-x: auto; }
html[data-pilot-theme="studio"] body.pds-admin .staff-tab { flex-shrink: 0; }
html[data-pilot-theme="studio"] body.pds-admin .client-detail-header > div { min-width: 0; flex-wrap: wrap; }
html[data-pilot-theme="studio"] body.pds-admin .client-detail-meta { overflow-wrap: anywhere; }

html[data-pilot-theme="studio"] body.pds-admin .cat-parent { background: var(--pds-surface); }
html[data-pilot-theme="studio"] body.pds-admin .cat-parent:hover { background: #423c52; }
html[data-pilot-theme="studio"] body.pds-admin .studio-table-scroll { max-width: 100%; overflow-x: auto; }
@media (max-width: 767.98px) {
    html[data-pilot-theme="studio"] body.pds-admin .config-section form > [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: minmax(0, 1fr) !important; }
    html[data-pilot-theme="studio"] body.pds-admin .item-card > [style*="display:flex"] { flex-wrap: wrap; min-width: 0; }
}

html[data-pilot-theme="studio"] body.pds-admin .cal-day-num { color: var(--pds-ink); }
html[data-pilot-theme="studio"] body.pds-admin .cal-day-num.closed-day { color: var(--pds-muted); }
html[data-pilot-theme="studio"] body.pds-admin .cal-day-num.sunday { color: var(--studio-danger-ink); }
html[data-pilot-theme="studio"] body.pds-admin .staff-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; }

/* Fenêtres secondaires : conservation des repères, contraste des textes. */
html[data-pilot-theme="studio"] body.pds-admin .modal-panel [style*="background:#fafaf8"] { background: var(--pds-surface) !important; }
html[data-pilot-theme="studio"] body.pds-admin .comp-legend .thr { color: var(--studio-success-ink); }
html[data-pilot-theme="studio"] body.pds-admin .comp-seg input:checked + label.bookable { background: #244438; color: #c0f1d9; border-color: #8bd5b5; }
html[data-pilot-theme="studio"] body.pds-admin .icon-pick-active { background: #45345e; color: #e3d4ff; }
html[data-pilot-theme="studio"] body.pds-admin #color-preview > div:last-child { background: var(--pds-surface) !important; }
html[data-pilot-theme="studio"] body.pds-admin .pf-chart-scale > span:first-child { color: var(--studio-success-ink); font-weight: 700; }

html[data-pilot-theme="studio"] body.pds-admin .products-content .btn[style*="color: #d63031"] { color: var(--studio-danger-ink) !important; }
html[data-pilot-theme="studio"] body.pds-admin .studio-order-header { flex-wrap: wrap; gap: 16px; }
html[data-pilot-theme="studio"] body.pds-admin .studio-order-header h1 { overflow-wrap: anywhere; }
html[data-pilot-theme="studio"] body.pds-admin .studio-table-scroll .data-table td:last-child { background-color: var(--pds-surface); }

/* #497 r2 : états peuplés de la recette indépendante. Les fonds sémantiques
 * et leur encre sont toujours corrigés ensemble, sous Studio uniquement. */
html[data-pilot-theme="studio"] body.pds-admin .encaissement-actions__total-block .encaissement-actions__discount-remove {
    color: #751c28 !important;
    background: transparent;
    border: 1px solid #751c28;
}
html[data-pilot-theme="studio"] body.pds-admin .encaissement-actions__total-block .encaissement-actions__discount-remove:is(:hover, :focus-visible) {
    background: #751c28;
    color: #fffaff !important;
}
html[data-pilot-theme="studio"] body.pds-admin .week-apt-block {
    background: color-mix(in srgb, var(--staff-color, #999) 25%, #fff) !important;
}
html[data-pilot-theme="studio"] body.pds-admin :is(.finance-content, .dashboard-content) [style*="background:#e8f4fd"] {
    background: #263d52 !important;
    color: #e0f0ff;
}
html[data-pilot-theme="studio"] body.pds-admin .finance-content [style*="background:#f0faf6"] {
    background: #244438 !important;
}
html[data-pilot-theme="studio"] body.pds-admin .finance-content [style*="background:#fef5f5"] {
    background: #512b38 !important;
}
html[data-pilot-theme="studio"] body.pds-admin .booking-status-card.is-active {
    background: #244438;
    color: #c0f1d9;
    border-color: #81b99c;
}
html[data-pilot-theme="studio"] body.pds-admin .booking-status-card.is-active :is(strong, p) { color: #c0f1d9; }
html[data-pilot-theme="studio"] body.pds-admin .products-content tr[style*="#f0faf6"] { background: #244438 !important; }
html[data-pilot-theme="studio"] body.pds-admin .products-content tr[style*="#fff5f5"] { background: #512b38 !important; }
html[data-pilot-theme="studio"] body.pds-admin .products-content tr[style*="#f0faf6"] td[style*="#00b894"] { color: #c0f1d9 !important; }
html[data-pilot-theme="studio"] body.pds-admin .products-content tr[style*="#fff5f5"] td[style*="#d63031"] { color: #ffd5df !important; }
html[data-pilot-theme="studio"] body.pds-admin .stock-low { background: #493920; color: #ffe0a6; }
html[data-pilot-theme="studio"] body.pds-admin .detail-chip-success { background: #244438; color: #c0f1d9; }
html[data-pilot-theme="studio"] body.pds-admin .icon-pick { background: #423c52; color: #fffaff; border-color: #9486ab; }
html[data-pilot-theme="studio"] body.pds-admin .icon-pick:is(:hover, .icon-pick-active) { background: #45345e; color: #e3d4ff; }
html[data-pilot-theme="studio"] body.pds-admin .rdv-cat-back { color: #e3d4ff; background: #45345e; }
html[data-pilot-theme="studio"] body.pds-admin .pointage-filter-btn { color: #e3d4ff; border-color: #bcaaca; }
html[data-pilot-theme="studio"] body.pds-admin .pointage-filter-btn:is(:hover, .active) { background: #244438; color: #c0f1d9; border-color: #81b99c; }
html[data-pilot-theme="studio"] body.pds-admin .cat-owner-draw-badge { color: #e3d4ff !important; border-color: #bcaaca !important; }

/* Repère numérique explicite, y compris ex aequo sur la carte d'occupation. */
html[data-pilot-theme="studio"] body.pds-admin .studio-chart-peak { position: relative; }
html[data-pilot-theme="studio"] body.pds-admin .studio-chart-peak::after {
    content: "Pic";
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 3px;
    border-radius: 3px;
    background: #c0f1d9;
    color: #132d22;
    font: 700 9px/1.1 var(--font-body);
    white-space: nowrap;
    pointer-events: none;
}
html[data-pilot-theme="studio"] body.pds-admin .heatmap-cell.studio-chart-peak { padding-top: 14px; min-height: 36px; }
html[data-pilot-theme="studio"] body.pds-admin .studio-chart-legend { display: none; color: var(--pds-muted); font-size: .75rem; margin: 10px 0 16px; }
html[data-pilot-theme="studio"] body.pds-admin .studio-chart-legend span { color: #c0f1d9; }
html[data-pilot-theme="studio"] body.pds-admin .module-frame > [style*="background:#e8f4fd"] { background: #263d52 !important; color: #e0f0ff; }

@media (max-width: 767.98px) {
    html[data-pilot-theme="studio"] body.pds-admin .modal-panel [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: minmax(0, 1fr) !important; }
    html[data-pilot-theme="studio"] body.pds-admin .studio-wrap-controls { flex-wrap: wrap; }
    html[data-pilot-theme="studio"] body.pds-admin .studio-wrap-controls select { min-width: 0; max-width: 100%; }
    html[data-pilot-theme="studio"] body.pds-admin .products-content > div[style*="justify-content: space-between"] { flex-wrap: wrap; gap: 12px; }
}
html[data-pilot-theme="studio"] body.pds-admin .booking-status-card.is-active a {
  color: #c0f1d9;
  text-decoration: underline;
}
@media (max-width: 767.98px) {
  html[data-pilot-theme="studio"] body.pds-admin .client-detail-header > div:last-child { flex-wrap: wrap; }
  html[data-pilot-theme="studio"] body.pds-admin .stk-toolbar { flex-wrap: wrap; gap: 8px; }
  html[data-pilot-theme="studio"] body.pds-admin .stk-toolbar > div { max-width: 100%; min-width: 0; }
  html[data-pilot-theme="studio"] body.pds-admin .stk-search { max-width: 100%; box-sizing: border-box; }
  html[data-pilot-theme="studio"] body.pds-admin :is(.gvl-search, .gvc-search) { flex-wrap: wrap; }
  html[data-pilot-theme="studio"] body.pds-admin :is(.gvl-search, .gvc-search) input { min-width: 0; max-width: 100%; }
}
@media (max-width: 767.98px) {
  html[data-pilot-theme="studio"] body.pds-admin .intel-layout { flex-direction: column; }
  html[data-pilot-theme="studio"] body.pds-admin .intel-sidebar {
    width: 100%; padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex; overflow-x: auto; align-items: center;
  }
  html[data-pilot-theme="studio"] body.pds-admin .intel-sidebar-title { padding: 0 16px; margin: 0; }
  html[data-pilot-theme="studio"] body.pds-admin .intel-nav-group { display: flex; margin: 0; }
  html[data-pilot-theme="studio"] body.pds-admin .intel-nav-label { display: none; }
  html[data-pilot-theme="studio"] body.pds-admin .intel-nav-link { white-space: nowrap; padding: 10px 12px; }
  html[data-pilot-theme="studio"] body.pds-admin .intel-content { padding: 16px 12px; min-width: 0; }
  html[data-pilot-theme="studio"] body.pds-admin .intel-content > [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: minmax(0, 1fr) !important; }
  html[data-pilot-theme="studio"] body.pds-admin .intel-content .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  html[data-pilot-theme="studio"] body.pds-admin .intel-section { min-width: 0; }
}
html[data-pilot-theme="studio"] body.pds-admin :is(.finance-content, .dashboard-content, .module-frame) [style*="background:#fef5f5"] [style*="color:#e55a5a" i] { color: #ffd5df !important; }
html[data-pilot-theme="studio"] body.pds-admin :is(.finance-content, .dashboard-content, .module-frame) [style*="background:#f0faf6"] [style*="color:#00b894" i] { color: #c0f1d9 !important; }
html[data-pilot-theme="studio"] body.pds-admin .finance-content a[style*="color:var(--accent)"] { color: var(--studio-accent) !important; }
html[data-pilot-theme="studio"] body.pds-admin .studio-inventory-loss { color: #ffd5df !important; }
html[data-pilot-theme="studio"] body.pds-admin .finance-content .cockpit-tab.active { color: var(--studio-accent) !important; }
html[data-pilot-theme="studio"] body.pds-admin .cal-ca.below { color: #ffd5df; }
html[data-pilot-theme="studio"] body.pds-admin .cal-ca.above { color: #c0f1d9; }

/* R3 #497 : encres des trois surfaces signalées, sans modifier leurs gabarits. */
html[data-pilot-theme="studio"] body.pds-admin .app-content > div:has(> form input[name="salon_id"]) p[style*="color: #666"] {
    color: var(--pds-muted) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .app-content > div:has(> form input[name="salon_id"]) span[style*="color: #888"] {
    color: #595365 !important;
}
html[data-pilot-theme="studio"] body.pds-admin .settings-section div[style*="font-size:2rem"][style*="color:var(--accent)"] {
    color: var(--studio-accent) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .settings-section div[style*="font-size:2rem"][style*="color:#16a34a"] {
    color: var(--studio-success-ink) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .settings-section div[style*="font-size:2rem"][style*="color:#dc2626"] {
    color: var(--studio-danger-ink) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .finance-content small[style*="background:rgba(108,92,231,0.12)"][style*="color:#6C5CE7"] {
    color: var(--studio-accent) !important;
    background: var(--pds-action-soft) !important;
}
/* La légende décrit un pic présent ; un panneau masqué ne la déclenche pas. */
html[data-pilot-theme="studio"] body.pds-admin :has(.studio-chart-peak):not(:has(> .analysis-panel)) > .studio-chart-legend,
html[data-pilot-theme="studio"] body.pds-admin .analysis-panel[style*="display: block"]:has(.studio-chart-peak) ~ .studio-chart-legend {
    display: block;
}

/* R4 #497 : ticket POS et rapport de caisse, sans changer les actions. */
html[data-pilot-theme="studio"] body.pds-admin .pos-content .btn-ghost[style*="color:#dc2626"] {
    color: var(--studio-danger-ink) !important;
    background: var(--pds-danger-soft) !important;
    border-color: var(--studio-danger-ink) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .pos-content span[style*="background:rgba(108,92,231,0.12)"][style*="color:#6c5ce7"] {
    color: var(--studio-accent) !important;
    background: var(--pds-action-soft) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .pos-content:has(.stat-card-value.amount-negative) :is(.stat-card-value.amount-negative, td[style*="color: #d63031"]) {
    color: var(--studio-danger-ink) !important;
}
html[data-pilot-theme="studio"] body.pds-admin .pos-content .finance-table a[style*="color: var(--accent)"] {
    color: var(--studio-accent) !important;
}
