/* ============================================================
   ORION CRM — Design System
   Aligné sur Orion Prospection : navy profond, or en dégradé,
   surfaces translucides, Space Grotesk pour les titres.
   ============================================================ */

:root {
    --navy-900: #060f24;
    --navy-800: #0A1A3A;
    --navy-700: #0f2248;
    --navy-600: #15315f;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --gold: #F5A623;
    --gold-light: #FBBF24;
    --gold-glow: rgba(245, 166, 35, 0.14);
    --white: #FFFFFF;
    --t1: rgba(255, 255, 255, 0.92);
    --t2: rgba(255, 255, 255, 0.62);
    --t3: rgba(255, 255, 255, 0.38);
    --border: rgba(255, 255, 255, 0.09);
    --border-2: rgba(255, 255, 255, 0.14);
    --green: #22C55E;  --green-s: rgba(34, 197, 94, 0.14);
    --blue: #3B82F6;   --blue-s: rgba(59, 130, 246, 0.14);
    --red: #EF4444;    --red-s: rgba(239, 68, 68, 0.12);
    --purple: #A78BFA; --purple-s: rgba(167, 139, 250, 0.14);
    --cyan: #06B6D4;   --cyan-s: rgba(6, 182, 212, 0.14);
    --orange: #F97316; --orange-s: rgba(249, 115, 22, 0.14);
    --pink: #EC4899;   --pink-s: rgba(236, 72, 153, 0.14);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --sidebar-w: 236px;
    /* Compatibilité avec les anciens noms de variables */
    --bg: var(--navy-900);
    --bg-card: var(--surface);
    --bg-hover: var(--surface-2);
    --text: var(--t1);
    --text-muted: var(--t3);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body { min-height: 100%; }

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(245, 166, 35, 0.06), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(59, 130, 246, 0.06), transparent 60%),
        var(--navy-900);
    background-attachment: fixed;
    color: var(--t1);
    display: flex;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

::selection { background: var(--gold-glow); color: var(--gold-light); }

/* ============================================================
   Écran de connexion
   ============================================================ */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(900px 500px at 75% 15%, rgba(245, 166, 35, 0.08), transparent 60%),
        radial-gradient(700px 450px at 15% 90%, rgba(59, 130, 246, 0.08), transparent 60%),
        var(--navy-900);
    z-index: 3000;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: var(--shadow);
    animation: cardIn .5s var(--ease);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.login-card__brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--t1);
    text-align: center;
    margin-bottom: 32px;
}

.login-card__brand span {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 300;
}

.login-card .form__group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}

.login-card label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--t2);
}

.login-card input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 12px 14px;
    color: var(--white);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color .25s, background .25s;
}

.login-card input:focus {
    border-color: rgba(245, 166, 35, 0.55);
    background: rgba(255, 255, 255, 0.07);
}

.login-card__error {
    color: #FCA5A5;
    font-size: 0.8rem;
    min-height: 18px;
    margin-bottom: 8px;
}

.login-card__submit {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
    border-right: 1px solid var(--border);
    padding: 24px 14px 16px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    z-index: 100;
}

.sidebar__brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--t1);
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.sidebar__brand::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    box-shadow: 0 0 14px rgba(245, 166, 35, 0.6);
    flex-shrink: 0;
}

.sidebar__brand span {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 300;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 11px;
    border: none;
    background: none;
    color: var(--t2);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all .18s;
    text-align: left;
    width: 100%;
    position: relative;
}

.sidebar__link:hover {
    background: var(--surface-2);
    color: var(--t1);
}

.sidebar__link--active {
    background: var(--gold-glow);
    color: var(--gold);
}

.sidebar__link--active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--gold), var(--gold-light));
}

.sidebar__user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 10px 4px;
    border-top: 1px solid var(--border);
}

.sidebar__user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar__user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--t1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__user-role {
    font-size: 0.7rem;
    color: var(--t3);
}

.sidebar__logout {
    flex-shrink: 0;
    background: none;
    border: 1px solid transparent;
    color: var(--t3);
    cursor: pointer;
    padding: 7px;
    border-radius: 9px;
    display: flex;
    transition: all .18s;
}

.sidebar__logout:hover {
    background: var(--red-s);
    border-color: rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
}

/* ============================================================
   Zone principale
   ============================================================ */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    /* Sans min-width: 0, un tableau large étirait toute la page au-delà de
       l'écran (barre de défilement horizontale, boutons hors champ). */
    min-width: 0;
    padding: 28px 36px;
    min-height: 100vh;
    max-width: 1440px;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar__left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.topbar__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar__count {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--t2);
    background: var(--surface-2);
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid var(--border);
}

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

.topbar__search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 10px 14px;
    transition: border-color .25s;
}

.topbar__search:focus-within {
    border-color: rgba(245, 166, 35, 0.5);
}

.topbar__search input {
    background: none;
    border: none;
    color: var(--white);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    width: 200px;
}

.topbar__search input::placeholder { color: var(--t3); }
.topbar__search svg { color: var(--t3); flex-shrink: 0; }

/* ============================================================
   Boutons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 11px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s, background .2s, border-color .2s, color .2s, opacity .2s;
    text-decoration: none;
}

.btn--primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--navy-900);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(245, 166, 35, 0.35);
}

.btn--ghost {
    background: var(--surface-2);
    color: var(--t2);
    border: 1px solid var(--border);
}

.btn--ghost:hover:not(:disabled) {
    border-color: var(--border-2);
    color: var(--t1);
}

.btn--sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 9px;
}

.btn--danger {
    background: var(--red-s);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn--danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.22);
    color: #FECACA;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ============================================================
   Filtres
   ============================================================ */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters__group {
    display: flex;
    align-items: center;
    gap: 7px;
}

.filters__label {
    font-size: 0.72rem;
    color: var(--t3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filters__select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--white);
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color .25s;
}

.filters__select:hover,
.filters__select:focus {
    border-color: rgba(245, 166, 35, 0.5);
}

/* Les options déroulantes : fond navy (sinon blanc sur blanc) */
select option {
    background-color: #1b2337;
    color: var(--white);
}

/* ============================================================
   Filtres avancés (panneau dépliable) + attribution en masse
   ============================================================ */
.advf {
    margin: -8px 0 20px;
    padding: 18px 20px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    animation: fadeUp .3s var(--ease);
}

.advf__section + .advf__section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.advf__section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.advf__section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gold);
}

.advf__section-hint {
    font-size: 0.74rem;
    color: var(--t3);
}

.advf__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px 14px;
}

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

.advf__label {
    font-size: 0.7rem;
    color: var(--t3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.advf__select,
.advf__input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--white);
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    transition: border-color .25s;
}

.advf__input::placeholder { color: var(--t3); }

.advf__input:hover,
.advf__input:focus,
.advf__select:hover,
.advf__select:focus {
    border-color: rgba(245, 166, 35, 0.5);
}

/* Un critère actif se voit au premier coup d'œil */
.advf__select:not([value=""]) { border-color: var(--border); }

.advf__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.advf__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    flex: 1;
    min-width: 0;
}

.advf__chips-empty {
    font-size: 0.76rem;
    color: var(--t3);
}

.advf__chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(245, 166, 35, 0.45);
    background: var(--gold-glow);
    color: var(--t1);
    font-family: inherit;
    font-size: 0.74rem;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.advf__chip:hover {
    background: rgba(245, 166, 35, 0.24);
    border-color: var(--gold);
}

.advf__chip-x {
    font-size: 0.95rem;
    line-height: 1;
    color: var(--gold);
}

/* Pastille de comptage sur les boutons « Filtres avancés » / « Attribuer » */
.advf__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 7px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--navy-900);
    color: var(--gold);
    font-size: 0.68rem;
    font-weight: 700;
}

.btn--primary .advf__badge {
    background: rgba(6, 15, 36, 0.28);
    color: var(--navy-900);
}

/* ---- Modale d'attribution des résultats filtrés ---- */
.assign-summary {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--t1);
}

.assign-summary b { color: var(--gold); }

.assign-criteres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.assign-critere {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--border-2);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.73rem;
    color: var(--t2);
}

.assign-critere--none {
    border-style: dashed;
    color: var(--t3);
}

/* ---- Cliquer pour appeler ---- */
.tel-lien {
    color: var(--t2);
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.22);
    white-space: nowrap;
    transition: color .18s, border-color .18s;
}

.tel-lien:hover {
    color: var(--gold-light);
    border-bottom-color: var(--gold);
}

.tel-lien::before {
    content: '\260E';
    margin-right: 5px;
    opacity: 0.5;
    font-size: 0.9em;
}

/* ---- Configuration Aircall ---- */
.ac-etat {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 6px 16px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.ac-etat__ligne {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.8rem;
    color: var(--t2);
}

.ac-etat__pastille {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ac-etat__ligne--ok .ac-etat__pastille { background: var(--green); }
.ac-etat__ligne--ko .ac-etat__pastille { background: rgba(255, 255, 255, 0.22); }
.ac-etat__ligne--ko { color: var(--t3); }
.ac-etat__aide { color: var(--t3); font-size: 0.92em; }

.ac-bloc {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.ac-bloc:last-of-type { border-bottom: none; }

.ac-bloc__titre {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gold);
    margin-bottom: 8px;
}

.ac-bloc code {
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.92em;
}

.ac-url {
    margin: 8px 0 14px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.74rem;
    color: var(--t2);
    word-break: break-all;
    user-select: all;
}

.ac-test-res { margin-left: 10px; font-size: 0.8rem; color: var(--t3); }
.ac-test-res--ok { color: var(--green); }
.ac-test-res--ko { color: var(--red); }

.ac-sync-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }

/* ---- Export Aircall ---- */
.aircall-bilan {
    margin: 4px 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.aircall-bilan__ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    font-size: 0.84rem;
    color: var(--t2);
    background: rgba(255, 255, 255, 0.02);
}

.aircall-bilan__ligne + .aircall-bilan__ligne { border-top: 1px solid var(--border); }
.aircall-bilan__ligne b { font-size: 1rem; color: var(--t1); font-variant-numeric: tabular-nums; }
.aircall-bilan__ligne--ok b { color: var(--green); }
.aircall-bilan__ligne--ko b { color: var(--orange); }

.aircall-exclus {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.aircall-exclus > summary {
    padding: 9px 14px;
    font-size: 0.8rem;
    color: var(--t2);
    cursor: pointer;
    user-select: none;
}

.aircall-exclus > summary:hover { color: var(--t1); }

.aircall-exclus__liste {
    max-height: 220px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
}

.aircall-exclu {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 14px;
    font-size: 0.78rem;
    color: var(--t3);
}

.aircall-exclu + .aircall-exclu { border-top: 1px solid rgba(255, 255, 255, 0.04); }
.aircall-exclu b { color: var(--t2); font-weight: 600; }

.assign-users {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px 12px;
    margin-top: 10px;
    padding-left: 25px;
}

.assign-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.83rem;
    color: var(--t2);
    cursor: pointer;
}

.assign-user input {
    width: 15px;
    height: 15px;
    accent-color: var(--gold);
    cursor: pointer;
}

/* Visible uniquement pour les administrateurs */
.filters__group--admin-only { display: none; }
body.role-admin .filters__group--admin-only { display: flex; }
/* Éléments réservés aux admins (page Gestion utilisateurs, etc.) */
.admin-only { display: none !important; }
body.role-admin .admin-only { display: flex !important; }
body.role-admin .admin-only.admin-only--table { display: table-cell !important; }

/* ============================================================
   Tableaux
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    animation: fadeUp .35s var(--ease);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table th {
    text-align: left;
    padding: 13px 16px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--t3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.02);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--t2);
}

.table td strong { color: var(--t1); font-weight: 600; }

.col-phone {
    width: 130px;
    white-space: nowrap;
}

/* Colonnes texte du tableau : une seule ligne + "…" pour des lignes de
   hauteur uniforme (le nom complet reste visible au survol et dans la fiche). */
.table td { vertical-align: middle; }
/* Sélection multiple + barre d'actions groupées */
/* Sélection multiple : masquée par défaut, révélée par le bouton
   « Sélectionner » (réservé aux administrateurs, cf. .admin-only). */
.col-cbx { display: none; width: 34px; text-align: center; }
body.role-admin.selection-on .col-cbx { display: table-cell; }
.col-cbx input {
    width: 15px; height: 15px; cursor: pointer;
    accent-color: var(--blue, #3B82F6);   /* bleu de la charte, moins agressif que le blanc */
    opacity: 0.75;
    transition: opacity .15s;
}
.col-cbx input:hover, .col-cbx input:checked { opacity: 1; }
.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid var(--gold, #F5A623);
    background: var(--gold-glow, rgba(245,166,35,0.14));
    border-radius: 12px;
}
.bulk-bar__count { font-weight: 700; color: var(--gold, #F5A623); font-size: 14px; }
.reassign-opt { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.reassign-opt input { width: 16px; height: 16px; accent-color: var(--gold, #F5A623); cursor: pointer; }
.bulk-bar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.col-entreprise { max-width: 240px; }
.col-entreprise strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.col-contact {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* La ligne entière ouvre la fiche (prospects et clients) */
#prospects-body tr, #clients-body tr { cursor: pointer; }
#prospects-body td.col-cbx { cursor: default; }
/* ===== Planning ===== */
.sidebar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: auto;
    border-radius: 100px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.planning-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.planning-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.planning-filter--active { background: var(--primary, #2563eb) !important; color: #fff !important; }
/* Planning en colonnes (kanban par jour) */
.planning-board {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 8px;
    align-items: flex-start;
}
.planning-col {
    flex: 0 0 300px;
    max-width: 300px;
    padding: 0 16px;
    border-right: 1px solid var(--border, rgba(255,255,255,0.12));
}
.planning-col:first-child { padding-left: 0; }
.planning-col:last-child { border-right: none; }
.planning-col__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 2px 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--gold, #F5A623);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    color: var(--gold, #F5A623);
}
.planning-day__count {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--t2, #94a3b8);
    background: var(--surface-2, rgba(255,255,255,0.06));
    border-radius: 100px;
    padding: 2px 9px;
}
.planning-col__body { display: flex; flex-direction: column; gap: 10px; }

.pcard {
    background: var(--surface, rgba(255,255,255,0.04));
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-left: 3px solid var(--blue, #3B82F6);
    border-radius: 10px;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.pcard--overdue { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.06); }
.pcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard__time {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--t1, #f1f5f9);
}
.pcard__who { font-size: 13.5px; font-weight: 600; color: var(--t1, #f1f5f9); }
.pcard__note { font-size: 12.5px; color: var(--t3, #94a3b8); line-height: 1.5; }
/* Traçabilité du rendez-vous : pour qui, par qui, quand il a été programmé */
.pcard__meta { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.pcard__meta-item { font-size: 11.5px; color: var(--t3); line-height: 1.45; }
.pcard__meta-item b { color: var(--t2); font-weight: 600; }
.rdv-trace {
    margin: -4px 0 14px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.78rem;
    color: var(--t3);
}
.rdv-trace b { color: var(--t2); font-weight: 600; }
.pcard__actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.pcard__actions .btn { padding: 4px 9px; font-size: 12px; }
.planning-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 100px; }
.planning-tag--late { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.badge--rdv-a_faire { background: rgba(37, 99, 235, 0.14); color: #2563eb; }
.badge--rdv-fait { background: rgba(34, 197, 94, 0.16); color: #16a34a; }
.badge--rdv-annule { background: rgba(148, 163, 184, 0.18); color: #64748b; }

.table tbody tr {
    transition: background .15s;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   Badges de statut (pills avec point de couleur)
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge--nouveau       { background: var(--blue-s);   color: #93C5FD; }
.badge--a_contacter   { background: var(--cyan-s);   color: #67E8F9; }
.badge--contacte      { background: var(--purple-s); color: #C4B5FD; }
.badge--a_relancer    { background: var(--orange-s); color: #FDBA74; }
.badge--a_recontacter { background: var(--pink-s);   color: #F9A8D4; }
.badge--qualifie      { background: var(--gold-glow); color: var(--gold-light); }
.badge--proposition   { background: var(--green-s);  color: #86EFAC; }
.badge--gagne         { background: rgba(34, 197, 94, 0.25); color: #86EFAC; }
.badge--perdu         { background: var(--red-s);    color: #FCA5A5; }

.badge--haute   { background: var(--red-s);   color: #FCA5A5; }
.badge--moyenne { background: var(--gold-glow); color: var(--gold-light); }
.badge--basse   { background: rgba(255, 255, 255, 0.07); color: var(--t3); }

/* Niveaux d'importance : la couleur vient de l'onglet « Niveaux » du Google
   Sheet (colonne Couleur), pas du nom du niveau. Ajouter « Très important »
   dans la feuille avec la couleur « rouge » suffit — aucun CSS à écrire. */
.badge--niv-rouge  { background: var(--red-s);    color: #FCA5A5; }
.badge--niv-orange { background: var(--orange-s); color: #FDBA74; }
.badge--niv-or     { background: var(--gold-glow); color: var(--gold-light); }
.badge--niv-vert   { background: var(--green-s);  color: #86EFAC; }
.badge--niv-bleu   { background: var(--blue-s);   color: #93C5FD; }
.badge--niv-gris   { background: rgba(255, 255, 255, 0.07); color: var(--t3); }

.badge--client-actif    { background: var(--green-s); color: #86EFAC; }
.badge--client-inactif  { background: rgba(255, 255, 255, 0.07); color: var(--t3); }
.badge--client-en_pause { background: var(--gold-glow); color: var(--gold-light); }

/* Statut modifiable dans le tableau : garde l'apparence d'un badge (les
   classes .badge--xxx fournissent la couleur), avec un chevron discret qui
   signale qu'on peut cliquer. Déclaré APRÈS les .badge--xxx pour que le
   chevron survive au raccourci `background` de ces règles. */
.status-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    padding: 4px 22px 4px 11px;
    font-family: inherit;
    line-height: 1.45;
    cursor: pointer;
    outline: none;
    max-width: 165px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%23ffffff' stroke-opacity='.55' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color .2s, filter .2s;
}

.status-select::before { content: none; }   /* pas de pastille dans un <select> */

.status-select:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.28);
    filter: brightness(1.12);
}

.status-select:focus-visible { border-color: var(--gold); }

.status-select:disabled { opacity: 0.55; cursor: progress; }

/* ============================================================
   État vide
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 90px 20px;
    color: var(--t3);
    animation: fadeUp .35s var(--ease);
}

.empty-state svg {
    margin-bottom: 18px;
    opacity: 0.35;
}

.empty-state p {
    margin-bottom: 22px;
    font-size: 0.95rem;
}

/* ============================================================
   Vues
   ============================================================ */
.view { display: none; }

.view--active {
    display: block;
    animation: fadeUp .35s var(--ease);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ============================================================
   Statistiques
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 7px;
    transition: transform .25s var(--ease), border-color .25s;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-2);
}

.stat-card__label {
    font-size: 0.75rem;
    color: var(--t3);
    letter-spacing: 0.04em;
    font-weight: 500;
}

.stat-card__value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card--accent {
    border-color: rgba(245, 166, 35, 0.3);
    background: linear-gradient(180deg, rgba(245, 166, 35, 0.05), transparent);
}
.stat-card--money {
    border-color: rgba(34, 197, 94, 0.35);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.06), transparent);
}
.stat-card--money .stat-card__value { color: #86EFAC; }

.stat-card--accent .stat-card__value {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================
   Modals
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal--visible { display: flex; }

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 8, 20, 0.65);
    backdrop-filter: blur(6px);
    animation: bdIn .25s ease;
}

@keyframes bdIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal__card {
    position: relative;
    background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
    border: 1px solid var(--border-2);
    border-radius: 18px;
    padding: 28px;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: modalIn .3s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.modal__card--wide { max-width: 700px; }

.modal__card--full {
    max-width: 920px;
    width: 95%;
    height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal__card--full .detail {
    flex: 1;
    overflow-y: auto;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.modal__close {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--t2);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 5px 11px;
    transition: all .18s;
}

.modal__close:hover {
    color: var(--white);
    border-color: var(--border-2);
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ============================================================
   Formulaires (modals)
   ============================================================ */
.modal__form .form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.modal__form .form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.modal__form .form__row .form__group { margin-bottom: 0; }

.modal__form label {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--t2);
}

.modal__form input,
.modal__form select,
.modal__form textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 11px 13px;
    color: var(--white);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color .25s, background .25s;
}

.modal__form input:focus,
.modal__form select:focus,
.modal__form textarea:focus {
    border-color: rgba(245, 166, 35, 0.55);
    background: rgba(255, 255, 255, 0.07);
}

.modal__form input::placeholder,
.modal__form textarea::placeholder { color: var(--t3); }

.modal__form textarea { resize: vertical; }

.modal__form select:disabled,
.modal__form input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   Fiche détail
   ============================================================ */
.detail {
    display: grid;
    gap: 16px;
}

.detail__section {
    padding: 18px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.detail__section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--t3);
    margin-bottom: 12px;
    font-weight: 700;
}

.detail__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.detail__field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail__label {
    font-size: 0.7rem;
    color: var(--t3);
}

.detail__value {
    font-size: 0.87rem;
    color: var(--t1);
    word-break: break-word;
}

/* Liens dans la fiche (email, téléphone, site, recherche Google) :
   couleur claire lisible sur le fond sombre. */
.detail__value a {
    color: #93C5FD;
    text-decoration: none;
    border-bottom: 1px solid rgba(147, 197, 253, 0.35);
    transition: color .15s, border-color .15s;
}
.detail__value a:hover {
    color: #BFDBFE;
    border-bottom-color: #93C5FD;
}

.detail__dernier-contact-edit {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.detail__dernier-contact-edit input[type="date"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 6px 9px;
    color: var(--white);
    font-size: 0.78rem;
    font-family: inherit;
    outline: none;
    color-scheme: dark;
    transition: border-color .25s;
}

.detail__dernier-contact-edit input[type="date"]:focus {
    border-color: rgba(245, 166, 35, 0.55);
}

.detail__notes {
    white-space: pre-wrap;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--t1);
}

.detail__notes--empty {
    color: var(--t3);
    font-style: italic;
}

.detail__notes-textarea {
    width: 100%;
    min-height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 13px;
    color: var(--white);
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color .25s, background .25s;
}

.detail__notes-textarea:focus {
    border-color: rgba(245, 166, 35, 0.55);
    background: rgba(255, 255, 255, 0.07);
}

.detail__notes-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.detail__actions {
    display: flex;
    gap: 9px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Timeline de notes */
.notes-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.note-entry {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    transition: border-color .2s;
}

.note-entry:hover { border-color: var(--border-2); border-left-color: var(--gold-light); }

.note-entry__date {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* Auteur de la note : distinct de la date, pour repérer d'un coup d'œil
   qui est intervenu sur la fiche quand on est plusieurs sur le CRM. */
.note-entry__author {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--t2);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: none;
}

.note-entry__body {
    font-size: 0.85rem;
    color: var(--t1);
    line-height: 1.6;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed;
    bottom: 26px;
    right: 26px;
    background: var(--navy-700);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 13px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--t1);
    transform: translateY(90px);
    opacity: 0;
    transition: all .3s var(--ease);
    z-index: 2000;
    box-shadow: var(--shadow);
}

.toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.toast--success {
    background: rgba(13, 40, 30, 0.95);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86EFAC;
}

.toast--error {
    background: rgba(45, 15, 18, 0.95);
    border-color: rgba(239, 68, 68, 0.4);
    color: #FCA5A5;
}

.toast--info {
    background: rgba(12, 28, 58, 0.95);
    border-color: rgba(59, 130, 246, 0.4);
    color: #BFDBFE;
}

.toast {
    max-width: min(460px, calc(100vw - 32px));
    pointer-events: none;
}

/* Rendu par lots : ligne « Afficher plus » en bas des tableaux */
.row-more td {
    text-align: center;
    padding: 14px 8px;
}

/* ============================================================
   Cellule d'actions
   ============================================================ */
.actions-cell {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================================
   DEVIS — formulaire
   ============================================================ */
.devis-lignes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.devis-lignes-table th {
    text-align: left;
    padding: 6px 8px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--t3);
    font-weight: 700;
}

.devis-lignes-table td {
    padding: 4px 8px 4px 0;
    vertical-align: middle;
}

.devis-lignes-table input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 11px;
    color: var(--white);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color .25s;
}

.devis-lignes-table input:focus {
    border-color: rgba(245, 166, 35, 0.55);
}

.devis-col-qte { width: 74px; }
.devis-col-prix { width: 125px; }

.devis-col-total {
    width: 110px;
    text-align: right;
    white-space: nowrap;
    color: var(--t2);
    font-weight: 500;
}

.devis-col-del { width: 40px; text-align: center; }

.devis-totaux {
    margin-left: auto;
    width: 290px;
    max-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.devis-totaux__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--t2);
}

.devis-totaux__row--ttc {
    border-top: 1px solid rgba(245, 166, 35, 0.4);
    padding-top: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
}

.devis-totaux__row--ttc span:last-child {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================
   DEVIS — aperçu (page claire, proche du PDF final)
   ============================================================ */
.devis-preview-wrapper {
    flex: 1;
    overflow-y: auto;
}

.devis-preview {
    background: #ffffff;
    color: #1e1e1e;
    border-radius: 12px;
    padding: 32px 36px;
    font-size: 0.85rem;
    line-height: 1.55;
    max-width: 760px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.dp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #0b1930;
    color: #fff;
    margin: -32px -36px 24px;
    padding: 22px 36px;
    border-radius: 12px 12px 0 0;
}

.dp-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.dp-brand-sub {
    font-size: 0.72rem;
    color: #93c5fd;
    margin-top: 2px;
}

.dp-title {
    text-align: right;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
}

.dp-numero {
    font-size: 0.78rem;
    color: var(--gold);
    font-weight: 600;
    margin-top: 2px;
}

.dp-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 16px;
}

.dp-block-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6e7480;
    font-weight: 700;
    margin-bottom: 5px;
}

.dp-dates {
    font-size: 0.8rem;
    color: #6e7480;
    margin-bottom: 16px;
}

.dp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 0.82rem;
}

.dp-table th {
    background: #0b1930;
    color: #fff;
    text-align: left;
    padding: 8px 10px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dp-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e5eaf2;
}

.dp-table tbody tr:nth-child(even) { background: #f5f7fa; }

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

.dp-totaux {
    margin-left: auto;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 20px;
}

.dp-totaux > div {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.dp-totaux .dp-ttc {
    border-top: 2px solid var(--gold);
    padding-top: 6px;
    font-weight: 700;
    color: #0b1930;
    font-size: 0.95rem;
}

/* Détail rédigé de la prestation, au-dessus du tableau de chiffrage */
.dp-prestation {
    margin-bottom: 18px;
    font-size: 0.82rem;
    line-height: 1.6;
}

/* Clause d'acceptation — texte figé, identique sur tous les devis */
.dp-clause {
    background: #f5f7fa;
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.78rem;
    line-height: 1.65;
    color: #3a4150;
}

.dp-footer {
    border-top: 1px solid #e5eaf2;
    padding-top: 10px;
    font-size: 0.68rem;
    color: #9aa1ac;
    text-align: center;
}

/* ============================================================
   DEVIS — historique dans la fiche client
   ============================================================ */
.devis-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.devis-history-table th {
    text-align: left;
    padding: 9px 10px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--t3);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.devis-history-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--t2);
}

.devis-history-table td strong { color: var(--t1); }

.devis-history-table tbody tr:last-child td { border-bottom: none; }

.devis-statut-select {
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 0.75rem;
}

.devis-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.devis-accepte {
    color: var(--green);
    font-weight: 600;
    white-space: nowrap;
    cursor: help;
}

/* ============================================================
   DEVIS — formulaire : bloc émetteur figé, aides, clause
   ============================================================ */
.devis-emetteur {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.devis-emetteur__title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--t3);
    font-weight: 700;
    margin-bottom: 6px;
}

.devis-emetteur__lines {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--t2);
}

.devis-hint {
    font-size: 0.75rem;
    color: var(--t3);
    line-height: 1.55;
    margin-top: 6px;
}

.devis-hint strong { color: var(--t2); font-weight: 600; }

.devis-hint-inline {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--t3);
}

.devis-clause-preview {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--t2);
    margin: 0;
}

.devis-form input[readonly] {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ============================================================
   PAGE PITCH — liste, éditeur d'arbre, mode déroulé
   ============================================================ */

.pitch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.pitch-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .18s, transform .18s var(--ease);
}
.pitch-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.pitch-card__nom { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1rem; color: var(--t1); }
.pitch-card__desc { font-size: .82rem; color: var(--t2); line-height: 1.5; flex: 1; }
.pitch-card__meta { font-size: .72rem; color: var(--t3); }
.pitch-card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---- Champs de formulaire HORS modale (la page Pitch n'est pas un modal,
   elle n'héritait donc d'aucun style : les champs sortaient en blanc brut) ---- */
.pitch-form .form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.pitch-form .form__group { margin-bottom: 14px; }
.pitch-form .form__row .form__group { margin-bottom: 0; }
.pitch-form label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--t2);
    margin-bottom: 7px;
    letter-spacing: .2px;
}
.pitch-form input,
.pitch-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--white);
    font: inherit;
    font-size: .88rem;
    padding: 11px 13px;
    outline: none;
    transition: border-color .15s;
}
.pitch-form textarea { line-height: 1.65; resize: vertical; }
.pitch-form input:focus,
.pitch-form textarea:focus { border-color: rgba(245, 166, 35, .5); }
.pitch-form input::placeholder,
.pitch-form textarea::placeholder { color: var(--t3); }

/* ---- Éditeur : plan à gauche, une seule étape à droite ---- */
.pitch-workspace {
    display: grid;
    grid-template-columns: 268px 1fr;
    gap: 18px;
    align-items: start;
    margin-top: 8px;
}

.pitch-map {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 10px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}
.pitch-map__titre {
    font-size: .66rem; text-transform: uppercase; letter-spacing: .8px;
    color: var(--t3); font-weight: 700; padding: 0 8px 10px;
}
.pmap__item {
    display: flex; align-items: center; gap: 8px; width: 100%;
    background: none; border: none; border-radius: 8px;
    color: var(--t2); font: inherit; font-size: .8rem;
    padding: 8px 10px; text-align: left; cursor: pointer;
    transition: background .12s, color .12s;
}
.pmap__item:hover { background: rgba(255, 255, 255, .05); color: var(--t1); }
.pmap__item--on { background: var(--gold-glow); color: var(--gold); font-weight: 600; }
.pmap__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmap__nb {
    font-size: .66rem; color: var(--t3);
    background: var(--surface-2); border-radius: 100px; padding: 1px 7px;
}
.pmap__item--on .pmap__nb { background: rgba(245, 166, 35, .2); color: var(--gold); }

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

.pstep__fil {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    padding-bottom: 16px; margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.pstep__fil-item {
    background: none; border: none; color: var(--t3);
    font: inherit; font-size: .76rem; cursor: pointer;
    padding: 3px 7px; border-radius: 6px;
}
.pstep__fil-item:hover { color: var(--t1); background: rgba(255, 255, 255, .05); }
.pstep__fil-item--on { color: var(--gold); font-weight: 600; cursor: default; }
.pstep__fil-sep { color: var(--t3); font-size: .72rem; }

.pstep__bloc { margin-bottom: 22px; }
.pstep__bloc > label {
    display: block; font-size: .72rem; font-weight: 600;
    color: var(--t2); margin-bottom: 8px;
}
.pstep__vide {
    font-size: .8rem; color: var(--t3); font-style: italic;
    margin-bottom: 12px; line-height: 1.6;
}

.pstep__reps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.prep2 {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    background: rgba(59, 130, 246, .06);
    border: 1px solid rgba(59, 130, 246, .2);
    border-radius: 10px;
    padding: 10px 12px;
}
.prep2__label {
    background: rgba(255, 255, 255, .05) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px; color: var(--t1); font: inherit; font-size: .84rem;
    padding: 8px 11px; outline: none; min-width: 0;
}
.prep2__label:focus { border-color: rgba(59, 130, 246, .6) !important; }
.prep2__del {
    background: none; border: 1px solid var(--border); color: var(--t3);
    border-radius: 7px; padding: 6px 9px; font-size: .72rem; cursor: pointer; line-height: 1;
}
.prep2__del:hover { color: #FCA5A5; border-color: rgba(239, 68, 68, .5); background: var(--red-s); }
.prep2__apercu {
    grid-column: 1 / -1;
    font-size: .74rem; color: var(--t3); line-height: 1.5;
    padding-left: 2px;
}
.prep2__nb { color: var(--blue); }

.pstep__pied { border-top: 1px solid var(--border); padding-top: 16px; }

@media (max-width: 900px) {
    .pitch-workspace { grid-template-columns: 1fr; }
    .pitch-map { position: static; max-height: 260px; }
    .pitch-form .form__row { grid-template-columns: 1fr; }
}

/* ---- Mode déroulé (pendant l'appel) ---- */
.play-fil { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; font-size: .76rem; }
.play-fil__item { color: var(--t3); background: var(--surface-2); border-radius: 100px; padding: 4px 12px; }
.play-fil__item--on { color: var(--gold); background: var(--gold-glow); font-weight: 600; }
.play-fil__sep { color: var(--t3); }

.play-carte {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 28px 32px;
    max-width: 780px;
}
.play-note {
    font-size: .8rem; color: var(--t3); font-style: italic;
    border-left: 2px solid var(--border-2); padding-left: 12px; margin-bottom: 18px;
}
.play-texte { font-size: 1.15rem; line-height: 1.75; color: var(--t1); }
.play-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .8px;
    color: var(--t3); font-weight: 700; margin: 26px 0 12px;
}
.play-choix { display: flex; flex-wrap: wrap; gap: 10px; }
.play-choix__btn { font-size: .88rem; }
.play-fin { margin-top: 24px; font-size: .9rem; color: var(--t2); }

@media (max-width: 768px) {
    .pitch-grid { grid-template-columns: 1fr; }
    .play-carte { padding: 20px 18px; }
    .play-texte { font-size: 1rem; }
}

/* ============================================================
   PAGE PRESTATIONS (admin)
   ============================================================ */
.prestation-desc {
    max-width: 540px;
    color: var(--t2);
    line-height: 1.5;
    white-space: normal;
    cursor: help;
}

/* ============================================================
   Responsive — la sidebar devient une barre de navigation basse
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border-right: none;
        border-top: 1px solid var(--border-2);
        background: rgba(6, 15, 36, 0.92);
        backdrop-filter: blur(14px);
    }

    .sidebar__brand { display: none; }

    .sidebar__nav {
        flex-direction: row;
        flex: 1;
        gap: 4px;
        /* Toutes les pages restent accessibles : la barre défile au doigt. */
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar__nav::-webkit-scrollbar { display: none; }

    .sidebar__link {
        flex: 0 0 auto;
        width: auto;
        min-width: 58px;
        flex-direction: column;
        gap: 4px;
        padding: 8px 6px;
        font-size: 0.65rem;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }

    .sidebar__link--active::before { display: none; }

    .sidebar__user {
        flex: 0 0 auto;
        border-top: none;
        padding: 0;
    }

    .sidebar__user-info { display: none; }

    .main {
        margin-left: 0;
        padding: 18px 14px 90px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar__right {
        width: 100%;
        flex-wrap: wrap;
    }

    .topbar__search { flex: 1; }
    .topbar__search input { width: 100%; }

    .modal__form .form__row { grid-template-columns: 1fr; }
    .detail__grid { grid-template-columns: 1fr; }
    .filters { flex-direction: column; align-items: stretch; }
    .filters__group { justify-content: space-between; }
    .devis-totaux { width: 100%; }
    .dp-blocks { grid-template-columns: 1fr; }
    .devis-preview { padding: 22px 18px; }
    .dp-header { margin: -22px -18px 18px; padding: 16px 18px; }
}
/* ============================================================
   Journal d'activité (admin)
   ============================================================ */
.journal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.jstat {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 14px 16px;
    animation: fadeUp .3s var(--ease);
}

.jstat__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.jstat__nom {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--t1);
}

.jstat__total {
    font-size: 0.72rem;
    color: var(--t3);
    white-space: nowrap;
}

.jstat__grille {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 6px;
}

.jstat__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.jstat__val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--t2);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

/* Les appels sont le chiffre qu'on vient chercher en premier */
.jstat__item--fort .jstat__val { color: var(--gold); font-size: 1.35rem; }

.jstat__lib {
    font-size: 0.64rem;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: center;
}

.jstat__pied {
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--t3);
}

.journal-detail {
    color: var(--t3);
    font-size: 0.8rem;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Le badge violet n'existait que pour les niveaux : on le réutilise ici */
.badge--niv-violet { background: var(--purple-s); color: #C4B5FD; }

/* ============================================================
   MA JOURNÉE
   ============================================================ */
.journee-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.jkpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.jkpi__label { font-size: .75rem; color: var(--t3); letter-spacing: .04em; font-weight: 500; }
.jkpi__val {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: 6px;
}
.jkpi__val small { font-size: 1rem; color: var(--t3); font-weight: 600; }
.jkpi__barre { height: 6px; border-radius: 100px; background: var(--surface-2); margin-top: 12px; overflow: hidden; }
.jkpi__barre span { display: block; height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .5s var(--ease); }
.jkpi--ok .jkpi__barre span { background: linear-gradient(90deg, #16a34a, #4ade80); }
.jkpi--alerte { border-color: rgba(239, 68, 68, 0.4); }
.jkpi--alerte .jkpi__val { color: #FCA5A5; }
.jkpi__sous { font-size: .76rem; color: var(--t3); margin-top: 6px; }

.journee-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.journee-bloc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    min-width: 0;
}
.journee-bloc--alerte { border-color: rgba(239, 68, 68, 0.28); }
.journee-bloc__titre {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-weight: 600; font-size: .9rem; margin-bottom: 12px;
}
.journee-bloc__nb {
    margin-left: auto; font-size: .72rem; font-weight: 700;
    background: var(--surface-2); color: var(--t2); border-radius: 100px; padding: 2px 9px;
}
.journee-liste { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.jitem {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid transparent;
    cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%;
}
.jitem:hover { border-color: var(--border-2); }
.jitem__heure { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--gold); min-width: 44px; font-size: .85rem; }
.jitem__corps { min-width: 0; flex: 1; }
.jitem__nom { display: block; font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jitem__sous { display: block; font-size: .75rem; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journee-vide { font-size: .82rem; color: var(--t3); padding: 6px 2px; }
.journee-equipe input[type="number"] {
    width: 84px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--white);
    padding: 6px 9px;
    border-radius: 8px;
    font-family: inherit;
    font-size: .82rem;
    outline: none;
}
.journee-equipe input[type="number"]:focus { border-color: rgba(245, 166, 35, 0.5); }
.sidebar__badge--or { background: var(--gold); color: #1a1205; }

/* ============================================================
   SESSION D'APPELS
   ============================================================ */
.session-barre { height: 4px; background: var(--surface-2); border-radius: 100px; overflow: hidden; margin-bottom: 16px; }
.session-barre__plein { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .4s var(--ease); }

.session-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 14px;
    margin-bottom: 14px;
}
.session-fiche, .session-pitch, .session-resultats {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    min-width: 0;
}
.sfiche__raison {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .74rem; font-weight: 600; border-radius: 100px; padding: 4px 11px; margin-bottom: 10px;
    background: var(--blue-s); color: #93C5FD;
}
.sfiche__raison--retard { background: var(--red-s); color: #FCA5A5; }
.sfiche__raison--nouveau { background: var(--gold-glow); color: var(--gold); }
.sfiche__nom { font-family: 'Space Grotesk', sans-serif; font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.sfiche__contact { color: var(--t2); margin-top: 4px; font-size: .92rem; }
.sfiche__tels { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.sfiche__tel {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 700;
    padding: 10px 16px; border-radius: var(--radius-sm);
    background: rgba(34, 197, 94, 0.14); border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86EFAC; text-decoration: none;
}
.sfiche__tel:hover { background: rgba(34, 197, 94, 0.22); }
.sfiche__sanstel { color: #FCA5A5; font-size: .85rem; margin: 12px 0; }
.sfiche__infos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; font-size: .82rem; margin-bottom: 12px; }
.sfiche__infos span { display: block; color: var(--t3); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.sfiche__infos div { min-width: 0; overflow-wrap: anywhere; }
.sfiche__notes { max-height: 230px; overflow-y: auto; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.sfiche__notes-zone { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.sfiche__notes-titre { font-size: .72rem; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.sfiche__notes-etat { text-transform: none; letter-spacing: 0; color: var(--gold); font-weight: 600; }
.sfiche__notes-edit {
    width: 100%; min-height: 150px; max-height: 320px; resize: vertical;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--t1); font: inherit; font-size: .84rem; line-height: 1.5; padding: 10px 12px; outline: none;
}
.sfiche__notes-edit:focus { border-color: rgba(245, 166, 35, 0.5); }
.sfiche__notes-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.sfiche__notes-aide { font-size: .72rem; color: var(--t3); }
.sfiche__notes-aide kbd { font-family: inherit; font-size: .68rem; border: 1px solid var(--border-2); border-radius: 4px; padding: 0 4px; }
.session-fin__aide { font-size: .85rem; }
.sfiche__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.session-pitch__head { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.session-pitch__head select { flex: 1; min-width: 0; }
.session-pitch__carte { padding: 18px; }
.session-pitch__carte .play-texte { font-size: 1.02rem; }

.session-resultats__titre { font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.session-resultats__btns { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.sres {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-2); background: var(--surface-2); color: var(--t1);
    font: inherit; font-weight: 600; font-size: .86rem; cursor: pointer;
    transition: transform .15s var(--ease), border-color .15s, background .15s;
}
.sres:hover { transform: translateY(-2px); }
.sres kbd, .session-aide kbd, #btn-session-valider kbd {
    font-family: inherit; font-size: .7rem; font-weight: 700;
    border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 6px; color: var(--t2); background: rgba(0, 0, 0, .2);
}
.sres--info:hover, .sres--info.sres--on { border-color: #3B82F6; background: var(--blue-s); }
.sres--ok:hover, .sres--ok.sres--on { border-color: #22C55E; background: var(--green-s); }
.sres--top { border-color: rgba(245, 166, 35, 0.5); }
.sres--top:hover, .sres--top.sres--on { border-color: var(--gold); background: var(--gold-glow); }
.sres--ko:hover, .sres--ko.sres--on { border-color: #EF4444; background: var(--red-s); }
.sres--neutre:hover { background: rgba(255, 255, 255, .09); }
.sres:disabled { opacity: .5; cursor: progress; transform: none; }
.session-details { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.session-details__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.session-aide { font-size: .74rem; color: var(--t3); margin-top: 12px; }

.session-fin {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 34px; text-align: center; max-width: 640px; margin: 30px auto;
}
.session-fin h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; margin-bottom: 10px; }
.session-fin p { color: var(--t2); margin-bottom: 18px; }
.session-fin__chiffres { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 22px; }
.session-fin__chiffres div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 16px; font-size: .82rem; color: var(--t2); }
.session-fin__chiffres b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; color: var(--t1); }

@media (max-width: 1100px) {
    .journee-grid { grid-template-columns: 1fr; }
    .session-layout { grid-template-columns: 1fr; }
    .session-resultats__btns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .session-resultats__btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sfiche__infos { grid-template-columns: 1fr; }
}

/* Journée d'un utilisateur (page Utilisateurs) */
.modal__card--large { max-width: 1080px; }
.journee-grid--modal .journee-liste { max-height: 300px; }
.users-obj { white-space: nowrap; }
.users-obj--ok { color: #86EFAC; font-weight: 600; }

/* Session : résultat déjà enregistré sur une fiche revisitée */
.sbandeau {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
    font-size: .84rem; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px;
    background: var(--surface-2); border: 1px solid var(--border-2); color: var(--t2);
}
.sbandeau b { color: var(--t1); }
.sbandeau--ok { background: var(--green-s); border-color: rgba(34, 197, 94, 0.4); color: #BBF7D0; }
.sbandeau--ko { background: var(--red-s); border-color: rgba(239, 68, 68, 0.4); color: #FCA5A5; }
.sbandeau__aide { color: var(--t3); font-size: .78rem; margin-left: auto; }
.sres--fait { border-color: #22C55E !important; box-shadow: inset 0 0 0 1px #22C55E; }
.sres--fait::after { content: '✓'; color: #4ADE80; font-weight: 700; }


/* Pastille de progression vide (aucune session) : masquée */
.topbar__count:empty { display: none; }

/* Session d'appels sur téléphone : les boutons de résultat juste sous la
   fiche (avant le pitch), pour ne pas devoir défiler à chaque appel. */
@media (max-width: 768px) {
    #session-active { display: flex; flex-direction: column; gap: 14px; }
    #session-active .session-layout { display: contents; }
    #session-active .session-fiche { order: 1; }
    #session-active .session-resultats { order: 2; }
    #session-active .session-pitch { order: 3; }
    .toast-container, .toasts { max-width: calc(100vw - 24px); }
}
