/* ============================================================
   style.css — STYLES DE L'ESPACE CONNECTÉ (layout.php)
   Version "tableau de bord moderne".
   Thème clair/sombre via les variables CSS (:root et :root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"])).

   SOMMAIRE
    1. Thèmes (variables, teintes)
    2. Base
    3. Menu latéral
    4. Coque et barre du haut
    5. Visiteur (connexion / inscription)
    6. Mise en page (conteneur, cartes, panneaux)
    7. Boutons
    8. Formulaires
    9. Abonnements
   10. Tableaux et listes
   11. Badges et alertes
   12. Agenda
   13. Tableau de bord (cartes, graphique, anneau, planning, encart)
   14. Paramètres de la société (.tp-*)
   15. Documents (devis / factures)
   16. Sélecteur de facturation (page d'accueil publique)
   17. Responsive (tablette / mobile)
   18. Impression (menu et barre du haut)
   ============================================================ */


/* ============================================================
   1. THÈMES
   ============================================================ */

/* BLEU CLASSIQUE */
:root,
:root[data-theme="blue"] {
    --bg: #f3f7fc;
    --bg-soft: #f6f9fd;
    --surface: #ffffff;
    --text: #14264a;
    --muted: #66789a;
    --border: #e2e9f4;
    --accent: #2563EB;
    --accent-d: #1D4ED8;
    --danger: #d6334a;
    --ok-bg: #e3f6ec;
    --err-bg: #fde8ea;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(17, 40, 82, .04), 0 6px 18px rgba(17, 40, 82, .04);
    --sidebar: 240px;
    --on-accent: #ffffff;
}

/* BLEU NUIT */
:root[data-theme="blue-dark"] {
    --bg: #0a1322;
    --bg-soft: #0d1a2e;
    --surface: #111e34;
    --text: #e6edf8;
    --muted: #8da2c0;
    --border: #1f3050;
    --accent: #818CF8;
    --accent-d: #6366F1;
    --danger: #ff7b8c;
    --ok-bg: #123a2b;
    --err-bg: #43202a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --on-accent: #0a1322;
}

/* ÉMERAUDE */
:root[data-theme="emerald"] {
    --bg: #f0fdfa;
    --bg-soft: #f5fffc;
    --surface: #ffffff;
    --text: #134e4a;
    --muted: #5f8580;
    --border: #ccece5;
    --accent: #0D9488;
    --accent-d: #0f766e;
    --danger: #d6334a;
    --ok-bg: #d1fae5;
    --err-bg: #fee2e2;
    --on-accent: #ffffff;
}

/* FORÊT */
:root[data-theme="forest"] {
    --bg: #10251e;
    --bg-soft: #163027;
    --surface: #1c3a2e;
    --text: #e4f5eb;
    --muted: #9bbbaa;
    --border: #315746;
    --accent: #34D399;
    --accent-d: #10B981;
    --danger: #fb7185;
    --ok-bg: #174b36;
    --err-bg: #542b35;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --on-accent: #06251a;
}

/* VIOLET */
:root[data-theme="violet"] {
    --bg: #faf5ff;
    --bg-soft: #fdfaff;
    --surface: #ffffff;
    --text: #3b1d5e;
    --muted: #88729f;
    --border: #eadcf7;
    --accent: #9333EA;
    --accent-d: #7e22ce;
    --danger: #d6334a;
    --ok-bg: #e3f6ec;
    --err-bg: #fde8ea;
    --on-accent: #ffffff;
}

/* NUIT VIOLETTE */
:root[data-theme="violet-dark"] {
    --bg: #1b1028;
    --bg-soft: #241535;
    --surface: #2d1d40;
    --text: #f3e8ff;
    --muted: #b9a2d0;
    --border: #49315e;
    --accent: #C084FC;
    --accent-d: #a855f7;
    --danger: #fb7185;
    --ok-bg: #1d4938;
    --err-bg: #512c3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --on-accent: #1b1028;
}

/* AMBRE */
:root[data-theme="amber"] {
    --bg: #fffaf0;
    --bg-soft: #fffcf5;
    --surface: #ffffff;
    --text: #542f12;
    --muted: #92734f;
    --border: #f3e2c6;
    --accent: #EA580C;
    --accent-d: #c2410c;
    --danger: #d6334a;
    --ok-bg: #e3f6ec;
    --err-bg: #fde8ea;
    --on-accent: #ffffff;
}

/* CAFÉ */
:root[data-theme="coffee"] {
    --bg: #211912;
    --bg-soft: #2a2018;
    --surface: #36291f;
    --text: #f8eddf;
    --muted: #c0a990;
    --border: #54402e;
    --accent: #FBBF24;
    --accent-d: #d97706;
    --danger: #fb7185;
    --ok-bg: #294536;
    --err-bg: #542b35;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --on-accent: #211912;
}

/* ROSE */
:root[data-theme="rose"] {
    --bg: #fff5f8;
    --bg-soft: #fff9fb;
    --surface: #ffffff;
    --text: #501b35;
    --muted: #987084;
    --border: #f4dce6;
    --accent: #DB2777;
    --accent-d: #be185d;
    --danger: #d6334a;
    --ok-bg: #e3f6ec;
    --err-bg: #fde8ea;
    --on-accent: #ffffff;
}

/* GRAPHITE */
:root[data-theme="graphite"] {
    --bg: #171b23;
    --bg-soft: #202631;
    --surface: #29313d;
    --text: #e8edf5;
    --muted: #a0acbd;
    --border: #3b4655;
    --accent: #94A3B8;
    --accent-d: #cbd5e1;
    --danger: #fb7185;
    --ok-bg: #234535;
    --err-bg: #512c35;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --on-accent: #171b23;
}

/* ------------------------------------------------------------
   Jetons partagés : dérivés de l'accent + alias.
   Les sections récentes (commerciaux, salariés, CRM, paramètres)
   utilisaient des noms jamais définis (--primary-color, --card-bg…) :
   elles restaient donc en clair dans tous les thèmes.
   Ils pointent maintenant sur les variables du thème actif.
   ------------------------------------------------------------ */
:root {
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-ring: color-mix(in srgb, var(--accent) 24%, transparent);
    --accent-faint: color-mix(in srgb, var(--accent) 5%, transparent);

    --primary: var(--accent);
    --primary-color: var(--accent);
    --pri: var(--accent);
    --text-color: var(--text);
    --tx: var(--text);
    --muted-color: var(--muted);
    --text-muted: var(--muted);
    --mut: var(--muted);
    --border-color: var(--border);
    --card-bg: var(--surface);
    --panel-bg: var(--surface);
    --input-bg: var(--surface);
    --surface-bg: var(--bg-soft);
    --surface-hover: var(--bg-soft);
    --bg-secondary: var(--bg-soft);

    --tp-set-border: var(--border);
    --tp-set-primary: var(--accent);
}

/* Couleurs d'accent réutilisables : une "teinte" = fond, bordure, fond d'icône, couleur d'icône, couleur de texte */

.tone-blue {
    --t-bg: #eef4ff;
    --t-bd: #d9e6ff;
    --t-ib: #dbe8ff;
    --t-ic: #3b6fe0;
    --t-tx: #1e3a8a;
}

.tone-green {
    --t-bg: #e9faf3;
    --t-bd: #c8efe0;
    --t-ib: #cdf3e4;
    --t-ic: #0f9f7a;
    --t-tx: #065f46;
}

.tone-violet {
    --t-bg: #f3efff;
    --t-bd: #e2d9ff;
    --t-ib: #e4dbff;
    --t-ic: #6d4fe0;
    --t-tx: #4c1d95;
}

.tone-pink {
    --t-bg: #fff0f3;
    --t-bd: #ffd8e1;
    --t-ib: #ffdbe3;
    --t-ic: #e0364f;
    --t-tx: #9f1239;
}

.tone-orange {
    --t-bg: #fff4e8;
    --t-bd: #ffe0bf;
    --t-ib: #ffe4c7;
    --t-ic: #e07b12;
    --t-tx: #7c2d12;
}

.tone-cyan {
    --t-bg: #e6f9fb;
    --t-bd: #c5eef3;
    --t-ib: #c9eff4;
    --t-ic: #0e9db2;
    --t-tx: #0e5360;
}

.tone-red {
    --t-bg: #fff0f0;
    --t-bd: #ffd6d6;
    --t-ib: #ffdcdc;
    --t-ic: #e5484d;
    --t-tx: #991b1b;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tone-blue {
    --t-bg: #12233f;
    --t-bd: #1d3763;
    --t-ib: #1b335e;
    --t-ic: #86adff;
    --t-tx: #c7dbff;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tone-green {
    --t-bg: #0f2b27;
    --t-bd: #174438;
    --t-ib: #14423a;
    --t-ic: #3fd6ad;
    --t-tx: #a8f0d9;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tone-violet {
    --t-bg: #1c1a3d;
    --t-bd: #2f2a66;
    --t-ib: #2c2763;
    --t-ic: #a48bff;
    --t-tx: #d8ccff;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tone-pink {
    --t-bg: #321a2a;
    --t-bd: #532337;
    --t-ib: #4d1f33;
    --t-ic: #ff7f98;
    --t-tx: #ffc4d0;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tone-orange {
    --t-bg: #33241a;
    --t-bd: #54381f;
    --t-ib: #4d3320;
    --t-ic: #ffab5c;
    --t-tx: #ffd9b3;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tone-cyan {
    --t-bg: #0f2a33;
    --t-bd: #174553;
    --t-ib: #15414e;
    --t-ic: #4dd3e6;
    --t-tx: #b3eef7;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tone-red {
    --t-bg: #321b21;
    --t-bd: #54252e;
    --t-ib: #4d2029;
    --t-ic: #ff7b86;
    --t-tx: #ffc2c8;
}

/* ============================================================
   2. BASE
   ============================================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font: 16px/1.55 "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
}

h1 {
    font-size: 1.7rem;
    margin: 0 0 1rem;
    letter-spacing: -.02em;
}

h2 {
    font-size: 1.1rem;
    margin: 0 0 .75rem;
}

code {
    padding: .1rem .35rem;
    border-radius: 5px;
    background: var(--bg);
    font-size: .85em;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}

.ic {
    width: 20px;
    height: 20px;
    flex: none;
}

.ic-inline {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

summary {
    cursor: pointer;
}

summary::-webkit-details-marker {
    display: none;
}

summary {
    list-style: none;
}

/* ============================================================
   3. MENU LATÉRAL
   ============================================================ */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar);
    padding: 20px 14px 18px;
    background: linear-gradient(180deg, #0c2d57 0%, #082243 55%, #061a36 100%);
    color: #fff;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px 24px;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.03em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    color: #4f8dff;
}

.brand-mark .ic {
    width: 36px;
    height: 36px;
    stroke-width: 2;
    fill: rgba(79, 141, 255, .22);
}

.guest-bar .brand {
    color: var(--text);
    padding: 0;
}

.side-nav {
    display: grid;
    gap: 4px;
    align-content: start;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    white-space: nowrap;
    border-radius: 11px;
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
}

.side-link .ic {
    width: 21px;
    height: 21px;
    opacity: .92;
}

.side-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.side-link.is-active {
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(47, 109, 246, .38);
}

.side-group > summary {
    cursor: pointer;
}

.side-chevron {
    margin-left: auto;
    width: 17px !important;
    height: 17px !important;
    transition: transform .2s;
}

.side-group[open] > summary .side-chevron {
    transform: rotate(180deg);
}

.side-sub {
    display: block;
    padding: 8px 13px 8px 47px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .68);
    font-size: .88rem;
    text-decoration: none;
}

.side-sub:hover,
.side-sub.is-current {
    color: #fff;
}

.side-sub.is-current {
    font-weight: 600;
}

.side-plan {
    margin-top: auto;
    display: grid;
    gap: 7px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 15px;
    background: rgba(255, 255, 255, .05);
}

.side-plan-crown {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(245, 184, 46, .16);
    color: #f5b82e;
}

.side-plan-crown .ic {
    width: 22px;
    height: 22px;
    fill: rgba(245, 184, 46, .25);
}

.side-plan-label {
    color: #5aa2ff;
    font-size: .86rem;
    text-decoration: none;
}

.side-plan strong {
    font-size: .95rem;
}

.side-plan .btn {
    margin-top: 6px;
    font-size: .86rem;
    padding: .6rem .5rem;
}

.scrim {
    display: none;
}

/* ============================================================
   4. COQUE ET BARRE DU HAUT
   ============================================================ */

.shell {
    margin-left: var(--sidebar);
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 66px;
    padding: 0 28px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    font-weight: 600;
}

.searchbox {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(440px, 100%);
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--muted);
}

.searchbox input {
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: .92rem;
}

.searchbox input:focus-visible {
    outline: none;
}

.searchbox:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--bg);
}

.icon-btn.sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

.icon-btn.sm .ic {
    width: 18px;
    height: 18px;
}

.nav-toggle {
    display: none;
}

 
.menu-pop {
    position: relative;
}

.userchip > summary {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 6px 4px 4px;
    border-radius: 14px;
}

.userchip > summary:hover {
    background: var(--bg);
}

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-d);
    color: var(--on-accent);
    font-weight: 700;
    font-size: .92rem;
}

.user-meta {
    display: grid;
    line-height: 1.2;
}

.user-meta strong {
    font-size: .93rem;
}

.user-meta small {
    color: var(--muted);
    font-size: .78rem;
}

.user-chevron {
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.pop {
    position: absolute;
    top: calc(100% + 8px);
    z-index: 60;
    min-width: 270px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 16px 40px rgba(10, 30, 70, .16);
}

.pop-right {
    right: 0;
}

.pop-title {
    display: block;
    padding: 8px 10px 6px;
    font-size: .9rem;
}

.pop-empty {
    margin: 0;
    padding: 6px 10px 10px;
}

.pop form {
    margin: 0;
}

.pop-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.pop-item:hover {
    background: var(--bg);
}

.pop-item .ic {
    width: 19px;
    height: 19px;
    color: var(--muted);
}

.pop-danger .ic {
    color: #e5484d;
}

.pop-warn .ic {
    color: #e07b12;
}

.pop-info .ic {
    color: var(--accent);
}

.banner {
    padding: .6rem 1.75rem;
    background: var(--accent);
    color: var(--on-accent);
}

.banner a {
    color: #fff;
    font-weight: 600;
    margin-left: .5rem;
}

/* ============================================================
   5. VISITEUR (CONNEXION / INSCRIPTION)
   ============================================================ */

.guest-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.guest-bar .brand-mark .ic {
    width: 30px;
    height: 30px;
}

body.is-guest .container {
    max-width: 1050px;
}

/* ============================================================
   6. MISE EN PAGE
   ============================================================ */

.container {
    max-width: 1560px;
    margin: 0 auto;
    padding: 26px 28px 44px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.page-head h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
}

.page-sub {
    margin: .25rem 0 0;
}

.head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

.section-title {
    margin: 1.6rem 0 .8rem;
    font-size: 1.1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card.form {
    max-width: 700px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 2.2rem 1.25rem;
}

.empty p {
    margin: 0 0 1rem;
}

.muted {
    color: var(--muted);
    font-size: .92rem;
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.panel {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.dash .panel,
.grid-charts .panel,
.grid-two .panel {
    margin-bottom: 0;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    white-space: nowrap;
}

.panel-head h2 .ic {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.panel-empty {
    margin: 8px 0;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--accent);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.text-link .ic {
    width: 14px;
    height: 14px;
}

.text-link:hover {
    text-decoration: underline;
}

.count {
    display: inline-block;
    margin-left: 4px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
}

/* ============================================================
   7. BOUTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: .6rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    font-size: .93rem;
    text-decoration: none;
    cursor: pointer;
}

.btn .ic {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-d);
    border-color: var(--accent-d);
}

.btn-ghost {
    background: transparent;
}

.btn-ghost:hover {
    background: var(--bg);
}

.btn-sm {
    padding: .35rem .75rem;
    font-size: .86rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn[disabled],
button[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

/* ============================================================
   8. FORMULAIRES
   ============================================================ */

.form {
    display: grid;
    gap: 1rem;
}

.form label {
    display: grid;
    gap: .3rem;
    font-weight: 600;
    font-size: .93rem;
}

input,
select,
textarea {
    width: 100%;
    padding: .62rem .75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    padding: 0;
    accent-color: var(--accent);
}

input[type="file"] {
    padding: .45rem .6rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: .5rem;
}

.field-error {
    color: var(--danger);
    font-weight: 400;
    font-size: .9rem;
}

.inline-form {
    margin: 0;
    display: inline;
}

.switch-row {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
}

.switch-row span {
    display: grid;
    gap: 2px;
}

.switch-row small {
    font-weight: 400;
}

.upload-form {
    display: grid;
    grid-template-columns: 1.3fr .8fr 1.6fr auto;
    gap: 12px;
    align-items: end;
}

.upload-form label {
    display: grid;
    gap: .3rem;
    font-weight: 600;
    font-size: .9rem;
}

.select-wrap select {
    width: auto;
    padding: .4rem 2rem .4rem .75rem;
    font-size: .87rem;
    border-radius: 9px;
}

.filter {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--muted);
}

.filter input {
    width: 170px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none !important;
}

.filter .ic {
    width: 18px;
    height: 18px;
}

.auth-card {
    max-width: 420px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card-wide {
    max-width: 720px;
}

/* ============================================================
   9. ABONNEMENTS
   ============================================================ */

.plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    border: 0;
    padding: 0;
    margin: 0;
}

.plans legend {
    font-weight: 600;
    margin-bottom: .5rem;
}

.plan {
    position: relative;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
}

.plan input {
    position: absolute;
    opacity: 0;
}

.plan:has(input:checked) {
    border-color: var(--accent);
}

.plan:has(input:focus-visible) {
    outline: 3px solid var(--accent);
}

.plan-price {
    font-size: 1.8rem;
    font-weight: 700;
}

.plan-price small {
    font-size: .9rem;
    font-weight: 400;
    color: var(--muted);
}

/* ============================================================
   10. TABLEAUX ET LISTES
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: .8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    background: var(--bg-soft);
}

tbody tr:hover td {
    background: color-mix(in srgb, var(--accent) 4%, transparent);
}

tr:last-child td {
    border-bottom: 0;
}

table.mini th,
table.mini td {
    padding: .55rem .4rem;
}

table.mini th {
    background: transparent;
}

 
 

.link-danger,
.link-action {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.link-danger {
    color: var(--danger);
}

.link-action {
    color: var(--accent);
}

.link-danger:hover,
.link-action:hover {
    text-decoration: underline;
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list li {
    padding: .55rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.list li:last-child {
    border-bottom: 0;
}

.details {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: .5rem 1rem;
    margin: 0;
}

.details dt {
    color: var(--muted);
}

.details dd {
    margin: 0;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.chip {
    display: grid;
    min-width: 170px;
    padding: 10px 18px 11px;
    border: 1px solid var(--t-bd);
    border-radius: 13px;
    background: var(--t-bg);
}

.chip span {
    color: var(--t-tx);
    font-size: .8rem;
    font-weight: 500;
    opacity: .85;
}

.chip strong {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--t-tx);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
}

.tabs a span {
    padding: 0 8px;
    border-radius: 999px;
    background: var(--bg);
    font-size: .76rem;
}

.tabs a .ic {
    width: 15px;
    height: 15px;
}

.tabs a.is-on {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tabs a:hover {
    color: var(--text);
}

/* ============================================================
   11. BADGES ET ALERTES
   ============================================================ */

.badge {
    display: inline-block;
    padding: .18rem .7rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--border);
    color: var(--text);
    white-space: nowrap;
}

.badge-brouillon {
    background: #e8edf5;
    color: #50627f;
}

.badge-envoye,
.badge-envoyee {
    background: #e0ebff;
    color: var(--accent-d);
}

.badge-accepte,
.badge-payee,
.badge-stock-ok,
.badge-leave-accepte {
    background: #d9f6e8;
    color: #0c7a55;
}

.badge-refuse,
.badge-retard,
.badge-stock-faible,
.badge-stock-rupture,
.badge-leave-refuse {
    background: #ffe3e6;
    color: #c8283d;
}

.badge-stock-surveiller,
.badge-leave-en_attente {
    background: #ffeccc;
    color: #b45309;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-brouillon {
    background: #22314d;
    color: #b6c4dc;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-envoye,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-envoyee {
    background: #1b335e;
    color: #9fc0ff;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-accepte,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-payee,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-stock-ok,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-leave-accepte {
    background: #14423a;
    color: #6fe5c0;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-refuse,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-retard,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-stock-faible,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-stock-rupture,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-leave-refuse {
    background: #4d2029;
    color: #ff9aa5;
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-stock-surveiller,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .badge-leave-en_attente {
    background: #4d3320;
    color: #ffc283;
}

.sub-red {
    color: #e5484d;
}

.sub-orange {
    color: #e07b12;
}

.sub-green {
    color: #10a37f;
}

.sub-blue {
    color: #3b6fe0;
}

.sub-violet {
    color: #6d4fe0;
}

.alert {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.alert-success {
    background: var(--ok-bg);
}

.alert-error {
    background: var(--err-bg);
}

.alert .ic {
    width: 22px;
    height: 22px;
    color: #10a37f;
}

/* ============================================================
   12. AGENDA
   ============================================================ */

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.cal-head {
    padding: .55rem;
    background: var(--bg-soft);
    font-weight: 600;
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
}

.cal-cell {
    min-height: 104px;
    padding: .4rem;
    background: var(--surface);
}

.cal-empty {
    background: var(--bg-soft);
}

.cal-today {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.cal-day {
    font-size: .85rem;
    color: var(--muted);
}

.cal-event {
    display: block;
    margin-top: .2rem;
    padding: .18rem .4rem;
    border-radius: 6px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: .78rem;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ============================================================
   13. TABLEAU DE BORD
   ============================================================ */

.dash {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 328px;
    gap: 24px;
    align-items: start;
}

.dash-main,
.dash-side {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.dash-head h1 {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.dash-head .muted {
    margin: .3rem 0 0;
    font-size: .96rem;
}

.wave {
    display: inline-block;
}

.date-pick {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 232px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    font-size: .93rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.date-pick .ic:first-child {
    color: var(--accent);
    width: 19px;
    height: 19px;
}

.date-pick span {
    flex: 1;
}

.date-pick .ic:last-of-type {
    width: 17px;
    height: 17px;
    color: var(--muted);
}

.date-pick input[type="date"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.dashboard-reminder {
    margin: 0;
}

/* 4 cartes d'indicateurs */

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.kpis-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
}

.kpi {
    display: grid;
    align-content: start;
    gap: 2px;
    padding: 18px 18px 16px;
    border: 1px solid var(--t-bd);
    border-radius: 15px;
    background: var(--t-bg);
    color: var(--text);
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}

a.kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(20, 50, 110, .1);
}

.kpi-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kpi-ico {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--t-ib);
    color: var(--t-ic);
    flex: none;
}

.kpi-ico .ic {
    width: 23px;
    height: 23px;
}

.kpi-label {
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-value {
    margin-top: 8px;
    font-size: 2.05rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    white-space: nowrap;
}

.kpi-note {
    color: var(--muted);
    font-size: .88rem;
}

.kpi-trend {
    margin-top: 12px;
    display: grid;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0f9f7a;
    font-size: .9rem;
}

.trend .ic {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.trend-down {
    color: #e5484d;
}

.trend-flat {
    color: var(--muted);
}

.trend-note {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    margin-top: 1px;
}

.grid-charts {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 20px;
}

.grid-charts.equal {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 20px;
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dash .grid-two,
.dash .grid-charts {
    margin-bottom: 0;
}

/* Histogramme */

.chart {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    height: 262px;
}

.chart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 24px;
    color: var(--muted);
    font-size: .72rem;
    text-align: right;
    line-height: 1;
}

.chart-plot {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) 24px;
    min-width: 0;
}

.chart-grid {
    position: absolute;
    inset: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.chart-grid i {
    display: block;
    height: 0;
    border-top: 1px solid var(--border);
}

.chart-bars {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 0 4px;
    height: 100%;
}

.chart-col {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex: 1;
    min-width: 0;
    height: 100%;
}

.chart-bar {
    display: block;
    width: 100%;
    max-width: 20px;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, #86a9f7, #5f8ef0);
}

.chart-bar.is-last {
    background: linear-gradient(180deg, #3f78f2, #2f6df6);
}

.chart-col:hover .chart-bar {
    filter: brightness(.93);
}

.chart-x {
    display: flex;
    gap: 5px;
    padding: 0 4px;
    align-items: center;
}

.chart-x span {
    display: flex;
    justify-content: center;
    flex: 1;
    min-width: 0;
    color: var(--muted);
    font-size: .72rem;
    white-space: nowrap;
}

/* Anneau "Statut des devis" */

.status-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0 4px;
}

.donut {
    display: grid;
    place-items: center;
    flex: none;
    width: 140px;
    height: 140px;
    border-radius: 50%;
}

.donut-hole {
    display: grid;
    place-content: center;
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: var(--surface);
    text-align: center;
    line-height: 1.15;
}

.donut-hole strong {
    font-size: 1.7rem;
    font-weight: 800;
}

.donut-hole span {
    color: var(--muted);
    font-size: .88rem;
}

.legend {
    flex: 1;
    min-width: 0;
    border-collapse: collapse;
    font-size: .9rem;
}

.legend td {
    white-space: nowrap;
    padding: 9px 4px;
    border: 0;
    background: transparent !important;
}

.legend .pct {
    color: var(--muted);
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
    border-radius: 50%;
}

/* Actions rapides */

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.quick {
    display: grid;
    align-content: space-between;
    justify-items: start;
    gap: 12px;
    min-height: 88px;
    padding: 13px 14px;
    border: 1px solid var(--t-bd);
    border-radius: 13px;
    background: var(--t-bg);
    color: var(--t-tx);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: transform .15s;
}

.quick:hover {
    transform: translateY(-2px);
}

.quick-ico {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--t-ib);
    color: var(--t-ic);
}

.quick-ico .ic {
    width: 20px;
    height: 20px;
}

/* Fil d'activité, alertes stock, documents & RH */

.feed,
.stock-list,
.rh-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feed li a,
.stock-list li a,
.rh-list li a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px 0;
    color: var(--text);
    text-decoration: none;
}

.feed li + li,
.stock-list li + li,
.rh-list li + li {
    border-top: 1px solid var(--border);
}

.feed li a:hover .feed-txt strong,
.stock-list li a:hover .feed-txt strong,
.rh-list li a:hover .feed-txt strong {
    color: var(--accent);
}

.feed-ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--t-ib);
    color: var(--t-ic);
}

.feed-ico.round {
    border-radius: 50%;
}

.feed-ico .ic {
    width: 21px;
    height: 21px;
}

.feed-txt {
    display: grid;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.feed-txt strong {
    font-size: .92rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-txt small {
    color: var(--muted);
    font-size: .8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-time {
    margin-left: auto;
    color: var(--muted);
    font-size: .8rem;
    white-space: nowrap;
}

.rh-chev {
    width: 18px;
    height: 18px;
    margin-left: auto;
    color: var(--muted);
}

/* Chiffres clés */

.figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.figures > div {
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 2px 12px;
    border-left: 1px solid var(--border);
}

.figures > div:first-child {
    padding-left: 0;
    border-left: 0;
}

.figures span:first-child {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.25;
}

.figures strong {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.figures .trend {
    font-size: .82rem;
}

.tagline {
    position: relative;
    width: fit-content;
    margin: 8px 0 0;
    color: var(--text);
    font: italic 1.05rem "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
}

.tagline svg {
    display: block;
    width: 100%;
    height: 12px;
    color: var(--accent);
}

/* Planning (colonne de droite) */

.seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.seg button {
    padding: 9px 6px;
    border: 0;
    border-radius: 9px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
}

.seg button.is-on {
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
}

.planner-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.planner-nav strong {
    font-size: .95rem;
    text-align: center;
}

.plan-list {
    display: grid;
    gap: 12px;
}

.plan-day {
    margin-top: 6px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.plan-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.plan-time {
    color: var(--t-ic);
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.2;
}

.plan-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--t-ic);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.plan-card:hover {
    background: var(--bg-soft);
}

.plan-ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--t-ib);
    color: var(--t-ic);
}

.plan-ico .ic {
    width: 17px;
    height: 17px;
}

.plan-txt {
    display: grid;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.plan-txt strong {
    font-size: .86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-txt small {
    color: var(--muted);
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-dur {
    display: none;
}

.planner-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding: 9px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--accent);
    font-size: .87rem;
    font-weight: 600;
    text-decoration: none;
}

.planner-add .ic {
    width: 16px;
    height: 16px;
}

.planner-add:hover {
    background: var(--bg-soft);
}

/* Encart "clients en ligne" */

.promo {
    position: relative;
    display: grid;
    overflow: hidden;
    min-height: 236px;
    padding: 20px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #2a5de0 0%, #4540cf 62%, #6a3fd0 100%);
}

.promo-copy {
    position: relative;
    z-index: 1;
    max-width: 205px;
}

.promo h3 {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 14px;
    font-size: .92rem;
    line-height: 1.3;
    font-weight: 600;
}

.promo h3 u {
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.promo-ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
}

.promo-ico .ic {
    width: 17px;
    height: 17px;
}

.promo ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 7px;
    font-size: .78rem;
}

.promo ul li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo ul .ic {
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    padding: 9px 14px;
    border-radius: 9px;
    background: var(--surface);
    color: #2a5de0;
    font-size: .84rem;
    font-weight: 600;
    text-decoration: none;
}

.promo-btn .ic {
    width: 15px;
    height: 15px;
}

.phone {
    position: absolute;
    right: -14px;
    bottom: -40px;
    width: 112px;
    height: 196px;
    padding-top: 22px;
    border: 3px solid #1b2547;
    border-radius: 20px;
    background: var(--surface);
    transform: rotate(11deg);
    box-shadow: 0 14px 30px rgba(10, 15, 60, .45);
}

.phone i {
    display: block;
    height: 6px;
    margin: 10px 12px 0;
    border-radius: 3px;
    background: #dbe3f5;
}

.phone i.short {
    width: 52%;
}

.phone-check {
    position: absolute;
    right: 12px;
    bottom: 56px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #12b886;
    color: #fff;
}

.phone-check .ic {
    width: 18px;
    height: 18px;
    stroke-width: 2.6;
}

.phone-sign {
    position: absolute;
    left: 14px;
    bottom: 26px;
    color: #2a5de0;
    font: italic 1.3rem "Segoe Script", "Brush Script MT", cursive;
}

/* Statistiques */

.hbars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.hbars li {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 12px;
    font-size: .9rem;
}

.hbar {
    height: 10px;
    border-radius: 999px;
    background: var(--bg);
    overflow: hidden;
}

.hbar i {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.hbars strong {
    text-align: right;
}

/* ============================================================
   14. PARAMÈTRES DE LA SOCIÉTÉ (.tp-*)
   ============================================================ */

.tp-settings {
    --tp-border: var(--border-color, #e5e7eb);
    --tp-muted: var(--text-muted, #6b7280);
    --tp-surface: var(--panel-bg, #fff);
    --tp-primary: var(--primary, #4f46e5);
    max-width: 1180px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.tp-settings * {
    box-sizing: border-box;
}

.tp-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
}

.tp-eyebrow {
    color: var(--tp-primary);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 8px;
}

.tp-hero h1 {
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -.045em;
    margin: 0 0 9px;
    font-weight: 800;
}

.tp-hero p {
    color: var(--tp-muted);
    margin: 0;
    line-height: 1.6;
}

.tp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--tp-border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.tp-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16a34a;
}

.tp-settings .tp-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .025);
}

.tp-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 23px 25px;
    border-bottom: 1px solid var(--tp-border);
}

.tp-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(99, 102, 241, .09);
    color: var(--tp-primary);
}

.tp-card-head h2 {
    font-size: 16px;
    margin: 1px 0 5px;
    font-weight: 750;
}

.tp-card-head p {
    font-size: 13px;
    color: var(--tp-muted);
    margin: 0;
    line-height: 1.55;
}

.tp-card-body {
    padding: 25px;
}

.tp-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
    color: var(--tp-muted);
    margin: 0 0 18px;
}

.tp-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px 22px;
}

.tp-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.tp-field-full {
    grid-column: 1 / -1;
}

.tp-label {
    font-size: 12px;
    font-weight: 700;
}

.tp-settings input:not([type="file"]),
.tp-settings select,
.tp-settings textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--tp-border);
    border-radius: 10px;
    padding: 11px 13px;
    background: var(--tp-surface);
    color: inherit;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.tp-settings input:not([type="file"]),
.tp-settings select {
    min-height: 43px;
}

.tp-settings textarea {
    resize: vertical;
    line-height: 1.6;
}

.tp-settings input:focus,
.tp-settings select:focus,
.tp-settings textarea:focus {
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .10);
}

.tp-settings input:disabled,
.tp-settings textarea:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.tp-divider {
    height: 1px;
    background: var(--tp-border);
    margin: 27px 0;
}

.tp-logo-box {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 18px;
    border: 1px dashed var(--tp-border);
    border-radius: 14px;
}

.tp-logo-preview {
    width: 94px;
    height: 94px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--tp-border);
    border-radius: 13px;
    background: rgba(127, 127, 127, .05);
    color: var(--tp-muted);
    flex: 0 0 94px;
}

.tp-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 7px;
}

.tp-logo-info {
    flex: 1;
    min-width: 180px;
}

.tp-logo-info strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.tp-logo-info p {
    color: var(--tp-muted);
    font-size: 12px;
    line-height: 1.6;
    margin: 0 0 12px;
}

.tp-settings input[type="file"] {
    display: block;
    max-width: 100%;
    font-size: 12px;
}

.tp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 22px;
    margin-top: 24px;
    border-top: 1px solid var(--tp-border);
}

.tp-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.tp-plan-price {
    font-size: 27px;
    font-weight: 850;
    letter-spacing: -.04em;
    margin: 15px 0 7px;
}

.tp-plan-price span {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--tp-muted);
}

.tp-muted {
    color: var(--tp-muted);
    font-size: 13px;
    line-height: 1.65;
}

.tp-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.tp-settings .btn {
    border-radius: 10px;
}

/* --- Thème sombre --- */

/* Les variables --border-color, --text-muted, --panel-bg et --primary n'existent pas
   dans les thèmes : on rebranche les variables .tp-* sur celles du thème sombre. */
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-settings {
    --tp-border: var(--border);
    --tp-muted: var(--muted);
    --tp-surface: var(--surface);
    --tp-primary: var(--accent);
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-settings .tp-card {
    box-shadow: var(--shadow);
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-icon {
    background: var(--accent-soft);
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-settings input:not([type="file"]),
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-settings select,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-settings textarea {
    background: var(--bg-soft);
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-settings input:focus,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-settings select:focus,
:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-settings textarea:focus {
    box-shadow: 0 0 0 3px var(--accent-ring);
}

:root:is([data-theme="blue-dark"], [data-theme="forest"], [data-theme="violet-dark"], [data-theme="coffee"], [data-theme="graphite"]) .tp-logo-preview {
    background: rgba(255, 255, 255, .04);
}

/* --- Responsive --- */

@media (max-width: 700px) {
    .tp-hero {
        flex-direction: column;
    }

    .tp-card-head,
    .tp-card-body {
        padding: 19px;
    }

    .tp-fields,
    .tp-plan-grid {
        grid-template-columns: 1fr;
    }

    .tp-field-full {
        grid-column: auto;
    }

    .tp-actions {
        flex-direction: column;
    }

    .tp-actions .btn {
        width: 100%;
    }
}

/* ============================================================
   15. DOCUMENTS (DEVIS / FACTURES)
   ============================================================ */

.document-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    color: var(--text);
}

.document-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.document-paper {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 42px;
    box-shadow: 0 8px 30px #0f172a0d;
}

.document-top {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 24px;
}

.document-logo {
    max-width: 170px;
    max-height: 90px;
    object-fit: contain;
    display: block;
    margin-bottom: 12px;
}

.document-company,
.document-client {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
}

.document-title {
    text-align: right;
}

.document-title h1 {
    font-size: 32px;
    letter-spacing: .08em;
    margin: 0 0 8px;
    color: var(--accent);
}

.document-title p {
    margin: 4px 0;
    font-size: 13px;
}

.document-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.document-parties h3,
.document-lines h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin: 0 0 10px;
}

.document-parties strong {
    font-size: 15px;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

.document-table th {
    background: var(--bg-soft);
    text-align: left;
    font-size: 12px;
    padding: 13px;
}

.document-table td {
    padding: 16px 13px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.document-table .num {
    text-align: right;
    white-space: nowrap;
}

.document-total span:first-child {
    display: table-cell;
    text-align: left;
    width: 65%;
}

.document-total strong,
.document-total span:last-child {
    display: table-cell;
    text-align: right;
    white-space: nowrap;
    width: 35%;
}

.document-grand {
    border-top: 2px solid var(--accent);
    margin-top: 8px;
    padding-top: 14px;
    font-size: 19px;
    font-weight: 800;
}

.document-totals {
    width: 340px;
    margin: 24px 0 0 auto;
    border-collapse: collapse;
    table-layout: fixed;
}

.document-total-label,
.document-total-value {
    padding: 7px 0;
}

.document-total-label {
    text-align: left;
}

.document-total-value {
    text-align: right;
    white-space: nowrap;
}

.document-grand td {
    border-top: 2px solid var(--accent);
    padding-top: 14px;
    font-size: 19px;
    font-weight: bold;
}

.document-note {
    margin-top: 35px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-line;
}

.document-footer {
    margin-top: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    white-space: pre-line;
}

/* --- Responsive et impression --- */

@media (max-width: 650px) {
    .document-paper {
        padding: 20px;
    }

    .document-top {
        flex-direction: column;
    }

    .document-title {
        text-align: left;
    }

    .document-parties {
        grid-template-columns: 1fr;
    }

    .document-toolbar {
        flex-wrap: wrap;
    }
}

@media print {
    body {
        background: #fff !important;
    }

    .sidebar,
    .app-sidebar,
    header,
    .topbar,
    .navbar,
    .page-head,
    .document-toolbar,
    nav,
    footer {
        display: none !important;
    }

    main,
    .main,
    .content,
    .app-content {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .document-page {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .document-paper {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 8mm;
    }

    .document-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        size: A4;
        margin: 10mm;
    }
}

/* ============================================================
   16. SÉLECTEUR DE FACTURATION
   Concerne la page d'accueil publique.
   ============================================================ */

.billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 30px auto 40px;
    padding: 6px;
    width: fit-content;
    max-width: 100%;
    background: rgba(128, 128, 128, 0.10);
    border: 1px solid rgba(128, 128, 128, 0.20);
    border-radius: 50px;
}

.billing-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    padding: 12px 22px;
    border-radius: 50px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.billing-btn.active {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.billing-discount {
    background: #16a34a;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 700;
}

.billing-btn:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: 3px;
}

.billing-saving {
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0 15px;
    text-align: center;
}

.billing-saving[hidden] {
    display: none;
}


/* =====================================================
   PAGES JURIDIQUES — TOUTPILOT
===================================================== */

.legal-page {
    max-width: 1100px;
    color: var(--text-color, #263247);
}

.legal-page h1 {
    color: var(--text-color, #263247);
    font-weight: 750;
}

.legal-content {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e8ebf1);
    border-radius: 14px;
    padding: 35px;
    box-shadow: 0 5px 20px rgba(20, 30, 50, 0.04);
    line-height: 1.8;
}

.legal-content h2 {
    font-size: 19px;
    font-weight: 700;
    margin-top: 35px;
    margin-bottom: 14px;
    color: var(--heading-color, #344d83);
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin-top: 24px;
}

.legal-content p,
.legal-content li {
    font-size: 14px;
    color: var(--text-color, #596579);
}

.legal-content li {
    margin-bottom: 6px;
}

.legal-content a {
    color: #5269c9;
    font-weight: 600;
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content table {
    font-size: 13px;
}

@media (max-width: 768px) {
    .legal-content {
        padding: 20px;
    }

    .legal-page h1 {
        font-size: 26px;
    }
}


/* --- Responsive --- */

@media (max-width: 480px) {
    .billing-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ============================================================
   17. RESPONSIVE (TABLETTE / MOBILE)
   ============================================================ */

@media (max-width: 1280px) {
    .dash {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-side .planner {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1000px) {
    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpis-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-charts,
    .grid-charts.equal,
    .grid-two {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s;
        box-shadow: 0 0 40px rgba(0, 0, 0, .4);
    }

    body.nav-open .sidebar {
        transform: none;
    }

    body.nav-open .scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(5, 15, 35, .55);
    }

    .shell {
        margin-left: 0;
    }

    .nav-toggle {
        display: grid;
    }

    .topbar {
        padding: 0 14px;
        gap: 8px;
    }

    .user-meta,
    .user-chevron {
        display: none;
    }

    .container {
        padding: 18px 14px 36px;
    }
}

@media (max-width: 720px) {
    .grid-2,
    .plans,
    .upload-form {
        grid-template-columns: 1fr;
    }

    .cal-cell {
        min-height: 70px;
    }

    .details {
        grid-template-columns: 1fr;
    }

    .dash-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-head {
        flex-direction: column;
    }

    .date-pick {
        width: 100%;
    }

    .figures {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 16px;
    }

    .figures > div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .status-body {
        flex-direction: column;
        align-items: stretch;
    }

    .donut {
        align-self: center;
    }

    .kpis,
    .kpis-6 {
        grid-template-columns: minmax(0, 1fr);
    }

    .chart {
        height: 220px;
    }
}

/* ============================================================
   18. IMPRESSION
   ============================================================ */

@media print {
    .sidebar,
    .topbar,
    .scrim {
        display: none !important;
    }

    .shell {
        margin: 0;
    }
}
 
/* =========================================================
   TOUTPILOT — CRM COMPLET
   Vue d'ensemble, prospects, clients, pipeline et tâches
========================================================= */

/* =========================================================
   CONTENEUR ET EN-TÊTE
========================================================= */

.crm-page {
    width: 100%;
    max-width: 100%;
}

.crm-page .crm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.crm-page .crm-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary-color, #6366f1);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.crm-page .crm-header h1 {
    margin: 0 0 7px;
    color: var(--text-color, #172033);
    font-size: 28px;
    font-weight: 800;
}

.crm-page .crm-header p {
    margin: 0;
    color: var(--muted-color, #64748b);
    font-size: 14px;
}

/* =========================================================
   NAVIGATION CRM
========================================================= */

.crm-page .crm-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 25px;
    padding: 7px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--card-bg, #fff);
}

.crm-page .crm-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--muted-color, #64748b);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: .2s ease;
}

.crm-page .crm-nav a:hover {
    background: var(--surface-bg, #f1f5f9);
    color: var(--text-color, #172033);
}

.crm-page .crm-nav a.active {
    background: var(--primary-color, #4f46e5);
    color: var(--on-accent);
}

/* =========================================================
   BOUTONS CRM — STYLE UNIFORME
========================================================= */

.crm-page .btn,
.crm-page button.btn,
.crm-page a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.crm-page .btn-primary {
    background: var(--primary-color, #4f46e5);
    border-color: var(--primary-color, #4f46e5);
    color: var(--on-accent);
}

.crm-page .btn-primary:hover {
    filter: brightness(.92);
    transform: translateY(-1px);
}

.crm-page .btn-secondary {
    background: var(--surface-bg, #f1f5f9);
    border-color: var(--border-color, #e2e8f0);
    color: var(--text-color, #334155);
}

.crm-page .btn-secondary:hover {
    background: var(--border-color, #e2e8f0);
}

.crm-page .btn-danger {
    background: var(--danger);
    color: #fff;
}

/* =========================================================
   INDICATEURS COMMERCIAUX
========================================================= */

.crm-page .crm-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.crm-page .crm-kpi {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: var(--card-bg, #fff);
    box-shadow: 0 3px 12px rgba(15, 23, 42, .035);
}

.crm-page .crm-kpi span {
    color: var(--muted-color, #64748b);
    font-size: 12px;
    font-weight: 600;
}

.crm-page .crm-kpi strong {
    color: var(--text-color, #172033);
    font-size: clamp(19px, 2vw, 27px);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.crm-page .crm-kpi small {
    color: var(--muted-color, #94a3b8);
    font-size: 11px;
}

/* =========================================================
   PANELS ET CARTES
========================================================= */

.crm-page .crm-panel {
    margin-bottom: 25px;
    padding: 23px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: var(--card-bg, #fff);
    box-shadow: 0 3px 12px rgba(15, 23, 42, .035);
}

.crm-page .crm-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

.crm-page .crm-panel-head h2 {
    margin: 0 0 6px;
    color: var(--text-color, #172033);
    font-size: 18px;
    font-weight: 750;
}

.crm-page .crm-panel-head p {
    margin: 0;
    color: var(--muted-color, #64748b);
    font-size: 13px;
}

/* =========================================================
   FORMULAIRES CRM
========================================================= */

.crm-form,
.crm-opportunity-form,
.crm-activity-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
}

.crm-form h2 {
    margin: 0;
    font-size: 18px;
}

.crm-opportunity-form .grid-2,
.crm-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.crm-form label,
.crm-opportunity-form label,
.crm-activity-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-color, #334155);
    font-size: 13px;
    font-weight: 600;
}

.crm-form input,
.crm-form select,
.crm-form textarea,
.crm-opportunity-form input,
.crm-opportunity-form select,
.crm-opportunity-form textarea,
.crm-activity-form input,
.crm-activity-form select,
.crm-activity-form textarea {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 11px 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    background: var(--input-bg, var(--card-bg, #fff));
    color: var(--text-color, #1e293b);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.crm-form textarea,
.crm-opportunity-form textarea,
.crm-activity-form textarea {
    min-height: 95px;
    resize: vertical;
}

.crm-form input:focus,
.crm-form select:focus,
.crm-form textarea:focus,
.crm-opportunity-form input:focus,
.crm-opportunity-form select:focus,
.crm-opportunity-form textarea:focus,
.crm-activity-form input:focus,
.crm-activity-form select:focus,
.crm-activity-form textarea:focus {
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.crm-opportunity-form .form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 5px;
}

/* =========================================================
   PIPELINE COMMERCIAL
========================================================= */

.crm-pipeline-section {
    margin-top: 28px;
}

.crm-pipeline {
    display: grid;
    grid-template-columns: repeat(6, minmax(245px, 1fr));
    align-items: start;
    gap: 15px;
    width: 100%;
    overflow-x: auto;
    padding: 5px 2px 18px;
}

.crm-stage {
    min-width: 245px;
    padding: 13px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 13px;
    background: var(--surface-bg, #f8fafc);
}

.crm-stage-header,
.crm-stage-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.crm-stage-header > div {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-color, #334155);
    font-size: 13px;
}

.crm-stage-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.crm-stage-count,
.crm-stage-head span {
    min-width: 25px;
    padding: 4px 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    background: var(--card-bg, #fff);
    color: var(--muted-color, #64748b);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.crm-stage-empty {
    padding: 23px 8px;
    border: 1px dashed var(--border-color, #cbd5e1);
    border-radius: 9px;
    color: var(--muted-color, #94a3b8);
    font-size: 12px;
    text-align: center;
}

/* =========================================================
   OPPORTUNITÉS
========================================================= */

.crm-opportunity {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 11px;
    background: var(--card-bg, #fff);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .035);
    transition: transform .2s, box-shadow .2s;
}

.crm-opportunity:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(15, 23, 42, .07);
}

.crm-opportunity-top {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 5px;
}

.crm-opportunity-contact {
    color: var(--muted-color, #64748b);
    font-size: 11px;
    font-weight: 650;
}

.crm-opportunity-amount {
    color: var(--primary-color, #4f46e5);
    font-size: 19px;
    font-weight: 800;
}

.crm-opportunity h3 {
    margin: 0 0 8px;
    color: var(--text-color, #172033);
    font-size: 14px;
    line-height: 1.5;
}

.crm-opportunity-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--muted-color, #64748b);
    font-size: 11px;
}

.crm-opportunity-weighted {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    color: var(--muted-color, #64748b);
    font-size: 11px;
}

.crm-opportunity-weighted strong {
    color: var(--text-color, #172033);
}

.crm-opportunity-description {
    margin: 10px 0 0;
    color: var(--muted-color, #64748b);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.crm-opportunity > a {
    color: var(--primary-color, #4f46e5);
    font-size: 13px;
    text-decoration: none;
}

.crm-probability,
.crm-opportunity small {
    color: var(--muted-color, #64748b);
    font-size: 11px;
}

/* Changement d'étape */

.crm-stage-action {
    display: flex;
    gap: 6px;
    margin-top: 13px;
}

.crm-stage-action select {
    flex: 1;
    min-width: 0;
    padding: 7px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 7px;
    background: var(--card-bg, #fff);
    color: var(--text-color, #334155);
    font-size: 11px;
}

.crm-stage-action .btn {
    min-height: 33px;
    padding: 6px 9px;
    font-size: 11px;
}

.crm-delete-link {
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    font-size: 11px;
    cursor: pointer;
}

.crm-delete-link:hover {
    text-decoration: underline;
}

/* =========================================================
   FICHE CONTACT
========================================================= */

.crm-detail-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.crm-detail-list > div {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.crm-detail-list span {
    color: var(--muted-color, #64748b);
    font-size: 13px;
}

.crm-detail-list strong {
    overflow-wrap: anywhere;
    text-align: right;
    font-size: 13px;
}

.crm-notes {
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    background: var(--surface-bg, #f1f5f9);
}

.crm-notes p {
    margin-bottom: 0;
    line-height: 1.6;
    white-space: normal;
}

/* =========================================================
   ACTIVITÉS ET HISTORIQUE
========================================================= */

.crm-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.crm-timeline-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.crm-timeline-dot {
    flex-shrink: 0;
    width: 11px;
    height: 11px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--primary-color, #6366f1);
}

.crm-timeline-item > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.crm-timeline-item span,
.crm-timeline-item small {
    color: var(--muted-color, #64748b);
    font-size: 12px;
}

.crm-timeline-item p {
    margin: 5px 0;
    line-height: 1.5;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {
    .crm-page .crm-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .crm-contact-grid {
        grid-template-columns: 1fr;
    }

    .crm-pipeline {
        grid-template-columns: repeat(6, 240px);
    }
}

@media (max-width: 650px) {
    .crm-page .crm-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .crm-page .crm-kpis {
        grid-template-columns: 1fr;
    }

    .crm-page .crm-panel {
        padding: 15px;
    }

    .crm-page .crm-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .crm-page .crm-nav a {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .crm-opportunity-form .grid-2,
    .crm-contact-grid {
        grid-template-columns: 1fr;
    }

    .crm-detail-list > div {
        flex-direction: column;
        gap: 4px;
    }

    .crm-detail-list strong {
        text-align: left;
    }

    .crm-pipeline {
        grid-template-columns: repeat(6, 245px);
    }
}
/* =========================================================
   TOUTPILOT — CRM
========================================================= */

.crm-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.crm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.crm-header h1 {
    margin: 5px 0;
    font-size: 30px;
    font-weight: 750;
}

.crm-header p,
.crm-panel-head p {
    color: var(--muted);
    margin: 5px 0 0;
}

.crm-eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.crm-nav {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.crm-nav a {
    padding: 12px 3px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.crm-nav a:hover,
.crm-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.crm-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.crm-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.crm-kpi > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.crm-kpi strong {
    font-size: 27px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.crm-kpi small {
    color: var(--muted);
    font-size: 12px;
}

.crm-columns {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
}

.crm-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
}

.crm-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.crm-panel-head h2 {
    font-size: 17px;
    margin: 0;
}

.crm-panel-head a {
    color: var(--accent);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.crm-contact-list,
.crm-task-list {
    display: flex;
    flex-direction: column;
}

.crm-contact,
.crm-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.crm-contact:last-child,
.crm-task:last-child {
    border-bottom: 0;
}

.crm-contact {
    color: var(--text);
    text-decoration: none;
}

.crm-contact:hover {
    opacity: .75;
}

.crm-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--bg-soft);
    color: var(--accent);
    font-weight: 800;
}

.crm-contact-info,
.crm-task > div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-contact-info strong,
.crm-task strong {
    font-size: 13px;
}

.crm-contact-info span,
.crm-task span,
.crm-task small {
    font-size: 12px;
    color: var(--muted);
}

.crm-badge,
.crm-priority {
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    padding: 5px 9px;
    white-space: nowrap;
}

.crm-badge.client {
    background: rgba(34, 160, 100, .12);
    color: #249b64;
}

.crm-badge.prospect {
    background: rgba(55, 130, 220, .12);
    color: #3985db;
}

.crm-priority.urgente,
.crm-priority.haute {
    color: #d94b4b;
    background: rgba(217, 75, 75, .10);
}

.crm-priority.normale {
    color: #3985db;
    background: rgba(55, 130, 220, .10);
}

.crm-priority.basse {
    color: var(--muted);
    background: var(--bg-soft);
}

.crm-empty {
    padding: 25px 10px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.crm-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.crm-quick-actions a {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color .2s, transform .2s;
}

.crm-quick-actions a:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.crm-quick-actions span {
    color: var(--muted);
    font-size: 12px;
}

/* =========================================
   SÉLECTEUR DES THÈMES
========================================= */

.theme-selector {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.theme-selector-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 7px 5px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}

.theme-option:hover {
    background: var(--bg);
}

.theme-option.is-active {
    background: var(--bg);
    border-color: var(--primary);
}

.theme-color {
    flex: 0 0 13px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--theme-color);
}

.theme-option > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-check {
    display: none;
    margin-left: auto;
}

.theme-option.is-active .theme-check {
    display: block;
}

.theme-option.is-active .theme-check::after {
    content: "✓";
    color: var(--primary);
    font-weight: 800;
}

/* Apparence : titre du menu déroulant */
details.theme-selector > summary.theme-selector-title,
details.theme-selector > summary.theme-selector-title * {
    font-weight: 400 !important;
    text-decoration: none !important;
}

details.theme-selector > summary.theme-selector-title {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

details.theme-selector > summary.theme-selector-title span {
    font-weight: 400 !important;
}
@media (max-width: 900px) {
    .crm-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .crm-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .crm-kpis {
        gap: 10px;
    }

    .crm-kpi {
        padding: 14px;
    }

    .crm-kpi strong {
        font-size: 22px;
    }

    .crm-quick-actions {
        grid-template-columns: 1fr;
    }

    .crm-panel {
        padding: 15px;
    }
}

/* ==========================================================
   CRM — PIPELINE RESPONSIVE
   ========================================================== */

/* Conteneur général du pipeline */
.crm-pipeline {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    min-width: 0;
    overflow: visible;
}

/* Colonnes des étapes */
.crm-stage {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* En-têtes des étapes */
.crm-stage-head {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Cartes des opportunités */
.crm-opportunity {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

/* Textes et montants */
.crm-opportunity h3,
.crm-opportunity p,
.crm-opportunity-amount {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Tablettes */
@media (max-width: 1200px) {
    .crm-pipeline {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .crm-pipeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .crm-stage {
        padding: 8px;
    }

    .crm-opportunity {
        padding: 10px;
    }
}

/* Très petits mobiles */
@media (max-width: 480px) {
    .crm-pipeline {
        grid-template-columns: minmax(0, 1fr);
    }

    .crm-stage {
        width: 100%;
    }
}


/* CRM — Actions alignées dans le tableau des prospects */
.crm-actions-inline {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    white-space: nowrap;
}

.crm-actions-inline form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.crm-actions-inline .crm-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 9px;
    margin: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.crm-actions-inline .crm-action-link:hover {
    text-decoration: underline;
}

.crm-actions-inline .link-danger {
    color: var(--danger);
}

/* Sur mobile, le tableau peut défiler horizontalement */
.crm-page .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.crm-page .table-wrap table {
    min-width: 750px;
}

@media (max-width: 600px) {
    .crm-actions-inline {
        gap: 8px;
    }
}



 
 
/* ==================================================
   ACTIONS DES TABLEAUX — CORRECTION DÉFINITIVE
   ================================================== */

td.actions {
    display: table-cell !important;
    vertical-align: middle !important;
    text-align: left !important;
    white-space: nowrap !important;
}

td.actions .crm-actions-inline {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    white-space: nowrap !important;
}

td.actions .crm-actions-inline form {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

td.actions .crm-actions-inline a,
td.actions .crm-actions-inline button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font: inherit;
    font-weight: 600;
    line-height: 1.5 !important;
    white-space: nowrap !important;
    text-decoration: none;
    cursor: pointer;
}

td.actions .crm-actions-inline .link-danger {
    color: var(--danger) !important;
}


 

/* =====================================================
   TOUTPILOT — HARMONISATION DES BOUTONS CRM
   ===================================================== */

/* Bouton principal */
.crm-page .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}

/* Bouton secondaire */
.crm-page .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-ring);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

.crm-page .btn-secondary:hover {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

/* Boutons des étapes du pipeline */
.crm-page .crm-stage-action {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.crm-page .crm-stage-action select {
    flex: 1;
    min-width: 0;
}

/* Bouton supprimer */
.crm-page .crm-delete-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 0;
    background: transparent;
    border: 0;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color .2s ease;
}

.crm-page .crm-delete-link:hover {
    color: #991b1b;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .crm-page .crm-stage-action {
        align-items: stretch;
    }

    .crm-page .crm-stage-action select,
    .crm-page .crm-stage-action button {
        width: 100%;
    }
}

/* ==========================================================
   CRM - TABLEAU RESPONSIVE
   ========================================================== */

/* Conteneur du tableau */
.crm-page .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

/* Tableau */
.crm-page .table-wrap table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

/* Cellules */
.crm-page .table-wrap th,
.crm-page .table-wrap td {
    padding: 14px 16px;
    vertical-align: middle;
    white-space: normal;
}

/* En-têtes */
.crm-page .table-wrap th {
    white-space: nowrap;
}

/* Actions */
.crm-page .table-wrap td.actions {
    white-space: nowrap !important;
}

.crm-page .crm-actions-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Téléphones et petites tablettes */
@media (max-width: 768px) {

    .crm-page {
        width: 100%;
        min-width: 0;
    }

    .crm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .crm-header .btn {
        width: 100%;
        justify-content: center;
    }

    .crm-panel {
        padding: 14px;
    }

    .crm-panel-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .crm-panel-head .filter {
        width: 100%;
    }

    .crm-panel-head .filter input {
        width: 100%;
        min-width: 0;
    }

    .crm-page .table-wrap table {
        min-width: 850px;
    }

    .crm-page .table-wrap th,
    .crm-page .table-wrap td {
        padding: 12px;
        font-size: 13px;
    }

    .crm-page .crm-actions-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-page .crm-actions-inline a,
    .crm-page .crm-actions-inline button {
        width: 100%;
        justify-content: center;
    }

    .crm-page .crm-actions-inline form {
        width: 100%;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {

    .crm-header h1 {
        font-size: 24px;
    }

    .crm-panel {
        padding: 10px;
    }

    .crm-page .table-wrap table {
        min-width: 800px;
    }
}

.document-sharing {
    grid-column: 1 / -1;
    width: 100%;
}

.employee-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.employee-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 10px;
    cursor: pointer;
}

.employee-checkbox input {
    width: auto;
    margin: 0;
}

.employee-checkbox small {
    margin-left: auto;
    opacity: .65;
}

.employee-checkbox:hover {
    background: var(--bg-secondary, #f5f5f5);
}

/* =========================================================
   TOUTPILOT — ESPACE SALARIÉ : MES DOCUMENTS
========================================================= */

.employee-documents-page {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    color: var(--text, #1e293b);
}

/* EN-TÊTE */

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.documents-eyebrow {
    display: inline-block;
    margin-bottom: 9px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 1.4px;
    color: var(--primary, #4f46e5);
}

.documents-header h1 {
    margin: 0;
    font-size: clamp(25px, 3vw, 32px);
    font-weight: 750;
    letter-spacing: -1px;
}

.documents-header p {
    margin: 9px 0 0;
    color: var(--muted, #64748b);
    font-size: 14px;
    line-height: 1.6;
}

.documents-header-icon {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    background: rgba(79, 70, 229, .10);
    color: var(--primary, #4f46e5);
    font-size: 25px;
}

/* STATISTIQUES */

.documents-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.documents-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    padding: 21px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 15px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .035);
}

.documents-stat-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-size: 20px;
}

.documents-icon-blue {
    background: var(--accent-soft);
    color: #4263eb;
}

.documents-icon-green {
    background: #e6f8ef;
    color: #169b62;
}

.documents-icon-purple {
    background: #f1eaff;
    color: #8755d8;
}

.documents-stat-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted, #64748b);
    font-size: 12px;
}

.documents-stat-card strong {
    display: block;
    font-size: 25px;
    font-weight: 750;
    line-height: 1.2;
}

/* PANNEAU PRINCIPAL */

.documents-panel {
    overflow: hidden;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    box-shadow: 0 3px 15px rgba(15, 23, 42, .035);
}

.documents-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 23px 25px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.documents-panel-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 750;
}

.documents-panel-header p {
    margin: 6px 0 0;
    color: var(--muted, #64748b);
    font-size: 13px;
}

.documents-count {
    padding: 7px 12px;
    border-radius: 20px;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--muted, #64748b);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

/* TABLEAU */

.documents-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.documents-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.documents-table thead {
    background: var(--bg-secondary, #f8fafc);
}

.documents-table th {
    padding: 14px 20px;
    text-align: left;
    color: var(--muted, #64748b);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .8px;
    white-space: nowrap;
}

.documents-table td {
    padding: 17px 20px;
    border-top: 1px solid var(--border, #e5e7eb);
    vertical-align: middle;
}

.documents-table tbody tr {
    transition: background .2s ease;
}

.documents-table tbody tr:hover {
    background: var(--bg-secondary, #f8fafc);
}

/* FICHIER */

.documents-file {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.documents-file-icon {
    width: 41px;
    height: 41px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 18px;
}

.file-icon-document {
    background: var(--accent-soft);
    color: #4263eb;
}

.file-icon-paie {
    background: #f1eaff;
    color: #8755d8;
}

.documents-file-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.documents-file-info strong {
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.documents-file-info span {
    max-width: 260px;
    color: var(--muted, #64748b);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* BADGES */

.documents-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.badge-document {
    background: var(--accent-soft);
    color: #4263eb;
}

.badge-paie {
    background: #f1eaff;
    color: #8755d8;
}

/* INFORMATIONS */

.documents-size {
    color: var(--muted, #64748b);
    font-size: 12px;
    white-space: nowrap;
}

.documents-date {
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
}

/* BOUTON TÉLÉCHARGEMENT */

.documents-action-heading {
    text-align: right !important;
}

.documents-action-cell {
    text-align: right;
}

.documents-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--primary, #4f46e5);
    border-radius: 9px;
    background: var(--primary, #4f46e5);
    color: var(--on-accent) !important;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none !important;
    white-space: nowrap;
    transition: .2s ease;
}

.documents-download-btn:hover {
    filter: brightness(.92);
    transform: translateY(-1px);
}

/* PIED DU PANNEAU */

.documents-panel-footer {
    padding: 15px 22px;
    border-top: 1px solid var(--border, #e5e7eb);
    background: var(--bg-secondary, #f8fafc);
}

.documents-panel-footer span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted, #64748b);
    font-size: 11px;
}

.documents-panel-footer svg {
    flex-shrink: 0;
    color: #16a36a;
}

/* AUCUN DOCUMENT */

.documents-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 65px 25px;
    text-align: center;
}

.documents-empty-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 19px;
    border-radius: 20px;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--muted, #64748b);
    font-size: 27px;
}

.documents-empty h3 {
    margin: 0 0 9px;
    font-size: 17px;
    font-weight: 750;
}

.documents-empty p {
    max-width: 420px;
    margin: 0;
    color: var(--muted, #64748b);
    font-size: 13px;
    line-height: 1.7;
}

/* RESPONSIVE */

@media (max-width: 850px) {

    .documents-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .documents-stat-card:last-child {
        grid-column: 1 / -1;
    }

}

@media (max-width: 600px) {

    .documents-header {
        align-items: flex-start;
    }

    .documents-header-icon {
        width: 45px;
        height: 45px;
        border-radius: 13px;
        font-size: 20px;
    }

    .documents-header p {
        font-size: 13px;
    }

    .documents-stats {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .documents-stat-card:last-child {
        grid-column: auto;
    }

    .documents-stat-card {
        padding: 15px;
    }

    .documents-panel-header {
        padding: 18px;
    }

    .documents-panel-footer {
        padding: 13px 16px;
    }

}

/* =========================================
   TOUTPILOT - COMPTEUR NOTIFICATIONS
========================================= */

/* Masquer définitivement l'ancien point rouge */
.bell-dot,
.bell summary::after,
.bell summary::before {
    display: none !important;
    content: none !important;
}

/* Positionnement de la cloche */
.bell summary {
    position: relative;
    overflow: visible !important;
}

/* Pastille avec le nombre */
.bell-count {
    position: absolute !important;
    top: -5px !important;
    right: -7px !important;

    display: flex !important;
    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;
    padding: 0 5px;

    background: var(--danger) !important;
    color: #ffffff !important;

    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1;

    border: 2px solid #ffffff;
    border-radius: 50px;

    box-sizing: border-box;
    z-index: 100;
}

/* Notifications */

.notification-form {
    margin: 0;
    width: 100%;
}

.notification-item {
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.notification-item.is-read {
    opacity: 0.55;
}

.notification-item.is-unread {
    background: var(--surface-hover, rgba(0, 0, 0, 0.035));
}

.notification-text {
    flex: 1;
}

.notification-new {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.10);
    padding: 3px 6px;
    border-radius: 5px;
}



/* ==========================================================
   ToutPilot — actions documentaires et agenda interactif
   ========================================================== */
.resource-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    min-width: 260px;
}
.resource-actions .inline-form {
    display: inline-flex;
    margin: 0;
}
.tp-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.tp-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 9px rgba(15, 23, 42, .09);
}
.tp-action svg { width: 14px; height: 14px; }
.tp-action-view { color: #2457a7; background: var(--accent-soft); border-color: var(--accent-ring); }
.tp-action-view:hover { background: var(--accent-ring); }
.tp-action-pdf { color: #a83232; background: #fff1f1; border-color: #fee2e2; }
.tp-action-pdf:hover { background: #ffe1e1; }
.tp-action-duplicate { color: #6d45a5; background: #f5f0ff; border-color: #e9ddff; }
.tp-action-duplicate:hover { background: #ede3ff; }
.tp-action-invoice { color: #087f68; background: #eafaf5; border-color: #c8f0e4; }
.tp-action-invoice:hover { background: #d8f5eb; }
.tp-action-payment { color: #8a5b08; background: #fff8e8; border-color: #f8e8bd; }
.tp-action-payment:hover { background: #fff0c9; }
.tp-action-paid { color: #087443; background: #e9f8ef; border-color: #c8eed7; cursor: default; }
.tp-action-edit { color: var(--text); background: var(--bg-soft); border-color: var(--border); }
.tp-action-edit:hover { background: var(--border); }
.tp-action-delete { color: #b42318; background: #fff1f0; border-color: #fee4e2; }
.tp-action-delete:hover { background: #ffe2df; }
.tp-action-delete,
.tp-action-payment { font-family: inherit; }

.cal-day-create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    border-radius: 9px;
    color: inherit;
    font-weight: 750;
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
}
.cal-day-create:hover {
    color: var(--on-accent);
    background: var(--primary, #315efb);
}
.cal-cell { position: relative; }
.cal-cell:hover { background: color-mix(in srgb, var(--primary, #315efb) 4%, transparent); }
@media (max-width: 760px) {
    .resource-actions { min-width: 0; }
    .tp-action { min-height: 32px; padding: 6px 8px; font-size: 11px; }
}


/* Statistiques par période */
.stats-period-panel { margin-bottom: 22px; }
.stats-period-panel .panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.stats-period-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.stats-period-filter select,
.stats-period-filter input {
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--border, #dbe3ef);
    border-radius: 9px;
    background: var(--surface, #fff);
    color: inherit;
}
.stats-period-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.stats-period-grid article {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: var(--surface, #fff);
}
.stats-period-grid article span { color: var(--muted, #64748b); font-size: 12px; font-weight: 600; }
.stats-period-grid article strong { font-size: 23px; line-height: 1.2; font-weight: 750; }
.stats-period-grid article small { color: var(--muted, #64748b); font-size: 11px; }
@media (max-width: 900px) {
    .stats-period-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .stats-period-grid { grid-template-columns: 1fr; }
    .stats-period-filter { width: 100%; }
    .stats-period-filter select,
    .stats-period-filter input { flex: 1 1 100%; }
}

/* Recherche client dans les formulaires de devis et factures */
#clientSearch {
    width: 100%;
    min-height: 40px;
    margin-bottom: 7px;
    padding: 9px 12px;
    border: 1px solid var(--border, #dbe3ef);
    border-radius: 9px;
    background: var(--surface, #fff);
    color: inherit;
}
#clientSearch:focus {
    outline: 3px solid rgba(49, 94, 251, .12);
    border-color: var(--primary, #315efb);
}

/* ============================================================
   19. STATISTIQUES — présentation compacte et professionnelle
   Surcharge limitée à la page statistiques.
   ============================================================ */

body:has(.stats-period-panel) .page-head {
    margin-bottom: 18px;
}

body:has(.stats-period-panel) .page-head h1 {
    font-size: 1.55rem;
    letter-spacing: -.035em;
}

body:has(.stats-period-panel) .page-sub {
    font-size: .84rem;
}

body:has(.stats-period-panel) .kpis-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

body:has(.stats-period-panel) .kpi {
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    column-gap: 11px;
    row-gap: 3px;
    min-width: 0;
    padding: 13px 15px;
    border-radius: 12px;
}

body:has(.stats-period-panel) .kpi-top {
    display: contents;
}

body:has(.stats-period-panel) .kpi-ico {
    grid-row: 1 / span 2;
    width: 36px;
    height: 36px;
}

body:has(.stats-period-panel) .kpi-ico .ic {
    width: 19px;
    height: 19px;
}

body:has(.stats-period-panel) .kpi-label {
    align-self: end;
    font-size: .78rem;
    line-height: 1.25;
    font-weight: 600;
}

body:has(.stats-period-panel) .kpi-value {
    align-self: start;
    margin-top: 0;
    font-size: 1.28rem;
    line-height: 1.2;
    letter-spacing: -.025em;
    white-space: normal;
    overflow-wrap: anywhere;
}

.stats-period-panel {
    margin-bottom: 18px;
    padding: 17px 19px;
}

.stats-period-panel .panel-head {
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 0;
}

.stats-period-panel .panel-head h2 {
    font-size: .98rem;
    margin-bottom: 3px;
}

.stats-period-panel .panel-head .muted {
    margin: 0;
    font-size: .78rem;
}

.stats-period-filter {
    gap: 6px;
}

.stats-period-filter select,
.stats-period-filter input {
    min-height: 34px;
    height: 34px;
    padding: 5px 9px;
    font: inherit;
    font-size: .78rem;
    border-radius: 8px;
}

.stats-period-filter select {
    min-width: 155px;
}

.stats-period-filter input {
    width: 132px;
}

.stats-period-filter .btn {
    min-height: 34px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: .78rem;
}

.stats-period-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
    margin-top: 15px;
}

.stats-period-grid article {
    min-width: 0;
    gap: 4px;
    padding: 12px 13px;
    border-radius: 10px;
    background: var(--bg-soft);
    border-color: var(--border);
}

.stats-period-grid article span {
    font-size: .72rem;
    line-height: 1.3;
    font-weight: 600;
}

.stats-period-grid article strong {
    font-size: 1.28rem;
    line-height: 1.25;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.stats-period-grid article small {
    font-size: .69rem;
    line-height: 1.35;
}

body:has(.stats-period-panel) .grid-charts {
    gap: 16px;
}

body:has(.stats-period-panel) .grid-charts.equal {
    margin-bottom: 16px;
}

body:has(.stats-period-panel) .grid-charts .panel {
    padding: 16px 18px;
}

body:has(.stats-period-panel) .grid-charts .panel-head {
    margin-bottom: 12px;
}

body:has(.stats-period-panel) .grid-charts .panel-head h2 {
    font-size: .94rem;
}

body:has(.stats-period-panel) .hbars {
    gap: 12px;
}

body:has(.stats-period-panel) .hbars li {
    grid-template-columns: 82px minmax(0, 1fr) 28px;
    gap: 9px;
    font-size: .8rem;
}

body:has(.stats-period-panel) .hbar {
    height: 8px;
}

body:has(.stats-period-panel) table.mini th,
body:has(.stats-period-panel) table.mini td {
    padding: .48rem .35rem;
    font-size: .78rem;
}

@media (max-width: 1100px) {
    .stats-period-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-period-filter {
        width: 100%;
    }
}

@media (max-width: 760px) {
    body:has(.stats-period-panel) .kpis-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-period-panel .panel-head {
        align-items: flex-start;
    }

    .stats-period-filter select {
        flex: 1 1 100%;
    }

    .stats-period-filter input {
        flex: 1 1 calc(50% - 6px);
        width: auto;
    }

    .stats-period-filter .btn {
        flex: 1 1 100%;
    }

    .stats-period-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body:has(.stats-period-panel) .grid-charts.equal {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    body:has(.stats-period-panel) .kpis-6,
    .stats-period-grid {
        grid-template-columns: 1fr;
    }

    body:has(.stats-period-panel) .kpi {
        padding: 11px 13px;
    }
}

/* ==========================================================
   TOUTPILOT — ACTIONS DES DEVIS ET FACTURES
   Alignement, espacement et séparation des groupes
   ========================================================== */

/* Conteneur des boutons */
.resource-actions {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 340px;
    padding: 12px 14px !important;
    vertical-align: middle;
}

/* Formulaires des boutons POST */
.resource-actions .inline-form,
.resource-actions > form {
    display: inline-flex;
    align-items: center;
    margin: 0 !important;
    padding: 0;
    flex: 0 0 auto;
}

/* Style commun des boutons */
.resource-actions .tp-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--border, #dbe3ef);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #334155);
    font-family: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease,
                color .18s ease, transform .18s ease;
}

/* Icônes */
.resource-actions .tp-action .ic,
.resource-actions .tp-action svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Survol général */
.resource-actions .tp-action:hover {
    transform: translateY(-1px);
}

/* Voir */
.resource-actions .tp-action-view {
    color: var(--accent);
    border-color: #bfdbfe;
    background: var(--accent-soft);
}

.resource-actions .tp-action-view:hover {
    background: var(--accent-ring);
}

/* PDF */
.resource-actions .tp-action-pdf {
    color: var(--danger);
    border-color: #fecaca;
    background: #fef2f2;
}

.resource-actions .tp-action-pdf:hover {
    background: #fee2e2;
}

/* Dupliquer */
.resource-actions .tp-action-duplicate {
    color: var(--text);
    background: var(--surface, #fff);
}

.resource-actions .tp-action-duplicate:hover {
    background: var(--bg-soft);
}

/* Facturer */
.resource-actions .tp-action-invoice {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.resource-actions .tp-action-invoice:hover {
    background: #d1fae5;
}

/* Modifier */
.resource-actions .tp-action-edit {
    color: var(--accent);
    border-color: #c7d2fe;
    background: #eef2ff;
}

.resource-actions .tp-action-edit:hover {
    background: #e0e7ff;
}

/* Paiement */
.resource-actions .tp-action-payment {
    color: #0369a1;
    border-color: #bae6fd;
    background: #f0f9ff;
}

.resource-actions .tp-action-payment:hover {
    background: #e0f2fe;
}

/* Déjà payé */
.resource-actions .tp-action-paid {
    color: #15803d;
    border-color: #bbf7d0;
    background: #f0fdf4;
    cursor: default;
}

/* Suppression */
.resource-actions .tp-action-delete {
    color: var(--danger);
    border-color: #fecaca;
    background: #fff1f2;
}

.resource-actions .tp-action-delete:hover {
    background: #ffe4e6;
    border-color: #fda4af;
}

/* ----------------------------------------------------------
   SÉPARATION DES GROUPES
   ---------------------------------------------------------- */

/* Séparation avant les actions secondaires */
.resource-actions > .inline-form:has(.tp-action-duplicate),
.resource-actions > .inline-form:has(.tp-action-invoice) {
    margin-left: 9px !important;
    padding-left: 12px;
    border-left: 1px solid var(--border, #dbe3ef);
}

/* Séparation avant Modifier */
.resource-actions > .tp-action-edit {
    margin-left: 9px;
    padding-left: 13px;
    border-left: 1px solid var(--border, #dbe3ef);
}

/* Séparation avant Supprimer */
.resource-actions > form:has(.tp-action-delete) {
    margin-left: 5px !important;
    padding-left: 12px;
    border-left: 1px solid var(--border, #dbe3ef);
}

/* ----------------------------------------------------------
   TABLETTE ET MOBILE
   ---------------------------------------------------------- */

@media (max-width: 900px) {
    .resource-actions {
        min-width: 300px;
        gap: 6px;
    }

    .resource-actions .tp-action {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 11px;
    }
}

@media (max-width: 560px) {
    .resource-actions {
        min-width: 260px;
        gap: 6px;
        padding: 10px !important;
    }
}


/* Espacement entre les boutons Voir, PDF et PAYÉ */
.resource-actions > .tp-action,
.resource-actions > .inline-form {
    margin-right: 6px;
}

.resource-actions {
    column-gap: 8px;
    row-gap: 8px;
}


/* Espacement entre toutes les actions des devis */
.resource-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px !important;
}

/* Espacement des formulaires contenant les boutons */
.resource-actions .inline-form {
    margin: 0 !important;
}

/* Boutons avec dimensions homogènes */
.resource-actions .tp-action {
    min-height: 35px;
    padding: 8px 12px;
    white-space: nowrap;
}

/* Espacement spécifique avant Modifier */
.resource-actions .tp-action-edit {
    margin-left: 6px;
}

/* Espacement avant Supprimer */
.resource-actions form:has(.tp-action-delete) {
    margin-left: 6px !important;
}

* ============================================================
   AGENDA — GESTION DIRECTE DES RENDEZ-VOUS
   ============================================================ */
.agenda-page-head { align-items: center; gap: 18px; }
.agenda-page-head h1 { margin-bottom: 4px; }
.agenda-page-head .muted { margin: 0; }
.agenda-actions { align-items: center; flex-wrap: wrap; }
.agenda-month-label { min-width: 130px; text-align: center; text-transform: capitalize; }
.agenda-day { cursor: pointer; transition: background .15s ease; }
.agenda-day:hover { background: var(--bg-soft); }
.agenda-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.agenda-day-top { display: flex; justify-content: space-between; align-items: center; min-height: 25px; }
.agenda-day-add { border: 0; background: transparent; color: var(--muted); border-radius: 6px; width: 25px; height: 25px; font-size: 19px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.agenda-day:hover .agenda-day-add, .agenda-day-add:focus-visible { opacity: 1; }
.agenda-day-add:hover { background: var(--border); color: var(--text); }
.agenda-event { width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit; line-height: 1.35; }
.agenda-event span { font-weight: 800; margin-right: 3px; }
.agenda-feedback { display: none; margin: 0 0 14px; padding: 11px 14px; border-radius: 9px; background: #e9f8ef; color: #17663a; font-size: .9rem; }
.agenda-feedback.is-visible { display: block; }
.agenda-feedback.is-error { background: #fff0f0; color: #a32222; }
.agenda-modal { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; }
.agenda-modal.is-open { display: flex; }
.agenda-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .58); backdrop-filter: blur(3px); }
.agenda-modal-dialog { position: relative; z-index: 1; width: min(100%, 590px); max-height: min(90vh, 760px); overflow-y: auto; padding: 25px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.agenda-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.agenda-modal-header h2 { margin: 4px 0 0; font-size: 1.45rem; }
.agenda-modal-eyebrow { color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.agenda-modal-close { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); color: var(--text); font-size: 25px; line-height: 1; cursor: pointer; }
.agenda-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.agenda-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: var(--text); font-size: .88rem; font-weight: 650; }
.agenda-field-full { grid-column: 1 / -1; }
.agenda-field input, .agenda-field select, .agenda-field textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg, var(--surface)); color: var(--text); font: inherit; font-weight: 400; }
.agenda-field textarea { resize: vertical; }
.agenda-field input:focus, .agenda-field select:focus, .agenda-field textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); }
.agenda-form-error { min-height: 0; margin-top: 12px; color: var(--danger); font-size: .88rem; }
.agenda-form-footer, .agenda-modal-footer { display: flex; align-items: center; gap: 9px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--border); }
.agenda-footer-spacer { flex: 1; }
.agenda-modal-open { overflow: hidden; }
@media (max-width: 900px) {
    .agenda-page-head { align-items: flex-start; flex-direction: column; }
    .agenda-actions { width: 100%; }
    .agenda-day-add { opacity: 1; }
}
@media (max-width: 600px) {
    .agenda-calendar { gap: 1px; }
    .agenda-calendar .cal-head { padding: .45rem .1rem; font-size: .72rem; }
    .agenda-calendar .cal-cell { min-height: 82px; padding: .25rem; }
    .agenda-day-top { min-height: 22px; }
    .agenda-day-add { width: 20px; height: 20px; font-size: 16px; }
    .agenda-event { padding: .2rem .25rem; font-size: .66rem; white-space: normal; overflow-wrap: anywhere; }
    .agenda-event span { display: block; margin: 0 0 1px; }
    .agenda-modal { padding: 10px; }
    .agenda-modal-dialog { padding: 19px; border-radius: 14px; }
    .agenda-form-grid { grid-template-columns: 1fr; gap: 13px; }
    .agenda-field-full { grid-column: auto; }
    .agenda-modal-footer { flex-wrap: wrap; }
    .agenda-modal-footer .btn { padding-left: 10px; padding-right: 10px; }
    .agenda-month-label { min-width: auto; }
}

/* Agenda — mini-fenêtre discrète heure + note */
.agenda-page-head { align-items: center; gap: 18px; }
.agenda-page-head h1 { margin-bottom: 4px; }
.agenda-page-head .muted { margin: 0; }
.agenda-actions { align-items: center; flex-wrap: wrap; }
.agenda-month-label { min-width: 130px; text-align: center; text-transform: capitalize; }
.agenda-day { cursor: default; transition: background .15s ease; }
.agenda-day:hover { background: var(--bg-soft); }
.agenda-day-top { display: flex; align-items: center; min-height: 25px; }
.agenda-event { display: flex !important; align-items: baseline; gap: 6px; width: 100%; margin-top: 4px; padding: 4px 6px !important; border: 0; border-radius: 5px; text-align: left; cursor: pointer; font: inherit; line-height: 1.25; overflow: hidden; }
.agenda-event-time { flex: 0 0 auto; font-weight: 800; }
.agenda-event-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* La fenêtre est un véritable overlay indépendant du calendrier. */
.agenda-mini {
    position: fixed !important;
    top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    z-index: 2147483000 !important;
    display: none; align-items: center; justify-content: center;
    box-sizing: border-box; padding: 12px;
    margin: 0 !important; transform: none !important;
}
.agenda-mini.is-open { display: flex !important; }
.agenda-mini-backdrop {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    width: 100%; height: 100%; border: 0; margin: 0; padding: 0;
    background: rgba(15,23,42,.32); cursor: default;
}
.agenda-mini-card {
    position: relative; z-index: 1; flex: 0 0 auto;
    width: min(100%, 330px); max-height: calc(100vh - 24px); overflow-y: auto;
    box-sizing: border-box; padding: 17px 18px 14px;
    border: 1px solid var(--border); border-radius: 13px;
    background: var(--surface); color: var(--text);
    box-shadow: 0 16px 55px rgba(0,0,0,.24);
}
.agenda-mini-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.agenda-mini-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.agenda-mini-date { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }
.agenda-mini-x { width: 27px; height: 27px; padding: 0; border: 0; border-radius: 7px; background: var(--bg-soft); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.agenda-mini-label { display: block; margin: 10px 0 5px; color: var(--text); font-size: .8rem; font-weight: 650; }
.agenda-mini-time, .agenda-mini-notes { display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg, var(--surface)); color: var(--text); font: inherit; font-size: .9rem; }
.agenda-mini-time { max-width: 145px; }
.agenda-mini-notes { min-height: 72px; resize: vertical; }
.agenda-mini-time:focus, .agenda-mini-notes:focus { outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); }
.agenda-mini-error { min-height: 0; margin-top: 7px; color: var(--danger); font-size: .78rem; }
.agenda-mini-actions { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.agenda-mini-spacer { flex: 1; }
.agenda-mini-actions .btn { min-height: 32px; padding: 6px 10px; font-size: .8rem; }
.agenda-modal-open { overflow: hidden; }
@media (max-width: 700px) {
  .agenda-page-head { align-items: flex-start; flex-direction: column; }
  .agenda-actions { width: 100%; }
  .agenda-calendar { gap: 1px; }
  .agenda-calendar .cal-head { padding: .45rem .1rem; font-size: .72rem; }
  .agenda-calendar .cal-cell { min-height: 82px; padding: .25rem; }
  .agenda-event { display: block !important; padding: .2rem .25rem !important; font-size: .66rem; white-space: normal; overflow-wrap: anywhere; }
  .agenda-event-time { display: block; }
  .agenda-event-note { display: block; white-space: nowrap; }
}

/* =====================================================
   TOUTPILOT — AGENDA MODERNE
===================================================== */

.agenda-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}

.agenda-page-head h1 {
    font-size: 27px;
    font-weight: 750;
    letter-spacing: -0.8px;
    margin: 0 0 6px;
}

.agenda-page-head p {
    font-size: 13px;
    margin: 0;
    opacity: .65;
}

.agenda-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.agenda-actions .btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.agenda-month-label {
    font-size: 15px;
    font-weight: 700;
    min-width: 125px;
    text-align: center;
    text-transform: capitalize;
}

/* CALENDRIER */

.agenda-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 9px;
    width: 100%;
}

.agenda-calendar .cal-head {
    text-align: center;
    padding: 12px 5px;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .7px;
    opacity: .55;
}

.agenda-calendar .cal-cell {
    position: relative;
    min-width: 0;
    min-height: 125px;
    padding: 10px;
    border: 1px solid var(--border, #e8eaf0);
    border-radius: 12px;
    background: var(--surface, #fff);
    transition: border-color .2s, box-shadow .2s, transform .2s;
    cursor: pointer;
    overflow: hidden;
}

.agenda-calendar .cal-cell:not(.cal-empty):hover {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 5px 18px rgba(30, 41, 59, .07);
    transform: translateY(-2px);
}

.agenda-calendar .cal-empty {
    background: transparent;
    border: 1px dashed var(--border, #e8eaf0);
    opacity: .35;
    cursor: default;
}

.agenda-day-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
}

.agenda-calendar .cal-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
}

.agenda-calendar .cal-today {
    border: 1px solid var(--primary, #6366f1);
    background: rgba(99, 102, 241, .035);
}

.agenda-calendar .cal-today .cal-day {
    color: white;
    background: var(--primary, #6366f1);
}

/* RENDEZ-VOUS */

.agenda-event {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    margin: 5px 0;
    padding: 7px 8px;
    border: 0;
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    background: rgba(99, 102, 241, .09);
    color: var(--text, #252b3b);
    text-align: left;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.agenda-event:hover {
    background: rgba(99, 102, 241, .17);
    transform: translateX(2px);
}

.agenda-event-time {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    color: var(--primary, #6366f1);
}

.agenda-event-note {
    min-width: 0;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 550;
    overflow-wrap: anywhere;
}

/* MESSAGE */

.agenda-feedback {
    margin-bottom: 10px;
    font-size: 12px;
}

/* =====================================================
   MINI-FENÊTRE DE RENDEZ-VOUS
===================================================== */

#agenda-mini {
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#agenda-mini-backdrop {
    background: rgba(15, 23, 42, .48) !important;
    backdrop-filter: blur(3px);
}

.agenda-mini-dialog {
    width: 100% !important;
    max-width: 350px !important;
    padding: 22px !important;
    border: 1px solid var(--border, #e5e7eb) !important;
    border-radius: 18px !important;
    background: var(--surface, #fff) !important;
    color: var(--text, #1f2937) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .22) !important;
    animation: agendaModalIn .2s ease-out;
}

#agenda-mini-title {
    font-size: 17px !important;
    font-weight: 750 !important;
    letter-spacing: -.4px;
}

#agenda-mini-date {
    font-size: 12px !important;
    opacity: .6;
}

#agenda-mini-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px !important;
    font-size: 22px !important;
    transition: background .2s;
}

#agenda-mini-close:hover {
    background: rgba(127, 127, 127, .12) !important;
}

#agenda-form label {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .1px;
    opacity: .8;
}

#agenda-time,
#agenda-notes {
    display: block;
    width: 100%;
    border: 1px solid var(--border, #e5e7eb) !important;
    border-radius: 10px !important;
    padding: 11px 12px !important;
    background: var(--bg, #fff) !important;
    color: var(--text, #1f2937) !important;
    font-family: inherit;
    font-size: 13px !important;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

#agenda-time:focus,
#agenda-notes:focus {
    border-color: var(--primary, #6366f1) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

#agenda-notes {
    min-height: 90px;
    line-height: 1.5;
}

#agenda-notes::placeholder {
    opacity: .45;
}

#agenda-form-error {
    font-size: 12px;
    line-height: 1.5;
}

#agenda-mini .btn {
    min-height: 35px;
    padding: 0 13px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    transition: transform .15s, opacity .15s;
}

#agenda-mini .btn:hover {
    transform: translateY(-1px);
}

#agenda-mini .btn:disabled {
    opacity: .5;
    cursor: wait;
}

@keyframes agendaModalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* RESPONSIVE */

@media (max-width: 850px) {
    .agenda-calendar {
        gap: 5px;
    }

    .agenda-calendar .cal-cell {
        min-height: 105px;
        padding: 6px;
    }

    .agenda-event {
        display: block;
        padding: 5px;
    }

    .agenda-event-time,
    .agenda-event-note {
        display: block;
    }
}

@media (max-width: 560px) {
    .agenda-page-head {
        align-items: flex-start;
    }

    .agenda-actions {
        width: 100%;
        justify-content: space-between;
    }

    .agenda-month-label {
        min-width: 0;
    }

    .agenda-calendar {
        gap: 3px;
    }

    .agenda-calendar .cal-head {
        padding: 7px 1px;
        font-size: 9px;
    }

    .agenda-calendar .cal-cell {
        min-height: 75px;
        padding: 3px;
        border-radius: 7px;
    }

    .agenda-calendar .cal-day {
        width: 23px;
        height: 23px;
        font-size: 10px;
    }

    .agenda-event {
        padding: 4px 3px;
        margin: 3px 0;
        border-left-width: 2px;
    }

    .agenda-event-time {
        font-size: 9px;
    }

    .agenda-event-note {
        font-size: 9px;
    }
}
/* =====================================================
   ABONNEMENTS — CORRECTION DU GROS ANNEAU
===================================================== */

/* Masquer le bouton radio natif */
.tp-plan-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
    outline: none !important;
}

/* Carte non sélectionnée */
.tp-plan-option {
    position: relative;
    border: 1px solid var(--tp-set-border);
    border-radius: 12px;
    transition: border-color .2s ease, background .2s ease;
}

/* Carte sélectionnée */
.tp-plan-option:has(input[type="radio"]:checked) {
    border: 2px solid var(--tp-set-primary);
    padding: 17px;
    background: var(--accent-faint);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Petit indicateur de sélection */
.tp-plan-option:has(input[type="radio"]:checked)::after {
    content: "✓";
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tp-set-primary);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 800;
}

/* Focus clavier discret */
.tp-plan-option input[type="radio"]:focus-visible {
    outline: 2px solid var(--tp-set-primary) !important;
    outline-offset: 4px;
}

.pl .employee-area-nav {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:0 0 20px;
    padding-bottom:12px;
    border-bottom:1px solid var(--bd);
}

.pl .employee-area-nav a {
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 15px;
    border-radius:9px;
    color:var(--mut);
    text-decoration:none;
    font-size:13px;
    font-weight:600;
    transition:.2s;
}

.pl .employee-area-nav a:hover {
    background:var(--bg);
    color:var(--tx);
}

.pl .employee-area-nav a.active {
    background:var(--pri);
    color:white;
}

/* Couleurs des actions dans le tableau des prospects */
.crm-page .crm-actions-inline a.crm-action-fiche,
.crm-page .crm-actions-inline a.crm-action-fiche:visited {
    color: var(--accent) !important;
}

.crm-page .crm-actions-inline a.crm-action-modifier,
.crm-page .crm-actions-inline a.crm-action-modifier:visited {
    color: var(--muted) !important;
}

.crm-page .crm-actions-inline a.crm-action-fiche:hover,
.crm-page .crm-actions-inline a.crm-action-modifier:hover {
    text-decoration: underline !important;
}

/* ============================================================
   UI PRO v2 — Boutons homogènes et CRM simplifié
   (ajout en fin de fichier : ne modifie aucune règle existante)
   ============================================================ */

/* ---- Boutons génériques manquants ---- */
.btn-secondary {
    background: var(--bg-soft);
    border-color: var(--border);
    color: var(--text);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--accent); }

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover { filter: brightness(.93); }

.btn-outline-primary {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}
.btn-outline-primary:hover { background: var(--accent); color: var(--on-accent); }

.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Boutons de la page Paramètres */
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: .6rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .93rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, filter .15s;
}
.tp-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tp-btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.tp-btn-secondary { background: var(--bg-soft); }
.tp-btn-secondary:hover { border-color: var(--accent); }

/* Bouton « Modifier » de la liste des salariés */
.employee-action-btn.edit { color: var(--accent); }

/* ---- Boutons d'action des tableaux CRM (Fiche / Modifier / Convertir / Supprimer) ---- */
.crm-page .crm-actions-inline { gap: 8px; }

.crm-page .crm-actions-inline a.crm-action-link,
.crm-page .crm-actions-inline button.crm-action-link {
    min-height: 34px;
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s, border-color .15s, color .15s;
}
.crm-page .crm-actions-inline a.crm-action-link:hover,
.crm-page .crm-actions-inline button.crm-action-link:hover {
    background: var(--bg-soft);
    border-color: var(--accent);
    color: var(--accent) !important;
}
.crm-page .crm-actions-inline a.crm-action-fiche {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent) !important;
}
.crm-page .crm-actions-inline a.crm-action-fiche:hover {
    background: var(--accent-d);
    border-color: var(--accent-d);
    color: var(--on-accent) !important;
}
.crm-page .crm-actions-inline .link-danger {
    border-color: #f3c5cb;
    color: var(--danger) !important;
}
.crm-page .crm-actions-inline .link-danger:hover {
    background: var(--err-bg);
    border-color: var(--danger);
    color: var(--danger) !important;
}

/* ---- Boutons CRM génériques (en-têtes, fiches) ---- */
.crm-page .btn-ghost { border-color: var(--border); }
.crm-page .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.crm-page .btn-sm { min-height: 34px; padding: 6px 13px; font-size: 13px; }
.crm-page .head-actions,
.crm-page .crm-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---- Barre d'outils des listes CRM (recherche + export) ---- */
.crm-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.crm-page .crm-panel-head .crm-toolbar .filter { margin: 0; }

/* ---- Pastilles de statut ---- */
.crm-stage-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

/* ============================================================
   Pipeline commercial (crm/pipeline.php) — aux couleurs du thème
   ============================================================ */
.pl-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: start;
}

.pl-col {
    display: flex;
    flex-direction: column;
    min-height: 450px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-soft);
}

.pl-col-head {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    background: var(--surface);
}

.pl-col-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.pl-count {
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
}

.pl-col-total {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.pl-dropzone {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 350px;
    padding: 10px;
}

.pl-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: grab;
}

.pl-card:hover {
    border-color: var(--accent);
}

.pl-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 6px;
}

.pl-card-contact {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.pl-card-amount {
    font-size: 13px;
    color: var(--text);
}

.pl-card-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
}

.pl-card-title a {
    color: var(--text);
    text-decoration: none;
}

.pl-card-title a:hover {
    color: var(--accent);
}

.pl-card-meta {
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--muted);
}

.pl-card-foot {
    display: flex;
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.pl-card-delete {
    padding: 0;
    border: 0;
    background: none;
    color: var(--danger);
    font-size: 11px;
    cursor: pointer;
}

/* Carte en cours de déplacement (SortableJS) */
.opacity-50 {
    opacity: .5;
}
/* Logo société dans l'avatar utilisateur */

/* Avatar utilisateur : cercle parfaitement rond */
.userchip .avatar {
    width: 50px;
    height: 50px;
    min-width: 38px;
    min-height: 38px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    padding: 0;
}

.userchip .avatar img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
}

/* ============================================================
   NAVIGATION SIDEBAR - CATÉGORIES ACCORDÉON
   ============================================================ */

/* Catégories */
.side-group {
    margin: 3px 0;
    border-radius: 11px;
}

/* En-tête de catégorie */
.side-group > summary.side-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    color: rgba(255, 255, 255, .82);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    border-radius: 11px;
    transition: background .2s, color .2s;
}

/* Supprimer le marqueur natif du navigateur */
.side-group > summary.side-group-title::-webkit-details-marker {
    display: none;
}

.side-group > summary.side-group-title::marker {
    content: "";
}

/* Survol de la catégorie */
.side-group > summary.side-group-title:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

/* Catégorie contenant la page active */
.side-group[open] > summary.side-group-title {
    color: #fff;
}

/* Flèche à droite */
.side-group-title .side-chevron {
    margin-left: auto;
    flex-shrink: 0;
    width: 17px !important;
    height: 17px !important;
    transition: transform .2s ease;
}

/* Rotation de la flèche */
.side-group[open] > summary .side-chevron {
    transform: rotate(180deg);
}

/* Contenu déroulé */
.side-group-content {
    display: grid;
    gap: 3px;
    padding: 3px 0 7px;
}

/* Liens des sous-menus */
.side-group-content .side-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px 9px 18px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .68);
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s, color .2s;
}

/* Icônes des sous-menus */
.side-group-content .side-sub .ic {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .9;
}

/* Survol des sous-menus */
.side-group-content .side-sub:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

/* Page actuellement sélectionnée */
.side-group-content .side-sub.is-current {
    background: rgba(79, 141, 255, .18);
    color: #fff;
    font-weight: 600;
}

/* Catégorie active : petit accent visuel */
.side-group[open] > summary.side-group-title {
    color: #fff;
}

/* Espacement général du menu */
.side-nav {
    gap: 5px;
}

.side-group-title > .ic {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: .9;
}

.side-group[open] > .side-group-title > .ic {
    color: #72a7ff;
}