/*
 * Cloudix — espace client (charte du site public dev.cloudix.eu).
 * Barre du haut + menu latéral en panneau bleu marine, contenu clair ou sombre.
 * Chargé en dernier dans <head> : il prend le pas sur style.css et les styles intégrés du layout.
 * Thème : html[data-theme="light" | "dark"] (choix mémorisé dans localStorage « cloudix-theme »,
 * partagé avec le site public, sinon réglage de l'appareil).
 */

/* ——— Jetons ——— */
:root {
    --cx-accent-rgb: 37, 99, 235;
    --cx-accent: #2563eb;
    --cx-accent-hover: #1d4ed8;
    --cx-accent-soft: #eff4ff;
    --cx-accent-2: #6366f1;

    --cx-bg: #f7f8fa; /* fonds clairs du site dev.cloudix.eu (--cx-bg-soft) */
    --cx-surface: #ffffff;
    --cx-surface-2: #f7f8fa;
    --cx-surface-hover: #f0f2f6;
    --cx-border: #e2e5eb;
    --cx-border-strong: #d0d6e0;
    --cx-heading: #111827;
    --cx-text: #1f2937;
    --cx-text-body: #4b5563;
    --cx-text-muted: #5b6576;

    --cx-success: #15803d; /* vert foncé : texte lisible (4,5:1 minimum) sur blanc et sur fond vert pâle */
    --cx-success-soft: #dcfce7;
    --cx-warning: #b45309;
    --cx-warning-soft: #fef3c7;
    --cx-danger: #dc2626;
    --cx-danger-soft: #fee2e2;
    --cx-info-soft: #e0ecff;

    /* Barre du haut et menu latéral : bleu foncé de la marque de dev.cloudix.eu (--cx-dark, utilisé
       par le pied de page et les bandeaux du site), textes en bleus très clairs.
       Le thème sombre redéfinit tous ces jetons. */
    --cx-nav-bg: #1e3a8a;
    --cx-nav-bg-2: #1e40af;
    --cx-topbar-bg: #1e3a8a;
    --cx-nav-text: #dbeafe;
    --cx-nav-muted: #bfdbfe;
    --cx-nav-hover: rgba(191, 219, 254, 0.12);
    --cx-nav-active: #395298;
    --cx-nav-line: rgba(191, 219, 254, 0.2);

    --cx-radius: 8px;
    --cx-radius-sm: 4px;
    /* Arrondis Bootstrap alignés sur dev.cloudix.eu : 4 px pour boutons et champs */
    --bs-border-radius: 4px;
    --bs-border-radius-sm: 3px;
    --bs-border-radius-lg: 6px;
    --bs-border-radius-xl: 8px;
    --cx-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --cx-shadow-md: 0 6px 28px rgba(15, 23, 42, 0.07);

    --cx-topbar-h: 58px;
    --cx-sidebar-w: 252px;
    --cx-sidebar-w-collapsed: 84px;
    --cx-gap: 10px;
    --cx-font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --cx-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Bootstrap 5.3 */
    --bs-body-font-family: var(--cx-font);
    --bs-body-bg: var(--cx-bg);
    --bs-body-color: var(--cx-text);
    --bs-emphasis-color: var(--cx-heading);
    --bs-secondary-color: var(--cx-text-muted);
    --bs-border-color: var(--cx-border);
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-link-color: #2563eb;
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: #1d4ed8;
    --bs-link-hover-color-rgb: 29, 78, 216;
    --bs-tertiary-bg: var(--cx-surface-2);
    --bs-secondary-bg: var(--cx-surface-2);
}

html[data-theme="dark"] {
    color-scheme: dark;
    /*
     * Palette « ardoise » du thème sombre de dev.cloudix.eu (assets/css/dark/base.css) :
     * gris bleuté neutre, le bleu ne reste que sur les accents (liens, onglets, focus, boutons).
     * --cx-accent reste le bleu de la marque : de nombreuses pages l'utilisent comme fond de bouton
     * avec texte blanc. Les textes et contours d'accent passent par --cx-accent-text (bleu clair).
     */
    --cx-accent-text: #93c5fd;
    --cx-accent-text-hover: #bfdbfe;
    --cx-accent-soft: rgba(147, 197, 253, 0.12);
    --cx-accent-2: #a5b4fc;
    --cx-bg: #0f141c;
    --cx-surface: #18202c;
    --cx-surface-2: #1d2633;
    --cx-surface-hover: #232d3b;
    --cx-surface-locked: #151c26;
    --cx-border: #2b3544;
    --cx-border-strong: #3a4658;
    --cx-heading: #f8fafc;
    --cx-text: #e2e8f0;
    --cx-text-body: #cbd5e1;
    --cx-text-muted: #a3adbb;
    --cx-success: #4ade80;
    --cx-success-soft: rgba(74, 222, 128, 0.14);
    --cx-warning: #fcd34d;
    --cx-warning-soft: rgba(252, 211, 77, 0.14);
    --cx-danger: #fca5a5;
    --cx-danger-soft: rgba(248, 113, 113, 0.14);
    --cx-info-soft: rgba(147, 197, 253, 0.12);
    /* Barre du haut et menu latéral : mêmes ardoises que la barre de navigation du site */
    --cx-nav-bg: #131a24;
    --cx-nav-bg-2: #18202c;
    --cx-topbar-bg: #0b1017;
    --cx-nav-text: #e2e8f0;
    --cx-nav-muted: #a3adbb;
    --cx-nav-hover: #1d2633;
    --cx-nav-active: #232d3b;
    --cx-nav-line: rgba(148, 163, 184, 0.16);
    --cx-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --cx-shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --bs-link-color: #93c5fd;
    --bs-link-color-rgb: 147, 197, 253;
    --bs-link-hover-color: #bfdbfe;
    --bs-link-hover-color-rgb: 191, 219, 254;
    scrollbar-color: #3a4658 #0b1017;
}

html[data-theme="dark"] ::selection {
    background: rgba(148, 163, 184, 0.38);
    color: #ffffff;
}

/* Textes d'accent : bleu clair du site (le bleu de la marque est trop sombre sur l'ardoise) */
html[data-theme="dark"] .pagetitle-modern-left h1 i,
html[data-theme="dark"] #main :is(.cx-tabs, .nav-tabs) .active :is(.cx-tab-count, .cx-tab-badge, .badge),
html[data-theme="dark"] .cx-profile-menu .dropdown-item:hover i {
    color: var(--cx-accent-text) !important;
}
html[data-theme="dark"] #main .cx-crumbs a:hover,
html[data-theme="dark"] .toast-icon:not(.success):not(.danger):not(.warning),
html[data-theme="dark"] .toast-title a,
html[data-theme="dark"] .cx-svc-os,
html[data-theme="dark"] .cx-pill--info {
    color: var(--cx-accent-text);
}
/* Contour des champs au focus : bleu clair, comme les champs du site */
html[data-theme="dark"] .form-select:is(:focus, :focus-visible),
html[data-theme="dark"] :is(input, textarea).form-control:not([readonly]):not(:disabled):focus,
html[data-theme="dark"] #main .cx-search > .form-control:focus,
html[data-theme="dark"] #main .cx-filters .form-control:focus {
    border-color: var(--cx-accent-text) !important;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, .16) !important;
}
/* Élément actif du menu latéral : liseré bleu clair, comme le lien courant de la barre du site */
html[data-theme="dark"] #sidebar .sidebar-nav .nav-link:not(.collapsed),
html[data-theme="dark"] #sidebar .cx-subnav a.is-active {
    box-shadow: inset 2px 0 0 #93c5fd, inset 0 0 0 1px rgba(148, 163, 184, 0.14) !important;
}

/* Pas de fondu de couleur sur toute la page pendant le changement de thème */
html.cx-theme-switching *,
html.cx-theme-switching *::before,
html.cx-theme-switching *::after {
    transition: none !important;
}

/* ——— Base ——— */
html,
body {
    background: var(--cx-bg) !important;
}

body {
    font-family: var(--cx-font) !important;
    color: var(--cx-text);
    font-size: 0.9375rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--cx-font);
    color: var(--cx-heading);
    letter-spacing: -0.01em;
}

a {
    color: var(--bs-link-color);
}

a:hover {
    color: var(--bs-link-hover-color);
}

::selection {
    background-color: rgba(var(--cx-accent-rgb), 0.25);
    color: inherit;
}

code,
kbd,
.font-monospace {
    font-family: var(--cx-mono) !important;
}

/* ——— Barre du haut ——— */
#header.header {
    left: 0 !important;
    right: 0;
    height: var(--cx-topbar-h);
    padding: 0 14px 0 12px;
    background: var(--cx-topbar-bg) !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--cx-nav-line);
    z-index: 999;
    gap: 12px;
}

#header .toggle-sidebar-btn {
    color: #fff !important;
    font-size: 26px;
    padding: 0 6px 0 0;
}

.cx-topbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-right: 8px;
}

.cx-topbar-logo img {
    height: 22px;
    width: auto;
    display: block;
}

.cx-topbar-logo .cx-topbar-mark { display: none; height: 34px; }

/* Menu réduit (bureau) : l'icône seule, centrée au-dessus de la barre réduite */
@media (min-width: 1200px) {
    body.cx-sidebar-collapsed .cx-topbar-logo .cx-topbar-wordmark { display: none; }
    body.cx-sidebar-collapsed .cx-topbar-logo .cx-topbar-mark { display: block; }
    body.cx-sidebar-collapsed .cx-topbar-logo {
        width: var(--cx-sidebar-w-collapsed);
        justify-content: center;
        padding-right: 0;
        margin-left: -12px; /* annule le retrait gauche de la barre du haut */
        margin-right: var(--cx-gap);
    }
}

.cx-topnav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0 0 0 12px;
    padding: 0;
    list-style: none;
}

.cx-topnav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--cx-radius-sm);
    color: var(--cx-nav-text);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.cx-topnav a:hover {
    background: var(--cx-nav-hover);
    color: #fff;
}

.cx-topnav a.active {
    background: var(--cx-accent);
    color: #fff;
}

@media (max-width: 1199px) {
    .cx-topnav {
        display: none;
    }
}

#header .header-nav > ul {
    gap: 6px;
}

#header .header-nav .nav-item {
    padding: 0 !important;
}

.cx-icon-btn,
#header .nav-cart {
    width: 36px;
    height: 36px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: var(--cx-radius-sm);
    border: 1px solid var(--cx-nav-line);
    background: transparent;
    color: var(--cx-nav-text) !important;
    padding: 0 !important;
    transition: background 0.15s ease;
}

.cx-icon-btn:hover,
#header .nav-cart:hover {
    background: var(--cx-nav-hover);
    color: #fff !important;
}

#header .nav-cart:hover::before {
    display: none !important;
}

#header .nav-cart-icon {
    font-size: 15px !important;
    color: inherit !important;
}

#header .nav-cart .badge {
    top: 2px !important;
    right: 2px !important;
    font-size: 0.65rem;
    min-width: 17px;
    height: 17px;
}

/* Bouton de thème : une icône par thème */
.cx-theme-toggle .bi {
    font-size: 15px;
}

.cx-theme-toggle .cx-icon-sun {
    display: none;
}

html[data-theme="dark"] .cx-theme-toggle .cx-icon-sun {
    display: inline-block;
}

html[data-theme="dark"] .cx-theme-toggle .cx-icon-moon {
    display: none;
}

/* Solde : même pastille que le profil, montant en chiffres alignés, icône discrète */
#header .nav-balance {
    height: 36px;
    padding: 0 12px 0 6px;
    border: 1px solid var(--cx-nav-line);
    border-radius: var(--cx-radius-sm);
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    gap: 8px;
    transition: background 0.15s ease;
}
#header .nav-balance:hover { background: var(--cx-nav-hover); }
#header .nav-balance-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 11px;
    color: #fff;
}
#header .nav-balance-amount { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

#header .nav-profile {
    gap: 8px;
    height: 36px;
    padding: 0 10px 0 4px !important;
    border: 1px solid var(--cx-nav-line);
    border-radius: var(--cx-radius-sm);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
}

#header .nav-profile:hover {
    background: var(--cx-nav-hover);
}

#header .nav-profile img {
    width: 28px;
    height: 28px;
    max-height: 28px;
    border-radius: 4px !important;
}

#header .nav-profile .cx-profile-name {
    color: #fff;
}

@media (max-width: 767px) {
    #header .nav-profile .cx-profile-name {
        display: none;
    }
}

/* ——— Menus déroulants ——— */
.dropdown-menu {
    background: var(--cx-surface);
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius);
    box-shadow: var(--cx-shadow-md);
    padding: 6px;
    font-size: 0.875rem;
    color: var(--cx-text);
    animation: none !important;
}

.dropdown-menu .dropdown-item {
    border-radius: 4px;
    color: var(--cx-text);
    padding: 8px 10px !important;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background: var(--cx-surface-hover);
    color: var(--cx-heading);
}

.dropdown-menu .dropdown-divider {
    border-color: var(--cx-border);
    margin: 6px 0;
}

.dropdown-menu-arrow::before {
    display: none !important;
}

.header-nav .profile {
    min-width: 240px;
}

.header-nav .profile .dropdown-header {
    padding: 8px 10px 4px;
    text-align: left;
}

.header-nav .profile .dropdown-header h6 {
    color: var(--cx-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 2px;
}

.header-nav .profile .dropdown-header span {
    color: var(--cx-text-muted);
    font-size: 0.8rem;
}

.header-nav .profile .dropdown-item i,
.header-nav .profile .dropdown-item svg {
    width: 16px;
    margin-right: 10px !important;
    color: var(--cx-text-muted);
    font-size: 14px;
}

/* ——— Menu latéral (panneau) ——— */
#sidebar.sidebar {
    /* Collé au bord gauche ; espace gardé en haut et en bas, comme un panneau posé */
    top: calc(var(--cx-topbar-h) + var(--cx-gap)) !important;
    left: 0 !important;
    bottom: var(--cx-gap);
    height: auto !important;
    width: var(--cx-sidebar-w) !important;
    padding: 14px 10px 10px !important;
    background: var(--cx-nav-bg) !important;
    border: 0 !important;
    border-right: 1px solid var(--cx-nav-line) !important;
    border-top: 1px solid var(--cx-nav-line) !important;
    border-bottom: 1px solid var(--cx-nav-line) !important;
    border-radius: 0 6px 6px 0 !important;
    box-shadow: var(--cx-shadow-md) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    scrollbar-color: rgba(147, 197, 253, 0.3) transparent;
    transition: width 0.2s ease, left 0.25s ease;
}

#sidebar .sidebar-logo {
    display: none !important;
}

#sidebar .sidebar-close-btn {
    color: var(--cx-nav-muted);
    top: 22px;
    right: 6px;
}

#sidebar .sidebar-close-btn:hover {
    color: #fff;
}

.cx-sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 -4px;
    padding: 0 4px;
}

.cx-sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.cx-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(147, 197, 253, 0.25);
    border-radius: 4px;
}

.cx-sidebar-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cx-nav-muted);
    padding: 0 8px 8px;
}

.cx-sidebar-search {
    position: relative;
    margin-bottom: 12px;
}

.cx-sidebar-search .bi-search {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--cx-nav-muted);
    pointer-events: none;
}

.cx-sidebar-search input {
    width: 100%;
    height: 34px;
    padding: 0 52px 0 30px;
    border-radius: var(--cx-radius-sm);
    border: 1px solid var(--cx-nav-line);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cx-sidebar-search input::placeholder {
    color: var(--cx-nav-muted);
}

.cx-sidebar-search input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.07);
}

.cx-sidebar-search kbd {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    padding: 1px 5px;
    font-size: 0.65rem;
    color: var(--cx-nav-muted);
    background: transparent;
    border: 1px solid var(--cx-nav-line);
    border-radius: 4px;
    box-shadow: none;
}

#sidebar .sidebar-nav .nav-item {
    margin-bottom: 2px !important;
}

#sidebar .sidebar-nav .nav-heading {
    font-size: 0.68rem !important;
    font-weight: 700;
    letter-spacing: 0.08em !important;
    color: var(--cx-nav-muted) !important;
    margin: 16px 0 6px !important;
    padding: 0 8px !important;
}

#sidebar .sidebar-nav .nav-link {
    margin: 0 !important;
    gap: 10px !important;
    padding: 8px 10px !important;
    border-radius: var(--cx-radius-sm) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: var(--cx-nav-text) !important;
    background: transparent !important;
    white-space: nowrap;
}

#sidebar .sidebar-nav .nav-link strong {
    font-weight: inherit !important;
}

#sidebar .sidebar-nav .nav-link i,
#sidebar .sidebar-nav .nav-link svg {
    width: 18px;
    min-width: 18px !important;
    font-size: 14px !important;
    color: var(--cx-nav-muted) !important;
    transform: none !important;
}

#sidebar .sidebar-nav .nav-link:hover {
    background: var(--cx-nav-hover) !important;
    color: #fff !important;
}

#sidebar .sidebar-nav .nav-link:hover i {
    color: #fff !important;
}

#sidebar .sidebar-nav .nav-link:not(.collapsed) {
    background: var(--cx-nav-active) !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.18);
}

#sidebar .sidebar-nav .nav-link:not(.collapsed) i {
    color: #93c5fd !important;
}

#sidebar .sidebar-nav .nav-link:not(.collapsed)::before {
    display: none !important;
}

.cx-sidebar-empty {
    display: none;
    padding: 8px;
    font-size: 0.8rem;
    color: var(--cx-nav-muted);
}

.cx-sidebar-footer {
    flex-shrink: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--cx-nav-line);
}

.cx-sidebar-footer .sidebar-nav .nav-link.cx-assist {
    border: 1px solid rgba(147, 197, 253, 0.28) !important;
}

.cx-collapse-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
    padding: 7px 10px;
    border: 0;
    border-radius: var(--cx-radius-sm);
    background: transparent;
    color: var(--cx-nav-muted);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.cx-collapse-btn:hover {
    background: var(--cx-nav-hover);
    color: #fff;
}

.cx-collapse-btn i {
    width: 18px;
    font-size: 14px;
    transition: transform 0.2s ease;
}

/* Menu replié (bureau uniquement) */
@media (min-width: 1200px) {
    body.cx-sidebar-collapsed #sidebar.sidebar {
        width: var(--cx-sidebar-w-collapsed) !important;
    }

    body.cx-sidebar-collapsed #sidebar .nav-link span,
    body.cx-sidebar-collapsed #sidebar .nav-heading,
    body.cx-sidebar-collapsed #sidebar .cx-sidebar-label,
    body.cx-sidebar-collapsed #sidebar .cx-sidebar-search,
    body.cx-sidebar-collapsed #sidebar .cx-collapse-btn span {
        display: none !important;
    }

    body.cx-sidebar-collapsed #sidebar .nav-link,
    body.cx-sidebar-collapsed #sidebar .cx-collapse-btn {
        justify-content: center;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.cx-sidebar-collapsed #sidebar .cx-collapse-btn i {
        transform: rotate(180deg);
    }

    /* Icônes centrées dans la barre réduite (barre de défilement masquée pour ne pas décaler la colonne) */
    body.cx-sidebar-collapsed #sidebar .cx-sidebar-scroll { scrollbar-width: none; margin: 0; padding: 0; }
    body.cx-sidebar-collapsed #sidebar .cx-sidebar-scroll::-webkit-scrollbar { display: none; }
    body.cx-sidebar-collapsed #sidebar .sidebar-nav .nav-link,
    body.cx-sidebar-collapsed #sidebar .cx-collapse-btn { width: 100%; gap: 0 !important; }
    body.cx-sidebar-collapsed #sidebar .sidebar-nav .nav-link i,
    body.cx-sidebar-collapsed #sidebar .cx-collapse-btn i { margin: 0 !important; text-align: center; }
    /* Espacement aéré comme le menu de référence : une ligne d'environ 40 pixels par icône */
    body.cx-sidebar-collapsed #sidebar .sidebar-nav .nav-link { padding-top: 11px !important; padding-bottom: 11px !important; }
    body.cx-sidebar-collapsed #sidebar .sidebar-nav .nav-link i:first-child { font-size: 15px !important; }

    body.cx-sidebar-collapsed #main,
    body.cx-sidebar-collapsed #footer {
        margin-left: calc(var(--cx-sidebar-w-collapsed) + var(--cx-gap)) !important;
    }
}

@media (max-width: 1199px) {
    #sidebar.sidebar {
        left: calc(-1 * var(--cx-sidebar-w) - 20px) !important;
        z-index: 1001 !important;
    }

    body.toggle-sidebar #sidebar.sidebar {
        left: 0 !important;
    }

    .cx-collapse-btn {
        display: none;
    }

    body.toggle-sidebar::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(8, 18, 48, 0.5);
        z-index: 1000;
    }
}

/* ——— Contenu ——— */
#main.main {
    margin-top: var(--cx-topbar-h) !important;
    padding: 20px 22px 28px !important;
    transition: margin-left 0.2s ease;
}

@media (min-width: 1200px) {
    #main,
    #footer {
        margin-left: calc(var(--cx-sidebar-w) + var(--cx-gap)) !important;
    }

    body:has(.sidebar.d-none) #main,
    body:has(.sidebar.d-none) #footer,
    body.cx-no-sidebar #main,
    body.cx-no-sidebar #footer {
        margin-left: 0 !important;
    }
}

@media (max-width: 767px) {
    #main.main {
        padding: 16px 14px 24px !important;
    }
}

.pagetitle h1,
.pagetitle-modern-left h1 {
    color: var(--cx-heading) !important;
    font-weight: 700;
}

.pagetitle-modern-left h1 i {
    color: var(--cx-accent) !important;
}

.pagetitle-modern-left p {
    color: var(--cx-text-muted) !important;
}

/* Bandeau d'en-tête de page (réutilisable : .cx-page-hero) */
.cx-page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius);
    background:
        radial-gradient(ellipse 60% 120% at 100% 0%, rgba(var(--cx-accent-rgb), 0.08) 0%, transparent 60%),
        linear-gradient(var(--cx-surface), var(--cx-surface));
    box-shadow: var(--cx-shadow-sm);
}

.cx-page-hero h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 2px;
}

.cx-page-hero p {
    margin: 0;
    color: var(--cx-text-muted);
    font-size: 0.875rem;
}

.cx-page-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* En-tête de page façon bannière : fil d'Ariane, titre appuyé, sous-titre */
#main .cx-page-hero {
    padding: 19px 23px 21px;
    margin-bottom: 20px;
    border: 1px solid rgba(var(--cx-accent-rgb), 0.09);
    border-radius: 12px;
    background:
        radial-gradient(70% 90% at 100% -10%, rgba(var(--cx-accent-rgb), 0.12), transparent 55%),
        radial-gradient(50% 70% at -5% 110%, rgba(var(--cx-accent-rgb), 0.06), transparent 50%),
        linear-gradient(160deg, #fafbfc 0%, #f5f6fa 55%, #f1f3f9 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 8px 24px rgba(15, 23, 42, 0.04);
}
#main .cx-page-hero h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 5px; color: var(--cx-heading); }
#main .cx-page-hero p { font-size: 0.9rem; font-weight: 500; color: var(--cx-text-muted); }
html[data-theme="dark"] #main .cx-page-hero {
    border-color: var(--cx-border);
    background:
        radial-gradient(70% 90% at 100% -10%, rgba(var(--cx-accent-rgb), 0.10), transparent 55%),
        radial-gradient(50% 70% at -5% 110%, rgba(148, 163, 184, 0.06), transparent 50%),
        var(--cx-surface);
    box-shadow: var(--cx-shadow-sm);
}
#main .cx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 7px; margin: 0 0 10px; font-size: 13px; font-weight: 600; line-height: 1.3; }
#main .cx-crumbs a { color: var(--cx-heading); font-weight: 600; text-decoration: none; }
#main .cx-crumbs a:hover { color: var(--cx-accent); }
#main .cx-crumbs > span:not(.is-current) { color: var(--cx-text-muted); font-weight: 500; }
#main .cx-crumbs .is-current { color: var(--cx-text-muted); font-weight: 600; }

/* ——— Cartes ——— */
.card {
    background: var(--cx-surface);
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius);
    box-shadow: var(--cx-shadow-sm);
    color: var(--cx-text);
    margin-bottom: 14px;
}

.card-header,
.card-footer {
    background: transparent;
    border-color: var(--cx-border);
    color: var(--cx-text);
}

.card-title {
    color: var(--cx-heading);
    font-weight: 700;
}

.card-title span {
    color: var(--cx-text-muted);
}

/* ——— Boutons ——— */
.btn {
    border-radius: var(--cx-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-primary {
    --bs-btn-bg: #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    --bs-btn-disabled-bg: #2563eb;
    --bs-btn-disabled-border-color: #2563eb;
}

.btn-outline-primary {
    --bs-btn-color: #2563eb;
    --bs-btn-border-color: rgba(37, 99, 235, 0.45);
    --bs-btn-hover-bg: #2563eb;
    --bs-btn-hover-border-color: #2563eb;
    --bs-btn-active-bg: #1d4ed8;
}

html[data-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #93c5fd;
    --bs-btn-border-color: rgba(147, 197, 253, 0.45);
    --bs-btn-hover-color: #fff;
}

html[data-theme="dark"] .btn-light {
    --bs-btn-bg: var(--cx-surface-2);
    --bs-btn-border-color: var(--cx-border);
    --bs-btn-color: var(--cx-text);
    --bs-btn-hover-bg: var(--cx-surface-hover);
    --bs-btn-hover-border-color: var(--cx-border-strong);
    --bs-btn-hover-color: #fff;
}

/* ——— Tableaux ——— */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cx-text);
    --bs-table-border-color: var(--cx-border);
    --bs-table-hover-bg: var(--cx-surface-hover);
    --bs-table-hover-color: var(--cx-heading);
    --bs-table-striped-bg: var(--cx-surface-2);
    font-size: 0.875rem;
}

.table > thead > tr > th {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cx-text-muted);
    border-bottom-color: var(--cx-border);
}

/* ——— Formulaires ——— */
.form-control,
.form-select {
    border-radius: var(--cx-radius-sm);
    border-color: var(--cx-border-strong);
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(var(--cx-accent-rgb), 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cx-heading);
}

/* ——— Badges de statut (.cx-status) ——— */
.cx-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.cx-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.cx-status--success { background: var(--cx-success-soft); color: var(--cx-success); }
.cx-status--warning { background: var(--cx-warning-soft); color: var(--cx-warning); }
.cx-status--danger  { background: var(--cx-danger-soft);  color: #b91c1c; }
.cx-status--info    { background: var(--cx-info-soft);    color: #1d4ed8; }
html[data-theme="dark"] .cx-status--danger { color: var(--cx-danger); }
.cx-status--muted   { background: var(--cx-surface-2);    color: var(--cx-text-muted); }

html[data-theme="dark"] .cx-status--info {
    color: #93c5fd;
}

/* ——— Pied de page ——— */
#footer.footer {
    border-top: 0 !important;
    padding: 16px 22px 22px !important;
    font-size: 0.8rem;
    color: var(--cx-text-muted);
    background: transparent;
}

#footer .copyright {
    color: var(--cx-text-muted);
    text-align: center;
}

.back-to-top {
    background: var(--cx-accent) !important;
    border-radius: var(--cx-radius-sm) !important;
}

/* ——— Notifications (toasts) — logique : templates/assets/js/cloudix-toast.js ——— */
.toast-notification-container {
    position: fixed;
    top: calc(var(--cx-topbar-h, 60px) + 12px);
    right: 16px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.toast-notification-container > * { pointer-events: auto; }

.toast-notification {
    --cx-toast-tone: var(--cx-accent);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 10px 12px 14px;
    overflow: hidden;
    background: var(--cx-surface);
    border: 1px solid var(--cx-border);
    border-radius: 6px;
    box-shadow: 0 12px 32px -12px rgba(15, 23, 42, .28), 0 2px 6px rgba(15, 23, 42, .06);
    color: var(--cx-text);
    font-family: var(--cx-font, inherit);
    animation: cxToastIn .22s cubic-bezier(.2, .8, .2, 1);
}
.toast-notification.success { --cx-toast-tone: var(--cx-success); }
.toast-notification.danger  { --cx-toast-tone: var(--cx-danger); }
.toast-notification.warning { --cx-toast-tone: var(--cx-warning); }
.toast-notification.is-leaving { animation: cxToastOut .2s ease-in forwards; }
html[data-theme="dark"] .toast-notification { box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .02); }

@keyframes cxToastIn  { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cxToastOut { to { opacity: 0; transform: translateX(12px); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

.toast-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cx-info-soft);
    color: var(--cx-accent);
}
.toast-icon svg { width: 17px; height: 17px; }
.toast-icon.success { background: var(--cx-success-soft); color: var(--cx-success); }
.toast-icon.danger  { background: var(--cx-danger-soft);  color: var(--cx-danger); }
.toast-icon.warning { background: var(--cx-warning-soft); color: var(--cx-warning); }

.toast-content { flex: 1; min-width: 0; padding-top: 1px; }
.cx-toast-label {
    margin: 0 0 1px;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--cx-heading);
}
.toast-notification .toast-title {
    margin: 0;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--cx-heading);
    overflow-wrap: anywhere;
}
.cx-toast .toast-title { color: var(--cx-text-muted); }
.toast-title a { color: var(--cx-accent); font-weight: 600; }

.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: -2px 0 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--cx-text-muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.toast-close svg { width: 15px; height: 15px; }
.toast-close:hover { background: var(--cx-surface-hover); color: var(--cx-heading); }
.toast-close:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: 1px; }

.cx-toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--cx-toast-tone);
    opacity: .55;
    transform-origin: left center;
    animation: cxToastTimer linear forwards;
}
.toast-notification.is-paused .cx-toast-progress { animation-play-state: paused; }
@keyframes cxToastTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ——— Fenêtre de confirmation ——— */
.cx-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1095;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .28);
    animation: cxFadeIn .16s ease-out;
}
html[data-theme="dark"] .cx-confirm-backdrop { background: rgba(0, 0, 0, .6); }
.cx-confirm-backdrop.is-leaving { animation: cxFadeOut .16s ease-in forwards; }
.cx-confirm {
    width: min(460px, 100%);
    overflow: hidden;
    background: var(--cx-surface);
    border: 1px solid var(--cx-border);
    border-radius: 6px;
    box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .4), 0 4px 12px rgba(15, 23, 42, .06);
    color: var(--cx-text);
    animation: cxConfirmIn .2s cubic-bezier(.2, .8, .2, 1);
}
.cx-confirm-backdrop.is-leaving .cx-confirm { animation: cxConfirmOut .16s ease-in forwards; }
.cx-confirm-head { display: flex; align-items: flex-start; gap: 16px; padding: 24px 24px 22px; }
.cx-confirm .toast-icon { width: 44px; height: 44px; border-radius: 50%; }
.cx-confirm .toast-icon svg { width: 22px; height: 22px; }
.cx-confirm.danger .toast-icon { box-shadow: 0 0 0 6px rgba(239, 68, 68, .07); }
.cx-confirm.info .toast-icon { box-shadow: 0 0 0 6px rgba(var(--cx-accent-rgb), .07); }
.cx-confirm-copy { min-width: 0; padding-top: 2px; }
.cx-confirm-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; line-height: 1.35; color: var(--cx-heading); }
.cx-confirm-text { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--cx-text-muted); overflow-wrap: anywhere; }
.cx-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    background: var(--cx-surface-2);
    border-top: 1px solid var(--cx-border);
}
.cx-confirm-btn {
    min-height: 40px;
    min-width: 96px;
    padding: 0 18px;
    border-radius: 4px;
    border: 1px solid var(--cx-border-strong, var(--cx-border));
    background: var(--cx-surface);
    color: var(--cx-heading);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.cx-confirm-btn:hover { background: var(--cx-surface-hover); }
.cx-confirm-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(var(--cx-accent-rgb), .3); }
.cx-confirm-ok { background: var(--cx-accent); border-color: var(--cx-accent); color: #fff; }
.cx-confirm-ok:hover { background: var(--cx-accent-hover); border-color: var(--cx-accent-hover); }
.cx-confirm-ok.danger { background: var(--cx-danger); border-color: var(--cx-danger); }
.cx-confirm-ok.danger:hover { filter: brightness(.92); background: var(--cx-danger); }
.cx-confirm-ok.danger:focus-visible { box-shadow: 0 0 0 3px rgba(239, 68, 68, .3); }
@keyframes cxFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cxFadeOut { to { opacity: 0; } }
@keyframes cxConfirmIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cxConfirmOut { to { opacity: 0; transform: translateY(4px) scale(.98); } }

@media (max-width: 575.98px) {
    .toast-notification-container { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; align-items: stretch; }
    .cx-confirm-backdrop { align-items: flex-end; padding: 12px; }
    .cx-confirm-head { padding: 20px 18px 18px; gap: 14px; }
    .cx-confirm-actions { flex-direction: column-reverse; padding: 12px 18px 16px; }
    .cx-confirm-btn { width: 100%; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .toast-notification, .toast-notification.is-leaving, .cx-confirm-backdrop, .cx-confirm, .cx-confirm-backdrop.is-leaving .cx-confirm { animation: none !important; }
    .cx-toast-progress { display: none; }
}

/* ================================================================
 * Thème sombre — composants Bootstrap et blocs blancs écrits en dur
 * dans les pages (styles intégrés). Uniquement html[data-theme="dark"].
 * ================================================================ */
html[data-theme="dark"] body {
    --bs-body-bg: var(--cx-bg);
    --bs-body-color: var(--cx-text);
    --bs-emphasis-color: var(--cx-heading);
    --bs-secondary-color: var(--cx-text-muted);
    --bs-tertiary-color: var(--cx-text-muted);
    --bs-border-color: var(--cx-border);
    --bs-tertiary-bg: var(--cx-surface-2);
    --bs-secondary-bg: var(--cx-surface-2);
    --bs-heading-color: var(--cx-heading);
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-body {
    color: var(--cx-heading) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary {
    color: var(--cx-text-muted) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-body {
    background-color: var(--cx-surface) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: var(--cx-surface-2);
    border-color: var(--cx-border);
    color: var(--cx-heading);
}

html[data-theme="dark"] .form-control::placeholder {
    color: var(--cx-text-muted);
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[readonly] {
    background-color: var(--cx-surface-locked);
}

html[data-theme="dark"] .modal-content {
    background: var(--cx-surface);
    border-color: var(--cx-border);
    color: var(--cx-text);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: var(--cx-border);
}

html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

html[data-theme="dark"] .list-group-item {
    background: var(--cx-surface);
    border-color: var(--cx-border);
    color: var(--cx-text);
}

html[data-theme="dark"] .nav-tabs {
    border-color: var(--cx-border);
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--cx-surface);
    border-color: var(--cx-border) var(--cx-border) var(--cx-surface);
    color: var(--cx-heading);
}

html[data-theme="dark"] .alert-info,
html[data-theme="dark"] .alert-primary {
    background: var(--cx-info-soft);
    border-color: rgba(147, 197, 253, 0.3);
    color: var(--cx-text);
}

html[data-theme="dark"] .alert-warning {
    background: var(--cx-warning-soft);
    border-color: rgba(252, 211, 77, 0.3);
    color: #fde68a;
}

html[data-theme="dark"] .alert-danger {
    background: var(--cx-danger-soft);
    border-color: rgba(252, 165, 165, 0.3);
    color: #fecaca;
}

html[data-theme="dark"] .alert-success {
    background: var(--cx-success-soft);
    border-color: rgba(74, 222, 128, 0.3);
    color: #bbf7d0;
}

/* Blocs des pages (styles intégrés) : fonds blancs / gris clairs et textes foncés écrits en dur */
html[data-theme="dark"] #main :is(
    .dashboard-card, .service-nav-card, .store-sidebar-style, .profile-card,
    .invoice-card, .service-card, .ticket-card, .account-card, .billing-card,
    .info-card, .stat-card, .summary-card, .offer-card, .product-card, .config-card
) {
    background: var(--cx-surface) !important;
    border-color: var(--cx-border) !important;
    color: var(--cx-text);
}

html[data-theme="dark"] #main [style*="background: #fff"],
html[data-theme="dark"] #main [style*="background:#fff"],
html[data-theme="dark"] #main [style*="background-color: #fff"],
html[data-theme="dark"] #main [style*="background: white"],
html[data-theme="dark"] #main [style*="background-color: white"],
html[data-theme="dark"] #main [style*="background: #f9fafb"],
html[data-theme="dark"] #main [style*="background: #f3f4f6"],
html[data-theme="dark"] #main [style*="background: #f8fafc"],
html[data-theme="dark"] #main [style*="background-color: #f8f9fa"],
html[data-theme="dark"] #main [style*="background: #f8f9fa"] {
    background: var(--cx-surface-2) !important;
}

html[data-theme="dark"] #main [style*="color: #1f2937"],
html[data-theme="dark"] #main [style*="color: #111827"],
html[data-theme="dark"] #main [style*="color: #374151"],
html[data-theme="dark"] #main [style*="color: #000"],
html[data-theme="dark"] #main [style*="color:#000"],
html[data-theme="dark"] #main [style*="color: #1e40af"],
html[data-theme="dark"] #main [style*="color: #012970"] {
    color: var(--cx-heading) !important;
}

html[data-theme="dark"] #main [style*="color: #6b7280"],
html[data-theme="dark"] #main [style*="color: #64748b"],
html[data-theme="dark"] #main [style*="color: #4b5563"] {
    color: var(--cx-text-muted) !important;
}

html[data-theme="dark"] #main [style*="border: 1px solid #e5e7eb"],
html[data-theme="dark"] #main [style*="border-color: #e5e7eb"] {
    border-color: var(--cx-border) !important;
}

/* ================================================================
 * Harmonisation des cartes des pages (styles intégrés) :
 * même surface, bordure fine et rayon partout, sans l'ancien « coin » bleu épais.
 * Préfixe #main pour passer devant les <style> des pages, chargés après cette feuille.
 * ================================================================ */
#main :is(
    .dashboard-card, .service-nav-card, .info-card, .invoice-card, .invoice-page-card,
    .payment-method-card-body, .billing-address-card-body, .store-offer-card, .store-sidebar,
    .status-card, .snapshots-card, .rebuild-card, .network-card, .monitoring-card, .location-card,
    .card-body.store-sidebar-style, .profile-card
) {
    background: var(--cx-surface) !important;
    border: 1px solid var(--cx-border) !important;
    border-radius: var(--cx-radius) !important;
    box-shadow: var(--cx-shadow-sm) !important;
    color: var(--cx-text);
    transform: none !important;
}

#main :is(.store-offer-card, .info-card, .invoice-card, .service-nav-card):hover {
    border-color: rgba(var(--cx-accent-rgb), 0.45) !important;
}

#main :is(
    .dashboard-card, .service-nav-card, .info-card, .invoice-card, .invoice-page-card,
    .payment-method-card-body, .billing-address-card-body, .store-offer-card, .store-sidebar,
    .status-card, .snapshots-card, .rebuild-card, .network-card, .monitoring-card, .location-card,
    .card-body.store-sidebar-style, .section .card
)::before,
#main :is(
    .dashboard-card, .service-nav-card, .info-card, .invoice-card, .invoice-page-card,
    .payment-method-card-body, .billing-address-card-body, .store-offer-card, .store-sidebar,
    .status-card, .snapshots-card, .rebuild-card, .network-card, .monitoring-card, .location-card,
    .card-body.store-sidebar-style, .section .card
)::after {
    display: none !important;
}

#main .card:has(.card-body.store-sidebar-style) {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* En-têtes de tableaux des pages : fond teinté uniforme */
#main .table > thead > tr > th {
    background: var(--cx-surface-2) !important;
    color: var(--cx-text-muted) !important;
}

#main .table > tbody > tr > td {
    background: transparent !important;
    color: var(--cx-text);
    border-color: var(--cx-border) !important;
}

/* Barre de progression de la navigation (Turbo) */
.turbo-progress-bar {
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* Sous-liste des serveurs dans le menu latéral (façon « Serveurs dédiés » de Holycloud) */
#sidebar .cx-subnav { list-style: none; margin: 4px 0 6px 18px; padding: 0 0 0 10px; border-left: 1px solid var(--cx-nav-line); }
#sidebar .cx-subnav a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; color: var(--cx-nav-muted); font-size: .8rem; text-decoration: none; }
#sidebar .cx-subnav a:hover { background: var(--cx-nav-hover); color: #fff; }
#sidebar .cx-subnav a.is-active { background: var(--cx-nav-active); color: #fff; box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.18); }
#sidebar .cx-subnav a i { font-size: 12px; width: 14px; }
#sidebar .cx-subnav-server { margin-top: 2px; }
#sidebar .cx-subnav-type { width: 24px; height: 24px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; background: rgba(255, 255, 255, .06); color: #93c5fd; }
#sidebar .cx-subnav a .cx-subnav-type i { font-size: 11px; width: auto; }
#sidebar .cx-subnav a.is-active .cx-subnav-type { background: rgba(147, 197, 253, .16); color: #fff; }
#sidebar .cx-subnav-text { min-width: 0; flex: 1; }
#sidebar .cx-subnav-text strong { display: block; font-size: .78rem; font-weight: 700; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sidebar .cx-subnav-text small { display: block; font-size: .68rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sidebar .cx-subnav-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #64748b; }
#sidebar .cx-subnav-dot.is-up { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
#sidebar .cx-subnav-dot.is-warn { background: #f59e0b; }
#sidebar .cx-subnav-dot.is-down { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
#sidebar .cx-subnav-dot.is-pending { background: #60a5fa; }
#sidebar .cx-subnav-title { display: none; }
/* Menu réduit : seule l'icône « Mes services » reste ; au survol, les services s'ouvrent dans une fenêtre à droite */
@media (min-width: 1200px) {
    html body.cx-sidebar-collapsed #sidebar .cx-subnav { display: none !important; }
    html body.cx-sidebar-collapsed #sidebar .cx-subnav.is-flyout {
        display: block !important; position: fixed; z-index: 1100; width: 270px; max-height: calc(100vh - 40px); overflow-y: auto;
        margin: 0; padding: 8px; border: 1px solid var(--cx-nav-line); border-radius: 8px;
        background: var(--cx-nav-bg); box-shadow: 0 14px 36px rgba(2, 6, 23, .45);
    }
    /* Pont invisible entre l'icône et la fenêtre : la souris peut passer de l'une à l'autre */
    html body.cx-sidebar-collapsed #sidebar .cx-subnav.is-flyout::before { content: ""; position: absolute; left: -30px; top: -10px; bottom: 0; width: 30px; }
    html body.cx-sidebar-collapsed #sidebar .cx-subnav.is-flyout .cx-subnav-title {
        display: block; padding: 4px 8px 9px; margin-bottom: 6px; border-bottom: 1px solid var(--cx-nav-line);
        font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--cx-nav-muted);
    }
}

/* ================================================================
 * Sobriété (style Holycloud / OVHcloud) : pas d'icônes décoratives dans le contenu.
 * On garde les icônes qui portent une fonction : boutons sans texte (copier, voir…),
 * pastilles d'état, chevrons « › », logos de marque, frise d'activité, tuiles chiffrées,
 * actions d'alimentation du serveur, alertes. Le menu latéral et la barre du haut ne changent pas.
 * ================================================================ */
/* Icône devant un texte dans un bouton ou un lien (marquées me-1 / me-2) */
#main :is(a:not(.btn), label, summary) > i:is(.me-1, .me-2), /* les boutons gardent leur icône (demande du 05/11/2026) */
/* Titres de blocs, onglets, fil d'Ariane, lignes d'infos */
#main :is(h1, h2, h3, h4, h5, h6) > i,
#main :is(h1, h2, h3, h4, h5, h6) > span > i.fa,
#main :is(.card-title, .cx-panel-title, .cx-subpanel-title, .cx-block-title, .cx-side-title, .cx-chart-title, .cx-subhead, .cx-tab-head, .cx-step-head, .cx-wizard-step-title) > i,
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .nav-pills, .cx-crumbs) i,
#main :is(.cx-svc-meta, .cx-hero-meta) i,
#main .cx-pm-config > summary > i.bi-sliders,
#main .form-label > i:not([data-bs-toggle]),
#main .cx-ov-help li a > i,
#main .nav-link > i,
#main .cx-chip > i,
#main .cx-usage-top > i,
#main .cx-cmds .btn > i,
/* Carrés d'icônes purement décoratifs */
#main :is(.cx-panel-icon, .cx-form-icon, .cx-fact-icon, .cx-next-icon, .cx-client-mark, .cx-svc-os, .cx-svc-icon),
#main .cx-card-icon:not(:has(img)) {
    display: none !important;
}
/* Exceptions : actions d'alimentation du serveur (comme Holycloud) */
#main .cx-power-actions .btn > i { display: inline-block !important; }
/* Les titres sans icône gardent un alignement propre */
#main :is(.cx-panel-head, .cx-box-head, .cx-card-head) h2 { gap: 0; }
/* …sauf ceux qui commencent par une pastille numérotée (formulaires en étapes) */
#main :is(.cx-panel-head, .cx-box-head, .cx-card-head) h2:has(> .cx-step) { gap: 10px; }
#main .cx-step { flex-shrink: 0; }
#main .cx-tabs button, #main .cx-svc-tabs a { gap: 0; }

/* ================================================================
 * Onglets : un seul style sur tout le site (façon Holycloud / OVHcloud).
 * Texte simple, ligne grise fine sur toute la largeur, onglet actif en bleu souligné.
 * ================================================================ */
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto;
    overflow-y: hidden;
    /* Défilement au doigt sans barre grise par-dessus le soulignement (mobile) */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 4px 0 18px !important;
    padding: 0 2px !important;
    list-style: none;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--cx-border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) > li {
    margin: 0 !important;
    flex: 0 0 auto;
}
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) :is(a, button, span.is-locked) {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    width: auto !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--cx-text-muted) !important;
    font-size: .9rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
    text-decoration: none;
    transform: none !important;
}
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) :is(a, button)::before,
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) :is(a, button)::after {
    display: none !important;
}
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) :is(a, button):hover {
    color: var(--cx-heading) !important;
}
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) :is(a, button, span.is-locked):is(.active, .is-active, [aria-selected="true"]) {
    color: var(--cx-accent) !important;
    font-weight: 600 !important;
    /* Soulignement dessiné à l'intérieur de l'onglet : jamais rogné par le défilement horizontal de la barre */
    box-shadow: inset 0 -2px 0 var(--cx-accent) !important;
}
html[data-theme="dark"] #main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) :is(a, button, span.is-locked):is(.active, .is-active, [aria-selected="true"]) {
    color: #93c5fd !important;
    box-shadow: inset 0 -2px 0 #93c5fd !important;
}
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"]) span.is-locked { opacity: .45; cursor: not-allowed; }
/* Compteurs dans les onglets (ex. fiche client admin) */
#main :is(.cx-tabs, .nav-tabs) :is(.cx-tab-count, .cx-tab-badge, .badge) {
    font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px;
    background: var(--cx-surface-2) !important; color: var(--cx-text-muted) !important;
}
#main :is(.cx-tabs, .nav-tabs) .active :is(.cx-tab-count, .cx-tab-badge, .badge) {
    background: var(--cx-accent-soft) !important; color: var(--cx-accent) !important;
}

/* « Mes services » : menu dépliant (toute la ligne ouvre / ferme la liste) */
#sidebar .sidebar-nav .nav-link i.cx-subnav-chevron { margin-left: auto; font-size: 11px !important; width: auto; min-width: 0 !important; opacity: .75; transition: transform .2s ease; transform: rotate(-90deg) !important; }
#sidebar [data-cx-subnav-list="services"] { display: none; }
html.cx-subnav-services-open #sidebar [data-cx-subnav-list="services"],
#sidebar .nav-item.is-open > [data-cx-subnav-list="services"] { display: block; }
html.cx-subnav-services-closed #sidebar [data-cx-subnav-list="services"] { display: none !important; }
html.cx-subnav-services-open #sidebar .sidebar-nav .cx-has-subnav > .nav-link i.cx-subnav-chevron,
#sidebar .sidebar-nav .nav-item.is-open > .nav-link i.cx-subnav-chevron { transform: rotate(0deg) !important; }
html.cx-subnav-services-closed #sidebar .sidebar-nav .cx-has-subnav > .nav-link i.cx-subnav-chevron { transform: rotate(-90deg) !important; }
body.cx-sidebar-collapsed #sidebar .sidebar-nav .nav-link i.cx-subnav-chevron { display: none; }

/* Compteurs du menu latéral (factures impayées, panier, tickets) */
#sidebar .cx-nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; font-style: normal; font-size: .7rem; font-weight: 700;
    background: rgba(147, 197, 253, .18); color: #dbeafe;
}
#sidebar .cx-nav-badge.is-alert { background: #e11d48; color: #fff; }
body.cx-sidebar-collapsed #sidebar .cx-nav-badge { display: none; }

/* Champ de recherche commun (loupe intégrée), modèle de la page Facturation */
#main .cx-search { position: relative; }
#main .cx-search > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--cx-text-muted); font-size: 12px; pointer-events: none; z-index: 1; }
#main .cx-search > .form-control { padding-left: 30px; height: 34px; font-size: .85rem; }
#main .cx-filters :is(.form-control-sm, .form-select-sm) { height: 34px; font-size: .85rem; }

/* ================================================================
 * Listes déroulantes (form-select) : un seul design sur tout le site.
 * Fond du thème, bordure fine, chevron fin, survol et focus bleus.
 * ================================================================ */
:root {
    --cx-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235b6576' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    --cx-select-chevron-focus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}
html[data-theme="dark"] {
    --cx-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23a3adbb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    --cx-select-chevron-focus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2393c5fd' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}
.form-select {
    -webkit-appearance: none;
    appearance: none;
    height: 38px;
    padding: 0 36px 0 12px !important;
    font-size: .875rem;
    font-weight: 500;
    line-height: 36px;
    color: var(--cx-heading) !important;
    background-color: var(--cx-surface) !important;
    background-image: var(--cx-select-chevron) !important;
    background-repeat: no-repeat !important;
    background-position: right 11px center !important;
    background-size: 14px 14px !important;
    border: 1px solid var(--cx-border-strong) !important;
    border-radius: var(--cx-radius-sm) !important;
    box-shadow: var(--cx-shadow-sm) !important;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.form-select.form-select-sm {
    height: 34px;
    line-height: 32px;
    padding: 0 32px 0 11px !important;
    font-size: .84rem;
    background-position: right 9px center !important;
    background-size: 13px 13px !important;
}
.form-select.form-select-lg { height: 44px; line-height: 42px; font-size: .95rem; }
.form-select[multiple], .form-select[size]:not([size="1"]) {
    height: auto; line-height: 1.4; padding: 6px !important; background-image: none !important; cursor: default;
}
.form-select[multiple] option, .form-select[size]:not([size="1"]) option { padding: 6px 8px; border-radius: 4px; }
.form-select:hover:not(:disabled) {
    border-color: rgba(var(--cx-accent-rgb), .55) !important;
    background-color: var(--cx-surface-hover) !important;
}
.form-select:focus, .form-select:focus-visible {
    outline: none;
    border-color: var(--cx-accent) !important;
    background-image: var(--cx-select-chevron-focus) !important;
    box-shadow: 0 0 0 3px rgba(var(--cx-accent-rgb), .16) !important;
}
.form-select:disabled {
    cursor: not-allowed; opacity: .6;
    background-color: var(--cx-surface-2) !important;
}
.form-select option, .form-select optgroup {
    background: var(--cx-surface);
    color: var(--cx-heading);
    font-weight: 500;
}
html[data-theme="dark"] .form-select { background-color: var(--cx-surface-2) !important; border-color: var(--cx-border) !important; }
html[data-theme="dark"] .form-select:hover:not(:disabled) { background-color: var(--cx-surface-hover) !important; }
/* Liste déroulante dans un groupe (ex. sélecteur + bouton) : coins raccordés */
.input-group > .form-select:not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group > .form-select:not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
/* Barre de filtres homogène : recherche au même fond et à la même bordure que les listes */
#main .cx-search > .form-control { background-color: var(--cx-surface) !important; border: 1px solid var(--cx-border-strong) !important; border-radius: var(--cx-radius-sm) !important; box-shadow: var(--cx-shadow-sm) !important; }
#main .cx-search > .form-control:hover { border-color: rgba(var(--cx-accent-rgb), .55) !important; }
#main .cx-search > .form-control:focus { border-color: var(--cx-accent) !important; box-shadow: 0 0 0 3px rgba(var(--cx-accent-rgb), .16) !important; }
html[data-theme="dark"] #main .cx-search > .form-control { background-color: var(--cx-surface-2) !important; border-color: var(--cx-border) !important; }

/* ================================================================
 * Liste ouverte des sélecteurs (Chrome / Edge récents : appearance base-select).
 * Les autres navigateurs gardent la liste native.
 * ================================================================ */
@supports (appearance: base-select) {
    .form-select:not([multiple]):not([size]),
    .form-select:not([multiple]):not([size])::picker(select) {
        appearance: base-select;
    }
    .form-select:not([multiple]):not([size]) {
        display: flex;
        align-items: center;
    }
    /* Le chevron du site est déjà dessiné en fond : on masque celui du navigateur */
    .form-select:not([multiple]):not([size])::picker-icon { display: none; }
    .form-select::picker(select) {
        margin-top: 6px;
        padding: 6px;
        min-width: anchor-size(width);
        max-height: min(340px, 60vh);
        overflow-y: auto;
        border: 1px solid var(--cx-border);
        border-radius: 6px;
        background: var(--cx-surface);
        color: var(--cx-heading);
        box-shadow: 0 16px 40px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);
        opacity: 0;
        transform: translateY(-4px);
        transition: opacity .14s ease, transform .14s ease, overlay .14s allow-discrete, display .14s allow-discrete;
    }
    .form-select:open::picker(select) { opacity: 1; transform: translateY(0); }
    @starting-style { .form-select:open::picker(select) { opacity: 0; transform: translateY(-4px); } }
    html[data-theme="dark"] .form-select::picker(select) {
        background: var(--cx-surface);
        border-color: var(--cx-border-strong);
        box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
    }
    .form-select option {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 34px;
        padding: 7px 10px;
        border-radius: 4px;
        font-size: .86rem;
        font-weight: 500;
        color: var(--cx-heading);
        background: transparent;
        cursor: pointer;
    }
    .form-select option:hover,
    .form-select option:focus-visible {
        outline: none;
        background: var(--cx-surface-hover);
    }
    .form-select option:checked {
        background: var(--cx-accent-soft);
        color: var(--cx-accent);
        font-weight: 600;
    }
    html[data-theme="dark"] .form-select option:checked { color: #93c5fd; }
    .form-select option::checkmark {
        order: 1;
        margin-left: auto;
        content: "";
        width: 14px;
        height: 14px;
        background: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    .form-select option:disabled { opacity: .45; cursor: not-allowed; }
    .form-select optgroup { padding: 6px 4px 2px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cx-text-muted); }
}
/* Tous les champs texte des barres de filtres : même fond et même bordure que les listes et la recherche */
#main .cx-filters .form-control { background-color: var(--cx-surface) !important; border: 1px solid var(--cx-border-strong) !important; border-radius: var(--cx-radius-sm) !important; box-shadow: var(--cx-shadow-sm) !important; height: 34px; font-size: .85rem; }
#main .cx-filters .form-control:hover { border-color: rgba(var(--cx-accent-rgb), .55) !important; }
#main .cx-filters .form-control:focus { border-color: var(--cx-accent) !important; box-shadow: 0 0 0 3px rgba(var(--cx-accent-rgb), .16) !important; }
html[data-theme="dark"] #main .cx-filters .form-control { background-color: var(--cx-surface-2) !important; border-color: var(--cx-border) !important; }
/* Liste ouverte plus compacte (les options n'héritent plus de la hauteur de ligne du champ) */
@supports (appearance: base-select) {
    .form-select::picker(select) { padding: 4px; margin-top: 4px; line-height: 1.3; }
    .form-select option { min-height: 0; padding: 6px 9px; line-height: 1.3; font-size: .85rem; }
    .form-select option + option { margin-top: 1px; }
}

/* Bouton de fermeture (×) : vraie zone cliquable, lisible sur mobile */
.btn-close {
    box-sizing: border-box;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    flex-shrink: 0;
    border-radius: 4px;
    background-size: 13px 13px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    opacity: .65;
    transition: background-color .15s ease, opacity .15s ease;
}
.btn-close:hover { opacity: 1; background-color: var(--cx-surface-hover); }
.btn-close:focus { box-shadow: 0 0 0 3px rgba(var(--cx-accent-rgb), .2); opacity: 1; }
.cx-drawer-head .btn-close { margin: -6px -8px 0 0; }
.alert .btn-close { width: 32px !important; height: 32px !important; }
@media (max-width: 575px) { .btn-close { width: 40px !important; height: 40px !important; background-size: 14px 14px !important; } }
/* Recherche dans les panneaux latéraux (hors #main) : même composant */
.cx-drawer .cx-search { position: relative; }
.cx-drawer .cx-search > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--cx-text-muted); font-size: 12px; pointer-events: none; z-index: 1; }
.cx-drawer .cx-search > .form-control { padding-left: 30px !important; height: 38px; font-size: .86rem; }

/* Compteur neutre (ex. nombre de clients) */
#sidebar .cx-nav-badge.is-muted { background: rgba(255, 255, 255, .08); color: var(--cx-nav-muted); }

/* ================================================================
 * Menu profil (barre du haut)
 * ================================================================ */
.header-nav .cx-profile-menu { width: 300px; padding: 6px; }
.cx-profile-menu .cx-pm-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.cx-profile-menu .cx-pm-head img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--cx-border); }
.cx-pm-id { min-width: 0; }
.cx-pm-id strong { display: block; font-size: .92rem; color: var(--cx-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-pm-id > span { display: block; font-size: .76rem; color: var(--cx-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-pm-tags { display: flex !important; gap: 4px; margin-top: 5px; }
.cx-pm-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .66rem; font-weight: 600; background: var(--cx-surface-2); color: var(--cx-text-muted); font-family: var(--cx-mono); }
.cx-pm-tag.is-admin { font-family: var(--cx-font); background: var(--cx-accent-soft); color: var(--cx-accent); }
html[data-theme="dark"] .cx-pm-tag.is-admin { color: #93c5fd; }
.cx-pm-balance { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 4px; padding: 9px 12px; border-radius: 4px; background: var(--cx-surface-2); border: 1px solid var(--cx-border); font-size: .8rem; color: var(--cx-text-muted) !important; text-decoration: none; }
.cx-pm-balance strong { font-size: .95rem; color: var(--cx-heading); }
.cx-pm-balance:hover { border-color: rgba(var(--cx-accent-rgb), .45); }
.cx-profile-menu .cx-pm-label { padding: 10px 10px 4px; font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--cx-text-muted); }
.cx-profile-menu .dropdown-item { display: flex !important; align-items: center; gap: 10px; padding: 7px 10px !important; font-size: .85rem; }
.cx-profile-menu .dropdown-item i { width: 16px; margin: 0 !important; text-align: center; font-size: 13px; color: var(--cx-text-muted); }
.cx-profile-menu .dropdown-item:hover i { color: var(--cx-accent); }
.cx-pm-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-style: normal; font-size: .7rem; font-weight: 700; background: var(--cx-surface-2); color: var(--cx-text-muted); }
.cx-pm-count.is-alert { background: #e11d48; color: #fff; }
.cx-profile-menu .cx-pm-logout, .cx-profile-menu .cx-pm-logout i { color: var(--cx-danger) !important; }
.cx-profile-menu .cx-pm-logout:hover { background: var(--cx-danger-soft) !important; }

/* ================================================================
 * Champs de formulaire : modifiable = blanc et net, verrouillé = gris avec cadenas.
 * ================================================================ */
:root {
    --cx-lock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%239aa3b2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M4.5 7V5a3.5 3.5 0 0 1 7 0v2M3.5 7h9v6.5h-9z'/%3E%3C/svg%3E");
}
html[data-theme="dark"] {
    --cx-lock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238b96a6' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M4.5 7V5a3.5 3.5 0 0 1 7 0v2M3.5 7h9v6.5h-9z'/%3E%3C/svg%3E");
}
:is(input, textarea).form-control:not([readonly]):not(:disabled) {
    background-color: var(--cx-surface) !important;
    border: 1px solid var(--cx-border-strong) !important;
    color: var(--cx-heading) !important;
    box-shadow: var(--cx-shadow-sm) !important;
}
:is(input, textarea).form-control:not([readonly]):not(:disabled):hover {
    border-color: rgba(var(--cx-accent-rgb), .55) !important;
}
:is(input, textarea).form-control:not([readonly]):not(:disabled):focus {
    border-color: var(--cx-accent) !important;
    box-shadow: 0 0 0 3px rgba(var(--cx-accent-rgb), .16) !important;
}
:is(input, textarea).form-control:is([readonly], :disabled) {
    background-color: var(--cx-surface-2) !important;
    background-image: var(--cx-lock-icon) !important;
    background-repeat: no-repeat !important;
    background-position: right 11px center !important;
    background-size: 14px 14px !important;
    padding-right: 34px !important;
    border: 1px dashed var(--cx-border-strong) !important;
    color: var(--cx-text-muted) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: 1;
}
textarea.form-control:is([readonly], :disabled) { background-position: right 11px top 11px !important; }
html[data-theme="dark"] :is(input, textarea).form-control:not([readonly]):not(:disabled) { background-color: var(--cx-surface-2) !important; border-color: var(--cx-border-strong) !important; }
html[data-theme="dark"] :is(input, textarea).form-control:is([readonly], :disabled) { background-color: var(--cx-surface-locked) !important; border-color: var(--cx-border) !important; }
/* Champs composés (préfixe « / », recherche) : le cadre est porté par le conteneur */
.cx-prefix-input > input.form-control.form-control { background-color: transparent !important; border: 0 !important; box-shadow: none !important; }
/* Champs de couleur, de fichier et de plage : pas de cadenas */
input.form-control:is([type="file"], [type="color"], [type="range"]) { background-image: none !important; }
/* Intitulés de formulaire lisibles en sombre (certaines pages imposaient un bleu nuit semi-transparent) */
html[data-theme="dark"] .form-label { color: var(--cx-text) !important; }
html[data-theme="dark"] .form-text, html[data-theme="dark"] .text-muted { color: var(--cx-text-muted) !important; }

/* ================================================================
 * Barre du haut : menus déroulants et compteurs
 * ================================================================ */
.cx-topnav > li { position: relative; }
.cx-topnav a.dropdown-toggle::after {
    content: ""; display: inline-block; margin-left: 2px; width: 7px; height: 7px; border: 0;
    border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg) translateY(-2px); opacity: .7; vertical-align: middle;
}
.cx-topnav a.dropdown-toggle.show { background: var(--cx-nav-hover); color: #fff; }
.cx-topnav .cx-topmenu { min-width: 230px; margin-top: 8px !important; padding: 6px; }
/* À la souris, les menus s'ouvrent au survol (au doigt, ils restent au clic) */
@media (hover: hover) and (pointer: fine) {
    .cx-topnav > li.dropdown:is(:hover, :focus-within) > .cx-topmenu { display: block; top: 100%; left: 0; }
    .cx-topnav > li.dropdown:is(:hover, :focus-within) > a.dropdown-toggle { background: var(--cx-nav-hover); color: #fff; }
    /* Pont invisible sur l'écart de 8px : le menu ne se ferme pas quand la souris descend dedans */
    .cx-topnav > li.dropdown > .cx-topmenu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
}
.cx-topmenu .dropdown-item { display: flex !important; align-items: center; gap: 8px; padding: 7px 10px !important; font-size: .85rem; border-radius: 4px; }
.cx-topmenu-label { padding: 8px 10px 4px; font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--cx-text-muted); }
/* Sous-menu dans un menu déroulant (ex. Facturation › Factures) : s'ouvre sur le côté au survol */
.cx-topmenu-sub { position: relative; }
.cx-topmenu-sub-chevron { margin-left: auto; font-size: 10px; opacity: .6; }
.cx-topnav .cx-topmenu-sub > .cx-topmenu-flyout { top: -7px; left: calc(100% + 6px); margin: 0 !important; min-width: 200px; }
.cx-topmenu-sub > .cx-topmenu-flyout::before { content: ""; position: absolute; top: 0; bottom: 0; left: -10px; width: 10px; }
.cx-topmenu-sub:is(:hover, :focus-within) > .dropdown-item { background: var(--cx-surface-hover); }
.cx-topmenu-sub:is(:hover, :focus-within) > .cx-topmenu-flyout { display: block; }
/* Au doigt (pas de survol) : les entrées du sous-menu s'affichent en retrait sous leur parent */
@media (hover: none), (pointer: coarse) {
    .cx-topnav .cx-topmenu-sub > .cx-topmenu-flyout { display: block; position: static; min-width: 0; padding: 0 0 0 12px; border: 0; box-shadow: none; background: transparent; }
    .cx-topmenu-sub-chevron { display: none; }
}
.cx-top-count { margin-left: 2px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-style: normal; font-size: .68rem; font-weight: 700; background: rgba(147, 197, 253, .2); color: #dbeafe; }
.cx-top-count.is-alert { background: #e11d48; color: #fff; }
.cx-topnav a.active .cx-top-count { background: rgba(255, 255, 255, .25); color: #fff; }
.cx-top-dot { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; display: inline-block; margin-left: 1px; transform: translateY(-5px); box-shadow: 0 0 0 2px var(--cx-topbar-bg); }

/* Onglets qui défilent horizontalement : pas de barre de défilement visible */
#main :is(.cx-svc-tabs, .cx-tabs, .nav-tabs, .cx-segmented[role="tablist"])::-webkit-scrollbar { display: none; }


/* ——— En-tête commun des pages de service (VPS, hébergement web, autres modules) ——— */
.cx-svc-hero { align-items: center; }
.cx-svc-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cx-svc-os { width: 48px; height: 48px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--cx-surface-2); border: 1px solid var(--cx-border); color: var(--cx-accent); font-size: 20px; }
.cx-svc-os img { width: 30px; height: 30px; object-fit: contain; }
.cx-svc-hero h1 { font-size: 1.45rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cx-svc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .82rem; color: var(--cx-text-muted); margin-top: 3px; }
.cx-svc-meta span.cx-svc-ip { font-family: var(--cx-mono); color: var(--cx-heading); font-size: .8rem; }
.cx-svc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cx-svc-actions form { display: inline-flex; margin: 0; }
.cx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .78rem; margin-bottom: 4px; color: var(--cx-text-muted); }
.cx-crumbs a { color: var(--bs-link-color); font-weight: 500; }
.cx-crumbs .is-current { color: var(--cx-text-muted); }

/* Raccourci clavier inutile sur écran tactile ou petit écran */
@media (hover: none), (max-width: 991.98px) { .cx-sidebar-search kbd { display: none; } }

/* ——— Pastilles d'en-tête (chiffres clés d'une page) ——— */
.cx-hero-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cx-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.5; background: var(--cx-surface-2); border: 1px solid var(--cx-border); color: var(--cx-heading); white-space: nowrap; text-decoration: none; }
.cx-pill strong { font-weight: 700; }
a.cx-pill:hover { border-color: rgba(var(--cx-accent-rgb), .45); color: var(--cx-heading); }
.cx-pill--success { background: var(--cx-success-soft); border-color: transparent; color: var(--cx-success); }
.cx-pill--warning { background: var(--cx-warning-soft); border-color: transparent; color: var(--cx-warning); }
.cx-pill--danger { background: var(--cx-danger-soft); border-color: transparent; color: var(--cx-danger); }
.cx-pill--info { background: var(--cx-info-soft); border-color: transparent; color: var(--cx-accent); }

/* ——— Admin : rubriques dans la barre de gauche sur petit écran ——— */
#sidebar .cx-sec-switch { display: none; }
@media (max-width: 1199px) {
    #sidebar .cx-sec-switch { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--cx-nav-line); list-style: none; }
    #sidebar .cx-sec-switch a { padding: 5px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; color: var(--cx-nav-muted); background: rgba(255, 255, 255, .05); text-decoration: none; }
    #sidebar .cx-sec-switch a.is-active { background: var(--cx-accent); color: #fff; }
    #sidebar .cx-sec-switch .cx-top-dot { transform: translateY(-4px); }
}
#sidebar .cx-nav-empty { padding: 6px 14px; font-size: .78rem; color: var(--cx-nav-muted); list-style: none; }

/* Menu du haut : espacements réguliers (texte, point d'alerte, flèche) */
.cx-topnav { gap: 4px; }
.cx-topnav a { gap: 0; padding: 6px 12px; }
.cx-topnav a .cx-top-dot { margin: 0 0 0 3px; transform: translateY(-6px); }
.cx-topnav a.dropdown-toggle::after { margin-left: 8px; }
.cx-topnav a .cx-top-count { margin-left: 6px; }
/* Notification du menu du haut : pastille rouge vif avec le nombre, posée sur le mot */
.cx-topnav .cx-top-label { position: relative; display: inline-block; }
.cx-topnav .cx-top-label { display: inline-flex; align-items: center; gap: 6px; }
.cx-top-notif { position: static; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #e11d48; color: #fff; font-style: normal; font-size: .66rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; text-indent: 0; padding-top: 1px; }
#sidebar .cx-sec-switch a { position: relative; }
#sidebar .cx-sec-switch .cx-top-notif { position: static; margin-left: 5px; box-shadow: none; }

/* ================================================================
 * Boutons teintés : fond pâle de la couleur, sans bordure (le bouton principal reste plein)
 * ================================================================ */
.btn { --cx-tone: 37, 99, 235; letter-spacing: .005em; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(var(--cx-tone), .25) !important; }
.btn-primary { box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
:is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-danger, .btn-outline-warning, .btn-outline-success, .btn-outline-info) {
    --bs-btn-color: rgb(var(--cx-tone-text));
    --bs-btn-bg: rgba(var(--cx-tone), .09);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: rgb(var(--cx-tone-text));
    --bs-btn-hover-bg: rgba(var(--cx-tone), .16);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: rgb(var(--cx-tone-text));
    --bs-btn-active-bg: rgba(var(--cx-tone), .22);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-color: rgb(var(--cx-tone-text));
    --bs-btn-disabled-bg: rgba(var(--cx-tone), .06);
    --bs-btn-disabled-border-color: transparent;
}
.btn-outline-primary { --cx-tone: 37, 99, 235; --cx-tone-text: 29, 78, 216; }
.btn-outline-secondary { --cx-tone: 100, 116, 139; --cx-tone-text: 51, 65, 85; }
.btn-outline-danger { --cx-tone: 220, 38, 38; --cx-tone-text: 200, 30, 30; }
.btn-outline-warning { --cx-tone: 245, 158, 11; --cx-tone-text: 180, 83, 9; }
.btn-outline-success { --cx-tone: 22, 163, 74; --cx-tone-text: 21, 128, 61; }
.btn-outline-info { --cx-tone: 14, 165, 233; --cx-tone-text: 3, 105, 161; }
html[data-theme="dark"] .btn-outline-primary { --cx-tone: 96, 165, 250; --cx-tone-text: 147, 197, 253; }
html[data-theme="dark"] .btn-outline-secondary { --cx-tone: 148, 163, 184; --cx-tone-text: 203, 213, 225; }
html[data-theme="dark"] .btn-outline-danger { --cx-tone: 248, 113, 113; --cx-tone-text: 252, 165, 165; }
html[data-theme="dark"] .btn-outline-warning { --cx-tone: 251, 191, 36; --cx-tone-text: 252, 211, 77; }
html[data-theme="dark"] .btn-outline-success { --cx-tone: 74, 222, 128; --cx-tone-text: 134, 239, 172; }
html[data-theme="dark"] .btn-outline-info { --cx-tone: 56, 189, 248; --cx-tone-text: 125, 211, 252; }
/* Actions pleines rouges / vertes : même douceur que le bouton principal */
.btn-danger { --bs-btn-bg: #dc2626; --bs-btn-border-color: #dc2626; --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; box-shadow: 0 1px 2px rgba(220, 38, 38, .25); }
.btn-success { --bs-btn-bg: #16a34a; --bs-btn-border-color: #16a34a; --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d; box-shadow: 0 1px 2px rgba(22, 163, 74, .25); }

/* ================================================================
 * Styles de boutons au choix (Paramètres généraux › Apparence) : classe cx-btn-* sur <html>.
 * « Teinté » est le style de base ci-dessus ; les autres le remplacent.
 * ================================================================ */
/* Neutre */
:is(html.cx-btn-neutral, .cx-bs-neutral) :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-danger, .btn-outline-warning, .btn-outline-success) {
    --bs-btn-bg: var(--cx-surface); --bs-btn-border-color: var(--cx-border-strong, #cbd5e1); --bs-btn-hover-bg: var(--cx-surface-2); --bs-btn-hover-border-color: var(--cx-border-strong, #94a3b8); --bs-btn-active-bg: var(--cx-surface-2);
    box-shadow: 0 1px 1px rgba(15, 23, 42, .04);
}
:is(html.cx-btn-neutral, .cx-bs-neutral) .btn-outline-primary, :is(html.cx-btn-neutral, .cx-bs-neutral) .btn-outline-secondary { --bs-btn-color: var(--cx-heading); --bs-btn-hover-color: var(--cx-heading); --bs-btn-active-color: var(--cx-heading); }

/* Pilule */
:is(html.cx-btn-pill, .cx-bs-pill) .btn { border-radius: 999px; padding-left: 18px; padding-right: 18px; }
:is(html.cx-btn-pill, .cx-bs-pill) .btn-sm { padding-left: 13px; padding-right: 13px; }
:is(html.cx-btn-pill, .cx-bs-pill) .btn-primary { box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
:is(html.cx-btn-pill, .cx-bs-pill) .btn:not(.btn-primary):not(.btn-danger) { box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }

/* Plein doux */
:is(html.cx-btn-solid, .cx-bs-solid) .btn { border: 0; color: #fff !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(15, 23, 42, .2); }
:is(html.cx-btn-solid, .cx-bs-solid) .btn-primary, :is(html.cx-btn-solid, .cx-bs-solid) .btn-outline-primary { background: linear-gradient(180deg, #3b82f6, #2563eb); }
:is(html.cx-btn-solid, .cx-bs-solid) .btn-outline-secondary { background: linear-gradient(180deg, #64748b, #475569); }
:is(html.cx-btn-solid, .cx-bs-solid) .btn-outline-warning { background: linear-gradient(180deg, #f59e0b, #d97706); }
:is(html.cx-btn-solid, .cx-bs-solid) .btn-outline-danger, :is(html.cx-btn-solid, .cx-bs-solid) .btn-danger { background: linear-gradient(180deg, #ef4444, #dc2626); }
:is(html.cx-btn-solid, .cx-bs-solid) .btn-outline-success { background: linear-gradient(180deg, #22c55e, #16a34a); }
:is(html.cx-btn-solid, .cx-bs-solid) .btn:hover { filter: brightness(1.07); }

/* Lien */
:is(html.cx-btn-ghost, .cx-bs-ghost) :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-danger, .btn-outline-warning, .btn-outline-success) { --bs-btn-bg: transparent; --bs-btn-disabled-bg: transparent; padding-left: 8px; padding-right: 8px; }

/* Carré net */
:is(html.cx-btn-sharp, .cx-bs-sharp) .btn { border-radius: 0; border-width: 1.5px; text-transform: uppercase; font-size: .74rem; letter-spacing: .06em; font-weight: 700; }
:is(html.cx-btn-sharp, .cx-bs-sharp) .btn-sm { font-size: .68rem; }
:is(html.cx-btn-sharp, .cx-bs-sharp) :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-danger, .btn-outline-warning, .btn-outline-success) { --bs-btn-bg: transparent; --bs-btn-border-color: rgb(var(--cx-tone-text)); }
:is(html.cx-btn-sharp, .cx-bs-sharp) :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-danger, .btn-outline-warning, .btn-outline-success):hover { --bs-btn-hover-bg: rgb(var(--cx-tone-text)); --bs-btn-hover-color: #fff; }

/* ——— Sélecteur à positions (ex. aperçu clair / sombre) ——— */
.cx-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--cx-radius-sm); background: var(--cx-surface-2); border: 1px solid var(--cx-border); }
.cx-seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 12px; border-radius: 3px; font-size: .78rem; font-weight: 600; color: var(--cx-text-muted); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.cx-seg button:hover { color: var(--cx-heading); }
.cx-seg button.is-active { background: var(--cx-surface); color: var(--cx-heading); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.cx-seg button i { font-size: .8rem; }

#sidebar .cx-nav-sep { list-style: none; height: 1px; margin: 10px 14px; background: var(--cx-nav-line); }

/* Lien « Demander la résiliation » sous Renouveler (fiches de service) */
.cx-cancel-link { display: block; margin-top: 10px; text-align: center; font-size: .78rem; color: var(--cx-text-muted); text-decoration: none; }
.cx-cancel-link:hover { color: var(--cx-danger); }
.cx-cancel-link.is-open { color: var(--cx-warning); font-weight: 600; }

/* Rubriques de l'admin : pages des autres rubriques masquées (affichées au changement de rubrique sur mobile, ou par la recherche) */
#sidebar-nav:not(.is-searching) .cx-sec-off { display: none !important; }
#sidebar-nav.is-searching .cx-nav-sep { display: none; }

/* Recherche de la barre latérale : pas de croix du navigateur (elle chevauchait « Ctrl K ») ;
   pendant la saisie, « Ctrl K » laisse la place à notre bouton d'effacement. */
.cx-sidebar-search input::-webkit-search-cancel-button,
.cx-sidebar-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.cx-sidebar-search-clear {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: none; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px;
    background: transparent; color: var(--cx-nav-muted); cursor: pointer;
}
.cx-sidebar-search-clear:hover, .cx-sidebar-search-clear:focus-visible { color: var(--cx-nav-text, #fff); background: var(--cx-nav-hover, rgba(255, 255, 255, 0.08)); outline: none; }
.cx-sidebar-search input:not(:placeholder-shown) ~ kbd { display: none; }
.cx-sidebar-search input:not(:placeholder-shown) ~ .cx-sidebar-search-clear { display: inline-flex; }
/* Texte sélectionné par Ctrl K : surlignage visible sur le fond bleu de la barre latérale */
.cx-sidebar-search input::selection { background: rgba(147, 197, 253, 0.55); color: #fff; }
/* « Ctrl K » reste affiché pendant la saisie : le bouton d'effacement se place juste à sa gauche */
.cx-sidebar-search input:not(:placeholder-shown) ~ kbd { display: inline-block; }
.cx-sidebar-search input:not(:placeholder-shown) { padding-right: 76px; }
.cx-sidebar-search-clear { right: 48px; }
@media (hover: none), (max-width: 991.98px) {
    .cx-sidebar-search input:not(:placeholder-shown) ~ kbd { display: none; }
    .cx-sidebar-search input:not(:placeholder-shown) { padding-right: 32px; }
    .cx-sidebar-search-clear { right: 6px; }
}
/* Cases à cocher : pas de halo bleu après un clic de souris ; il reste visible au clavier (Tab) pour l'accessibilité */
.form-check-input:focus:not(:focus-visible) { box-shadow: none; }
.form-check-input:not(:checked):focus:not(:focus-visible) { border-color: var(--bs-border-color, var(--cx-border-strong)); }
/* Aucun halo de focus nulle part (champs, listes, boutons, cases, liens) : le champ actif se repère à sa bordure colorée ;
   au clavier (Tab), un contour fin reste affiché sur les boutons, cases et liens pour l'accessibilité. */
input:focus, textarea:focus, select:focus, button:focus, a:focus,
.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus, .btn:active:focus, .btn-check:focus + .btn,
.page-link:focus, .nav-link:focus, .dropdown-item:focus, .accordion-button:focus, .btn-close:focus, .input-group .form-control:focus {
    box-shadow: none !important;
}
.form-control:focus, .form-select:focus, textarea:focus { border-color: var(--cx-accent) !important; outline: none; }
.form-check-input:not(:checked):focus { border-color: var(--bs-border-color, var(--cx-border-strong)) !important; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible), .btn:focus:not(:focus-visible), .form-check-input:focus:not(:focus-visible) { outline: none; }
.btn:focus-visible, button:focus-visible, a:focus-visible, .form-check-input:focus-visible { outline: 2px solid rgba(var(--cx-accent-rgb), .55); outline-offset: 2px; }
/* Engrenage « Paramètres » de la barre du haut (admin) */
.cx-settings-btn { position: relative; }
.cx-settings-btn.is-active { color: var(--cx-accent); }
.cx-settings-btn .cx-top-notif { position: absolute; top: -4px; right: -4px; }
.cx-settings-menu { max-height: calc(100vh - 90px); overflow-y: auto; }
/* Une seule consigne à la fois : l'aide sous un champ disparaît quand le message d'erreur s'affiche */
.input-group.has-validation:has(.is-invalid) + .form-text,
.was-validated .input-group.has-validation:has(:invalid) + .form-text,
.form-control.is-invalid ~ .form-text { display: none; }

/* Icônes des boutons : petites, alignées sur le texte */
#main .btn > i:is(.fa, .fas, .far, .fa-solid, .fa-regular, .bi) { font-size: .9em; vertical-align: -1px; }

/* Thème sombre : les tuiles d'alerte (factures impayées, échéance dépassée, paiement refusé) passent
 * en rouge vif plein. Le rouge transparent des autres badges donnait un carré bordeaux terne sur l'ardoise.
 * :root + :is() l'emporte sur les règles html[data-theme="dark"] .cx-kpi-icon.is-danger des pages. */
:root[data-theme="dark"] :is(.cx-kpi-icon, .cx-q-kpi-icon, .cx-due-icon, .cx-result-icon).is-danger,
:root[data-theme="dark"] .cx-kpi-icon--ko {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, .35), 0 4px 14px -2px rgba(239, 68, 68, .55);
}
:root[data-theme="dark"] .cx-kpi:has(.cx-kpi-icon.is-danger) { border-color: rgba(239, 68, 68, .45); }
:root[data-theme="dark"] a.cx-kpi:has(.cx-kpi-icon.is-danger):hover { border-color: rgba(239, 68, 68, .75); }

/* ——— Tuiles de chiffres (.cx-kpis) : un seul style pour toutes les pages de l'espace client ———
   Icône 38 px, libellé, valeur ; .cx-kpi-hint en option sous la valeur. 3 ou 4 tuiles s'alignent seules. */
.cx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cx-kpi {
    display: flex; align-items: center; gap: 12px; min-width: 0; width: 100%;
    padding: 14px 16px; text-align: left; font: inherit; color: inherit; text-decoration: none;
    background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: var(--cx-radius); box-shadow: var(--cx-shadow-sm);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
button.cx-kpi { cursor: pointer; }
a.cx-kpi:hover, button.cx-kpi:hover { border-color: rgba(var(--cx-accent-rgb), .45); transform: translateY(-1px); color: inherit; }
button.cx-kpi.is-active { border-color: var(--cx-accent); box-shadow: 0 0 0 3px rgba(var(--cx-accent-rgb), .12); }
.cx-kpi-body { flex: 1; min-width: 0; }
.cx-kpi-icon {
    width: 38px; height: 38px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 5px; background: var(--cx-accent-soft); color: var(--cx-accent); font-size: 15px;
}
html[data-theme="dark"] .cx-kpi-icon { color: #93c5fd; }
.cx-kpi-icon.is-success { background: var(--cx-success-soft); color: var(--cx-success); }
.cx-kpi-icon.is-danger { background: var(--cx-danger-soft); color: var(--cx-danger); }
.cx-kpi-icon.is-warning { background: var(--cx-warning-soft); color: var(--cx-warning); }
.cx-kpi-icon.is-muted { background: var(--cx-surface-2); color: var(--cx-text-muted); }
.cx-kpi-label { font-size: .78rem; color: var(--cx-text-muted); margin-bottom: 1px; }
.cx-kpi-value { font-size: 1.35rem; font-weight: 700; color: var(--cx-heading); line-height: 1.15; }
.cx-kpi-value small { font-size: .78rem; font-weight: 500; color: var(--cx-text-muted); margin-left: 4px; }
.cx-kpi-hint { font-size: .72rem; color: var(--cx-text-muted); margin-top: 2px; }
.cx-kpi-action { flex-shrink: 0; }

/* Tuile en alerte (factures impayées) : fin cadre rouge, chiffre rouge */
.cx-kpi.is-alert { border-color: rgba(239, 68, 68, .45); }
a.cx-kpi.is-alert:hover { border-color: rgba(239, 68, 68, .75); }
.cx-kpi-value.is-danger { color: var(--cx-danger); }

/* Bandeau des factures impayées (tableau de bord) */
.cx-unpaid-alert { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid rgba(239, 68, 68, .35); border-radius: var(--cx-radius); background: var(--cx-danger-soft); }
.cx-unpaid-icon { flex: none; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(239, 68, 68, .12); color: var(--cx-danger); font-size: 15px; }
.cx-unpaid-body { flex: 1; min-width: 0; }
.cx-unpaid-body strong { display: block; color: var(--cx-heading); font-size: .92rem; }
.cx-unpaid-body span { font-size: .82rem; color: var(--cx-text-muted); }
.cx-unpaid-close { flex: none; border: 0; background: none; color: var(--cx-text-muted); padding: 4px; align-self: flex-start; cursor: pointer; }
.cx-unpaid-close:hover { color: var(--cx-heading); }
@media (max-width: 575px) { .cx-unpaid-alert { flex-wrap: wrap; } .cx-unpaid-alert .btn { width: 100%; } }
