/* Feuille de style unique, sans étape de compilation (hébergement mutualisé). */
/* Police Manrope (licence libre OFL), hébergée avec l'outil : même rendu sur tous les appareils, aucun appel extérieur. */
@font-face { font-family: "Manrope"; font-weight: 300; font-display: swap; src: url("../fonts/manrope/manrope-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("../fonts/manrope/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url("../fonts/manrope/manrope-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../fonts/manrope/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../fonts/manrope/manrope-latin-700-normal.woff2") format("woff2"); }

/* IBM Plex Mono (licence libre OFL) pour les chiffres et les étiquettes de données (charte GrowOn). */
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/plex/IBMPlexMono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/plex/IBMPlexMono-500.woff2") format("woff2"); }

/* Les couleurs viennent de grow-on-tokens.css (charte GrowOn, chargé avant ce fichier) : clair, sombre système et sombre forcé.
   Ici, seulement des alias vers ces variables, pour garder des noms courts dans les composants. */
:root {
    /* Les champs, listes et barres de défilement natifs suivent aussi le thème du système. */
    color-scheme: light dark;
    --bg: var(--color-bg);
    --surface: var(--color-surface);
    --surface-2: var(--color-surface-2);
    --text: var(--color-text);
    --muted: var(--color-text-muted);
    --border: var(--color-border);
    --accent: var(--color-accent);
    --accent-text: var(--color-on-accent);
    --danger: var(--color-alert);
    /* Vert réservé à « objectif atteint » (charte) ; les messages de confirmation restent neutres. */
    --ok-bg: var(--color-surface-2);
    --ok-text: var(--status-ok);
    /* Pas d'orange dans la charte : les états « en cours » sont neutres. */
    --warn-bg: var(--color-surface-2);
    --warn-text: var(--color-text);
    --radius: var(--radius-sm);
    /* Cartes : aplats sans ombre ni bordure, rayon de la charte. */
    --radius-card: var(--radius-md);
    --shadow-card: none;
    /* Onglet actif de la barre : en clair, fond doux teinté pétrole ; en sombre, menthe (#8FC7B2)
       à 35 % d'opacité avec texte clair (choix du 23/10). */
    --nav-active: #DBE6E9;
    --nav-active-text: var(--color-text);
    /* Barre flottante en verre dépoli (choix du 23/10, à reporter dans la charte) :
       le contenu défile flouté derrière ; onglet actif teinté pétrole. */
    --nav-glass: rgb(255 255 255 / 55%);
    --nav-glass-rim: rgb(255 255 255 / 70%);
    --nav-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 80%), 0 8px 24px rgb(27 31 36 / 12%);
    --nav-glass-active: rgb(31 74 85 / 12%);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --nav-active: rgb(143 199 178 / 35%); --nav-active-text: var(--color-text);
        --nav-glass: rgb(36 41 47 / 55%); --nav-glass-rim: rgb(255 255 255 / 14%);
        --nav-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 8px 24px rgb(0 0 0 / 35%);
        --nav-glass-active: rgb(143 199 178 / 28%);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark; --nav-active: rgb(143 199 178 / 35%); --nav-active-text: var(--color-text);
    --nav-glass: rgb(36 41 47 / 55%); --nav-glass-rim: rgb(255 255 255 / 14%);
    --nav-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 8px 24px rgb(0 0 0 / 35%);
    --nav-glass-active: rgb(143 199 178 / 28%);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
/* Titres en fin ; texte courant en normal, mises en avant en semi-gras. */
h1, h2, h3 { font-weight: 300; }
strong, b, th, legend { font-weight: 600; }
button, input, select, textarea { font: inherit; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
}

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

header.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    /* En-tête fondu dans le fond : seules les cartes ressortent. */
    background: var(--bg);
}

header.top .brand { font-weight: 600; text-decoration: none; color: var(--text); }
header.top .spacer { flex: 1; }

nav.main {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

nav.main a { text-decoration: none; color: var(--muted); }
nav.main a.active { color: var(--text); font-weight: 500; }

/* Sous-menus : liste déroulante au clic (fonctionne au doigt comme à la souris). */
/* Ordinateur : la barre reste collée en haut pendant le défilement (mobile et tablette la fixent ailleurs). */
nav.main { align-items: center; position: sticky; top: 0; z-index: 10; }
nav.main details.menu { position: relative; }
nav.main details.menu summary { cursor: pointer; color: var(--muted); list-style: none; }
nav.main details.menu summary::-webkit-details-marker { display: none; }
nav.main details.menu summary::after { content: " ▾"; font-size: .8em; }
nav.main details.menu summary.active { color: var(--text); font-weight: 500; }
nav.main .submenu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 0;
}
nav.main .submenu a { padding: 10px 16px; white-space: nowrap; }
nav.main .submenu a:hover { background: var(--bg); }
/* Sur ordinateur aussi, chaque onglet garde son icône (mêmes repères qu'au téléphone) :
   grande icône, libellé juste dessous. */
nav.main { gap: 4px 8px; padding: 6px 16px; }
nav.main > a.tab, nav.main details.menu summary { display: inline-flex; flex-direction: column; align-items: center; gap: 0; min-width: 84px; padding: 6px 16px; border-radius: 18px; font-size: .8125rem; }
nav.main > a.tab.active, nav.main details.menu summary.active { background: var(--nav-active); color: var(--nav-active-text); }
nav.main .icon { display: block; width: 30px; height: 30px; flex: none; }

/* Réglages : avatar en haut à droite, menu déroulant aligné à droite. */
header.top { position: relative; z-index: 30; }
header.top details.settings { position: relative; }
header.top details.settings summary { cursor: pointer; list-style: none; display: flex; border-radius: 50%; }
header.top details.settings summary::-webkit-details-marker { display: none; }
header.top details.settings summary.active .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
header.top .submenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 0;
}
header.top .submenu a { padding: 12px 16px; white-space: nowrap; text-decoration: none; color: var(--text); }
header.top .submenu a:hover, header.top .submenu a.active { background: var(--bg); }
header.top .submenu .who { padding: 10px 16px 6px; font-weight: 500; border-bottom: 1px solid var(--border); }
header.top .submenu form { margin: 0; }
header.top .submenu button.link { width: 100%; text-align: left; padding: 12px 16px; color: var(--danger); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.list-links { display: flex; flex-direction: column; padding: 0; }
.list-links a { display: flex; justify-content: space-between; padding: 14px 16px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.list-links a:last-child { border-bottom: 0; }

/* Sur téléphone : barre fixe en bas d'écran, icône + libellé, atteignable au pouce.
   Un téléphone couché (écran large mais très bas) garde cette vue. */
@media (max-width: 759px), (max-height: 500px) and (pointer: coarse) {
    body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    /* Barre flottante en pilule, façon Instagram, décollée des bords
       (charte : aplat bordé, ni verre ni ombre). */
    nav.main {
        position: fixed;
        top: auto;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        flex-wrap: nowrap;
        justify-content: space-around;
        gap: 2px;
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: var(--radius-pill);
        background: var(--surface);
        z-index: 20;
    }
    nav.main > a.tab, nav.main details.menu { flex: 1; margin-left: 0; min-width: 0; }
    nav.main > a.tab, nav.main details.menu summary {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-height: 52px;
        justify-content: center;
        border-radius: var(--radius-pill);
        font-size: .625rem;
        white-space: nowrap;
    }
    nav.main .icon { display: block; width: 22px; height: 22px; }
    /* Réglage client « icônes seules » : libellé gardé pour les lecteurs d'écran, icône un peu plus grande. */
    nav.main.icons-only > a.tab > span, nav.main.icons-only summary > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    nav.main.icons-only .icon { width: 26px; height: 26px; }
    /* Verre dépoli (navigateurs qui le gèrent, dont Safari iPhone) ; sinon l'aplat bordé reste. */
    @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        nav.main {
            background: var(--nav-glass);
            border-color: var(--nav-glass-rim);
            box-shadow: var(--nav-glass-shadow);
            -webkit-backdrop-filter: blur(18px) saturate(180%);
            backdrop-filter: blur(18px) saturate(180%);
        }
        body nav.main > a.tab.active, body nav.main details.menu summary.active { background: var(--nav-glass-active); }
    }
    /* Page en cours : posée sur un fond en pilule, libellé en semi-gras (charte). */
    nav.main > a.tab.active, nav.main details.menu summary.active {
        background: var(--nav-active);
        color: var(--nav-active-text);
        font-weight: 600;
    }
    nav.main details.menu summary::after { content: none; }
    nav.main details.menu { position: static; }
    nav.main .submenu {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        bottom: calc(84px + env(safe-area-inset-bottom));
        border-radius: var(--radius-lg);
        min-width: 0;
    }
    nav.main .submenu a { padding: 14px 16px; font-size: 1rem; }
}

main { max-width: 1100px; margin: 0 auto; padding: 16px; }

h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }

.card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin-bottom: 16px;
}

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; background: var(--ok-bg); color: var(--ok-text); }
.flash.warn { background: var(--warn-bg); color: var(--warn-text); }
.errors { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--danger); color: var(--danger); }

label { display: block; font-weight: 500; margin: 12px 0 4px; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 2px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
    width: 100%;
    max-width: 480px;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

select[multiple] { min-height: 160px; }

button, .button {
    display: inline-block;
    padding: 10px 16px;
    font: inherit;
    font-weight: 500;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
    text-decoration: none;
}

button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 400; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
td.center, th.center { text-align: center; }
tr.group th { background: var(--bg); color: var(--text); font-size: 0.95rem; }

.badge { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 0.8rem; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.badge.off { color: var(--danger); border-color: var(--danger); }

ul.tree { list-style: none; padding-left: 20px; margin: 0; }
ul.tree.root { padding-left: 0; }
ul.tree li { padding: 4px 0; }

.password { font-family: ui-monospace, monospace; font-size: 1.2rem; padding: 4px 8px; background: var(--bg); border-radius: 4px; }

.login { max-width: 420px; margin: 8vh auto; }

fieldset.checklist {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem .75rem;
    max-height: 16rem;
    overflow-y: auto;
    max-width: 36rem;
}

fieldset.checklist legend {
    font-weight: 500;
    padding: 0 .25rem;
}

td select {
    width: auto;
    padding: .25rem .5rem;
}

/* Fiche de coaching */
.session-head p { margin: 2px 0; }
.card.live { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; position: sticky; top: 0; z-index: 1; }
.card.live strong { font-size: 1.3rem; }
.point { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 2px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px 12px; margin: 0 0 8px; }
.point > * { grid-column: 1; margin: 0; }
.point-title { font-weight: 500; }
.point .code { color: var(--muted); font-weight: 400; margin-right: 4px; }
.point.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.point.tappable:active { background: var(--bg); }
/* « Fait » : grande case du côté du pouce (droite par défaut, gauche pour les gauchers). */
.states { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.point.tappable .state-todo, .point label.check input, .point label.check span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
label.state { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: .9rem; }
label.state:has(input:checked) { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.point label.check { grid-column: 2; grid-row: 1 / span 4; align-self: center; position: relative; display: grid; place-items: center; width: 48px; height: 48px; margin: 0; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer; }
.point label.check:has(input:checked) { background: var(--accent); border-color: var(--accent); }
.point label.check:has(input:checked)::after { content: "✓"; color: var(--accent-text); font-size: 1.5rem; font-weight: 600; }
.point:has(.state-na input:checked) label.check, .point:has(.state-unseen input:checked) label.check { border-style: dashed; }
.point:has(.state-na input:checked) .point-title, .point:has(.state-unseen input:checked) .point-title { color: var(--muted); }
.point label.check:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.hand-left .point { grid-template-columns: 48px minmax(0, 1fr); }
.hand-left .point > * { grid-column: 2; }
.hand-left .point label.check { grid-column: 1; }
.hand-left .states { justify-content: flex-start; }
.hand-left .section-head { justify-content: flex-start; gap: 16px; }
.hand-left .section-head label.observed-toggle { order: -1; }
.hand-left .debrief-field { flex-direction: row-reverse; }
.state-tag { font-size: 0.85rem; }
.state-tag.state-done { color: var(--text); font-weight: 600; }
.state-tag.state-todo { color: var(--muted); }
.state-tag.state-na, .state-tag.state-unseen { color: var(--muted); }
p.big { font-size: 2rem; font-weight: 600; margin: 0; }
.bar { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 60px; gap: 8px; align-items: center; margin: 4px 0; }
.bar .track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar .track i { display: block; height: 100%; background: var(--color-progress); }
.debrief h3 { font-size: 1rem; margin: 0 0 4px; }
.debrief p { margin: 2px 0; }
td input.weight { width: 4rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head label.observed-toggle { margin: 0; }
.core-sep { margin: 28px 0 0; padding-top: 12px; border-top: 2px solid var(--accent); }
.core-sep h2 { margin: 0; color: var(--accent); }
p.core-label { margin: 14px 0 4px; padding-top: 8px; border-top: 2px solid var(--accent); color: var(--accent); font-weight: 500; }
tr.core th { background: var(--surface); color: var(--accent); border-top: 2px solid var(--accent); font-size: 1rem; }
.debrief-field { display: flex; gap: 8px; align-items: flex-start; max-width: 600px; }
.debrief-field textarea { flex: 1; }
.debrief-field button { padding: 8px 12px; font-weight: 400; }
.point.skipped { opacity: .5; cursor: default; }
.point.skipped:active { background: var(--surface); }

/* Bouton « Créer » flottant : en bas à droite (à gauche pour les gauchers), au-dessus de la barre. */
body:has(details.fab) main { padding-bottom: 96px; }
details.fab { position: fixed; right: 16px; bottom: 24px; z-index: 15; }
body.hand-left details.fab { right: auto; left: 16px; }
details.fab summary { list-style: none; border-radius: 999px; padding: 14px 20px; }
details.fab summary::-webkit-details-marker { display: none; }
.fab-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 0;
}
body.hand-left .fab-menu { right: auto; left: 0; }
.fab-menu a { padding: 14px 16px; text-decoration: none; color: var(--text); }
.fab-menu a:hover { background: var(--bg); }
@media (max-width: 759px), (max-height: 500px) and (pointer: coarse) {
    /* Au-dessus de la barre flottante (12 px du bas + 66 px de haut), avec 12 px d'air. */
    details.fab { bottom: calc(90px + env(safe-area-inset-bottom)); }
    body:has(details.fab) main { padding-bottom: 72px; }
}

/* Suivi des coachings : cartes sur téléphone, tableau sur ordinateur. */
.session-cards { display: none; }
@media (max-width: 759px), (max-height: 500px) and (pointer: coarse) {
    .session-table { display: none; }
    .session-cards { display: flex; flex-direction: column; gap: 10px; }
    .session-card {
        display: flex;
        gap: 12px;
        align-items: center;
        padding: 16px 18px;
        background: var(--surface);
        border-radius: var(--radius-card);
        box-shadow: var(--shadow-card);
        color: var(--text);
        text-decoration: none;
    }
    .sc-main { flex: 1; min-width: 0; }
    .sc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
    .sc-meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
    .sc-axis { margin-top: 8px; font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .sc-axis span { color: var(--muted); }
    .sc-score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
    .sc-value { font-size: 1.4rem; font-weight: 600; }
    .sc-cov { font-size: .75rem; color: var(--muted); white-space: nowrap; }
    .badge.draft { color: var(--warn-text); background: var(--warn-bg); border-color: transparent; }
}

/* Page Coaching : cartes de synthèse cliquables. */
.muted { color: var(--muted); }
.hub-card { display: block; color: var(--text); text-decoration: none; margin-bottom: 12px; }
.hub-card h2 { margin-top: 0; }
.hub-go { display: block; margin-top: 8px; color: var(--accent); font-size: .9rem; }
.ritual { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ritual.soon { color: var(--muted); }
.ritual-count strong { font-family: var(--font-mono); font-weight: 500; font-size: 1.3rem; }
.ritual-count .mine { color: var(--muted); font-size: .8em; }
.ritual-rate { font-family: var(--font-mono); font-weight: 500; min-width: 3.5em; text-align: right; }
.meter { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 3px; background: var(--color-track); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.meter .min-mark { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--text); }
.ritual-status { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.check { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-text); color: var(--surface); font-size: .75rem; font-weight: 600; margin-right: 4px; }
/* En cours : neutre. Minimum couvert : vert avec coche (seul usage du vert). Pas de code couleur de retard. */
.ritual.covered .meter span { background: var(--ok-text); }
.ritual.covered .ritual-status, .ritual.covered .ritual-rate { color: var(--ok-text); font-weight: 500; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.pill.covered { background: var(--ok-text); color: var(--surface); }
.segmented { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.segmented a { flex: 1; text-align: center; padding: 10px 6px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.segmented a.active { background: var(--accent); color: var(--accent-text); font-weight: 500; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-nav a { text-decoration: none; font-size: 1.4rem; padding: 4px 14px; }
td.center { white-space: nowrap; }

/* Sélecteur de vue Performance, façon Instagram : titre centré dans l'en-tête, liste flottante translucide. */
/* Avec un titre centré : trois colonnes, la gauche (logo) se réduit sans jamais toucher le titre. */
header.top.has-center { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
header.top.has-center .spacer { display: none; }
header.top.has-center > .top-end { grid-column: 3; justify-self: end; }
header.top.has-center .agencysel { grid-column: 1; justify-self: start; max-width: 100%; }
header.top.has-center .agencysel > summary, header.top.has-center .agencysel.single { max-width: 100%; }
header.top .header-center { grid-column: 2; min-width: 0; }
header.top.has-center { min-height: 56px; }
.viewsel-title, .viewsel summary { font-size: 1.2rem; font-weight: 600; white-space: nowrap; }
.viewsel { position: relative; }
.viewsel summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.viewsel summary::-webkit-details-marker { display: none; }
.viewsel .chev { width: 16px; height: 16px; transition: transform .15s; }
.viewsel[open] .chev { transform: rotate(180deg); }
.viewsel .panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 210px;
    padding: 6px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    z-index: 50;
}
.viewsel .panel a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; color: var(--text); text-decoration: none; white-space: nowrap; }
.viewsel .panel a svg { width: 22px; height: 22px; flex: none; }
.viewsel .panel a.on { background: color-mix(in srgb, var(--text) 8%, transparent); font-weight: 500; }
.center-text { text-align: center; }

/* Logo du client en haut à gauche : bouton de choix de l'agence visualisée. */
.agencysel { position: relative; min-width: 0; }
.agencysel > summary, .agencysel.single { display: flex; align-items: center; gap: 10px; max-width: 62vw; }
.agencysel > summary { list-style: none; cursor: pointer; border-radius: 10px; }
.agencysel > summary::-webkit-details-marker { display: none; }
.agencysel > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* Logo dans un carré de la taille de l'avatar, sans fond ni cadre : un logo transparent ne montre que son dessin. */
.agencysel .logo { display: block; flex: none; width: 34px; height: 34px; object-fit: contain; }
.agencysel .logo-dark { display: none; }
.agencysel .client-initials { flex: none; background: var(--text); color: var(--bg); }
.agencysel .agency-name { display: inline-flex; align-items: center; gap: 2px; min-width: 0; font-weight: 600; color: var(--text); }
.agencysel .agency-name .label { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agencysel .chev { width: 14px; height: 14px; flex: none; transition: transform .15s; }
.agencysel[open] .chev { transform: rotate(180deg); }
.agencysel .panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    display: flex;
    flex-direction: column;
    min-width: 230px;
    max-height: 60vh;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    z-index: 50;
}
.agencysel .panel button { all: unset; box-sizing: border-box; padding: 12px 16px; border-radius: 16px; color: var(--text); white-space: nowrap; cursor: pointer; }
.agencysel .panel button:hover, .agencysel .panel button:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }
.agencysel .panel button.on { background: color-mix(in srgb, var(--text) 8%, transparent); font-weight: 600; }
.agencysel .agency-row { display: flex; align-items: center; gap: 2px; }
.agencysel .agency-row > button:first-child { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.agencysel .agency-row small { font-size: .75rem; font-weight: 400; color: var(--muted); }
.agencysel .panel button.star { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; color: var(--muted); }
.agencysel .star svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.agencysel .panel button.star.set { color: var(--accent); }
.agencysel .star.set svg { fill: currentColor; }
.agencysel .panel .agency-search { margin: 4px 4px 6px; width: auto; }
/* Logo sombre (s'il existe) quand le thème est sombre. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .agencysel.has-dark .logo-light { display: none; }
    :root:not([data-theme="light"]) .agencysel.has-dark .logo-dark { display: block; }
}
:root[data-theme="dark"] .agencysel.has-dark .logo-light { display: none; }
:root[data-theme="dark"] .agencysel.has-dark .logo-dark { display: block; }
.logo-slot { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border); }
/* Aperçu sur le fond où le logo sera affiché (clair ou sombre). */
.logo-slot img { width: 64px; height: 64px; object-fit: contain; padding: 8px; border-radius: 12px; background: var(--brand-os); }
.logo-slot.logo-dark img { background: var(--brand-graphite); }

/* Chiffres et étiquettes de données : police à chasse fixe (charte). */
.figure, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Logo GrowOn (fichiers fournis par le design, version claire ou sombre selon le thème).
   Sur ordinateur : signé sur la connexion, sans signature dans le bandeau. Sur téléphone : seulement sur l'écran de chargement. */
.top-end { display: flex; align-items: center; gap: 16px; }
.product-logo img { display: block; width: auto; height: 20px; }
.brand-logo { display: block; margin: 8px 0 24px; }
.brand-logo img { width: 220px; max-width: 100%; height: auto; }
.brand-logo .on-dark, .product-logo .on-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) :is(.brand-logo, .product-logo) .on-light { display: none; }
    :root:not([data-theme="light"]) :is(.brand-logo, .product-logo) .on-dark { display: block; }
}
:root[data-theme="dark"] :is(.brand-logo, .product-logo) .on-light { display: none; }
:root[data-theme="dark"] :is(.brand-logo, .product-logo) .on-dark { display: block; }
@media (max-width: 759px), (max-height: 500px) and (pointer: coarse) {
    .brand-logo, .product-logo, header.top .brand { display: none; }
}
.ritual-rate.soon { font-family: var(--font-sans); font-weight: 400; color: var(--muted); }

/* Bilan rattaché à la fiche : ⋯ ou appui long sur un point, menu des seuls choix possibles. */
.point button.pick { padding: 4px 12px; font-weight: 600; line-height: 1; border-radius: 999px; }
.point { -webkit-touch-callout: none; }
.pick-tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-text); vertical-align: 1px; }
.pick-menu { display: grid; gap: 4px; margin: -4px 0 10px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pick-menu button { text-align: left; background: transparent; color: var(--accent); border: 0; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.pick-menu button.on, .pick-menu button:focus-visible { background: var(--bg); }
.pick-menu button.on::after { content: " ✓"; }
.pick-menu .hint { margin: 6px 8px; }
.debrief-point { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 8px 10px; margin: 0 0 8px; border-radius: 10px; background: var(--bg); }
.debrief-point .chosen { font-weight: 500; }
.debrief-point .error { flex-basis: 100%; color: var(--danger); font-size: .9rem; }

/* Sur tablette (760 à 1199 px de large, au moins 600 px de haut) : barre flottante verticale,
   du côté de la main choisie dans le profil (droite par défaut), atteignable au pouce quand on
   tient l'appareil à deux mains. Charte : aplat bordé, ni ombre ni verre. */
@media (min-width: 760px) and (max-width: 1199px) and (min-height: 600px) {
    nav.main {
        position: fixed;
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
        width: 72px;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 4px;
        padding: 8px 6px;
        border: 1px solid var(--border);
        border-radius: 36px;
        background: var(--surface);
        z-index: 20;
    }
    body.hand-left nav.main { right: auto; left: 16px; }
    nav.main > a.tab, nav.main details.menu summary {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 60px;
        border-radius: 28px;
        font-size: .625rem;
        white-space: nowrap;
    }
    nav.main .icon { display: block; width: 24px; height: 24px; }
    nav.main.icons-only > a.tab > span, nav.main.icons-only summary > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    nav.main.icons-only .icon { width: 26px; height: 26px; }
    /* Verre dépoli (navigateurs qui le gèrent, dont Safari iPhone) ; sinon l'aplat bordé reste. */
    @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        nav.main {
            background: var(--nav-glass);
            border-color: var(--nav-glass-rim);
            box-shadow: var(--nav-glass-shadow);
            -webkit-backdrop-filter: blur(18px) saturate(180%);
            backdrop-filter: blur(18px) saturate(180%);
        }
        body nav.main > a.tab.active, body nav.main details.menu summary.active { background: var(--nav-glass-active); }
    }
    nav.main > a.tab.active, nav.main details.menu summary.active { background: var(--nav-active); color: var(--nav-active-text); font-weight: 600; }
    nav.main details.menu summary::after { content: none; }
    nav.main details.menu { position: static; }
    nav.main .submenu { position: fixed; top: auto; right: 104px; left: auto; }
    body.hand-left nav.main .submenu { right: auto; left: 104px; }
    /* Le contenu laisse la place à la barre ; l'en-tête garde toute la largeur. */
    main { padding: 24px 104px 24px 24px; }
    body.hand-left main { padding: 24px 24px 24px 104px; }
    /* Les cartes se rangent sur deux colonnes : la largeur de la tablette sert. */
    .hub-grid, .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
    .hub-grid > .card { margin: 0; }
    .cols > :only-child { grid-column: 1 / -1; }
}

/* Sélecteur de période, sous le titre de chaque page chiffrée : mois (plage libre) à gauche,
   quatre boutons M / M-1 / N / N-1 à droite. */
.period { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: -8px 0 16px; }
.period-custom-pick { position: relative; }
.period-custom-pick > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch-min); }
.period-custom-pick > summary::-webkit-details-marker { display: none; }
.period-custom-pick > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.period .cal { width: 20px; height: 20px; color: var(--muted); }
.period-label { font-weight: 600; }
.period-presets { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); }
.period-presets button { min-height: 36px; min-width: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--muted); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.period-presets button.on { background: var(--nav-active); color: var(--nav-active-text); font-weight: 600; }
.period-dates { flex-basis: 100%; margin: 0; color: var(--muted); font-size: var(--text-sm); }
.period-sheet { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: min(360px, calc(100vw - 32px)); max-height: calc(100dvh - 120px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.period-sheet h2 { margin: 0; font-size: 1rem; }
.period-sheet form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.period-sub { flex-basis: 100%; font-size: var(--text-sm); color: var(--muted); }
.period-years button { min-height: 40px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: none; color: var(--text); font: inherit; cursor: pointer; }
.period-years button.on { background: var(--nav-active); color: var(--nav-active-text); border-color: transparent; font-weight: 600; }
.period-month select { flex: 1; min-height: var(--touch-min); min-width: 0; }
.period-month .button { flex-basis: 100%; }
.period-sheet .period-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.period-range .period-sub, .period-range .button { grid-column: 1 / -1; }
.period-range label { align-items: center; text-align: center; }
.period-sheet label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); color: var(--muted); }
.period-sheet input { min-height: var(--touch-min); width: 100%; min-width: 0; box-sizing: border-box; }
/* Fenêtre de plage ouverte : la page derrière est voilée (un toucher sur le voile referme). */
body:has(.period-custom-pick[open])::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgb(27 31 36 / 45%); }
/* Le bouton Créer s'efface pendant le choix d'une plage libre. */
body:has(.period-custom-pick[open]) details.fab { display: none; }
/* Sur téléphone : la fenêtre s'ouvre juste sous le mois, sur toute la largeur, par-dessus les cartes. */
@media (max-width: 759px), (max-height: 500px) and (pointer: coarse) {
    .period-sheet { width: calc(100vw - 32px); max-height: calc(100dvh - 260px - env(safe-area-inset-bottom)); }
}

/* Canal du site : interrupteur gauche / droite (Physique | Téléphone), clin d'œil à l'ancien logo. */
span.label { display: block; font-weight: 500; margin: 12px 0 4px; }
.channel-switch { display: flex; align-items: center; gap: 12px; }
.channel-switch-side { cursor: pointer; color: var(--muted); user-select: none; }
.channel-switch:has([aria-checked="false"]) .channel-switch-side:first-of-type,
.channel-switch:has([aria-checked="true"]) .channel-switch-side:last-of-type { color: var(--text); font-weight: 600; }
.channel-switch-track {
    position: relative; width: 64px; height: 34px; padding: 0; flex: none;
    border: 2px solid var(--text); border-radius: 999px; background: transparent; cursor: pointer;
}
.channel-switch-knob {
    position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent); transition: transform .15s ease;
}
.channel-switch-track[aria-checked="true"] .channel-switch-knob { transform: translateX(30px); }

/* Coaching consulté : points positifs teintés menthe, opportunité teintée sable (l'or de la marque).
   L'opportunité est une piste de développement : jamais de rouge (charte). */
:root {
    --positive-bg: rgb(143 199 178 / 28%);
    --positive-rim: var(--quart-1-rim);
    --axis-bg: rgb(205 184 154 / 32%);
    --axis-rim: var(--medal-gold-rim);
}
.debrief { display: flex; flex-direction: column; gap: 10px; }
.debrief-block { padding: 12px 14px; border-radius: var(--radius-md); }
.debrief-block.is-positive { background: var(--positive-bg); }
.debrief-block.is-axis { background: var(--axis-bg); }
.debrief-block .debrief-point { background: var(--surface); }
/* Titre du bloc puis, juste à côté, le point de la fiche choisi (« Point positif 1  1.1 · Se lève… »). */
.debrief-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.debrief-chosen { font-size: 1rem; font-weight: 600; color: var(--text); }
.debrief-kind { display: inline-flex; align-items: center; gap: 6px; }
.debrief-icon { width: 20px; height: 20px; flex: none; color: var(--positive-rim); }
.is-axis .debrief-icon { color: var(--axis-rim); }
tr.is-positive td { background: var(--positive-bg); }
tr.is-axis td { background: var(--axis-bg); }
tr.is-positive td:first-child { box-shadow: inset 4px 0 0 var(--positive-rim); }
tr.is-axis td:first-child { box-shadow: inset 4px 0 0 var(--axis-rim); }
.mark-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; background: var(--surface); }

/* Rapports : sur ordinateur seulement. L'onglet disparaît au téléphone et à la tablette. */
@media (max-width: 759px), (max-height: 500px) and (pointer: coarse), (min-width: 760px) and (max-width: 1199px) and (min-height: 600px) {
    nav.main > a.tab.desktop-only, nav.main > details.desktop-only { display: none; }
}

/* « Voir comme » (super-admin) : tout à droite de la barre, liste des niveaux, bandeau pendant l'aperçu. */
nav.main details.view-as { margin-left: auto; }
nav.main details.view-as .submenu { left: auto; right: 0; }
nav.main details.view-as .submenu .who { padding: 8px 16px 4px; font-size: var(--text-xs); color: var(--muted); }
nav.main details.view-as .submenu button { background: none; border: 0; color: var(--text); font: inherit; text-align: left; padding: 10px 16px; white-space: nowrap; cursor: pointer; border-radius: 0; }
nav.main details.view-as .submenu button:hover { background: var(--bg); }
nav.main details.view-as .submenu button.active { font-weight: 600; }
nav.main details.view-as .submenu { max-height: 70vh; overflow-y: auto; min-width: 320px; }
nav.main details.view-as details.level > summary { display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; padding: 10px 16px; border-radius: 0; background: none; font-size: 1rem; color: var(--text); cursor: pointer; list-style: none; }
nav.main details.view-as > summary::after, nav.main details.view-as details.level > summary::after { content: none; }
nav.main details.view-as details.level > summary::-webkit-details-marker { display: none; }
nav.main details.view-as details.level > summary small { color: var(--muted); }
nav.main details.view-as details.level > summary.empty { color: var(--muted); cursor: default; pointer-events: none; }
nav.main details.view-as details.level[open] > summary { font-weight: 600; }
nav.main details.view-as details.level button { padding-left: 28px; width: 100%; }
nav.main details.view-as details.level button.any { color: var(--muted); font-style: italic; }
nav.main details.view-as .submenu button.stop { border-top: 1px solid var(--border); color: var(--muted); }
.view-as-banner { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 8px 16px; background: var(--axis-bg); color: var(--text); font-size: var(--text-sm); }
.view-as-banner form { margin: 0; }
.view-as-banner button { padding: 4px 14px; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.report-row .muted { font-size: var(--text-sm); }
.report-row .button { white-space: nowrap; flex: none; }

/* Ordinateur : la page s'élargit et les cartes se rangent sur deux colonnes (comme sur tablette). */
@media (min-width: 1200px) {
    main { max-width: 1280px; }
    .hub-grid, .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
    .hub-grid > .card { margin: 0; }
    .cols > :only-child { grid-column: 1 / -1; }
}

/* Statuts d'un coaching : à valider (sable), validé (menthe + coche), refusé (gris + croix), brouillon (neutre). */
.badge[class*="status-"] { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; border-color: transparent; }
.badge[class*="status-"] svg { width: 14px; height: 14px; flex: none; }
.badge.status-draft { background: var(--warn-bg); color: var(--muted); }
.badge.status-pending { background: var(--axis-bg); color: var(--text); }
.badge.status-accepted { background: var(--positive-bg); color: var(--text); }
.badge.status-accepted svg { color: var(--positive-rim); }
.badge.status-refused { background: var(--text); color: var(--surface); }

/* Validation par la personne coachée, et rappel du refus pour le coach. */
.card.validation.is-pending { background: var(--axis-bg); border-color: transparent; }
.card.validation.is-refused { border-left: 4px solid var(--text); }
.card.validation .actions { align-items: flex-start; flex-wrap: wrap; }
.card.validation details.refuse > summary { list-style: none; cursor: pointer; display: inline-block; }
.card.validation details.refuse > summary::-webkit-details-marker { display: none; }
.card.validation details.refuse[open] { flex-basis: 100%; }
.card.validation details.refuse form { display: grid; gap: 8px; margin-top: 12px; }

/* Centre de notifications : pastille sur l'avatar, liste par date. */
header.top details.settings summary { position: relative; }
.pastille { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--axis-rim); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
header.top .submenu .count { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--axis-bg); font-size: var(--text-xs); font-weight: 700; }
.notification-list { padding: 0; overflow: hidden; }
.notification-list p { padding: 16px; margin: 0; }
.notification-list .notification { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.notification-list .notification:last-child { border-bottom: 0; }
.notification-list .notification.unread { background: var(--axis-bg); font-weight: 600; }
.notification-list .notification .when { color: var(--muted); font-size: var(--text-sm); white-space: nowrap; font-weight: 400; }

/* Performance — « Ma perf' » (maquette v7) : ARPD en grand, rang/CA/contrats, produits réalisé – objectif.
   Barres = achievement ; vert + coche seulement quand l'objectif est atteint (charte). */
.perf-asof { margin: -4px 0 10px; font-size: .8rem; }
.perf-hero { display: grid; gap: 8px; }
.perf-label { font-size: .75rem; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.perf-big { font-size: 2.4rem; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.perf-big small { font-family: var(--font-sans); font-size: 1rem; color: var(--muted); }
.perf-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.perf-ach { font-family: var(--font-mono); font-weight: 500; color: var(--text); }
.perf-ach.met, .pt .r.met { color: var(--ok-text); }
.perf-ach.met::before, .pt .r.met::before, .perf-table td.met::before, .perf-trio .met .v::before { content: "✓"; display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: 5px; border: 1.5px solid currentColor; border-radius: 50%; font-family: var(--font-sans); font-size: .7em; line-height: 1; vertical-align: .15em; box-sizing: border-box; }
.perf-meter { position: relative; height: 8px; border-radius: 4px; background: var(--color-track); }
.perf-meter span { display: block; height: 100%; border-radius: 4px; background: var(--color-text-muted); }
.perf-meter.met span { background: var(--ok-text); }
.perf-meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); }
.perf-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: center; }
.perf-trio > div, .perf-trio > a { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.perf-trio svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.perf-trio .v { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 500; }
.perf-trio .k { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.perf-trio .rank-gold svg { stroke: var(--medal-gold-rim); } .perf-trio .rank-gold .v { color: var(--medal-gold-rim); }
.perf-trio .rank-silver svg { stroke: var(--medal-silver-rim); } .perf-trio .rank-silver .v { color: var(--medal-silver-rim); }
.perf-trio .rank-bronze svg { stroke: var(--medal-bronze-rim); } .perf-trio .rank-bronze .v { color: var(--medal-bronze-rim); }
.perf-products .pt-head, .perf-products .pt { display: grid; grid-template-columns: 1fr 84px 84px; }
.perf-products .pt-head { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; text-align: right; padding-bottom: 4px; }
.perf-products .pt { gap: 3px 0; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--border); }
.pt .pname { font-weight: 600; }
.pt .k { font-size: .78rem; color: var(--muted); }
.pt .r, .pt .o { text-align: right; font-family: var(--font-mono); font-size: .85rem; }
.pt .r { font-weight: 500; }
.pt .r.big { font-size: 1.05rem; }
.pt .o { color: var(--muted); }
.pt .perf-meter { grid-column: 1 / -1; margin: 4px 0 6px; height: 6px; }
.perf-note { margin: 8px 0 0; font-size: .75rem; color: var(--muted); }
@media (min-width: 1200px) {
    .perf-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
    .perf-grid > div > .card:last-child, .perf-grid > .card { margin-bottom: 0; }
}
.perf-refs { display: grid; grid-template-columns: 1fr auto 64px; gap: 4px 12px; align-items: baseline; font-size: .85rem; color: var(--muted); }
.perf-refs b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.perf-refs .perf-ach { text-align: right; }
.perf-refs small { font-family: var(--font-sans); font-weight: 400; color: var(--muted); }
/* Mon agence : conseillers */
.ps-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.ps-sort { position: relative; }
.ps-sort summary { list-style: none; cursor: pointer; padding: 6px 14px; min-height: 32px; border-radius: 999px; background: var(--accent); color: var(--color-on-accent); font-size: .8rem; font-weight: 600; }
.ps-sort summary::-webkit-details-marker { display: none; }
.ps-sort summary::after { content: " ▾"; }
.ps-sort .panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; display: grid; padding: 6px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 30px rgba(0, 0, 0, .14); }
.ps-sort .panel a { padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .9rem; }
.ps-sort .panel a.on { color: var(--accent); font-weight: 600; }
.ps-sort .panel a.on::after { content: " ✓"; }
.ps-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 76px; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.ps-row:first-of-type { border-top: 0; }
.ps-row .perf-meter { grid-column: 2 / -1; height: 6px; }
.ps-row .perf-ach { text-align: right; white-space: nowrap; }
.ps-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-row.me .ps-name, .ps-row.me .ps-val { color: var(--color-accent); }
.ps-val { font-family: var(--font-mono); font-size: .9rem; white-space: nowrap; }
.ps-val { text-align: right; }
.ps-val small { display: block; color: var(--muted); font-size: .72rem; }
.ps-rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: .8rem; font-weight: 600; background: var(--bg); color: var(--muted); }
.ps-rank.rank-gold { background: var(--medal-gold); color: var(--on-medal); }
.ps-rank.rank-silver { background: var(--medal-silver); color: var(--on-medal); }
.ps-rank.rank-bronze { background: var(--medal-bronze); color: var(--on-medal); }
.perf-myrank { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.ps-rank.big { width: 44px; height: 44px; font-size: 1.1rem; }
/* Ma perf' : projeté du tracker sous un filet, focus du mois teinté sable. */
.perf-proj { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--color-border); font-size: .85rem; color: var(--muted); }
.perf-proj b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.perf-focus { background: var(--axis-bg); display: grid; gap: 2px; }
.pf-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid rgb(138 114 72 / 25%); font-size: .9rem; }
.pf-row:first-of-type { border-top: 0; }
.pf-row b { font-weight: 600; }
.pf-row span { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.pf-row strong { color: var(--text); font-weight: 600; }
.perf-incentive { display: grid; gap: 6px; }
.perf-incentive > .muted { font-size: .85rem; }
.perf-proj-rows { padding-top: 8px; border-top: 1px solid var(--color-border); }
/* Liste des contrats (depuis la carte Prime) */
.contract { display: grid; gap: 4px; }
.ct-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ct-head b { font-family: var(--font-mono); font-weight: 500; }
.ct-head .muted { font-size: .8rem; }
.ct-line { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.ct-line span:last-child { font-family: var(--font-mono); white-space: nowrap; }
.ct-line.upstream { color: var(--muted); }
.ct-total { padding-top: 6px; border-top: 1px solid var(--color-border); font-weight: 600; }
.ct-none { margin: 0; font-size: .85rem; }
a.perf-incentive { color: inherit; text-decoration: none; }
/* Tableau détaillé des produits */
.perf-table { font-size: .78rem; width: 100%; }
.perf-table th, .perf-table td { padding: 8px 4px; }
.perf-table thead th, .perf-table thead th.num { font-family: var(--font-sans); white-space: normal; font-size: .68rem; line-height: 1.2; color: var(--muted); font-weight: 500; text-align: right; vertical-align: bottom; }
.perf-table thead th:first-child { text-align: left; }
.perf-table th[scope="row"] { font-weight: 600; text-align: left; }
.perf-table .num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.perf-table .num small { color: var(--muted); font-size: .75em; }
.perf-table tfoot th, .perf-table tfoot td { border-top: 1px solid var(--color-border); font-weight: 600; }
a.perf-products { display: block; color: inherit; text-decoration: none; }
.perf-trio > a { color: inherit; text-decoration: none; display: grid; justify-items: center; gap: 2px; min-width: 0; border-radius: var(--radius); }

/* Carte NPS : scores agence et individuel côte à côte, puis note moyenne et réponses ; verbatims. */
.nps-card { display: grid; gap: 14px; }
.nps-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.nps-scores > div { display: grid; gap: 4px; align-content: start; }
.nps-scores .perf-ach { font-size: .8rem; }
.nps-rows { display: grid; grid-template-columns: 1fr repeat(2, minmax(56px, auto)); gap: 6px 16px; font-size: .9rem; color: var(--muted); }
.nps-rows b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.nps-rows .muted { text-align: right; font-size: .75rem; }
a.nps-comments { display: block; color: inherit; text-decoration: none; }
.nps-comments { display: grid; gap: 12px; }
.verbatim { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
:is(.verbatim, .ct-verbatim) .vb-score { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--color-border); font-family: var(--font-mono); font-weight: 500; }
:is(.verbatim, .ct-verbatim) .vb-score.promoter { border-color: var(--ok-text); color: var(--ok-text); }
.verbatim .muted { font-size: .75rem; }
.verbatim p { margin: 2px 0 0; }

/* Cartes et éléments touchables : pas de flèche, un léger enfoncement au toucher, comme un bouton. */
a.card, .perf-trio > a { transition: transform .12s ease, background-color .12s ease; -webkit-tap-highlight-color: transparent; }
a.card:active { transform: scale(.985); }
.perf-trio > a { border-radius: 12px; }
.perf-trio > a:active { transform: scale(.95); background: var(--color-track); }
/* Valeur réalisée à l'objectif (ex. ARPD de l'agence) : même vert que son achievement. */
.perf-refs b.met { color: var(--ok-text); }
/* Trio : NPS à l'objectif, icône et valeur dans le vert « objectif atteint ». */
.perf-trio .met svg { stroke: var(--ok-text); } .perf-trio .met .v { color: var(--ok-text); }

/* Détail des produits d'un segment : liste de puces pour passer d'un segment (ou canal) à l'autre. */
.seg-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.seg-chips a { flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--color-border); color: var(--text); text-decoration: none; font-size: .9rem; }
.seg-chips a.on { background: var(--nav-active); color: var(--nav-active-text); border-color: transparent; font-weight: 600; }

/* Évolution de l'ARPD : courbes et barres sur un axe unique, grille discrète, légende au-dessus. */
a.perf-hero { color: inherit; text-decoration: none; }
.evo-card { display: grid; gap: 10px; }
.evo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); }
.evo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.evo-legend .sw { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--color-accent); }
.evo-legend .sw.ref { border-top-color: var(--color-text-muted); }
.evo-legend .sw.target { border-top: 2px dashed var(--color-text-muted); }
.evo-legend .sw.bar { width: 10px; height: 10px; border: 0; border-radius: 2px; background: var(--color-accent); }
.evo-chart { width: 100%; height: auto; overflow: visible; }
.evo-chart .grid { stroke: var(--color-border); stroke-width: 1; }
.evo-chart text { font-family: var(--font-mono); font-size: 9px; fill: var(--color-text-muted); }
.evo-chart .ylab { text-anchor: end; }
.evo-chart .xlab { text-anchor: middle; font-family: var(--font-sans); }
.evo-chart .endlab, .evo-chart .ptlab { text-anchor: middle; fill: var(--text); font-size: 8.5px; }
.evo-chart .ptlab { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.evo-chart .ptlab.last { font-weight: 600; font-size: 10px; }
.evo-chart path.main, .evo-chart path.ref, .evo-chart path.target { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.evo-chart path.main { stroke: var(--color-accent); }
.evo-chart path.ref { stroke: var(--color-text-muted); stroke-width: 1.5; }
.evo-chart path.target, .evo-chart line.target { stroke: var(--color-text-muted); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.evo-chart .dot { fill: var(--color-accent); stroke: var(--surface); stroke-width: 2; }
.evo-chart path.bar { fill: var(--color-accent); }
.perf-table td.met { color: var(--ok-text); }
/* Mes contrats : code SIPP du véhicule conduit, en étiquette discrète à côté du numéro. */
.ct-sipp { display: inline-block; margin-left: 6px; padding: 1px 6px; border: 1px solid var(--color-border); border-radius: 6px; font-family: var(--font-mono); font-size: .75rem; font-weight: 500; color: var(--muted); vertical-align: 1px; }
/* Bulle de valeur au toucher : au-dessus du graphique, centrée sur la barre ou le point touché. */
.evo-plot { position: relative; touch-action: pan-y; }
.evo-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 4px 10px; border-radius: 8px; background: var(--text); color: var(--surface); font-family: var(--font-mono); font-size: .78rem; white-space: pre; line-height: 1.45; pointer-events: none; z-index: 2; }
.evo-chart path.bar.on { fill: var(--text); }
.evo-chart .dot.on { r: 6; }
/* Carte jour par jour : titre et bascule Facturé | Tracker sur une ligne. */
.evo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.evo-switch { margin: 0; padding: 0; }
.seg-chips button { flex: none; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--color-border); background: transparent; color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.seg-chips button.on { background: var(--nav-active); color: var(--nav-active-text); border-color: transparent; font-weight: 600; }
.evo-empty { margin: 0; padding: 40px 0; text-align: center; }

/* Mes contrats : loupe, filtres, prime par contrat, dépliage (dates, verbatim en bulle). */
.ct-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ct-loupe { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.ct-loupe svg { width: 22px; height: 22px; }
.ct-loupe[aria-expanded="true"] { background: var(--nav-active); color: var(--nav-active-text); }
.ct-search { width: 100%; margin-bottom: 10px; font-family: var(--font-mono); }
.ct-filters { margin-bottom: 12px; }
.ct-product { flex: none; width: auto; margin: 0; padding: 4px 30px 4px 12px; border-radius: 999px; border: 1px solid var(--color-border); background-color: transparent; color: var(--text); font: inherit; font-size: .85rem; }
.ct-product.on { background-color: var(--nav-active); color: var(--nav-active-text); border-color: transparent; font-weight: 600; }
details.contract > summary { display: grid; gap: 4px; list-style: none; cursor: pointer; }
details.contract > summary::-webkit-details-marker { display: none; }
details.contract:active { transform: scale(.985); }
details.contract[open]:active { transform: none; }
.ct-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: -2px 0 4px; }
.ct-tags span { padding: 1px 8px; border-radius: 999px; background: var(--color-track); color: var(--muted); font-size: .72rem; }
.ct-bonus { align-items: start; color: var(--color-accent); font-weight: 600; }
.ct-bonus small { display: block; font-size: .7rem; font-weight: 400; color: var(--muted); }
.ct-more { display: grid; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--color-border); }
.ct-dates { display: flex; align-items: end; gap: 10px; font-family: var(--font-mono); }
.ct-dates small { display: block; font-family: var(--font); font-size: .7rem; color: var(--muted); }
.ct-bubble { margin: 0; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: var(--bg); font-size: .88rem; font-style: italic; }
.contract[hidden] { display: none; }
.ct-verbatim { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.ct-nomatch { text-align: center; }

/* Focus du mois : produit en focus, techniques en liste, dialogues en bulles, « Me coacher » en bas. */
a.perf-focus { color: inherit; text-decoration: none; }
.focus-card { display: grid; gap: 8px; }
.focus-techniques { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .92rem; }
.focus-dialogues { display: grid; gap: 8px; }
.focus-coach { margin: 6px 0 0; }
.focus-coach button { width: 100%; }
.admin-tips summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.admin-tips textarea { min-height: 96px; }

/* Briefing de shift : carte mise en avant tant qu'il n'est pas lu, repliée sur une ligne ensuite. */
.brief-card { display: grid; gap: 6px; }
.brief-open { color: inherit; text-decoration: none; }
a.brief-create { flex: none; border-radius: 999px; padding: 6px 14px; font-size: var(--text-sm); text-decoration: none; }
.brief-follow a.brief-create { justify-self: start; }
.brief-card.unread a.brief-create { background: var(--accent-text); color: var(--accent); }
.brief-card.unread { background: var(--accent); color: var(--accent-text); }
.brief-card.unread .perf-label, .brief-card.unread .muted { color: inherit; opacity: .8; }
.brief-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brief-line > span { min-width: 0; }
.brief-pill { flex: none; font-size: var(--text-sm); padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.brief-card.unread .brief-pill { background: var(--accent-text); color: var(--accent); }
.brief-count { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); color: var(--muted); }
.brief-count.met { color: var(--ok-text); }
.brief-count svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brief-figures, .brief-section, .brief-follow { display: grid; gap: 8px; }
.brief-section p { margin: 0 0 6px; }
.brief-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.brief-tiles > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius); background: var(--bg); }
.brief-tiles .k { font-size: .75rem; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.brief-tiles .v { font-size: 1.25rem; font-weight: 600; }
.brief-tiles .s { font-size: var(--text-sm); color: var(--muted); }
.brief-tiles .met .v { color: var(--ok-text); }
.brief-tiles .axis { background: var(--axis-bg); }
.brief-tiles .soon { opacity: .6; }
.brief-volumes > div { background: var(--surface-2); }
.brief-verbatims { display: grid; gap: 8px; }
.brief-pending { margin: 0; padding-left: 18px; }
.brief-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brief-numbers input { width: 100%; }
.brief-ack button { width: 100%; }
.brief-end { display: block; height: 1px; }
.brief-tiles .met .v::before { content: "✓"; display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: 6px; border: 1.5px solid currentColor; border-radius: 50%; font-size: .6em; line-height: 1; vertical-align: .2em; box-sizing: border-box; }
.brief-tiles .s b { font-weight: 600; }
.brief-tiles .s b.ok { color: var(--ok-text); }
.brief-dialogue { color: inherit; text-decoration: none; padding: 10px 12px; border-radius: var(--radius); background: var(--axis-bg); }
.brief-dialogue .vb-score svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.brief-split { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; }
.brief-split > i { width: 1px; align-self: stretch; background: var(--border); }
.brief-split small { display: block; font-size: .68rem; color: var(--muted); white-space: nowrap; }
.brief-split span { display: grid; }
.brief-numbers { grid-template-columns: 1fr; }
.brief-half { border: 0; padding: 0; margin: 0; min-width: 0; }
.brief-half legend { padding: 0; margin-bottom: 4px; }
.brief-half input { width: 100%; }
.brief-export { display: flex; gap: 8px; margin-bottom: 12px; }
.brief-export button { flex: 1; }

/* Impression du briefing (A4, à laisser en base arrière) : couleurs du thème clair quel que soit le thème,
   sans menus ni boutons, cartes entières sur une page. */
@media print {
    :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
        --color-bg: #FFFFFF; --color-surface: #FFFFFF; --color-surface-2: #E3E6E1; --color-border: #D5D9D3;
        --color-text: #1B1F24; --color-text-muted: #565D64; --color-accent: #1F4A55; --color-on-accent: #FFFFFF;
        --status-ok: #2F7D4F; color-scheme: light;
    }
    @page { size: A4; margin: 12mm; }
    body { background: #FFFFFF; }
    header.top, nav.main, .brief-export, .brief-ack, .brief-follow, .fab, .view-as-banner, .brief-end { display: none !important; }
    main { padding: 0 !important; max-width: none !important; }
    .card { box-shadow: none; border: 1px solid var(--color-border); break-inside: avoid; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
