/* ════════════════════════════════════════════════════════════════
   O2 POINTAGE — Feuille de styles principale
   Version 5.2 — Refonte visuelle complète
   Hiérarchie : Variables → Reset → Composants → Layout Admin
                → Espace Gestionnaire → Responsive
   ════════════════════════════════════════════════════════════════ */

/* ── 0. Polices Mont (pages publiques uniquement) ── */
@font-face {
    font-family: 'Mont';
    src: url('../fonts/Mont-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Mont';
    src: url('../fonts/Mont-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Mont';
    src: url('../fonts/Mont-Bold.ttf') format('truetype');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

/* ── 1. Variables globales ── */
:root {
    --o2p-blue:        #004F8F;
    --o2p-blue-dark:   #003D6E;
    --o2p-blue-light:  #E8F0FA;
    --o2p-green:       #47877F;
    --o2p-green-light: #E9F3F1;
    --o2p-green-border:#BFDDD8;
    --o2p-red:         #D81E5C;
    --o2p-red-light:   #FBE7ED;
    --o2p-red-border:  #F3B9CB;
    --o2p-orange:      #EA580C;
    --o2p-orange-light:#FFF7ED;
    --o2p-amber:       #D97706;
    --o2p-slate-900:   #273F52;
    --o2p-slate-700:   #3A5570;
    --o2p-slate-500:   #5B7184;
    --o2p-slate-200:   #DCE6ED;
    --o2p-slate-100:   #EEF3F6;
    --o2p-slate-50:    #F6F9FB;
    --o2p-white:       #ffffff;
    /* Nuances complémentaires — identifiées lors du nettoyage, utilisées à
       de nombreux endroits mais qui n'avaient pas encore de variable dédiée */
    --o2p-slate-400:   #8296A6;
    --o2p-slate-300:   #C2D1DC;
    --o2p-green-dark:  #35655F;
    --o2p-blue-border: #D3E6F5;
    --o2p-amber-border:#FDE68A;
    --o2p-amber-bg:    #FFFBEB;
    --o2p-amber-dark:  #B45309;
    --o2p-red-dark:    #7A1338;
    /* Ombres teintées bleu océan — plus douces et "premium" qu'un noir pur */
    --o2p-shadow-sm:   0 1px 6px rgba(0,79,143,.08);
    --o2p-shadow-md:   0 4px 24px rgba(0,79,143,.12);
    --o2p-shadow-lg:   0 12px 40px rgba(0,79,143,.16);
    --o2p-radius-sm:   8px;
    --o2p-radius-md:   12px;
    --o2p-radius-lg:   16px;
    /* Couleurs secondaires officielles de la charte O2 (usage ponctuel, jamais dominant) */
    --o2p-corail:      #EB5B62;
    --o2p-emeraude:    #47877F;
    --o2p-framboise:   #D81E5C;
    --o2p-poudre:      #E8F0FA;
    --o2p-anthracite:  #273F52;
    /* Dégradés de marque — bleu océan vers bleu foncé, pour boutons et fonds premium */
    --o2p-gradient-blue:      linear-gradient(135deg, #0063B8 0%, #004F8F 55%, #003D6E 100%);
    --o2p-gradient-blue-dark: linear-gradient(135deg, #003D6E 0%, #273F52 100%);
    /* Police Mont en premier — fallback système si non chargée */
    --o2p-font:        'Mont', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    /* Hiérarchie typographique */
    --o2p-text-xs:     13px;
    --o2p-text-sm:     15px;
    --o2p-text-base:   17px;
    --o2p-text-md:     19px;
    --o2p-text-lg:     22px;
    --o2p-text-xl:     26px;
    --o2p-text-2xl:    32px;
    --o2p-text-3xl:    50px;
}

/* ── 2. Reset de base ── */
.o2p-wrapper *,
.o2p-admin-espace * {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

/* ── 2bis. Boutons — refonte visuelle complète (espace gestionnaire) ──
   WordPress affiche par défaut des boutons très plats et basiques
   (".button", ".button-primary", ".button-small") — cette section leur
   donne un vrai rendu professionnel : dégradés subtils, ombres douces,
   coins arrondis, et une légère animation au survol/clic, sans jamais
   changer les classes ou le HTML existant dans le reste du plugin. */
.o2p-admin-espace .button,
.o2p-admin-espace button.button,
.o2p-admin-espace input.button {
    background: linear-gradient(180deg, #FFFFFF 0%, #F4F7FA 100%);
    border: 1px solid var(--o2p-slate-200);
    border-radius: 9px;
    color: var(--o2p-slate-700);
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 16px;
    box-shadow: 0 1px 2px rgba(39,63,82,.06), 0 1px 1px rgba(39,63,82,.04);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
    cursor: pointer;
}
.o2p-admin-espace .button:hover,
.o2p-admin-espace button.button:hover,
.o2p-admin-espace input.button:hover {
    background: linear-gradient(180deg, #FFFFFF 0%, #ECF1F5 100%);
    border-color: var(--o2p-slate-300);
    color: var(--o2p-slate-900);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(39,63,82,.10), 0 1px 2px rgba(39,63,82,.06);
}
.o2p-admin-espace .button:active,
.o2p-admin-espace button.button:active,
.o2p-admin-espace input.button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(39,63,82,.08);
}
.o2p-admin-espace .button:focus-visible,
.o2p-admin-espace button.button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--o2p-blue-light), 0 1px 2px rgba(39,63,82,.06);
}
.o2p-admin-espace .button:disabled,
.o2p-admin-espace button.button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Bouton principal — dégradé bleu de la charte, mis en avant */
.o2p-admin-espace .button-primary,
.o2p-admin-espace button.button-primary {
    background: linear-gradient(180deg, #0D63AE 0%, var(--o2p-blue) 55%, var(--o2p-blue-dark) 100%);
    border: 1px solid var(--o2p-blue-dark);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,79,143,.30), 0 1px 2px rgba(0,79,143,.20);
}
.o2p-admin-espace .button-primary:hover,
.o2p-admin-espace button.button-primary:hover {
    background: linear-gradient(180deg, #1571BE 0%, #0058A3 55%, var(--o2p-blue-dark) 100%);
    border-color: var(--o2p-blue-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,79,143,.35), 0 2px 4px rgba(0,79,143,.20);
}
.o2p-admin-espace .button-primary:focus-visible {
    box-shadow: 0 0 0 3px #BBDBF5, 0 2px 6px rgba(0,79,143,.30);
}

/* Boutons compacts — même traitement, juste plus petits */
.o2p-admin-espace .button-small {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 7px;
}

/* Liens de suppression — restent discrets (texte, pas de fond), mais avec
   un rendu intentionnel plutôt qu'un simple lien bleu par défaut du navigateur */
.o2p-admin-espace .button-link-delete {
    background: none;
    border: none;
    color: var(--o2p-red);
    font-weight: 600;
    font-size: 12.5px;
    padding: 4px 2px;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .12s ease, color .12s ease;
}
.o2p-admin-espace .button-link-delete:hover {
    color: var(--o2p-red);
    border-bottom-color: var(--o2p-red);
}

/* ════════════════════════════════════════════════════════════════
   INTERFACE INTERVENANT (shortcode [o2_pointage])
   Conçu pour mobile — lisibilité maximale, simple à comprendre
   ════════════════════════════════════════════════════════════════ */

/* Fond de page coloré pour faire ressortir les cartes */
.o2p-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 14px 50px;
    font-family: var(--o2p-font);
    min-height: 100vh;
    background: var(--o2p-blue-light);
    position: relative;
    overflow: hidden;
}
/* Marqueur identitaire O2 — la maison filaire, discrète en fond, comme dans la charte graphique */
.o2p-wrapper::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -50px;
    width: 200px;
    height: 200px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 L94 36 L94 96 L6 96 L6 36 Z' fill='none' stroke='%23004F8F' stroke-width='2' opacity='0.06'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transform: rotate(12deg);
    pointer-events: none;
    z-index: 0;
}
.o2p-wrapper > * { position: relative; z-index: 1; }

/* Carte blanche principale */
.o2p-card {
    background: var(--o2p-white);
    border-radius: var(--o2p-radius-lg);
    padding: 32px 22px;
    box-shadow: var(--o2p-shadow-md);
    text-align: center;
    margin-bottom: 14px;
}

/* Carte créneau de mission (alignée à gauche) */
.o2p-carte-creneau {
    text-align: left;
    padding: 22px 20px;
}
.o2p-carte-creneau .o2p-bloc-planning { margin-bottom: 0; }
.o2p-erreur-creneau { margin-top: 10px; }
#o2p-liste-creneaux { max-width: 480px; margin: 0 auto; }

/* Horloge — grande et bien lisible */
.o2p-horloge-conteneur {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.o2p-horloge {
    font-size: 28px;
    font-weight: 800;
    color: var(--o2p-blue);
    letter-spacing: -1px;
    line-height: 1;
    text-align: center;
}
.o2p-date-jour {
    font-size: 12px;
    font-weight: 700;
    color: var(--o2p-slate-500);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
/* Logo */
.o2p-logo-img {
    width: 72px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}
.o2p-logo-mini {
    width: 34px;
    height: auto;
    flex-shrink: 0;
}
/* Photo de profil de l'intervenant dans son espace — donne un côté
   personnalisé et rassurant dès qu'il se connecte. */
.o2p-avatar-intervenant {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2.5px solid var(--o2p-blue);
    box-shadow: 0 2px 8px rgba(0,79,143,.25);
    background: var(--o2p-blue-light);
}
.o2p-avatar-intervenant-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2.5px solid var(--o2p-blue);
    background: var(--o2p-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Conteneur autour de la photo — permet de poser le petit rond "en ligne"
   par-dessus, en bas à droite, sans toucher à la photo elle-même. */
.o2p-avatar-conteneur {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.o2p-avatar-conteneur .o2p-avatar-intervenant,
.o2p-avatar-conteneur .o2p-avatar-intervenant-placeholder {
    width: 100%;
    height: 100%;
}
.o2p-avatar-statut-en-ligne {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--o2p-green-dark);
    border: 2.5px solid var(--o2p-white);
}

/* Typographie — grande et lisible */
.o2p-titre {
    font-size: 22px;
    font-weight: 800;
    color: var(--o2p-slate-900);
    margin: 0 0 6px;
    line-height: 1.3;
}
.o2p-sous-titre {
    font-size: 14px;
    color: var(--o2p-slate-500);
    margin: 0 0 26px;
    line-height: 1.5;
}
.o2p-label {
    display: block;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    color: var(--o2p-slate-900);
    margin-bottom: 10px;
}

/* Champs de saisie — grands pour les doigts */
.o2p-input {
    width: 100%;
    padding: 17px 18px;
    border: 2px solid var(--o2p-slate-200);
    border-radius: var(--o2p-radius-md);
    font-size: 18px;
    font-family: var(--o2p-font);
    color: var(--o2p-slate-900);
    outline: none;
    margin-bottom: 14px;
    transition: border-color .15s;
    background: var(--o2p-white);
}
.o2p-input:focus {
    border-color: var(--o2p-blue);
    box-shadow: 0 0 0 4px rgba(0,79,143,.1);
}
/* Code secret : très grand et bien centré */
.o2p-input-pin {
    text-align: center;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: 20px;
    padding: 20px;
}

/* Bouton principal — grand, gros texte, facile à taper */
.o2p-btn {
    display: block;
    width: 100%;
    padding: 18px;
    background: var(--o2p-gradient-blue);
    color: var(--o2p-white);
    border: none;
    border-radius: var(--o2p-radius-md);
    font-size: 17px;
    font-family: var(--o2p-font);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,79,143,.28);
    transition: filter .15s, transform .1s, box-shadow .15s;
    text-align: center;
}
.o2p-btn:hover  { filter: brightness(1.07); box-shadow: 0 6px 18px rgba(0,79,143,.36); }
.o2p-btn:active { transform: scale(.98); }
.o2p-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Pulsation douce bouton ARRIVÉE */
@keyframes o2p-pulse-arrivee {
    0%   { box-shadow: 0 0 0 0 rgba(53, 101, 95, 0.55); }
    60%  { box-shadow: 0 0 0 12px rgba(53, 101, 95, 0); }
    100% { box-shadow: 0 0 0 0 rgba(53, 101, 95, 0); }
}
.o2p-btn-arrivee, .o2p-btn-confirmation-interne {
    background: var(--o2p-green-dark);
    font-size: 16px;
    padding: 22px 18px;
    border-radius: var(--o2p-radius-md);
    margin-top: 14px;
    animation: o2p-pulse-arrivee 1.8s ease-out infinite;
    position: relative;
    overflow: hidden;
}
.o2p-btn-arrivee:hover, .o2p-btn-confirmation-interne:hover  { background: #24463F; animation: none; }
.o2p-btn-arrivee:active, .o2p-btn-confirmation-interne:active { animation: none; }

/* Pulsation douce bouton DÉPART */
@keyframes o2p-pulse-depart {
    0%   { box-shadow: 0 0 0 0 rgba(216, 30, 92, 0.55); }
    60%  { box-shadow: 0 0 0 12px rgba(216, 30, 92, 0); }
    100% { box-shadow: 0 0 0 0 rgba(216, 30, 92, 0); }
}
.o2p-btn-depart {
    background: var(--o2p-red);
    font-size: 16px;
    padding: 22px 18px;
    border-radius: var(--o2p-radius-md);
    animation: o2p-pulse-depart 1.8s ease-out infinite;
    position: relative;
    overflow: hidden;
}
.o2p-btn-depart:hover  { background: #B0184D; animation: none; }
.o2p-btn-depart:active { animation: none; }

/* Balayage lumineux qui traverse le bouton de gauche à droite, en boucle
   avec une petite pause — attire l'œil sans être agressif ni distrayant. */
@keyframes o2p-shine-sweep {
    0%   { left: -75%; }
    35%  { left: 125%; }
    100% { left: 125%; }
}
.o2p-btn-arrivee::before,
.o2p-btn-confirmation-interne::before,
.o2p-btn-depart::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        100deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,.55) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: skewX(-20deg);
    animation: o2p-shine-sweep 3s ease-in-out infinite;
    pointer-events: none;
}
.o2p-btn-arrivee:hover::before,
.o2p-btn-confirmation-interne:hover::before,
.o2p-btn-depart:hover::before,
.o2p-btn-arrivee:active::before,
.o2p-btn-confirmation-interne:active::before,
.o2p-btn-depart:active::before { animation: none; display: none; }

/* Bouton secondaire (retour) */
.o2p-btn-ghost {
    display: block;
    width: 100%;
    padding: 14px;
    background: none;
    color: var(--o2p-slate-500);
    border: 2px solid var(--o2p-slate-200);
    border-radius: var(--o2p-radius-sm);
    font-size: 14px;
    font-family: var(--o2p-font);
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: background .15s;
}
.o2p-btn-ghost:hover { background: var(--o2p-slate-100); }

/* Messages d'erreur — bien visible, rouge */
.o2p-erreur {
    color: var(--o2p-red);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    min-height: 22px;
    line-height: 1.5;
    text-align: left;
    background: var(--o2p-red-light);
    border-radius: var(--o2p-radius-sm);
    padding: 8px 12px;
}
.o2p-erreur:empty { background: none; padding: 0; }

/* En-tête après connexion (nom + bouton quitter) */
.o2p-header-pointage {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--o2p-white);
    border-radius: var(--o2p-radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: var(--o2p-shadow-sm);
    gap: 10px;
}
.o2p-header-pointage-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
/* Nom de l'intervenant */
.o2p-nom   { font-weight: 800; font-size: 18px; color: var(--o2p-slate-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o2p-poste { font-size: 14px; color: var(--o2p-slate-500); margin-top: 2px; }

/* ── Barre de navigation en bas — toujours visible, fixe ── */
.o2p-nav-bas {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: var(--o2p-white);
    border-top: 1px solid var(--o2p-slate-200);
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    display: flex;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.o2p-nav-bas-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    font-family: var(--o2p-font);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--o2p-slate-400);
    padding: 6px 2px;
    border-radius: var(--o2p-radius-sm);
    cursor: pointer;
    transition: color .15s;
}
.o2p-nav-bas-icone { font-size: 19px; line-height: 1; }
.o2p-nav-bas-item.o2p-nav-bas-actif { color: var(--o2p-green-dark); }

/* ── Vues (Accueil / Pointages / Planning / Profil) ── */
.o2p-vue-titre { font-size: 16px; font-weight: 800; color: var(--o2p-slate-900); margin: 4px 0 14px; }

/* ── Ligne d'info en lecture seule dans "Mon profil" ── */
.o2p-profil-ligne {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--o2p-slate-100);
}
.o2p-profil-ligne:last-child { border-bottom: none; }
.o2p-profil-label { font-size: 13px; color: var(--o2p-slate-500); font-weight: 600; }
.o2p-profil-valeur { font-size: 14px; color: var(--o2p-slate-900); font-weight: 700; }

/* Bouton quitter — discret pour éviter les accidents */
.o2p-btn-deco {
    background: var(--o2p-slate-100);
    color: var(--o2p-slate-500);
    border: 1.5px solid var(--o2p-slate-200);
    padding: 8px 12px;
    border-radius: var(--o2p-radius-sm);
    font-size: 12px;
    font-family: var(--o2p-font);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
}
.o2p-btn-deco:hover { background: var(--o2p-slate-200); }

/* Bloc infos mission — nom client très lisible + bordure bleue */
.o2p-bloc-planning {
    background: var(--o2p-blue-light);
    border-radius: var(--o2p-radius-md);
    padding: 18px;
    margin-bottom: 18px;
    text-align: left;
    border-left: 5px solid var(--o2p-blue);
}
/* Nom du client — le plus grand, lu d'un coup d'œil */
.o2p-bloc-planning .client-nom     { font-weight: 800; font-size: 21px; color: var(--o2p-slate-900); line-height: 1.3; }
.o2p-bloc-planning .client-adresse { font-size: 16px; color: var(--o2p-slate-500); margin-top: 6px; line-height: 1.5; }
.o2p-bloc-planning .heure-poste    { font-size: 18px; color: var(--o2p-blue); font-weight: 800; margin-top: 10px; }

/* Résumé journées du mois */
.o2p-stats-cote-a-cote {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.o2p-stats-cote-a-cote > div {
    flex: 1;
    min-width: 0; /* évite que le texte ne déborde du cadre */
}
.o2p-bloc-heures-mois {
    background: var(--o2p-green-light);
    border: 1.5px solid var(--o2p-green-border);
    border-radius: var(--o2p-radius-md);
    padding: 10px 8px;
    margin-bottom: 0;
    text-align: center;
}
.o2p-heures-mois-label {
    font-size: 9.5px;
    color: var(--o2p-green);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    line-height: 1.2;
}
.o2p-heures-mois-valeur {
    font-size: 14px;
    font-weight: 800;
    color: var(--o2p-green-dark);
}

/* Salaire en cours — même style que le bloc journées travaillées, mais en
   bleu pour bien le distinguer visuellement, sans jamais rivaliser avec
   le bouton de pointage (toujours en dessous, jamais au-dessus). */
.o2p-bloc-salaire-mois {
    background: var(--o2p-blue-light);
    border: 1.5px solid var(--o2p-blue-border);
    border-radius: var(--o2p-radius-md);
    padding: 10px 8px;
    margin-bottom: 0;
    text-align: center;
}
.o2p-salaire-mois-label {
    font-size: 9.5px;
    color: var(--o2p-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    line-height: 1.2;
}
.o2p-salaire-mois-valeur {
    font-size: 14px;
    font-weight: 800;
    color: var(--o2p-blue);
}
.o2p-salaire-mois-note {
    font-size: 9px;
    color: var(--o2p-slate-500);
    margin-top: 2px;
    font-style: italic;
    line-height: 1.2;
}

/* Bloc prochaine mission / demain */
.o2p-bloc-demain {
    background: var(--o2p-blue-light);
    border: 1.5px solid var(--o2p-blue-border);
    border-radius: var(--o2p-radius-md);
    padding: 14px 16px;
    margin-top: 14px;
    text-align: left;
}
.o2p-bloc-demain-titre {
    font-size: 12px;
    font-weight: 700;
    color: var(--o2p-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 7px;
}
.o2p-bloc-demain-texte {
    font-size: 14px;
    color: var(--o2p-slate-900);
    line-height: 1.7;
    font-weight: 500;
}

/* Boîte résultat pointage */
.o2p-resultat-box {
    border-radius: var(--o2p-radius-md);
    padding: 20px 16px;
    text-align: center;
}
.o2p-resultat-box.succes { background: var(--o2p-green-light); border: 1.5px solid var(--o2p-green-border); }
.o2p-resultat-box.erreur { background: var(--o2p-red-light);   border: 1.5px solid var(--o2p-red-border); }
.o2p-resultat-icone  { font-size: 44px; margin-bottom: 10px; line-height: 1; }
.o2p-resultat-titre  { font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.o2p-resultat-titre.succes-txt { color: var(--o2p-green-dark); }
.o2p-resultat-titre.erreur-txt { color: var(--o2p-red); }
.o2p-resultat-detail { font-size: 14px; line-height: 1.7; color: var(--o2p-slate-700); font-weight: 500; }

/* Spinner */
.o2p-spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--o2p-slate-200);
    border-top: 4px solid var(--o2p-blue);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: o2p-spin 1s linear infinite;
}
@keyframes o2p-spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════
   COMPOSANTS ADMIN PARTAGÉS (wp-admin + espace gestionnaire)
   ════════════════════════════════════════════════════════════════ */

/* Grille de statistiques */
.o2p-admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.o2p-admin-stat-card {
    background: var(--o2p-white);
    border-radius: var(--o2p-radius-md);
    padding: 18px 16px;
    box-shadow: var(--o2p-shadow-sm);
}
.o2p-admin-stat-val   { font-size: var(--o2p-text-2xl); font-weight: 900; line-height: 1; }
.o2p-admin-stat-label { font-size: var(--o2p-text-xs); color: var(--o2p-slate-500); margin-top: 7px; font-weight: 500; line-height: 1.4; }

/* Tableau admin */
.o2p-admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--o2p-white);
    font-size: 14px;
    border-radius: var(--o2p-radius-md);
    overflow: hidden;
}
.o2p-admin-table th,
.o2p-admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--o2p-slate-200);
}
.o2p-admin-table th {
    background: var(--o2p-slate-50);
    font-weight: 700;
    color: var(--o2p-slate-900);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.o2p-admin-table tr:last-child td { border-bottom: none; }
.o2p-admin-table tr:hover td { background: var(--o2p-slate-50); }

/* Wrapper scrollable pour les tableaux sur mobile */
.o2p-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--o2p-radius-md);
    box-shadow: var(--o2p-shadow-sm);
}

/* Badge statut */
.o2p-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════
   ESPACE GESTIONNAIRE FRONTEND (shortcode [o2_admin])
   ════════════════════════════════════════════════════════════════ */

.o2p-admin-espace {
    font-family: var(--o2p-font);
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    color: var(--o2p-slate-900);
    overflow: visible;
}

/* Page de connexion */
.o2p-admin-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 40px 16px;
    background: var(--o2p-slate-100);
    position: relative;
    overflow: hidden;
}
/* Marqueur identitaire O2 — deux maisons filaires discrètes, comme sur les visuels de la charte */
.o2p-admin-login-wrap::before,
.o2p-admin-login-wrap::after {
    content: "";
    position: absolute;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 L94 36 L94 96 L6 96 L6 36 Z' fill='none' stroke='%23004F8F' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}
.o2p-admin-login-wrap::before {
    top: -60px; left: -60px;
    width: 320px; height: 320px;
    opacity: .06;
    transform: rotate(-10deg);
}
.o2p-admin-login-wrap::after {
    bottom: -80px; right: -60px;
    width: 240px; height: 240px;
    opacity: .05;
    transform: rotate(8deg);
}
.o2p-admin-login-wrap > * { position: relative; z-index: 1; }

/* Barre supérieure */
.o2p-admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--o2p-gradient-blue-dark);
    color: var(--o2p-white);
    padding: 13px 24px;
    font-size: 15px;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    transition: box-shadow .3s ease;
    overflow: hidden;
}
/* Marqueur identitaire O2 — maison filaire blanche, discrète, ancrée à droite de la barre */
.o2p-admin-topbar::after {
    content: "";
    position: absolute;
    top: -28px;
    right: 90px;
    width: 110px;
    height: 110px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 L94 36 L94 96 L6 96 L6 36 Z' fill='none' stroke='white' stroke-width='3' opacity='0.12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}
.o2p-admin-topbar-left, .o2p-admin-topbar-right { position: relative; z-index: 1; }
.o2p-admin-topbar.o2p-scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.o2p-admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
}
.o2p-logo-mini-blanc {
    background: var(--o2p-white);
    border-radius: var(--o2p-radius-sm);
    padding: 3px;
    width: 30px;
}
.o2p-admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
}

/* Navigation par onglets */
.o2p-admin-nav {
    display: flex;
    gap: 0;
    background: var(--o2p-slate-900);
    padding: 0 16px;
    flex-wrap: nowrap;
    overflow: visible;
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9998;
    transition: box-shadow .3s ease;
    align-items: stretch;
}
.o2p-admin-nav.o2p-scrolled {
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* Groupe parent */
.o2p-nav-groupe {
    position: relative;
}
.o2p-nav-groupe-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    padding: 0 18px;
    height: 48px;
    font-size: 13px;
    font-family: var(--o2p-font);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}
.o2p-nav-groupe:hover .o2p-nav-groupe-btn,
.o2p-nav-groupe-btn.has-active {
    background: rgba(255,255,255,.08);
    color: var(--o2p-white);
    border-bottom-color: var(--o2p-corail);
}

/* Dropdown — s'ouvre au survol de la souris (comportement bureau inchangé).
   La bascule au clic (.o2p-nav-groupe-ouvert) n'est activée que sur petit
   écran, dans la media query plus bas — jamais sur ordinateur. */
.o2p-nav-dropdown {
    display: none;
    position: fixed;
    top: 98px; /* 50px topbar + 48px nav */
    background: var(--o2p-slate-900);
    border-radius: 0 0 12px 12px;
    padding: 6px;
    min-width: 200px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    border-top: 2px solid var(--o2p-corail);
}
.o2p-nav-groupe:hover .o2p-nav-dropdown {
    display: block;
}

/* Petits titres de famille à l'intérieur d'un menu déroulant (ex: dans
   Pilotage : "Vue d'ensemble" / "Aide à la décision" / "Conformité") —
   discrets, non cliquables, juste pour repérer la logique d'un coup d'œil. */
.o2p-nav-groupe-titre {
    color: rgba(255,255,255,.4);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 10px 12px 4px;
}
.o2p-nav-groupe-titre:first-child {
    padding-top: 4px;
}

/* Bouton "hamburger" — invisible sur ordinateur, seul le CSS mobile
   plus bas le rend visible sur petit écran. */
.o2p-nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--o2p-white);
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
}
.o2p-nav-hamburger:active { background: rgba(255,255,255,.15); }

/* Fond sombre derrière le menu mobile ouvert — permet de refermer en
   touchant en dehors, comme sur la plupart des applications. */
.o2p-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 9997;
}
.o2p-nav-overlay.o2p-visible { display: block; }

/* Boutons dans le dropdown */
.o2p-admin-nav-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.65);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--o2p-font);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    width: 100%;
    text-align: left;
    display: block;
}
.o2p-admin-nav-btn.active,
.o2p-admin-nav-btn:hover {
    background: rgba(255,255,255,.12);
    color: var(--o2p-white);
}

/* Zone de contenu principale */
.o2p-admin-contenu {
    background: var(--o2p-slate-100);
    padding: 24px 40px;
    padding-top: 30px;
    margin-top: 100px;
    min-height: calc(100vh - 100px);
    font-size: 14px;
}
.o2p-admin-contenu label {
    font-size: 14px;
    font-weight: 600;
    color: var(--o2p-slate-900);
}
.o2p-admin-contenu .o2p-input { margin-bottom: 12px; font-size: 14px; }

/* ── Champs de formulaire (espace gestionnaire) — même souci de finition
   que les boutons : bordure plus douce, ombre légère au focus au lieu du
   halo brut par défaut, transition fluide. ── */
.o2p-admin-espace .o2p-input,
.o2p-admin-espace select.o2p-input,
.o2p-admin-espace textarea.o2p-input {
    border: 1px solid var(--o2p-slate-200);
    border-radius: 8px;
    background: var(--o2p-white);
    box-shadow: inset 0 1px 2px rgba(39,63,82,.03);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.o2p-admin-espace .o2p-input:hover,
.o2p-admin-espace select.o2p-input:hover,
.o2p-admin-espace textarea.o2p-input:hover {
    border-color: var(--o2p-slate-300);
}
.o2p-admin-espace .o2p-input:focus,
.o2p-admin-espace select.o2p-input:focus,
.o2p-admin-espace textarea.o2p-input:focus {
    border-color: var(--o2p-blue);
    box-shadow: 0 0 0 3px var(--o2p-blue-light);
}

/* ── Cases à cocher et boutons radio — couleur de la charte au lieu du
   bleu générique du navigateur, légèrement agrandis pour rester faciles
   à cliquer/toucher. ── */
.o2p-admin-espace input[type="checkbox"],
.o2p-admin-espace input[type="radio"] {
    accent-color: var(--o2p-blue);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── Étiquettes de statut (badges) — un léger relief au lieu d'un simple
   aplat de couleur, pour mieux se détacher visuellement du fond. ── */
.o2p-admin-espace .o2p-badge {
    box-shadow: 0 1px 2px rgba(39,63,82,.06);
    border: 1px solid rgba(39,63,82,.05);
}

/* Ligne de compétence (polyvalence) : "contents" pour que la grille du
   parent aligne parfaitement checkbox+label et select sur toutes les lignes,
   quelle que soit la longueur du nom du métier. Masquée via display:none par
   le JS quand ce métier est déjà le poste principal choisi. */
.o2p-iv-competence-ligne { display: contents; }

/* Titres de section dans l'espace admin */
.o2p-admin-contenu h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--o2p-slate-900);
    margin: 0 0 16px;
}
.o2p-admin-contenu h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--o2p-slate-900);
    margin: 0 0 10px;
}

/* Cartes intervenants dans l'historique */
.o2p-carte-historique-iv {
    background: var(--o2p-white);
    border-radius: var(--o2p-radius-md);
    padding: 18px 22px;
    margin-bottom: 14px;
    box-shadow: var(--o2p-shadow-sm);
    transition: box-shadow .15s;
}
.o2p-carte-historique-iv:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

/* Clignotement alerte : uniquement arrivée NON pointée après l'heure prévue.
   Une arrivée déjà enregistrée en retard ne clignote jamais. */
@keyframes o2p-clignote {
    0%, 100% { background-color: var(--o2p-red-light); }
    50%       { background-color: var(--o2p-red-border); }
}
.o2p-ligne-retard { animation: o2p-clignote 1.2s ease-in-out infinite; }
/* Les cellules portent aussi l'animation : les tableaux appliquent souvent
   leur propre fond aux <td>, ce qui pouvait masquer l'animation du <tr>. */
.o2p-ligne-retard td { animation: o2p-clignote 1.2s ease-in-out infinite; }
.o2p-ligne-retard td:first-child { border-left: 4px solid var(--o2p-red) !important; }
.o2p-ligne-retard:hover td { animation: o2p-clignote 1.2s ease-in-out infinite; }

/* Clignotement "interne en attente de confirmation" — bleu, pas rouge :
   ce n'est pas une faute (pas d'horaire à respecter), juste un rappel visuel
   pour que le gestionnaire pense à appeler/relancer l'intervenant si besoin. */
@keyframes o2p-clignote-interne {
    0%, 100% { background-color: var(--o2p-blue-light); }
    50%       { background-color: var(--o2p-blue-border); }
}
.o2p-ligne-attente-interne { animation: o2p-clignote-interne 1.6s ease-in-out infinite; }
.o2p-ligne-attente-interne td:first-child { border-left: 4px solid var(--o2p-blue); }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile first
   ════════════════════════════════════════════════════════════════ */

/* Tablettes (≤ 900px) */
@media (max-width: 900px) {
    .o2p-admin-contenu { padding: 18px 16px; }
    .o2p-admin-topbar  { padding: 10px 14px; }
    /* Grilles de stats : 4 colonnes → 2 colonnes */
    .o2p-admin-stats   { grid-template-columns: repeat(2, 1fr); }
    /* Tableaux non encore convertis en cartes : au moins lisibles avec défilement */
    .o2p-admin-table { font-size: var(--o2p-text-xs); }
    .o2p-admin-table th,
    .o2p-admin-table td { padding: 9px 10px; }

    /* ── Tableaux convertis en petites cartes empilées (.o2p-table-carte) ──
       Chaque ligne devient une carte, chaque cellule une paire
       "étiquette : valeur" — beaucoup plus lisible qu'un tableau à 10+
       colonnes compressé sur un petit écran. */
    .o2p-table-carte, .o2p-table-carte tbody, .o2p-table-carte tr, .o2p-table-carte td { display: block; width: 100%; }
    .o2p-table-carte thead { display: none; }
    .o2p-table-carte { font-size: 13px; }
    .o2p-table-carte tr {
        background: var(--o2p-white);
        border-radius: 10px;
        padding: 4px 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 6px rgba(0,0,0,.05);
    }
    .o2p-table-carte td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid var(--o2p-slate-100);
        text-align: right;
    }
    .o2p-table-carte td:last-child { border-bottom: none; }
    .o2p-table-carte td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 10.5px;
        color: var(--o2p-slate-500);
        text-align: left;
        flex-shrink: 0;
        text-transform: uppercase;
        letter-spacing: .3px;
    }
    /* La cellule d'identité (photo + nom) est l'en-tête de la carte : pleine
       largeur, sans étiquette redondante devant. */
    .o2p-table-carte td[data-label="Intervenant"] {
        display: block;
        padding: 14px 0 10px;
    }
    .o2p-table-carte td[data-label="Intervenant"]::before { content: none; }

    /* ── Grilles à colonnes fixes (formulaires, blocs d'infos) : passent à
       1 ou 2 colonnes sur petit écran. Ciblées directement via leur style,
       sans toucher au HTML — le calendrier (7 colonnes, jours de la
       semaine) est volontairement exclu : il doit garder son défilement
       horizontal pour rester lisible en grille, pas s'empiler. */
    [style*="grid-template-columns:1fr 1fr;"],
    [style*="grid-template-columns:1fr 1fr 1fr;"],
    [style*="grid-template-columns:minmax(180px,1fr) 190px"],
    [style*="grid-template-columns:repeat(3,1fr)"] {
        grid-template-columns: 1fr !important;
    }
    [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns:repeat(5,1fr)"] {
        grid-template-columns: repeat(2,1fr) !important;
    }
    .o2p-nav-hamburger { display: block; }
    .o2p-topbar-titre-texte { display: none; } /* logo seul, plus de place pour le ☰ et le menu */
    .o2p-topbar-connecte-texte { display: none; } /* "Connecté : Nom" — superflu sur petit écran */

    .o2p-admin-nav {
        display: none; /* masqué par défaut, affiché via .o2p-nav-ouvert */
        flex-direction: column;
        top: 58px;
        max-height: calc(100vh - 58px);
        overflow-y: auto;
        padding: 8px;
        box-shadow: 0 8px 24px rgba(0,0,0,.4);
    }
    .o2p-admin-nav.o2p-nav-ouvert { display: flex; }

    /* Chaque groupe devient un accordéon empilé (au lieu d'un survol) */
    .o2p-nav-groupe { width: 100%; }
    .o2p-nav-groupe-btn {
        width: 100%;
        height: auto;
        padding: 14px 12px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        justify-content: space-between;
    }
    .o2p-nav-groupe-btn::after { content: "▸"; font-size: 12px; transition: transform .15s; }
    .o2p-nav-groupe.o2p-nav-groupe-ouvert .o2p-nav-groupe-btn::after { transform: rotate(90deg); }
    .o2p-nav-groupe.o2p-nav-groupe-ouvert .o2p-nav-groupe-btn {
        background: rgba(255,255,255,.08);
        color: var(--o2p-white);
    }
    /* Ouverture au clic — uniquement ici, sous 900px, jamais sur ordinateur */
    .o2p-nav-dropdown { display: none; }
    .o2p-nav-groupe.o2p-nav-groupe-ouvert .o2p-nav-dropdown { display: block; }

    /* Sous-menu : plus de position fixed (on est déjà dans le tiroir), juste
       une liste empilée sous le bouton du groupe. */
    .o2p-nav-dropdown {
        position: static;
        box-shadow: none;
        border-top: none;
        border-radius: 0;
        min-width: 0;
        padding: 4px 4px 4px 16px;
    }
    .o2p-admin-nav-btn { padding: 13px 14px; font-size: 14px; } /* cible tactile plus grande */

    /* ── Cibles tactiles plus généreuses (boutons/icônes trop petits au doigt) ──
       WordPress affiche ses ".button-small" en pensant à un clic souris
       précis — sur mobile, on agrandit la zone cliquable sans changer
       l'apparence visuelle du texte/icône lui-même. S'applique partout,
       pas seulement dans les tableaux (ex: bouton "Annuler" des pop-up). */
    .button,
    .button-small,
    .o2p-table-carte a {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 14px;
    }
    /* Bouton "✕" de fermeture des fenêtres pop-up — bien plus facile à
       toucher précisément qu'un simple caractère minuscule. */
    #o2p-close-modal-copie {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    /* Interface intervenant */
    .o2p-wrapper { margin: 12px auto; padding: 0 10px; }
    .o2p-card    { padding: 24px 18px; }
    .o2p-titre   { font-size: var(--o2p-text-base); }
    .o2p-horloge { font-size: 24px; }
    .o2p-resultat-icone { font-size: 34px; }

    /* Header pointage : empile sur très petits écrans */
    .o2p-header-pointage { flex-wrap: wrap; gap: 8px; }

    /* Espace gestionnaire */
    .o2p-admin-topbar-left  { font-size: var(--o2p-text-sm); }
    .o2p-admin-topbar-right { gap: 8px; font-size: var(--o2p-text-xs); }
    .o2p-admin-nav-btn      { padding: 8px 10px; font-size: var(--o2p-text-xs); }

    /* Stats : 2 colonnes sur mobile */
    .o2p-admin-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    /* Grille 7 colonnes → 2 colonnes */
    .o2p-admin-stats[style*="repeat(7"] { grid-template-columns: repeat(2, 1fr) !important; }
    .o2p-admin-stat-val   { font-size: var(--o2p-text-xl); }
    .o2p-admin-stat-label { font-size: 11px; }

    /* Tableaux : scroll horizontal, pas de retour à la ligne forcé */
    .o2p-table-wrap       { border-radius: var(--o2p-radius-sm); }
    .o2p-admin-table th,
    .o2p-admin-table td   { white-space: nowrap; padding: 8px 10px; }

    /* Formulaires : champs pleine largeur sur mobile */
    .o2p-admin-contenu .o2p-input,
    .o2p-admin-contenu input[type="text"],
    .o2p-admin-contenu input[type="email"],
    .o2p-admin-contenu input[type="number"],
    .o2p-admin-contenu input[type="date"],
    .o2p-admin-contenu select {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Boîte résultat */
    .o2p-resultat-box { padding: 16px; }
}

/* Très petit (≤ 360px) */
@media (max-width: 360px) {
    .o2p-card { padding: 20px 14px; }
    .o2p-btn  { font-size: var(--o2p-text-sm); padding: 13px; }
    .o2p-admin-stats { grid-template-columns: 1fr 1fr; }
    .o2p-horloge     { font-size: 22px; }
}

/* ════════════════════════════════════════════════════════════════
   STYLES wp-admin UNIQUEMENT
   ════════════════════════════════════════════════════════════════ */

/* Tableau de bord wp-admin : wrapper scrollable */
.o2p-wp-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 900px) {
    .o2p-stats-7 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
    .o2p-stats-7 { grid-template-columns: repeat(2, 1fr); }
}

/* ── ANNIVERSAIRE : confettis + message qui apparaît puis disparaît ── */
.o2p-confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    opacity: 0.95;
    animation-name: o2p-confetti-tomber;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    border-radius: 2px;
}
@keyframes o2p-confetti-tomber {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

.o2p-anniv-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    text-align: center;
    background: rgba(255,255,255,.97);
    border-radius: 24px;
    padding: 32px 28px;
    box-shadow: 0 24px 64px rgba(0,0,0,.25);
    max-width: 340px;
    width: calc(100% - 40px);
    opacity: 0;
    animation: o2p-anniv-apparition 0.6s cubic-bezier(.34,1.56,.64,1) forwards,
               o2p-anniv-disparition 0.6s ease-in forwards 4.4s;
}
@keyframes o2p-anniv-apparition {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes o2p-anniv-disparition {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
}
.o2p-anniv-emoji {
    font-size: 44px;
    margin-bottom: 12px;
    line-height: 1;
    animation: o2p-anniv-balancement 1.2s ease-in-out infinite;
}
@keyframes o2p-anniv-balancement {
    0%, 100% { transform: rotate(-6deg); }
    50%      { transform: rotate(6deg); }
}
.o2p-anniv-texte {
    font-size: 24px;
    font-weight: 900;
    color: var(--o2p-blue);
    line-height: 1.3;
    margin-bottom: 10px;
}
.o2p-anniv-sous-texte {
    font-size: 14px;
    color: var(--o2p-slate-500);
    font-weight: 600;
    line-height: 1.5;
}
@media (max-width: 380px) {
    .o2p-anniv-texte { font-size: 20px; }
    .o2p-anniv-emoji { font-size: 36px; }
}

/* ── Guide visuel "Localisation bloquée" ── */
#o2p-guide-localisation-overlay.o2p-actif { display: flex !important; }

/* ── Popup de confirmation de pointage (arrivée / départ) ── */
#o2p-confirm-pointage-overlay.o2p-actif { display: flex !important; }
.o2p-confirm-pointage-carte {
    background: var(--o2p-white);
    border-radius: 20px;
    padding: 30px 24px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: o2p-confirm-pop-in .25s ease-out;
}
@keyframes o2p-confirm-pop-in {
    0%   { transform: scale(.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
#o2p-confirm-pointage-btn:disabled { opacity: .5; cursor: not-allowed; }

.o2p-guide-loc-carte {
    background: var(--o2p-white);
    border-radius: 20px;
    padding: 26px 22px;
    max-width: 360px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.o2p-guide-loc-etape {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--o2p-slate-50);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.o2p-guide-loc-etape-numero {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--o2p-blue);
    color: var(--o2p-white);
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.o2p-guide-loc-etape-texte {
    font-size: 13.5px;
    color: var(--o2p-slate-900);
    line-height: 1.45;
    padding-top: 2px;
}
.o2p-guide-loc-etape-texte strong {
    color: var(--o2p-blue);
}
.o2p-guide-loc-mockup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--o2p-green-dark);
    color: var(--o2p-white);
    font-weight: 700;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    margin: 4px 2px;
}
.o2p-guide-loc-icones {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}
.o2p-guide-loc-icone-exemple {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--o2p-slate-100);
    border: 1.5px solid var(--o2p-slate-200);
    border-radius: 8px;
    font-size: 19px;
}
.o2p-guide-loc-note {
    display: block;
    font-size: 12px;
    color: var(--o2p-amber-dark);
    background: var(--o2p-amber-bg);
    border: 1px solid var(--o2p-amber-border);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
}

/* ════════════════════════════════════════════════════════════════
   MODULES MA JOURNÉE, SUIVI ÉQUIPE, PLANNING SEMAINE — mobile
   ════════════════════════════════════════════════════════════════ */

/* Planning semaine : défilement horizontal sur mobile (grille 7 jours) */
.o2p-sem-row  { min-width: 600px; }

/* Wrapper scrollable pour la grille semaine */
@media (max-width: 900px) {
    /* Grille semaine — scroll horizontal plutôt que compression */
    [style*="o2p-sem"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Stats 4 semaines : 2 colonnes au lieu de 4 */
    [style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: repeat(2,1fr) !important;
    }

    /* Ma Journée : ring + texte empilés verticalement */
    [style*="display:flex"][style*="align-items:center"][style*="gap:18px"] {
        flex-wrap: wrap;
    }

    /* Boutons imprévu/urgence : pleine largeur */
    #o2p-btn-imprevu,
    #o2p-btn-urgence {
        width: 100%;
        min-height: 44px;
    }

    /* Cartes tâches : padding réduit */
    .o2p-tache-card { padding: 11px 12px; }

    /* Messages épinglés : empilés verticalement */
    .o2p-msg-epingle { flex-direction: column !important; }
    .o2p-msg-epingle button { width: 100%; margin-top: 8px; }

    /* Historique messages : badges en colonne */
    .o2p-hist-msg-item [style*="display:flex"][style*="gap:12px"] {
        flex-direction: column;
    }

    /* Filtre poste suivi équipe : pleine largeur */
    #o2p-suivi-filtre-poste { width: 100%; }
}

@media (max-width: 600px) {
    /* Semaine : label gestionnaire plus court */
    .o2p-sem-label { flex: 0 0 100px !important; font-size: 11px !important; }
    .o2p-sem-cell  { min-width: 70px !important; padding: 6px 4px !important; }

    /* Ring progression Ma Journée : taille réduite */
    [style*="width:80px"][style*="height:80px"] {
        width: 64px !important;
        height: 64px !important;
    }

    /* Classement semaine : barres plus courtes */
    [style*="width:80px"][style*="border-radius:999px"][style*="height:7px"] {
        width: 50px !important;
    }

    /* Formulaires Ma Journée : pleine largeur */
    #o2p-form-imprevu  { padding: 12px; }
    #o2p-form-urgence  { padding: 12px; }
    #o2p-form-imprevu .o2p-input,
    #o2p-form-urgence  textarea { font-size: 16px !important; } /* évite le zoom auto iOS */

    /* Stats 4 semaines : 1 colonne sur très petit */
    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns:repeat(2,1fr)"][style*="gap:10px"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Modèles tâches : segments cliquables scrollables */
    .o2p-seg { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}


/* ════════════════════════════════════════════════════════════════
   O2 UI 2026 — couche responsive et accessibilité, sans changer
   la logique métier. Mobile-first pour les intervenants.
   ════════════════════════════════════════════════════════════════ */
:root {
    --o2p-radius-sm: 10px;
    --o2p-radius-md: 14px;
    --o2p-radius-lg: 18px;
    --o2p-shadow-soft: 0 2px 12px rgba(15,23,42,.06);
    --o2p-shadow-card: 0 8px 30px rgba(15,23,42,.08);
}

.o2p-input, .o2p-admin-espace input, .o2p-admin-espace select, .o2p-admin-espace textarea {
    min-height: 44px;
}

.o2p-admin-espace button, .o2p-admin-espace .button,
#o2p-intervenant-app button, #o2p-client-app button {
    -webkit-tap-highlight-color: transparent;
}

#o2p-intervenant-app, #o2p-client-app, .o2p-admin-espace {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@media (max-width: 600px) {
    #o2p-intervenant-app { width:100%; overflow-x:hidden; }
    #o2p-intervenant-app input, #o2p-intervenant-app select, #o2p-intervenant-app textarea,
    #o2p-client-app input, #o2p-client-app select, #o2p-client-app textarea,
    .o2p-admin-espace input, .o2p-admin-espace select, .o2p-admin-espace textarea {
        font-size:16px !important;
    }
    #o2p-intervenant-app button, #o2p-client-app button { min-height:44px; }
    .o2p-admin-topbar { min-height:58px; padding:10px 12px !important; }
    .o2p-topbar-titre-texte { font-size:13px !important; }
    .o2p-admin-topbar-right { gap:6px !important; }
    .o2p-topbar-connecte-texte { display:none !important; }
    .o2p-admin-nav { max-width:92vw; }
    .o2p-admin-espace table { font-size:12px; }
    .o2p-admin-espace .o2p-card { border-radius:14px !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* ════════════════════════════════════════════════════════════════
   O2 POINTAGE 7.95 — DESIGN SYSTEM O2 2026
   Refonte visuelle uniquement : aucun changement de logique métier.
   Référence : charte O2 (bleu océan, bleu poudré, blanc, anthracite,
   corail/framboise en CTA, marqueur maison discret).
   ════════════════════════════════════════════════════════════════ */

:root {
    --o2p-blue: #004F8F;
    --o2p-poudre: #E8F0FA;
    --o2p-corail: #EB5B62;
    --o2p-framboise: #D81E5C;
    --o2p-emeraude: #47877F;
    --o2p-anthracite: #273F52;
    --o2p-surface: #FFFFFF;
    --o2p-surface-soft: #F7FAFD;
    --o2p-border-soft: #D9E5EF;
    --o2p-shadow-premium: 0 10px 30px rgba(0,79,143,.10);
    --o2p-shadow-focus: 0 0 0 4px rgba(0,79,143,.13);
}

/* Police de marque sur l'ensemble des interfaces O2 du plugin. */
.o2p-wrapper,
.o2p-admin-espace,
.o2p-admin-espace button,
.o2p-admin-espace input,
.o2p-admin-espace select,
.o2p-admin-espace textarea {
    font-family: var(--o2p-font);
}

/* ── INTERVENANT : application mobile ── */
#o2p-app.o2p-wrapper {
    width: 100%;
    max-width: 520px;
    min-height: 100svh;
    padding: 14px 12px calc(88px + env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(circle at 100% 0%, rgba(0,79,143,.07), transparent 34%),
        linear-gradient(180deg, #F4F8FC 0%, var(--o2p-poudre) 100%);
}

#o2p-app .o2p-card {
    border: 1px solid rgba(0,79,143,.07);
    box-shadow: var(--o2p-shadow-premium);
}

/* Connexion : carte plus légère, plus proche d'une vraie application. */
#o2p-form-connexion .o2p-card {
    padding: 30px 22px 24px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}
#o2p-form-connexion .o2p-card::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -90px;
    top: -90px;
    border: 2px solid rgba(0,79,143,.08);
    border-radius: 44% 56% 52% 48%;
    pointer-events: none;
}
#o2p-form-connexion .o2p-logo-img {
    width: 88px;
    height: auto;
    object-fit: contain;
    margin-bottom: 16px;
}
#o2p-form-connexion .o2p-titre {
    color: var(--o2p-blue);
    font-size: 25px;
    line-height: 1.18;
    letter-spacing: -.02em;
}
#o2p-form-connexion .o2p-sous-titre {
    color: #60758A;
    line-height: 1.55;
    margin-bottom: 22px;
}

/* Champs tactiles : grande zone de saisie et focus très visible. */
#o2p-app .o2p-input {
    min-height: 50px;
    border: 1px solid var(--o2p-border-soft);
    border-radius: 13px;
    background: rgba(255,255,255,.98);
    padding: 12px 14px;
    color: var(--o2p-anthracite);
    box-shadow: 0 1px 1px rgba(39,63,82,.03);
}
#o2p-app .o2p-input:focus {
    border-color: var(--o2p-blue);
    box-shadow: var(--o2p-shadow-focus);
    outline: none;
}
#o2p-app .o2p-input-pin {
    text-align: center;
    letter-spacing: .42em;
    font-size: 22px !important;
    font-weight: 700;
}

#o2p-app .o2p-btn {
    min-height: 52px;
    border-radius: 14px;
    background: var(--o2p-blue);
    border: 0;
    box-shadow: 0 8px 20px rgba(0,79,143,.20);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
}
#o2p-app .o2p-btn:hover {
    background: #075A9D;
    box-shadow: 0 10px 24px rgba(0,79,143,.24);
}
#o2p-app .o2p-btn:focus-visible {
    outline: none;
    box-shadow: var(--o2p-shadow-focus), 0 8px 20px rgba(0,79,143,.20);
}
#o2p-app .o2p-btn-ghost {
    min-height: 44px;
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--o2p-blue);
    background: transparent;
}

/* En-tête intervenant : identité claire + hiérarchie forte. */
#o2p-etape-pointage .o2p-header-pointage {
    border-radius: 20px;
    padding: 14px 15px;
    margin-bottom: 12px;
    border: 1px solid rgba(0,79,143,.07);
    box-shadow: 0 6px 20px rgba(0,79,143,.07);
}
#o2p-etape-pointage .o2p-avatar-intervenant,
#o2p-etape-pointage .o2p-avatar-intervenant-placeholder {
    width: 52px !important;
    height: 52px !important;
    border-radius: 18px;
    object-fit: cover;
}
#o2p-etape-pointage .o2p-avatar-statut-en-ligne {
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    right: -1px;
    bottom: -1px;
}
#o2p-etape-pointage .o2p-nom {
    font-size: 18px;
    color: var(--o2p-anthracite);
}
#o2p-etape-pointage .o2p-poste {
    color: #6B7F92;
}

/* Horloge : information utile mais moins dominante que l'action principale. */
#o2p-etape-pointage .o2p-horloge-conteneur {
    justify-content: space-between;
    padding: 0 4px;
    margin: 4px 2px 10px;
}
#o2p-etape-pointage .o2p-horloge {
    font-size: clamp(26px, 8vw, 34px);
    letter-spacing: -.04em;
    color: var(--o2p-anthracite);
}
#o2p-etape-pointage .o2p-date-jour {
    font-size: 12px;
    color: #6A7F91;
    font-weight: 600;
    text-align: right;
}

/* Carte mission : la lecture doit commencer par le client puis l'horaire. */
#o2p-liste-creneaux .o2p-card,
#o2p-liste-creneaux .o2p-carte-creneau {
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(0,79,143,.09);
}
#o2p-liste-creneaux .o2p-bloc-planning {
    border-left: 0;
    border-top: 4px solid var(--o2p-blue);
    background: linear-gradient(180deg, #F6FAFE 0%, #EDF4FB 100%);
    padding: 17px;
    border-radius: 16px;
}
#o2p-liste-creneaux .o2p-bloc-planning .client-nom {
    color: var(--o2p-anthracite);
    font-size: 20px;
}
#o2p-liste-creneaux .o2p-bloc-planning .client-adresse {
    color: #687E92;
    font-size: 14px;
}
#o2p-liste-creneaux .o2p-bloc-planning .heure-poste {
    display: inline-flex;
    margin-top: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(0,79,143,.10);
    font-size: 14px;
}

/* CTA selon la charte : corail / framboise. Le vert reste réservé au statut. */
#o2p-app .o2p-btn-arrivee,
#o2p-app .o2p-btn-confirmation-interne {
    /* ARRIVÉE = VERT : le vert est réservé à l'action positive
       d'arrivée réussie. Le rouge reste réservé au DÉPART. */
    background: var(--o2p-green-dark) !important;
    border-color: var(--o2p-green-dark) !important;
    box-shadow: 0 9px 22px rgba(53,101,95,.28);
}
#o2p-app .o2p-btn-arrivee:hover,
#o2p-app .o2p-btn-confirmation-interne:hover {
    background: #24463F !important;
}
#o2p-app .o2p-btn-depart {
    background: var(--o2p-framboise) !important;
    border-color: var(--o2p-framboise) !important;
    box-shadow: 0 9px 22px rgba(216,30,92,.22);
}
#o2p-app .o2p-btn-depart:hover {
    background: #C91B56 !important;
}

/* Statistiques : cartes de lecture rapide. */
#o2p-app .o2p-stats-cote-a-cote {
    gap: 9px;
    margin-bottom: 11px;
}
#o2p-app .o2p-bloc-heures-mois,
#o2p-app .o2p-bloc-salaire-mois {
    min-height: 72px;
    border-radius: 16px;
    padding: 11px 9px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#o2p-app .o2p-bloc-heures-mois {
    background: #EEF7F5;
    border-color: rgba(71,135,127,.22);
}
#o2p-app .o2p-bloc-salaire-mois {
    background: #EEF4FB;
    border-color: rgba(0,79,143,.13);
}

/* Navigation basse : style application native, compatible safe-area. */
#o2p-app .o2p-nav-bas {
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.97);
    border-top: 1px solid rgba(39,63,82,.10);
    box-shadow: 0 -8px 24px rgba(39,63,82,.08);
    backdrop-filter: blur(14px);
}
#o2p-app .o2p-nav-bas-item {
    min-height: 54px;
    border-radius: 14px;
    color: #6F8294;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
}
#o2p-app .o2p-nav-bas-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    border-radius: 10px;
    font-size: 18px;
}
#o2p-app .o2p-nav-bas-item.o2p-nav-bas-actif {
    color: var(--o2p-blue);
    background: var(--o2p-poudre);
}
#o2p-app .o2p-nav-bas-item.o2p-nav-bas-actif .o2p-nav-bas-icone {
    background: rgba(0,79,143,.09);
}

/* Écrans profil / historique / planning : uniformité des cartes. */
#o2p-app .o2p-vue-titre {
    font-size: 21px;
    color: var(--o2p-blue);
    letter-spacing: -.02em;
}
#o2p-app .o2p-carte-historique-iv,
#o2p-app .o2p-bloc-demain {
    border: 1px solid rgba(0,79,143,.07);
    box-shadow: 0 7px 22px rgba(0,79,143,.07);
}
#o2p-app .o2p-resultat-box {
    border-radius: 18px;
}

/* ── GESTIONNAIRE : identité O2 et densité plus professionnelle ── */
.o2p-admin-espace {
    background: #F4F7FA;
}
.o2p-admin-espace .o2p-admin-topbar {
    background: var(--o2p-blue);
    box-shadow: 0 5px 18px rgba(0,43,79,.18);
}
.o2p-admin-espace .o2p-admin-topbar::after {
    opacity: .65;
}
.o2p-admin-espace .o2p-admin-nav {
    background: var(--o2p-anthracite);
}
.o2p-admin-espace .o2p-nav-groupe-btn.has-active,
.o2p-admin-espace .o2p-nav-groupe:hover .o2p-nav-groupe-btn {
    border-bottom-color: var(--o2p-corail);
}
.o2p-admin-espace .o2p-admin-contenu {
    background: #F4F7FA;
}
.o2p-admin-espace .o2p-admin-stat-card,
.o2p-admin-espace .o2p-card,
.o2p-admin-espace .o2p-carte-historique-iv,
.o2p-admin-espace .o2p-modele-card,
.o2p-admin-espace .o2p-emp-card {
    border: 1px solid rgba(39,63,82,.07);
    box-shadow: 0 6px 20px rgba(39,63,82,.065);
}
.o2p-admin-espace .o2p-admin-stat-card {
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}
.o2p-admin-espace .o2p-admin-stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--o2p-blue);
}
.o2p-admin-espace .o2p-admin-stat-val {
    color: var(--o2p-anthracite);
    letter-spacing: -.035em;
}
.o2p-admin-espace .o2p-admin-table {
    border: 1px solid rgba(39,63,82,.07);
    box-shadow: 0 6px 20px rgba(39,63,82,.05);
}
.o2p-admin-espace .o2p-admin-table th {
    background: var(--o2p-poudre);
    color: var(--o2p-blue);
}
.o2p-admin-espace .o2p-admin-table td {
    background: #fff;
}
.o2p-admin-espace .o2p-admin-table tr:hover td {
    background: #F7FAFD;
}
.o2p-admin-espace .o2p-input:focus,
.o2p-admin-espace select.o2p-input:focus,
.o2p-admin-espace textarea.o2p-input:focus {
    border-color: var(--o2p-blue);
    box-shadow: var(--o2p-shadow-focus);
}
.o2p-admin-espace .button-primary,
.o2p-admin-espace button.button-primary {
    background: var(--o2p-blue);
    border-color: var(--o2p-blue);
}
.o2p-admin-espace .button-primary:hover,
.o2p-admin-espace button.button-primary:hover {
    background: #075A9D;
    border-color: #075A9D;
}
.o2p-admin-espace .button-link-delete {
    color: var(--o2p-framboise);
}

/* Connexion gestionnaire : même territoire graphique que l'app intervenant. */
.o2p-admin-login-wrap {
    background:
        radial-gradient(circle at 12% 15%, rgba(0,79,143,.10), transparent 25%),
        linear-gradient(180deg, #F4F8FC 0%, #EAF2F9 100%);
}
.o2p-admin-login-wrap .o2p-card {
    border-radius: 24px;
    border: 1px solid rgba(0,79,143,.08);
    box-shadow: 0 18px 45px rgba(0,79,143,.12);
}
.o2p-admin-login-wrap .o2p-btn {
    background: var(--o2p-blue) !important;
}

/* ── Responsive gestionnaire : mobile réellement exploitable ── */
@media (max-width: 600px) {
    #o2p-app.o2p-wrapper {
        padding-left: 10px;
        padding-right: 10px;
    }
    #o2p-etape-pointage .o2p-header-pointage {
        padding: 12px 13px;
    }
    #o2p-liste-creneaux .o2p-carte-creneau {
        padding: 14px;
    }
    #o2p-app .o2p-btn {
        min-height: 54px;
        font-size: 15.5px;
    }
    .o2p-admin-espace .o2p-admin-contenu {
        padding: 16px 10px 26px;
    }
    .o2p-admin-espace .o2p-admin-stats {
        gap: 9px;
    }
    .o2p-admin-espace .o2p-admin-stat-card {
        padding: 15px 13px;
    }
    .o2p-admin-espace .o2p-admin-topbar {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .o2p-admin-espace .o2p-admin-login-wrap {
        min-height: 100svh;
        padding: 24px 12px 72px;
    }
}

@media (max-width: 360px) {
    #o2p-form-connexion .o2p-card {
        padding-left: 16px;
        padding-right: 16px;
    }
    #o2p-etape-pointage .o2p-nom {
        font-size: 16px;
    }
    #o2p-liste-creneaux .o2p-bloc-planning .client-nom {
        font-size: 18px;
    }
}


/* ── 2026 finalisation : accessibilité, tactile et appareils à encoche ── */
#o2p-app,
.o2p-admin-espace,
.o2p-admin-login-wrap {
    -webkit-tap-highlight-color: transparent;
}

#o2p-app button,
#o2p-app a,
#o2p-app input,
#o2p-app select,
#o2p-app textarea,
.o2p-admin-espace button,
.o2p-admin-espace a,
.o2p-admin-espace input,
.o2p-admin-espace select,
.o2p-admin-espace textarea {
    touch-action: manipulation;
}

#o2p-app :focus-visible,
.o2p-admin-espace :focus-visible,
.o2p-admin-login-wrap :focus-visible {
    outline: 3px solid rgba(0,79,143,.32);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    #o2p-app.o2p-wrapper {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    #o2p-app .o2p-btn,
    .o2p-admin-espace .o2p-btn,
    .o2p-admin-espace button.button-primary {
        min-height: 52px;
    }

    .o2p-admin-espace .o2p-admin-contenu {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    #o2p-app *,
    .o2p-admin-espace *,
    .o2p-admin-login-wrap * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* ════════════════════════════════════════════════════════════════
   O2 UI 2026 — PASSAGE RESPONSIVE FINAL v8.5
   Objectif : intervenant 100 % mobile + gestionnaire desktop/mobile.
   Cette couche ne modifie aucune règle métier ni aucun sélecteur JS.
   ════════════════════════════════════════════════════════════════ */

/* Empêche les éléments flex/grid de forcer un débordement horizontal. */
.o2p-admin-espace,
.o2p-admin-espace .o2p-admin-contenu,
.o2p-admin-espace .o2p-card,
.o2p-admin-espace .o2p-table-wrap,
#o2p-app.o2p-wrapper {
    min-width: 0;
    max-width: 100%;
}
.o2p-admin-espace img,
#o2p-app img,
#o2p-client-app img {
    max-width: 100%;
    height: auto;
}
.o2p-admin-espace input,
.o2p-admin-espace select,
.o2p-admin-espace textarea,
#o2p-app input,
#o2p-app select,
#o2p-app textarea {
    max-width: 100%;
}

/* Les zones d'actions passent proprement à la ligne au lieu de sortir de l'écran. */
.o2p-admin-espace .o2p-actions,
.o2p-admin-espace .o2p-actions-row,
.o2p-admin-espace .o2p-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Les modales gestionnaires ne doivent jamais dépasser le viewport. */
.o2p-admin-espace [role="dialog"],
.o2p-admin-espace .o2p-modal,
.o2p-admin-espace .o2p-modal-contenu {
    max-width: calc(100vw - 24px);
}

/* Calendriers/grilles larges : le défilement est local, jamais sur toute la page. */
.o2p-admin-espace .o2p-calendar-wrap,
.o2p-admin-espace .o2p-planning-scroll,
.o2p-admin-espace .o2p-gantt-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* ── Téléphone : priorité à la lisibilité et aux actions au doigt ── */
@media (max-width: 600px) {
    html, body { max-width: 100%; overflow-x: hidden; }

    #o2p-app.o2p-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Les cartes ne doivent pas devenir des bandeaux trop serrés. */
    #o2p-app .o2p-card,
    #o2p-app .o2p-carte-creneau {
        width: 100%;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    /* Actions intervenant : une action principale par ligne = moins d'erreurs. */
    #o2p-app .o2p-btn,
    #o2p-app button[type="submit"],
    #o2p-app button[type="button"] {
        min-height: 52px;
    }

    /* Gestionnaire : les actions d'une fiche se replient naturellement. */
    .o2p-admin-espace .o2p-actions,
    .o2p-admin-espace .o2p-actions-row,
    .o2p-admin-espace .o2p-modal-actions {
        width: 100%;
    }
    .o2p-admin-espace .o2p-actions > .button,
    .o2p-admin-espace .o2p-actions > button,
    .o2p-admin-espace .o2p-actions-row > .button,
    .o2p-admin-espace .o2p-actions-row > button,
    .o2p-admin-espace .o2p-modal-actions > .button,
    .o2p-admin-espace .o2p-modal-actions > button {
        flex: 1 1 160px;
        min-height: 46px;
    }

    /* Les tableaux restent utilisables : on ne compresse pas 8–12 colonnes.
       Les tables .o2p-table-carte sont déjà transformées en cartes par la couche
       responsive existante ; les autres restent dans leur wrapper scrollable. */
    .o2p-admin-espace .o2p-table-wrap {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .o2p-admin-espace .o2p-table-wrap > table {
        max-width: none;
    }

    /* En mode carte, les valeurs longues ne cassent pas la largeur. */
    .o2p-table-carte td,
    .o2p-table-carte td * {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    /* Formulaires : une colonne sur téléphone. */
    .o2p-admin-espace form > .o2p-grid,
    .o2p-admin-espace .o2p-form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Navigation : fermeture visuelle propre après sélection. */
    .o2p-admin-nav {
        width: min(92vw, 360px);
        max-width: 92vw;
    }

    /* Les en-têtes trop longs peuvent revenir à la ligne. */
    .o2p-admin-espace h1,
    .o2p-admin-espace h2,
    .o2p-admin-espace h3,
    .o2p-admin-espace h4 {
        overflow-wrap: anywhere;
    }

    /* Les champs de recherche prennent toute la largeur. */
    .o2p-admin-espace input[type="search"],
    .o2p-admin-espace input[type="text"],
    .o2p-admin-espace input[type="tel"],
    .o2p-admin-espace input[type="date"],
    .o2p-admin-espace input[type="time"],
    .o2p-admin-espace input[type="number"],
    .o2p-admin-espace select,
    .o2p-admin-espace textarea {
        width: 100%;
    }

    /* Sécurité : aucun élément décoratif ne doit créer une barre horizontale. */
    #o2p-app .o2p-card,
    #o2p-app .o2p-modal,
    #o2p-app [role="dialog"] {
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 380px) {
    #o2p-app.o2p-wrapper { padding-left: 8px; padding-right: 8px; }
    #o2p-app .o2p-card { padding-left: 14px; padding-right: 14px; }
    .o2p-admin-espace .o2p-admin-contenu { padding-left: 8px; padding-right: 8px; }
    .o2p-admin-espace .o2p-admin-stats { grid-template-columns: 1fr !important; }
    .o2p-admin-espace .button,
    .o2p-admin-espace button.button { width: 100%; }
}

/* ── Ordinateur : conserver l'espace de travail sans écraser les tableaux. ── */
@media (min-width: 901px) {
    .o2p-admin-espace .o2p-admin-contenu {
        min-width: 0;
    }
    .o2p-admin-espace .o2p-table-wrap {
        max-width: 100%;
    }
}


/* ── Documents > Feuilles de route : même langage visuel que Fiches de profil / Contrats ── */
.o2p-feuille-route-liste {
    max-height: 600px;
    overflow-y: auto;
    padding: 2px 4px 2px 0;
    scrollbar-gutter: stable;
}
.o2p-feuille-route-carte {
    background: var(--o2p-white);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    border: 1px solid transparent;
}
.o2p-feuille-route-carte:hover { border-color: var(--o2p-slate-100); }
.o2p-feuille-route-carte-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}
.o2p-feuille-route-identite {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
}
.o2p-feuille-route-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--o2p-blue-light);
    border: 2px solid var(--o2p-slate-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex: 0 0 52px;
}
.o2p-feuille-route-infos { min-width: 0; }
.o2p-feuille-route-client {
    font-weight: 800;
    font-size: 15px;
    color: var(--o2p-slate-900);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.o2p-feuille-route-sousligne,
.o2p-feuille-route-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: 11.5px;
    color: var(--o2p-slate-500);
}
.o2p-feuille-route-sousligne > span,
.o2p-feuille-route-meta > span {
    background: var(--o2p-slate-50);
    border-radius: 5px;
    padding: 2px 8px;
}
.o2p-feuille-route-metier {
    background: var(--o2p-blue-light) !important;
    color: var(--o2p-blue) !important;
    font-weight: 700;
}
.o2p-feuille-route-intervenant {
    background: var(--o2p-amber-bg) !important;
    color: var(--o2p-amber) !important;
    font-weight: 700;
}
.o2p-feuille-route-partagee { font-weight: 600; }
.o2p-feuille-route-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: wrap;
}
.o2p-feuille-route-actions .button {
    font-size: 13px;
    white-space: nowrap;
}
@media (max-width: 900px) {
    .o2p-feuille-route-liste { max-height: 600px; padding-right: 2px; }
    .o2p-feuille-route-carte { padding: 14px; }
    .o2p-feuille-route-carte-main {
        align-items: stretch;
        flex-direction: column;
    }
    .o2p-feuille-route-identite { align-items: flex-start; }
    .o2p-feuille-route-actions {
        justify-content: stretch;
        width: 100%;
    }
    .o2p-feuille-route-actions .button {
        flex: 1 1 calc(50% - 4px);
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        text-align: center;
    }
}
@media (max-width: 480px) {
    .o2p-feuille-route-identite { gap: 10px; }
    .o2p-feuille-route-avatar { width: 44px; height: 44px; flex-basis: 44px; font-size: 20px; }
    .o2p-feuille-route-actions .button { flex-basis: 100%; width: 100%; }
}

/* ── Documents > Contrats : même langage visuel que les Fiches de profil ── */
.o2p-contrat-liste {
    max-height: 600px;
    overflow-y: auto;
    padding: 2px 4px 2px 0;
    scrollbar-gutter: stable;
}
.o2p-contrat-carte {
    background: var(--o2p-white);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    border: 1px solid transparent;
}
.o2p-contrat-carte:hover {
    border-color: var(--o2p-slate-100);
}
.o2p-contrat-carte-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}
.o2p-contrat-identite {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
}
.o2p-contrat-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--o2p-blue-light);
    border: 2px solid var(--o2p-slate-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex: 0 0 52px;
}
.o2p-contrat-infos { min-width: 0; }
.o2p-contrat-nom {
    font-weight: 800;
    font-size: 15px;
    color: var(--o2p-slate-900);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.o2p-contrat-sousligne,
.o2p-contrat-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: 11.5px;
    color: var(--o2p-slate-500);
}
.o2p-contrat-sousligne > span:not(.o2p-contrat-statut),
.o2p-contrat-meta > span {
    background: var(--o2p-slate-50);
    border-radius: 5px;
    padding: 2px 8px;
}
.o2p-contrat-statut {
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.o2p-contrat-signe { color: var(--o2p-green-dark) !important; }
.o2p-contrat-expiration { font-weight: 700; }
.o2p-contrat-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: wrap;
}
.o2p-contrat-actions .button {
    font-size: 13px;
    white-space: nowrap;
}
.o2p-contrat-upload-label { cursor: pointer; }

@media (max-width: 900px) {
    .o2p-contrat-liste { max-height: 600px; padding-right: 2px; }
    .o2p-contrat-carte { padding: 14px; }
    .o2p-contrat-carte-main {
        align-items: stretch;
        flex-direction: column;
    }
    .o2p-contrat-identite { align-items: flex-start; }
    .o2p-contrat-actions {
        justify-content: stretch;
        width: 100%;
    }
    .o2p-contrat-actions .button,
    .o2p-contrat-actions label.button {
        flex: 1 1 calc(50% - 4px);
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        text-align: center;
    }
}
@media (max-width: 480px) {
    .o2p-contrat-identite { gap: 10px; }
    .o2p-contrat-avatar { width: 44px; height: 44px; flex-basis: 44px; font-size: 20px; }
    .o2p-contrat-actions .button,
    .o2p-contrat-actions label.button { flex-basis: 100%; width: 100%; }
}


/* ── Documents : rendu robuste des listes de cartes ───────────────────────
   Ces règles sont volontairement non limitées à .o2p-admin-espace : les
   pages Documents peuvent être rendues dans différents conteneurs selon le
   mode d'intégration. Le rendu doit rester identique dans tous les cas. */
#o2p-contrat-liste,
#o2p-feuille-route-liste,
#o2p-fiche-liste {
    display: block;
    max-height: 600px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 2px 4px 2px 0 !important;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
#o2p-contrat-liste > .o2p-contrat-carte,
#o2p-feuille-route-liste > .o2p-feuille-route-carte,
#o2p-fiche-liste > .o2p-fiche-carte {
    box-sizing: border-box;
    width: 100%;
}
#o2p-contrat-liste > .o2p-contrat-carte,
#o2p-feuille-route-liste > .o2p-feuille-route-carte {
    display: block;
    background: var(--o2p-white) !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    padding: 14px 18px !important;
    margin: 0 0 10px 0 !important;
    box-shadow: 0 1px 6px rgba(0,0,0,.05) !important;
}
#o2p-contrat-liste > .o2p-contrat-carte:last-child,
#o2p-feuille-route-liste > .o2p-feuille-route-carte:last-child,
#o2p-fiche-liste > .o2p-fiche-carte:last-child { margin-bottom: 0 !important; }
#o2p-contrat-liste .o2p-contrat-carte-main,
#o2p-feuille-route-liste .o2p-feuille-route-carte-main {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 14px !important;
}
#o2p-contrat-liste .o2p-contrat-actions,
#o2p-feuille-route-liste .o2p-feuille-route-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    flex-wrap: wrap !important;
}
#o2p-contrat-liste .o2p-contrat-actions .button:not(.o2p-btn-delete-contrat),
#o2p-feuille-route-liste .o2p-feuille-route-actions .button:not(.o2p-btn-delete-feuille-route) {
    background: var(--o2p-blue) !important;
    border-color: var(--o2p-blue-dark) !important;
    color: var(--o2p-white) !important;
    box-shadow: 0 2px 6px rgba(0,79,143,.20) !important;
    text-shadow: none !important;
}
#o2p-contrat-liste .o2p-contrat-actions .button:not(.o2p-btn-delete-contrat):hover,
#o2p-feuille-route-liste .o2p-feuille-route-actions .button:not(.o2p-btn-delete-feuille-route):hover {
    background: var(--o2p-blue-dark) !important;
    border-color: var(--o2p-blue-dark) !important;
    color: var(--o2p-white) !important;
}
#o2p-contrat-liste .o2p-contrat-actions .o2p-btn-delete-contrat,
#o2p-feuille-route-liste .o2p-feuille-route-actions .o2p-btn-delete-feuille-route {
    color: var(--o2p-red) !important;
}
@media (max-width: 900px) {
    #o2p-contrat-liste > .o2p-contrat-carte,
    #o2p-feuille-route-liste > .o2p-feuille-route-carte { padding: 14px !important; }
    #o2p-contrat-liste .o2p-contrat-carte-main,
    #o2p-feuille-route-liste .o2p-feuille-route-carte-main {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    #o2p-contrat-liste .o2p-contrat-actions,
    #o2p-feuille-route-liste .o2p-feuille-route-actions {
        width: 100% !important;
        justify-content: stretch !important;
    }
    #o2p-contrat-liste .o2p-contrat-actions .button,
    #o2p-feuille-route-liste .o2p-feuille-route-actions .button {
        flex: 1 1 calc(50% - 4px) !important;
        min-height: 42px;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box;
    }
}
@media (max-width: 480px) {
    #o2p-contrat-liste .o2p-contrat-actions .button,
    #o2p-feuille-route-liste .o2p-feuille-route-actions .button { flex-basis: 100% !important; width: 100% !important; }
}

/* ── Documents : actions bleues cohérentes avec Fiches de profil ──
   Les actions principales des cartes Fiches / Contrats / Feuilles de route
   utilisent toutes le bleu O2. La suppression reste volontairement discrète
   et rouge pour conserver une hiérarchie visuelle et éviter les clics
   destructifs accidentels. */
.o2p-admin-espace .o2p-fiche-carte > div:last-child .button:not(.o2p-fiche-btn-delete),
.o2p-admin-espace .o2p-contrat-actions .button:not(.o2p-btn-delete-contrat),
.o2p-admin-espace .o2p-feuille-route-actions .button:not(.o2p-btn-delete-feuille-route) {
    background: linear-gradient(180deg, #0D63AE 0%, var(--o2p-blue) 55%, var(--o2p-blue-dark) 100%);
    border-color: var(--o2p-blue-dark);
    color: var(--o2p-white);
    box-shadow: 0 2px 6px rgba(0,79,143,.22), 0 1px 2px rgba(0,79,143,.12);
}
.o2p-admin-espace .o2p-fiche-carte > div:last-child .button:not(.o2p-fiche-btn-delete):hover,
.o2p-admin-espace .o2p-contrat-actions .button:not(.o2p-btn-delete-contrat):hover,
.o2p-admin-espace .o2p-feuille-route-actions .button:not(.o2p-btn-delete-feuille-route):hover {
    background: linear-gradient(180deg, #1571BE 0%, #0058A3 55%, var(--o2p-blue-dark) 100%);
    border-color: var(--o2p-blue-dark);
    color: var(--o2p-white);
    box-shadow: 0 6px 16px rgba(0,79,143,.30), 0 2px 4px rgba(0,79,143,.16);
}
.o2p-admin-espace .o2p-fiche-carte > div:last-child .button:not(.o2p-fiche-btn-delete):focus-visible,
.o2p-admin-espace .o2p-contrat-actions .button:not(.o2p-btn-delete-contrat):focus-visible,
.o2p-admin-espace .o2p-feuille-route-actions .button:not(.o2p-btn-delete-feuille-route):focus-visible {
    color: var(--o2p-white);
    box-shadow: 0 0 0 3px #BBDBF5, 0 2px 6px rgba(0,79,143,.25);
}

/* Les zones de listes sont de vrais cadres de consultation : la page reste
   stable et seul le contenu de la liste défile lorsque les cartes dépassent
   la hauteur disponible. */
.o2p-fiche-carte,
.o2p-contrat-carte,
.o2p-feuille-route-carte { box-sizing: border-box; }
.o2p-feuille-route-liste,
.o2p-contrat-liste,
#o2p-fiche-liste {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}


/* ── Documents : hiérarchie visuelle finale des actions ─────────────────
   Seules les actions de consultation principales sont bleues :
   - Voir PDF (fiches, contrats, feuilles de route)
   - Voir (feuille de route) reste une action secondaire.
   Les actions d'édition, duplication, dépôt, etc. restent neutres pour
   éviter une interface trop chargée visuellement. */
.o2p-admin-espace .o2p-fiche-carte > div:last-child .button:not(.o2p-fiche-btn-pdf):not(.o2p-fiche-btn-delete),
.o2p-admin-espace .o2p-contrat-actions .button:not(.o2p-btn-pdf-contrat):not(.o2p-btn-delete-contrat),
.o2p-admin-espace .o2p-feuille-route-actions .button:not(.o2p-btn-pdf-feuille-route):not(.o2p-btn-delete-feuille-route) {
    background: var(--o2p-white) !important;
    border-color: var(--o2p-slate-200) !important;
    color: var(--o2p-slate-700) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04) !important;
    text-shadow: none !important;
}
.o2p-admin-espace .o2p-fiche-carte > div:last-child .o2p-fiche-btn-pdf,
.o2p-admin-espace .o2p-contrat-actions .o2p-btn-pdf-contrat,
.o2p-admin-espace .o2p-feuille-route-actions .o2p-btn-pdf-feuille-route {
    background: var(--o2p-blue) !important;
    border-color: var(--o2p-blue) !important;
    color: var(--o2p-white) !important;
    box-shadow: 0 2px 6px rgba(0,79,143,.18) !important;
    text-shadow: none !important;
}
.o2p-admin-espace .o2p-fiche-carte > div:last-child .o2p-fiche-btn-pdf:hover,
.o2p-admin-espace .o2p-contrat-actions .o2p-btn-pdf-contrat:hover,
.o2p-admin-espace .o2p-feuille-route-actions .o2p-btn-pdf-feuille-route:hover {
    background: var(--o2p-blue-dark) !important;
    border-color: var(--o2p-blue-dark) !important;
    color: var(--o2p-white) !important;
}
.o2p-admin-espace .o2p-fiche-carte > div:last-child .o2p-fiche-btn-delete,
.o2p-admin-espace .o2p-contrat-actions .o2p-btn-delete-contrat,
.o2p-admin-espace .o2p-feuille-route-actions .o2p-btn-delete-feuille-route {
    color: var(--o2p-red) !important;
}

/* ════════════════════════════════════════════════════════════════
   V8.8.53 — RAIL DESKTOP UNIFIÉ
   Sur ordinateur, toutes les vues de l'espace gestionnaire utilisent
   exactement le même axe gauche/droite. Les petits formulaires et cartes
   internes peuvent conserver leur largeur propre à l'intérieur de ce rail,
   mais la page elle-même ne change plus de largeur d'une section à l'autre.
   Mobile/tablette : aucun changement (règles <= 900px existantes).
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) {
    .o2p-admin-espace .o2p-admin-topbar {
        padding-left: max(12px, calc((100vw - 1650px) / 2));
        padding-right: max(12px, calc((100vw - 1650px) / 2));
    }

    .o2p-admin-espace .o2p-admin-nav {
        padding-left: max(12px, calc((100vw - 1650px) / 2));
        padding-right: max(12px, calc((100vw - 1650px) / 2));
    }

    .o2p-admin-espace .o2p-admin-contenu {
        padding-left: max(12px, calc((100vw - 1650px) / 2));
        padding-right: max(12px, calc((100vw - 1650px) / 2));
    }

    /* Chaque bloc de premier niveau posé dans la zone de contenu partage
       le même rail. Les fenêtres modales restent volontairement exclues :
       elles doivent continuer à être centrées sur toute la fenêtre. */
    .o2p-admin-espace .o2p-admin-contenu > *:not([id$="-modal"]):not([id="o2p-modale-tel"]):not(#o2p-modal-copie-planning):not(#o2p-paiement-modal):not(#o2p-ct-modal):not(#o2p-ct-import-modal):not(#o2p-ct-dupliquer-modal):not(#o2p-fr-modal):not(#o2p-fr-dupliquer-modal) {
        width: 100%;
        max-width: 1650px !important;
        margin-left: auto;
        margin-right: auto;
    }

    /* Les éléments qui étaient historiquement limités à 700–1000 px ne
       collent plus leur bord à une position différente. Leur contenu interne
       peut néanmoins rester volontairement compact quand il possède son
       propre composant/card. */
    .o2p-admin-espace .o2p-admin-contenu > .o2p-bulletin-page {
        width: 100%;
        max-width: 1650px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   CRM COMMERCIAL v8.8.55
   ═══════════════════════════════════════════════════════════════════ */
.o2p-crm-page{font-family:inherit;color:var(--o2p-slate-900)}
.o2p-crm-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin:0 0 18px}
.o2p-crm-head h2{margin:0 0 5px;font-size:22px}.o2p-crm-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.o2p-crm-head p{margin:0;color:var(--o2p-slate-500);font-size:13px}
.o2p-crm-kpis-mini,.o2p-crm-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.o2p-crm-kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.o2p-crm-mini-card,.o2p-crm-kpi{background:var(--o2p-white);border:1px solid var(--o2p-slate-100);border-radius:12px;padding:15px 16px;box-shadow:0 1px 5px rgba(0,0,0,.04)}
.o2p-crm-mini-card span,.o2p-crm-kpi span{display:block;color:var(--o2p-slate-500);font-size:11.5px;font-weight:700}.o2p-crm-mini-card strong{display:block;font-size:20px;margin-top:6px}.o2p-crm-kpi strong{display:block;font-size:23px;margin-top:6px}.o2p-crm-kpi small{display:block;color:var(--o2p-slate-500);margin-top:3px;font-weight:700}
.o2p-crm-filters{display:flex;gap:8px;flex-wrap:wrap;align-items:center;background:var(--o2p-white);border:1px solid var(--o2p-slate-100);border-radius:12px;padding:12px;margin-bottom:14px}.o2p-crm-filters input,.o2p-crm-filters select{min-height:38px;border:1px solid var(--o2p-slate-200);border-radius:8px;padding:7px 10px;font-size:12.5px;background:#fff}.o2p-crm-filters input:first-child{flex:1;min-width:240px}
.o2p-crm-filters{position:relative}.o2p-crm-filters input:focus,.o2p-crm-filters select:focus{outline:2px solid rgba(0,79,143,.12);outline-offset:1px}.o2p-crm-filters .o2p-crm-search-loading{background-image:linear-gradient(90deg,transparent,rgba(0,79,143,.08),transparent);background-size:200% 100%;animation:o2p-crm-search-pulse 1s linear infinite}.o2p-crm-filter-status{width:100%;font-size:11px;color:var(--o2p-slate-500);min-height:15px;margin-top:1px}
@keyframes o2p-crm-search-pulse{from{background-position:200% 0}to{background-position:-200% 0}}
.o2p-crm-table-wrap{background:var(--o2p-white);border-radius:12px;overflow:hidden;border:1px solid var(--o2p-slate-100);position:relative;margin-bottom:16px}.o2p-crm-table-scroll{max-height:500px;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;position:relative}.o2p-crm-table{margin:0;min-width:2500px;border-collapse:collapse;border-spacing:0;overflow:visible}.o2p-crm-table thead th{position:sticky;top:0;z-index:5;background:var(--o2p-slate-50);box-shadow:0 1px 0 var(--o2p-slate-200);white-space:nowrap}.o2p-crm-table td{white-space:nowrap;vertical-align:middle}.o2p-crm-table td small,.o2p-crm-table td:nth-child(7) small,.o2p-crm-table td:nth-child(8) small,.o2p-crm-table td:nth-child(9) small,.o2p-crm-table td:nth-child(13) small{display:block;color:var(--o2p-slate-400);font-size:11px;margin-top:3px;white-space:normal}.o2p-crm-table .o2p-crm-number{font-weight:800;color:var(--o2p-blue-dark);text-align:center}.o2p-crm-table .o2p-crm-prospect-sticky{position:sticky;left:0;z-index:7;background:var(--o2p-white);min-width:190px;width:190px;box-shadow:8px 0 14px rgba(15,23,42,.08)}.o2p-crm-table thead .o2p-crm-prospect-sticky{z-index:9;background:var(--o2p-slate-50);box-shadow:8px 0 14px rgba(15,23,42,.06)}.o2p-crm-table tbody tr:hover .o2p-crm-prospect-sticky{background:var(--o2p-slate-50)}.o2p-crm-table .o2p-crm-actions-sticky{position:sticky;right:0;z-index:6;background:var(--o2p-white);box-shadow:-8px 0 14px rgba(15,23,42,.08);min-width:270px}.o2p-crm-table thead .o2p-crm-actions-sticky{z-index:8}.o2p-crm-actions-fixed{display:flex;gap:6px;align-items:center;justify-content:flex-start;white-space:nowrap}.o2p-crm-actions-fixed .button,.o2p-crm-actions-fixed .button-link-delete{margin:0!important}.o2p-crm-table th:nth-child(9),.o2p-crm-table td:nth-child(9){width:250px;min-width:250px;max-width:250px}.o2p-crm-table th:nth-child(9),.o2p-crm-table td:nth-child(9){white-space:normal}.o2p-crm-table th:nth-child(10),.o2p-crm-table td:nth-child(10){width:135px;min-width:135px;max-width:135px} .o2p-crm-client-situation{min-width:210px;max-width:250px;white-space:normal!important}.o2p-crm-client-status{display:inline-flex;flex-direction:column;gap:2px;border-radius:9px;padding:6px 9px;line-height:1.2}.o2p-crm-client-status strong{font-size:11px}.o2p-crm-client-status small{font-size:10px;color:inherit;opacity:.82}.o2p-crm-client-status.active{background:#dcfce7;color:#166534}.o2p-crm-client-status.today{background:#ecfdf5;color:#047857}.o2p-crm-client-status.upcoming{background:#eff6ff;color:#1d4ed8}.o2p-crm-client-status.inactive{background:#f1f5f9;color:#475569}.o2p-crm-client-status.neutral{background:#f8fafc;color:#64748b;border:1px solid #e2e8f0}.o2p-crm-client-status.warning{background:#fff7ed;color:#c2410c}.o2p-crm-empty{text-align:center;padding:35px!important;color:var(--o2p-slate-500)}
.o2p-crm-badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:800;white-space:nowrap;background:var(--o2p-slate-100);color:var(--o2p-slate-700)}.o2p-crm-badge.new{background:#eef2ff;color:#3730a3}.o2p-crm-badge.wait{background:#fff7ed;color:#c2410c}.o2p-crm-badge.qual{background:#ecfeff;color:#0e7490}.o2p-crm-badge.visit{background:#eff6ff;color:#1d4ed8}.o2p-crm-badge.quote,.o2p-crm-badge.valid{background:#eff6ff;color:#2563eb}.o2p-crm-badge.signed,.o2p-crm-badge.started{background:var(--o2p-green-light);color:var(--o2p-green-dark)}.o2p-crm-badge.lost{background:var(--o2p-red-light);color:var(--o2p-red)}
.o2p-crm-grid2{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(330px,.65fr);gap:14px;margin-bottom:14px}.o2p-crm-grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:14px}.o2p-crm-panel{padding:18px}.o2p-crm-panel h3{margin:0 0 12px;font-size:15px}.o2p-crm-chart{height:280px}.o2p-crm-help{font-size:12px;color:var(--o2p-slate-500);margin:0 0 12px}.o2p-crm-funnel{display:flex;flex-direction:column;gap:7px}.o2p-crm-funnel div{display:flex;justify-content:space-between;align-items:center;background:var(--o2p-slate-50);border-radius:8px;padding:9px 11px;font-size:12px}.o2p-crm-funnel b{font-size:14px}.o2p-crm-insight{margin-top:14px;padding:18px;border-left:4px solid var(--o2p-blue)}.o2p-crm-insight h3{margin:0 0 8px}.o2p-crm-insight ul{margin:0;padding-left:20px;color:var(--o2p-slate-700);font-size:13px;line-height:1.7}
.o2p-crm-period{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.o2p-crm-period label{font-size:11px;font-weight:700;color:var(--o2p-slate-500)}.o2p-crm-period input{display:block;margin-top:4px;min-height:36px;border:1px solid var(--o2p-slate-200);border-radius:8px;padding:6px 9px}.o2p-crm-modal{position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:100000;display:flex;align-items:center;justify-content:center;padding:20px}.o2p-crm-dialog{width:min(920px,96vw);max-height:92vh;overflow:auto;background:var(--o2p-white);border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.2)}.o2p-crm-dialog-head{display:flex;justify-content:space-between;gap:15px;padding:20px;border-bottom:1px solid var(--o2p-slate-100);position:sticky;top:0;background:var(--o2p-white);z-index:2}.o2p-crm-dialog-head h3{margin:0 0 4px}.o2p-crm-dialog-head p{margin:0;color:var(--o2p-slate-500);font-size:12px}.o2p-crm-dialog-head .o2p-crm-close{border:0;background:var(--o2p-slate-100);width:34px;height:34px;min-width:34px;height:34px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer;padding:0;display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px}.o2p-crm-dialog-actions .o2p-crm-close{width:auto;min-width:0;height:auto;border:1px solid var(--o2p-slate-200);border-radius:8px;background:#fff;color:var(--o2p-slate-700);font-size:13px;line-height:1.2;font-weight:600;cursor:pointer;padding:9px 14px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}.o2p-crm-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;padding:20px}.o2p-crm-field{display:flex;flex-direction:column;gap:5px}.o2p-crm-field.full{grid-column:1/-1}
.o2p-crm-history-option{margin-top:2px;padding:13px 14px;border:1px solid var(--o2p-slate-200);border-radius:10px;background:var(--o2p-slate-50);}
.o2p-crm-history-check{display:flex;align-items:flex-start;gap:10px;cursor:pointer;margin:0;line-height:1.35;}
.o2p-crm-history-check input[type="checkbox"]{width:18px;height:18px;min-width:18px;margin:1px 0 0;accent-color:#0b5da7;cursor:pointer;}
.o2p-crm-history-check span{display:flex;flex-direction:column;gap:2px;}
.o2p-crm-history-check strong{font-size:13px;color:var(--o2p-slate-800);}
.o2p-crm-history-check small{font-size:11.5px;font-weight:400;color:var(--o2p-slate-500);line-height:1.45;}
.o2p-crm-history-status{margin:9px 0 0 28px;padding:9px 11px;border-radius:8px;background:#eef7f1;border:1px solid #cfe8d8;color:#245d3a;font-size:11.5px;line-height:1.45;}
.o2p-crm-contact-note{margin-top:-4px;padding:9px 12px;border-radius:8px;background:var(--o2p-slate-50);border:1px solid var(--o2p-slate-100);color:var(--o2p-slate-500);font-size:11.5px;line-height:1.45}.o2p-crm-field label{font-size:11.5px;font-weight:800;color:var(--o2p-slate-600)}.o2p-crm-field input,.o2p-crm-field select,.o2p-crm-field textarea{width:100%;box-sizing:border-box;border:1px solid var(--o2p-slate-200);border-radius:8px;padding:9px 10px;font-size:13px;background:#fff}.o2p-crm-phone-wrap{display:grid;grid-template-columns:minmax(185px,38%) minmax(0,1fr);gap:7px}.o2p-crm-phone-wrap select,.o2p-crm-phone-wrap input{min-width:0}.o2p-crm-phone-help{font-size:10.5px;color:var(--o2p-slate-500);line-height:1.35}.o2p-crm-phone-field{min-width:0}.o2p-crm-dialog-actions{display:flex;justify-content:flex-end;gap:9px;padding:15px 20px;border-top:1px solid var(--o2p-slate-100);position:sticky;bottom:0;background:var(--o2p-white)}#o2p-crm-form-error{margin:0 20px;color:var(--o2p-red);font-size:12px;font-weight:700}

.o2p-crm-import-body{padding:20px}.o2p-crm-import-drop{border:1px dashed var(--o2p-slate-300);border-radius:12px;padding:22px;background:var(--o2p-slate-50)}.o2p-crm-import-drop strong{display:block;margin-bottom:10px}.o2p-crm-import-drop input{width:100%;box-sizing:border-box;padding:10px;background:#fff;border:1px solid var(--o2p-slate-200);border-radius:8px}.o2p-crm-import-drop p{font-size:12px;color:var(--o2p-slate-500);margin:10px 0 0}.o2p-crm-import-note{margin-top:14px;padding:14px 16px;border:1px solid var(--o2p-blue-200,var(--o2p-slate-200));border-radius:10px;background:#fff;font-size:12px;line-height:1.55}.o2p-crm-import-note strong{margin-bottom:6px}.o2p-crm-import-note ul{margin:7px 0 0 18px;padding:0}.o2p-crm-import-note li{margin:3px 0}.o2p-crm-import-note p{margin:9px 0 0;font-size:11px}.o2p-crm-import-success,.o2p-crm-import-error{margin-top:14px;padding:14px;border-radius:10px;font-size:12px}.o2p-crm-import-success{background:var(--o2p-green-light);color:var(--o2p-green-dark)}.o2p-crm-import-error{background:var(--o2p-red-light);color:var(--o2p-red)}.o2p-crm-import-stats{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}.o2p-crm-import-stats span{background:#fff;padding:8px 10px;border-radius:8px}.o2p-crm-import-success details{margin-top:10px}.o2p-crm-import-success ul{margin:7px 0 0 18px}
@media(max-width:900px){.o2p-crm-kpis-mini,.o2p-crm-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.o2p-crm-grid2,.o2p-crm-grid3{grid-template-columns:1fr}.o2p-crm-head{flex-direction:column}.o2p-crm-form-grid{grid-template-columns:1fr}.o2p-crm-field.full{grid-column:auto}.o2p-crm-period{width:100%}.o2p-crm-period label{flex:1}.o2p-crm-period input{width:100%;box-sizing:border-box}}
@media(max-width:700px){.o2p-crm-table .o2p-crm-prospect-sticky{min-width:155px;width:155px;max-width:155px}}
@media(max-width:520px){.o2p-crm-phone-wrap{grid-template-columns:1fr}.o2p-crm-kpis-mini,.o2p-crm-kpi-grid{grid-template-columns:1fr}.o2p-crm-filters input,.o2p-crm-filters select,.o2p-crm-filters button{width:100%}.o2p-crm-filters input:first-child{min-width:0}.o2p-crm-modal{padding:8px}.o2p-crm-dialog{max-height:96vh}.o2p-crm-dialog-actions{flex-direction:column}.o2p-crm-dialog-actions button{width:100%}}

.o2p-crm-activities{margin:0 20px 15px;padding:13px;background:var(--o2p-slate-50);border:1px solid var(--o2p-slate-100);border-radius:10px}.o2p-crm-activities h4{margin:0 0 8px;font-size:13px}.o2p-crm-activities div{padding:7px 0;border-top:1px solid var(--o2p-slate-200);font-size:11.5px;color:var(--o2p-slate-700)}.o2p-crm-activities div:first-of-type{border-top:0}.o2p-crm-activities small{color:var(--o2p-slate-400)}

.o2p-crm-action-group{margin-top:10px}.o2p-crm-action-group h4{margin:0 0 6px;font-size:11px}.o2p-crm-action-group h4 span{font-weight:600;color:var(--o2p-slate-500)}.o2p-crm-action-list{display:flex;flex-direction:column;gap:7px}.o2p-crm-action-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px;border:1px solid var(--o2p-slate-100);border-radius:8px;background:var(--o2p-slate-50);font-size:11.5px}.o2p-crm-action-main{min-width:0}.o2p-crm-action-main strong,.o2p-crm-action-main span,.o2p-crm-action-main small{display:block}.o2p-crm-action-main span{color:var(--o2p-slate-500);margin-top:2px}.o2p-crm-action-main small{color:var(--o2p-slate-500);margin-top:4px;font-size:10px}.o2p-crm-action-side{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}.o2p-crm-action-side b{white-space:nowrap}.o2p-crm-action-side .button{min-height:28px;padding:3px 8px;font-size:10.5px}.o2p-crm-action-item.late{border-left:3px solid var(--o2p-red);background:var(--o2p-red-light)}.o2p-crm-action-item.today{border-left:3px solid var(--o2p-orange)}.o2p-crm-action-item.future{border-left:3px solid var(--o2p-blue)}

/* ═══════════ NOTIFICATIONS O2 — confirmation serveur ═══════════ */
.o2p-toast-notif{position:fixed;top:22px;right:22px;z-index:100001;display:flex;align-items:center;gap:10px;min-width:280px;max-width:min(420px,calc(100vw - 32px));box-sizing:border-box;padding:13px 16px;border-radius:12px;background:#fff;border:1px solid var(--o2p-slate-200,#e2e8f0);box-shadow:0 10px 30px rgba(15,23,42,.16);font-size:13.5px;font-weight:700;color:var(--o2p-slate-900,#0f172a);opacity:0;transform:translateY(-8px);transition:opacity .22s ease,transform .22s ease}.o2p-toast-notif.o2p-toast-visible{opacity:1;transform:translateY(0)}.o2p-toast-icon{width:24px;height:24px;flex:0 0 24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:900}.o2p-toast-success{border-left:4px solid var(--o2p-green,#16a34a)}.o2p-toast-success .o2p-toast-icon{background:var(--o2p-green-light,#dcfce7);color:var(--o2p-green-dark,#166534)}.o2p-toast-error{border-left:4px solid var(--o2p-red,#dc2626)}.o2p-toast-error .o2p-toast-icon{background:var(--o2p-red-light,#fee2e2);color:var(--o2p-red,#dc2626)}.o2p-toast-message{line-height:1.4}@media(max-width:600px){.o2p-toast-notif{top:12px;right:12px;left:12px;min-width:0;max-width:none}}

/* CRM COMMERCIAL v8.9 — pilotage renforcé */
.o2p-crm-forecast{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.o2p-crm-forecast>div,.o2p-crm-compare-grid>div{background:var(--o2p-slate-50);border:1px solid var(--o2p-slate-100);border-radius:9px;padding:10px}.o2p-crm-forecast span,.o2p-crm-compare-grid span{display:block;color:var(--o2p-slate-500);font-size:10.5px;font-weight:700}.o2p-crm-forecast strong{display:block;margin-top:4px;font-size:15px}.o2p-crm-compare-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.o2p-crm-compare-grid b{display:block;margin-top:4px;font-size:14px}.o2p-crm-quick-read{margin:0;padding-left:19px;font-size:12px;line-height:1.8}.o2p-crm-period .button{min-height:36px}.o2p-crm-dashboard .o2p-table-wrap{overflow:auto}.o2p-crm-dashboard .o2p-admin-table{min-width:760px}
@media(max-width:700px){.o2p-crm-forecast{grid-template-columns:1fr}.o2p-crm-period .button{width:100%}}
@media print{body *{visibility:hidden!important}.o2p-crm-dashboard,.o2p-crm-dashboard *{visibility:visible!important}.o2p-crm-dashboard{position:absolute!important;left:0!important;top:0!important;width:100%!important}.o2p-crm-period .button{display:none!important}.o2p-crm-table-wrap{max-height:none!important;overflow:visible!important}.o2p-crm-table-scroll{max-height:none!important;overflow:visible!important}.o2p-crm-panel,.o2p-crm-kpi{break-inside:avoid}.o2p-admin-espace .o2p-admin-nav,.o2p-admin-espace .o2p-admin-topbar{display:none!important}}


/* CRM ANALYSE v8.9.5 — actions commerciales prioritaires + grilles anti-débordement */
.o2p-crm-actions-panel{margin:0 0 14px;padding:18px;min-width:0;}
.o2p-crm-actions-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:14px;}
.o2p-crm-actions-head h3{margin:0 0 5px;font-size:16px;}
.o2p-crm-actions-head .o2p-crm-help{margin:0;max-width:900px;}
.o2p-crm-actions-total{flex:0 0 auto;min-width:125px;padding:10px 14px;border:1px solid var(--o2p-slate-200);border-radius:10px;background:var(--o2p-slate-50);text-align:center;}
.o2p-crm-actions-total strong{display:block;font-size:20px;line-height:1.1;color:var(--o2p-slate-900);}
.o2p-crm-actions-total span{display:block;margin-top:3px;font-size:10.5px;color:var(--o2p-slate-500);font-weight:700;}
.o2p-crm-actions-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start;}
.o2p-crm-actions-columns .o2p-crm-action-group{margin-top:0;min-width:0;}
.o2p-crm-actions-columns .o2p-crm-action-list{max-height:360px;overflow-y:auto;padding-right:3px;}
.o2p-crm-action-history{margin-top:14px;padding-top:14px;border-top:1px solid var(--o2p-slate-100);}
.o2p-crm-action-history .o2p-crm-action-list{max-height:260px;overflow-y:auto;padding-right:3px;}
.o2p-crm-insight-grid{align-items:start;}
.o2p-crm-insight-grid>.o2p-crm-panel{min-width:0;overflow:hidden;}
.o2p-crm-insight-grid .o2p-admin-table{width:100%;max-width:100%;table-layout:fixed;}
.o2p-crm-insight-grid .o2p-admin-table th,.o2p-crm-insight-grid .o2p-admin-table td{overflow:hidden;text-overflow:ellipsis;word-break:break-word;}
.o2p-crm-grid2>.o2p-crm-panel,.o2p-crm-grid3>.o2p-crm-panel{min-width:0;}
@media(max-width:1100px){
  .o2p-crm-actions-columns{grid-template-columns:1fr;}
  .o2p-crm-actions-columns .o2p-crm-action-list{max-height:300px;}
}
@media(max-width:700px){
  .o2p-crm-actions-head{flex-direction:column;}
  .o2p-crm-actions-total{width:100%;box-sizing:border-box;}
}


/* CRM UI/UX 8.9.6 — hiérarchie visuelle, actions prioritaires et cartes analytiques */
.o2p-crm-dashboard{--crm-radius:14px;--crm-gap:14px;}
.o2p-crm-dashboard .o2p-crm-head{padding-bottom:2px;}
.o2p-crm-dashboard .o2p-crm-head h2{font-size:24px;letter-spacing:-.2px;}
.o2p-crm-dashboard .o2p-crm-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px;}
.o2p-crm-dashboard .o2p-crm-kpi{position:relative;overflow:hidden;border:1px solid var(--o2p-slate-100);border-radius:var(--crm-radius);padding:16px 17px;background:linear-gradient(180deg,#fff 0%,#fbfdfe 100%);box-shadow:0 2px 10px rgba(39,63,82,.055);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;}
.o2p-crm-dashboard .o2p-crm-kpi:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(39,63,82,.09);border-color:var(--o2p-blue-border);}
.o2p-crm-dashboard .o2p-crm-kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--o2p-blue);opacity:.72;}
.o2p-crm-dashboard .o2p-crm-kpi:nth-child(3):before,.o2p-crm-dashboard .o2p-crm-kpi:nth-child(7):before{background:var(--o2p-green);}
.o2p-crm-dashboard .o2p-crm-kpi:nth-child(6):before,.o2p-crm-dashboard .o2p-crm-kpi:nth-child(9):before{background:var(--o2p-red);}
.o2p-crm-dashboard .o2p-crm-kpi strong{font-size:24px;letter-spacing:-.3px;}
.o2p-crm-dashboard .o2p-crm-kpi small{font-size:10.5px;}

.o2p-crm-actions-panel{position:relative;border:1px solid var(--o2p-blue-border);border-radius:var(--crm-radius);padding:20px;background:linear-gradient(180deg,#ffffff 0%,#f9fbfd 100%);box-shadow:0 5px 22px rgba(0,79,143,.08);overflow:hidden;}
.o2p-crm-actions-panel:before{content:"";position:absolute;left:0;right:0;top:0;height:4px;background:var(--o2p-blue);}
.o2p-crm-actions-head{align-items:center;margin-bottom:12px;}
.o2p-crm-section-kicker,.o2p-crm-card-kicker{text-transform:uppercase;letter-spacing:.07em;font-size:9.5px;font-weight:900;color:var(--o2p-blue);margin-bottom:4px;}
.o2p-crm-actions-head h3{font-size:18px;letter-spacing:-.15px;margin-bottom:4px;}
.o2p-crm-actions-head .o2p-crm-help{max-width:980px;line-height:1.5;}
.o2p-crm-actions-total{min-width:138px;padding:11px 15px;border-color:var(--o2p-blue-border);background:var(--o2p-blue-light);border-radius:12px;}
.o2p-crm-actions-total strong{font-size:24px;color:var(--o2p-blue-dark);}
.o2p-crm-action-summary{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px;}
.o2p-crm-action-summary span{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border:1px solid var(--o2p-slate-200);border-radius:999px;background:#fff;color:var(--o2p-slate-700);font-size:10.5px;font-weight:800;}
.o2p-crm-action-summary span b{font-size:12px;}
.o2p-crm-action-summary .late{border-color:var(--o2p-red-border);background:var(--o2p-red-light);color:var(--o2p-red-dark);}
.o2p-crm-action-summary .today{border-color:var(--o2p-amber-border);background:var(--o2p-amber-bg);color:var(--o2p-amber-dark);}
.o2p-crm-action-summary .future{border-color:var(--o2p-blue-border);background:var(--o2p-blue-light);color:var(--o2p-blue-dark);}
.o2p-crm-actions-columns{gap:14px;}
.o2p-crm-actions-columns .o2p-crm-action-group{padding:11px;border:1px solid var(--o2p-slate-100);border-radius:12px;background:#fff;box-shadow:0 1px 5px rgba(39,63,82,.035);}
.o2p-crm-actions-columns .o2p-crm-action-group h4{font-size:11px;padding:0 2px 8px;margin:0;border-bottom:1px solid var(--o2p-slate-100);}
.o2p-crm-actions-columns .o2p-crm-action-list{max-height:340px;padding:8px 3px 2px 0;}
.o2p-crm-action-item{padding:10px 11px;border-radius:10px;background:#fff;box-shadow:0 1px 4px rgba(39,63,82,.035);}
.o2p-crm-action-item:hover{border-color:var(--o2p-blue-border);box-shadow:0 3px 10px rgba(0,79,143,.07);}
.o2p-crm-action-item .o2p-crm-action-main strong{font-size:12px;color:var(--o2p-slate-900);}
.o2p-crm-action-item .o2p-crm-action-main span{font-size:11px;color:var(--o2p-slate-700);}
.o2p-crm-action-item .o2p-crm-action-side b{font-size:10.5px;}
.o2p-crm-action-side .button{border-radius:7px!important;font-weight:700;}
.o2p-crm-action-done{border-color:var(--o2p-green-border)!important;background:var(--o2p-green-light)!important;color:var(--o2p-green-dark)!important;}
.o2p-crm-action-view{border-color:var(--o2p-slate-200)!important;background:#fff!important;color:var(--o2p-slate-700)!important;}
.o2p-crm-action-history{margin-top:16px;padding-top:15px;}

/* Les trois cartes analytiques doivent réellement rester dans leurs colonnes. */
.o2p-crm-insight-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:14px;align-items:stretch;}
.o2p-crm-insight-grid>.o2p-crm-panel{width:auto;max-width:none;min-width:0;box-sizing:border-box;overflow:hidden;border-radius:var(--crm-radius);}
.o2p-crm-insight-grid .o2p-crm-insight-card{display:flex;flex-direction:column;min-height:100%;padding:18px;}
.o2p-crm-insight-grid .o2p-crm-card-kicker{color:var(--o2p-slate-500);margin-bottom:2px;}
.o2p-crm-insight-grid .o2p-crm-insight-card h3{margin:0 0 12px;font-size:15px;}
.o2p-crm-insight-grid .o2p-admin-table{width:100%;min-width:0!important;max-width:100%;table-layout:fixed;margin:0;}
.o2p-crm-insight-grid .o2p-admin-table th,.o2p-crm-insight-grid .o2p-admin-table td{min-width:0;white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;padding-left:9px;padding-right:9px;}
.o2p-crm-insight-grid .o2p-admin-table th{font-size:9.5px;}
.o2p-crm-insight-grid .o2p-admin-table td{font-size:11px;}
.o2p-crm-services{border-top:3px solid var(--o2p-blue);}
.o2p-crm-zones{border-top:3px solid var(--o2p-green);}
.o2p-crm-losses{border-top:3px solid var(--o2p-red);}
.o2p-crm-losses .o2p-crm-card-kicker{color:var(--o2p-red);}
.o2p-crm-losses .o2p-admin-table td:last-child{font-weight:900;color:var(--o2p-red-dark);text-align:right;}
.o2p-crm-losses .o2p-admin-table th:last-child{text-align:right;}

.o2p-crm-dashboard .o2p-crm-grid2,.o2p-crm-dashboard .o2p-crm-grid3{gap:14px;}
.o2p-crm-dashboard .o2p-crm-panel{border-radius:var(--crm-radius);box-shadow:0 2px 10px rgba(39,63,82,.045);}
.o2p-crm-dashboard .o2p-crm-panel h3{letter-spacing:-.1px;}
.o2p-crm-dashboard .o2p-table-wrap{border-radius:10px;}
.o2p-crm-dashboard .o2p-crm-insight{border-radius:var(--crm-radius);box-shadow:0 2px 10px rgba(39,63,82,.045);}

@media(max-width:1100px){
  .o2p-crm-dashboard .o2p-crm-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .o2p-crm-insight-grid{grid-template-columns:1fr;}
  .o2p-crm-insight-grid>.o2p-crm-panel{min-height:0;}
}
@media(max-width:700px){
  .o2p-crm-dashboard .o2p-crm-kpi-grid{grid-template-columns:1fr;}
  .o2p-crm-actions-head{align-items:stretch;}
  .o2p-crm-actions-total{width:100%;box-sizing:border-box;}
  .o2p-crm-action-summary{display:grid;grid-template-columns:1fr;}
  .o2p-crm-action-summary span{justify-content:center;}
}

/* CRM 8.9.7 — fiche prospect dédiée */
.o2p-crm-detail-dialog{width:min(1080px,96vw);}
.o2p-crm-detail-head{align-items:center;}
.o2p-crm-detail-title{display:flex;align-items:center;gap:12px;min-width:0;}
.o2p-crm-detail-avatar{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:var(--o2p-blue-light);border:1px solid var(--o2p-blue-border);font-size:20px;flex:0 0 44px;}
.o2p-crm-detail-title h3{font-size:21px;letter-spacing:-.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:60vw;}
.o2p-crm-detail-head-actions{display:flex;align-items:center;gap:10px;}
.o2p-crm-detail-body{padding:18px 20px 20px;background:var(--o2p-slate-50);}
.o2p-crm-detail-hero{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px;}
.o2p-crm-detail-hero>div{background:#fff;border:1px solid var(--o2p-slate-100);border-radius:12px;padding:12px 13px;min-width:0;box-shadow:0 1px 5px rgba(39,63,82,.035);}
.o2p-crm-detail-hero span,.o2p-crm-detail-card dt{display:block;color:var(--o2p-slate-500);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.035em;}
.o2p-crm-detail-hero strong{display:block;margin-top:5px;font-size:12px;color:var(--o2p-slate-900);}
.o2p-crm-detail-hero small{display:block;margin-top:4px;color:var(--o2p-slate-500);font-size:10.5px;}
.o2p-crm-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.o2p-crm-detail-card{background:#fff;border:1px solid var(--o2p-slate-100);border-radius:12px;padding:15px 16px;box-shadow:0 1px 6px rgba(39,63,82,.035);min-width:0;}
.o2p-crm-detail-card h4{margin:0 0 12px;font-size:13px;color:var(--o2p-slate-900);}
.o2p-crm-detail-card dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;margin:0;}
.o2p-crm-detail-card dl>div{min-width:0;}
.o2p-crm-detail-card dl>div.full{grid-column:1/-1;}
.o2p-crm-detail-card dd{margin:3px 0 0;color:var(--o2p-slate-800);font-size:12px;font-weight:650;word-break:break-word;line-height:1.45;}
.o2p-crm-detail-card dd a{color:var(--o2p-blue);text-decoration:none;}
.o2p-crm-detail-card dd a:hover{text-decoration:underline;}
.o2p-crm-detail-money{color:var(--o2p-green-dark)!important;font-weight:850!important;}
.o2p-crm-detail-notes,.o2p-crm-detail-history{margin-top:12px;}
.o2p-crm-detail-notes p{margin:5px 0;color:var(--o2p-slate-700);font-size:12px;line-height:1.6;}
.o2p-crm-detail-muted{margin:0;color:var(--o2p-slate-500);font-size:12px;}
.o2p-crm-timeline{display:flex;flex-direction:column;gap:0;}
.o2p-crm-timeline-item{display:grid;grid-template-columns:18px minmax(0,1fr);gap:9px;position:relative;padding-bottom:12px;}
.o2p-crm-timeline-item:last-child{padding-bottom:0;}
.o2p-crm-timeline-dot{width:8px;height:8px;border-radius:50%;background:var(--o2p-blue);margin:5px 0 0 2px;box-shadow:0 0 0 3px var(--o2p-blue-light);}
.o2p-crm-timeline-item:not(:last-child) .o2p-crm-timeline-dot:after{content:"";position:absolute;left:5px;top:13px;bottom:0;width:1px;background:var(--o2p-slate-200);}
.o2p-crm-timeline-item strong{font-size:10.5px;color:var(--o2p-slate-500);}
.o2p-crm-timeline-item p{margin:3px 0;color:var(--o2p-slate-800);font-size:12px;line-height:1.45;}
.o2p-crm-timeline-item small{font-size:10px;color:var(--o2p-slate-400);}
.o2p-crm-detail-empty{padding:30px 20px;color:var(--o2p-slate-500);}
.o2p-crm-btn-view{border-color:var(--o2p-blue-border)!important;color:var(--o2p-blue-dark)!important;background:var(--o2p-blue-light)!important;font-weight:750!important;}
@media(max-width:900px){.o2p-crm-detail-hero{grid-template-columns:repeat(2,minmax(0,1fr));}.o2p-crm-detail-grid{grid-template-columns:1fr;}.o2p-crm-detail-title h3{max-width:52vw;}}
@media(max-width:520px){.o2p-crm-detail-hero{grid-template-columns:1fr;}.o2p-crm-detail-body{padding:12px;}.o2p-crm-detail-card{padding:13px;}.o2p-crm-detail-card dl{grid-template-columns:1fr;}.o2p-crm-detail-card dl>div.full{grid-column:auto;}.o2p-crm-detail-title h3{max-width:58vw;font-size:17px;}.o2p-crm-detail-avatar{width:38px;height:38px;flex-basis:38px;}.o2p-crm-detail-head-actions .o2p-crm-badge{display:none;}}


/* CRM 8.9.8 — parcours commercial */
.o2p-crm-pipeline-card{grid-column:1/-1;margin:0 0 18px;border:1px solid var(--o2p-slate-200,#e2e8f0);border-radius:16px;background:#fff;padding:18px 20px;box-sizing:border-box;}
.o2p-crm-pipeline-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px;}
.o2p-crm-pipeline-head h4{margin:0 0 5px;font-size:15px;color:var(--o2p-slate-900,#0f172a)}
.o2p-crm-pipeline-head p{margin:0;color:var(--o2p-slate-500,#64748b);font-size:12px}
.o2p-crm-pipeline-current{font-size:12px;padding:7px 10px;border-radius:999px;background:#eff6ff;color:#1d4ed8;white-space:nowrap}
.o2p-crm-pipeline-steps{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:7px;align-items:stretch}
.o2p-crm-pipeline-step{appearance:none;border:1px solid var(--o2p-slate-200,#e2e8f0);background:#f8fafc;color:#475569;border-radius:11px;padding:9px 6px;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:11px;line-height:1.2;cursor:pointer;transition:.16s ease;}
.o2p-crm-pipeline-step:hover:not(:disabled){border-color:#93c5fd;transform:translateY(-1px);box-shadow:0 4px 12px rgba(15,23,42,.06)}
.o2p-crm-pipeline-step.done{background:#f0fdf4;border-color:#bbf7d0;color:#166534}
.o2p-crm-pipeline-step.current{background:#eff6ff;border-color:#60a5fa;color:#1d4ed8;font-weight:700;box-shadow:inset 0 0 0 1px rgba(59,130,246,.08)}
.o2p-crm-pipeline-step:disabled{opacity:.6;cursor:wait}
.o2p-crm-pipeline-num{width:23px;height:23px;border-radius:50%;display:grid;place-items:center;background:#e2e8f0;color:#475569;font-size:11px;font-weight:700}
.o2p-crm-pipeline-step.done .o2p-crm-pipeline-num{background:#22c55e;color:#fff}.o2p-crm-pipeline-step.current .o2p-crm-pipeline-num{background:#2563eb;color:#fff}
.o2p-crm-pipeline-hint{margin-top:12px;padding:9px 11px;border-radius:10px;background:#f8fafc;color:#64748b;font-size:11px}
@media(max-width:1000px){.o2p-crm-pipeline-steps{grid-template-columns:repeat(3,minmax(0,1fr))}.o2p-crm-pipeline-head{flex-direction:column}.o2p-crm-pipeline-current{white-space:normal}}
@media(max-width:600px){.o2p-crm-pipeline-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.o2p-crm-pipeline-card{padding:14px}.o2p-crm-pipeline-step{font-size:10px}}

.o2p-crm-new-action{font-weight:700;}
#o2p-crm-action-error{color:var(--o2p-red);font-size:12px;margin-top:8px;}

/* CRM v8.10.6 — parcours commercial : étapes longues et résultat final. */
.o2p-crm-pipeline-steps{align-items:stretch}.o2p-crm-pipeline-step,.o2p-crm-pipeline-result{min-width:120px;white-space:normal;line-height:1.25}.o2p-crm-pipeline-result{display:flex;flex:1 1 120px;align-items:center;justify-content:center;gap:7px;border:1px solid var(--o2p-slate-200);border-radius:10px;background:var(--o2p-slate-50);padding:10px 8px;font-size:12px;font-weight:700;color:var(--o2p-slate-600)}.o2p-crm-pipeline-result.won{border-color:var(--o2p-green);background:var(--o2p-green-light);color:var(--o2p-green-dark)}.o2p-crm-choice-modal{z-index:120000}.o2p-crm-choice-modal .o2p-crm-dialog{max-width:520px}

/* ═══ CRM v8.10.13 — Objectifs commerciaux & pilotage directeur ═══ */
.o2p-crm-objectifs{margin-bottom:14px;border-radius:14px!important;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);border:1px solid var(--o2p-blue-border);box-shadow:0 4px 18px rgba(0,79,143,.07);overflow:hidden}
.o2p-crm-objectifs:before{content:"";display:block;height:4px;background:var(--o2p-blue)}
.o2p-crm-objectifs-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding:18px 20px 12px}
.o2p-crm-objectifs-head h3{margin:0 0 4px;font-size:18px}.o2p-crm-objectifs-head .o2p-crm-help{max-width:760px;line-height:1.5}
.o2p-crm-objectifs-period{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;flex:0 0 auto}.o2p-crm-objectifs-period label{font-size:10.5px;font-weight:800;color:var(--o2p-slate-500)}
.o2p-crm-objectifs-period select,.o2p-crm-objectifs-period input{display:block;margin-top:4px;min-height:36px;border:1px solid var(--o2p-slate-200);border-radius:8px;padding:6px 9px;background:#fff;color:var(--o2p-slate-800);font-size:12px}
.o2p-crm-objectifs-period-label{margin:0 20px 14px;padding:9px 11px;border-radius:9px;background:var(--o2p-blue-light);border:1px solid var(--o2p-blue-border);font-size:11.5px;color:var(--o2p-slate-700)}
.o2p-crm-objectifs-period-label span{color:var(--o2p-slate-500)}
.o2p-crm-objectifs-layout{display:grid;grid-template-columns:minmax(440px,.9fr) minmax(0,1.1fr);gap:14px;padding:0 20px 16px}
.o2p-crm-objectifs-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start}
.o2p-crm-objectifs-form label{display:grid;grid-template-columns:minmax(0,1fr) 92px;gap:7px;align-items:center;padding:9px 10px;border:1px solid var(--o2p-slate-100);border-radius:9px;background:#fff;min-width:0}
.o2p-crm-objectifs-form label span{font-size:10.5px;font-weight:800;color:var(--o2p-slate-700);line-height:1.3}.o2p-crm-objectifs-form input{width:100%;box-sizing:border-box;min-height:34px;border:1px solid var(--o2p-slate-200);border-radius:7px;padding:6px 8px;font-size:12px;font-weight:800;text-align:right}
.o2p-crm-objectifs-form small{grid-column:1/-1;margin-top:-4px;font-size:9px;color:var(--o2p-slate-400)}
.o2p-crm-objectifs-score{min-width:0}.o2p-crm-score-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.o2p-crm-score-item{padding:10px 11px;border:1px solid var(--o2p-slate-100);border-radius:9px;background:#fff;min-width:0}.o2p-crm-score-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}.o2p-crm-score-top span{font-size:10px;color:var(--o2p-slate-500);font-weight:800;line-height:1.25}.o2p-crm-score-top strong{font-size:10.5px;color:var(--o2p-slate-900);white-space:nowrap}
.o2p-crm-progress{height:7px;border-radius:999px;background:var(--o2p-slate-100);overflow:hidden;margin:8px 0 5px}.o2p-crm-progress i{display:block;height:100%;border-radius:inherit;background:var(--o2p-blue);min-width:0}.o2p-crm-score-item small{font-size:9.5px;color:var(--o2p-slate-500)}
.o2p-crm-objectifs-chart-wrap{margin:0 20px 14px;padding:12px 13px;border:1px solid var(--o2p-slate-100);border-radius:10px;background:#fff}.o2p-crm-objectifs-chart-wrap>div:first-child{display:flex;justify-content:space-between;gap:10px;align-items:baseline;margin-bottom:5px}.o2p-crm-objectifs-chart-wrap strong{font-size:11px}.o2p-crm-objectifs-chart-wrap span{font-size:9.5px;color:var(--o2p-slate-500)}.o2p-crm-objectifs-chart{height:240px}
.o2p-crm-objectifs-actions{display:flex;align-items:center;gap:10px;padding:12px 20px;border-top:1px solid var(--o2p-slate-100);background:var(--o2p-slate-50)}
.o2p-crm-indicators{margin-bottom:14px;border-radius:14px!important}.o2p-crm-indicator-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}.o2p-crm-indicator{padding:11px 10px;border:1px solid var(--o2p-slate-100);border-radius:9px;background:#fff;text-align:center}.o2p-crm-indicator span{display:block;font-size:9.5px;line-height:1.25;color:var(--o2p-slate-500);font-weight:800}.o2p-crm-indicator strong{display:block;margin-top:5px;font-size:18px;color:var(--o2p-blue-dark)}
.o2p-crm-period-comparison{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:12px;padding-top:12px;border-top:1px solid var(--o2p-slate-100)}.o2p-crm-period-comparison>div:first-child strong{display:block;font-size:11px}.o2p-crm-period-comparison>div:first-child span{display:block;font-size:9.5px;color:var(--o2p-slate-500);margin-top:2px}.o2p-crm-compare-pills{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.o2p-crm-compare-pills span{display:inline-flex;align-items:center;gap:4px;padding:5px 8px;border-radius:999px;background:var(--o2p-slate-50);border:1px solid var(--o2p-slate-200);font-size:9.5px;color:var(--o2p-slate-600)}.o2p-crm-compare-pills b{font-size:9px}.o2p-crm-compare-pills .up{background:var(--o2p-green-light);border-color:var(--o2p-green-border);color:var(--o2p-green-dark)}.o2p-crm-compare-pills .down{background:var(--o2p-red-light);border-color:var(--o2p-red-border);color:var(--o2p-red-dark)}
.o2p-crm-director-actions{border-left:4px solid var(--o2p-blue)!important}.o2p-crm-director-actions ul{margin:0;padding-left:18px;font-size:11.5px;line-height:1.65;color:var(--o2p-slate-700)}.o2p-crm-director-actions li+li{margin-top:4px}.o2p-crm-diagnostic-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.o2p-crm-diagnostic-grid>div{padding:9px;border-radius:8px;background:var(--o2p-slate-50);text-align:center}.o2p-crm-diagnostic-grid span{display:block;font-size:9px;color:var(--o2p-slate-500);line-height:1.25}.o2p-crm-diagnostic-grid strong{display:block;margin-top:4px;font-size:16px}
@media(max-width:1100px){.o2p-crm-objectifs-layout{grid-template-columns:1fr}.o2p-crm-indicator-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.o2p-crm-objectifs-head{flex-direction:column}.o2p-crm-objectifs-period{width:100%}.o2p-crm-objectifs-period label{flex:1}.o2p-crm-objectifs-period input,.o2p-crm-objectifs-period select{width:100%}.o2p-crm-objectifs-form{grid-template-columns:1fr}.o2p-crm-score-grid{grid-template-columns:1fr}.o2p-crm-indicator-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.o2p-crm-period-comparison{align-items:flex-start;flex-direction:column}.o2p-crm-compare-pills{justify-content:flex-start}.o2p-crm-diagnostic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* CRM v8.10.15 — précision des indicateurs et numérotation stable. */
.o2p-crm-ratio-note{margin:10px 0 0;padding:9px 11px;border-radius:9px;background:var(--o2p-slate-50);border:1px solid var(--o2p-slate-100);line-height:1.5;}
.o2p-crm-table .o2p-crm-number{min-width:82px;}
.o2p-crm-table .o2p-crm-number strong{font-variant-numeric:tabular-nums;}


/* CRM 8.10.19 — tableau de bord dirigeant : hiérarchie KPI, alertes et tunnel de conversion */
.o2p-crm-executive{position:relative;margin:0 0 16px;padding:20px;border:1px solid var(--o2p-blue-border);border-radius:16px;background:linear-gradient(180deg,#fff 0%,#f8fbfe 100%);box-shadow:0 5px 20px rgba(0,79,143,.07);overflow:hidden;}
.o2p-crm-executive:before{content:"";position:absolute;left:0;right:0;top:0;height:4px;background:var(--o2p-blue);}
.o2p-crm-executive-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px;}
.o2p-crm-executive-head h3{margin:0 0 4px;font-size:19px;letter-spacing:-.15px;color:var(--o2p-slate-900);}
.o2p-crm-executive-head p{margin:0;color:var(--o2p-slate-500);font-size:12px;line-height:1.5;max-width:850px;}
.o2p-crm-executive-period{flex:0 0 auto;padding:9px 13px;border:1px solid var(--o2p-blue-border);border-radius:11px;background:var(--o2p-blue-light);text-align:right;}
.o2p-crm-executive-period span{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.06em;font-weight:900;color:var(--o2p-blue);}
.o2p-crm-executive-period strong{display:block;margin-top:3px;font-size:12px;color:var(--o2p-blue-dark);}
.o2p-crm-executive-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;}
.o2p-crm-executive-kpi{display:flex;align-items:flex-start;gap:9px;min-width:0;padding:12px;border:1px solid var(--o2p-slate-100);border-radius:12px;background:#fff;box-shadow:0 1px 5px rgba(39,63,82,.035);}
.o2p-crm-executive-kpi>div:last-child{min-width:0;flex:1 1 auto;}
.o2p-crm-exec-icon{width:34px;height:34px;flex:0 0 34px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:var(--o2p-blue-light);font-size:16px;}
.o2p-crm-exec-label{display:block;font-size:9.5px;text-transform:uppercase;letter-spacing:.025em;font-weight:900;color:var(--o2p-slate-500);white-space:normal;overflow-wrap:anywhere;line-height:1.2;}
.o2p-crm-executive-kpi strong{display:block;margin-top:3px;font-size:19px;line-height:1.1;color:var(--o2p-slate-900);letter-spacing:-.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.o2p-crm-executive-kpi small{display:block;margin-top:4px;font-size:9.5px;line-height:1.25;color:var(--o2p-slate-500);white-space:normal;overflow-wrap:anywhere;overflow:visible;text-overflow:clip;}
.o2p-crm-executive-alerts{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:12px;padding-top:12px;border-top:1px solid var(--o2p-slate-100);}
.o2p-crm-executive-alerts-title{font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;color:var(--o2p-slate-600);margin-right:2px;}
.o2p-crm-executive-alerts span{display:inline-flex;align-items:center;padding:7px 10px;border-radius:999px;font-size:12px;font-weight:800;border:1px solid var(--o2p-slate-200);background:#fff;color:var(--o2p-slate-700);}
.o2p-crm-executive-alerts span.danger{border-color:var(--o2p-red-border);background:var(--o2p-red-light);color:var(--o2p-red-dark);}
.o2p-crm-executive-alerts span.warning{border-color:var(--o2p-amber-border);background:var(--o2p-amber-bg);color:var(--o2p-amber-dark);}
.o2p-crm-executive-ok{margin-top:12px;padding:9px 11px;border-top:1px solid var(--o2p-slate-100);font-size:10.5px;font-weight:700;color:var(--o2p-green-dark);}
.o2p-crm-funnel-panel{min-width:0;}
.o2p-crm-funnel{display:flex;flex-direction:column;gap:9px;margin-top:10px;}
.o2p-crm-funnel-row>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px;}
.o2p-crm-funnel-row strong{font-size:10.5px;color:var(--o2p-slate-800);}
.o2p-crm-funnel-row span{font-size:9.5px;color:var(--o2p-slate-500);text-align:right;white-space:nowrap;}
.o2p-crm-funnel-bar{height:8px;border-radius:999px;background:var(--o2p-slate-100);overflow:hidden;}
.o2p-crm-funnel-bar i{display:block;height:100%;border-radius:inherit;background:var(--o2p-blue);min-width:0;}
.o2p-crm-pipeline-snapshot>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid var(--o2p-slate-100);border-radius:9px;background:#fff;}
.o2p-crm-pipeline-snapshot>div span{font-size:10.5px;color:var(--o2p-slate-700);}
.o2p-crm-pipeline-snapshot>div b{font-size:12px;color:var(--o2p-blue-dark);}
@media(max-width:1200px){.o2p-crm-executive-kpis{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:700px){.o2p-crm-executive{padding:15px;}.o2p-crm-executive-head{flex-direction:column;}.o2p-crm-executive-period{width:100%;box-sizing:border-box;text-align:left;}.o2p-crm-executive-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}.o2p-crm-executive-kpi{padding:10px;}.o2p-crm-exec-icon{width:30px;height:30px;flex-basis:30px;font-size:14px;}.o2p-crm-executive-kpi strong{font-size:16px;}.o2p-crm-funnel-row>div:first-child{align-items:flex-start;flex-direction:column;gap:2px;}.o2p-crm-funnel-row span{text-align:left;}}


/* ═══ CRM v8.10.20 — Parcours commercial : lisibilité et anti-chevauchement ═══
 * Les étapes restent un vrai parcours horizontal sur desktop, mais chaque étape
 * possède une largeur stable. Le conteneur défile seul si nécessaire : aucune
 * étape ne se superpose ni ne sort du cadre. Les libellés longs restent lisibles.
 */
.o2p-crm-pipeline-card{min-width:0;overflow:hidden;}
.o2p-crm-pipeline-head{min-width:0;}
.o2p-crm-pipeline-head>div:first-child{min-width:0;flex:1 1 auto;}
.o2p-crm-pipeline-head p{max-width:760px;line-height:1.5;}
.o2p-crm-pipeline-current{
    flex:0 1 auto;
    max-width:min(42%,420px);
    white-space:normal;
    overflow-wrap:anywhere;
    text-align:center;
    line-height:1.35;
    box-sizing:border-box;
}
.o2p-crm-pipeline-steps{
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:stretch;
    gap:8px;
    width:100%;
    min-width:0;
    overflow-x:auto;
    overflow-y:hidden;
    padding:2px 2px 10px;
    box-sizing:border-box;
    scrollbar-width:thin;
    scrollbar-color:#b7c7d8 transparent;
    scroll-snap-type:x proximity;
}
.o2p-crm-pipeline-steps::-webkit-scrollbar{height:7px;}
.o2p-crm-pipeline-steps::-webkit-scrollbar-track{background:#f1f5f9;border-radius:999px;}
.o2p-crm-pipeline-steps::-webkit-scrollbar-thumb{background:#b7c7d8;border-radius:999px;}
.o2p-crm-pipeline-step{
    flex:0 0 124px!important;
    width:124px;
    min-width:124px!important;
    min-height:82px;
    box-sizing:border-box;
    padding:10px 8px;
    text-align:center;
    white-space:normal;
    overflow-wrap:break-word;
    word-break:normal;
    scroll-snap-align:start;
}
.o2p-crm-pipeline-step>span:last-child,
.o2p-crm-pipeline-result>span:last-child{
    display:block;
    max-width:100%;
    overflow-wrap:anywhere;
    word-break:normal;
}
.o2p-crm-pipeline-result{
    flex:0 0 110px!important;
    width:110px;
    min-width:110px!important;
    min-height:82px;
    box-sizing:border-box;
    padding:10px 8px;
    text-align:center;
    scroll-snap-align:start;
}
.o2p-crm-pipeline-current strong{overflow-wrap:anywhere;}
.o2p-crm-pipeline-hint{line-height:1.5;}

@media(max-width:1000px){
    .o2p-crm-pipeline-head{flex-direction:column;}
    .o2p-crm-pipeline-current{max-width:100%;align-self:flex-start;}
}
@media(max-width:700px){
    .o2p-crm-pipeline-steps{
        display:grid!important;
        grid-template-columns:repeat(2,minmax(0,1fr));
        overflow:visible;
        padding:2px 0;
        scroll-snap-type:none;
    }
    .o2p-crm-pipeline-step,
    .o2p-crm-pipeline-result{
        width:auto;
        min-width:0!important;
        flex:none!important;
    }
}
@media(max-width:430px){
    .o2p-crm-pipeline-steps{grid-template-columns:1fr;}
}

/* CRM v8.10.24 — listes métier normalisées et affichage explicite des choix enregistrés. */
.o2p-crm-pipeline-current{white-space:normal!important;max-width:360px;line-height:1.3;overflow-wrap:anywhere;text-align:right;}
.o2p-crm-detail-hero .o2p-crm-badge,.o2p-crm-badge{max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.25;}
.o2p-crm-pipeline-step>span:last-child{display:block;max-width:100%;overflow-wrap:anywhere;text-align:center;}
@media(max-width:900px){.o2p-crm-pipeline-current{max-width:none;width:100%;text-align:left;}.o2p-crm-pipeline-head{align-items:stretch;}}

/* CRM v8.10.29 — références de comparaison KPI explicites (mois/semaine/plage). */
.o2p-crm-dashboard .o2p-crm-executive-kpi>div:last-child{min-width:0;flex:1 1 auto;}
.o2p-crm-dashboard .o2p-crm-executive-kpi small{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.25;}

/* CRM v8.10.25 — typographie d'analyse commerciale agrandie et hiérarchie renforcée. */
.o2p-crm-dashboard .o2p-crm-section-kicker,
.o2p-crm-dashboard .o2p-crm-card-kicker{font-size:10.5px;}
.o2p-crm-dashboard .o2p-crm-help{font-size:12.5px;line-height:1.55;}
.o2p-crm-dashboard .o2p-crm-executive-head h3{font-size:20px;}
.o2p-crm-dashboard .o2p-crm-executive-head p{font-size:12.5px;}
.o2p-crm-dashboard .o2p-crm-executive-period span{font-size:9.5px;}
.o2p-crm-dashboard .o2p-crm-executive-period strong{font-size:13px;}
.o2p-crm-dashboard .o2p-crm-executive-kpi{padding:13px;}
.o2p-crm-dashboard .o2p-crm-exec-label{font-size:10.5px;}
.o2p-crm-dashboard .o2p-crm-executive-kpi strong{font-size:20px;}
.o2p-crm-dashboard .o2p-crm-executive-kpi small{font-size:10px;}
.o2p-crm-dashboard .o2p-crm-objectifs-head h3{font-size:19px;}
.o2p-crm-dashboard .o2p-crm-objectifs-period label{font-size:11px;}
.o2p-crm-dashboard .o2p-crm-objectifs-period select,
.o2p-crm-dashboard .o2p-crm-objectifs-period input{font-size:13px;}
.o2p-crm-dashboard .o2p-crm-objectifs-period-label{font-size:12px;}
.o2p-crm-dashboard .o2p-crm-objectifs-form label span{font-size:11.5px;}
.o2p-crm-dashboard .o2p-crm-objectifs-form input{font-size:13px;}
.o2p-crm-dashboard .o2p-crm-objectifs-form small{font-size:9.5px;}
.o2p-crm-dashboard .o2p-crm-objectifs-chart-wrap strong{font-size:12px;}
.o2p-crm-dashboard .o2p-crm-objectifs-chart-wrap span{font-size:10px;}
.o2p-crm-dashboard .o2p-crm-indicator{padding:12px 10px;}
.o2p-crm-dashboard .o2p-crm-indicator span{font-size:10.5px;}
.o2p-crm-dashboard .o2p-crm-indicator strong{font-size:20px;}
.o2p-crm-dashboard .o2p-crm-period-comparison>div:first-child strong{font-size:12px;}
.o2p-crm-dashboard .o2p-crm-period-comparison>div:first-child span{font-size:10px;}
.o2p-crm-dashboard .o2p-crm-compare-pills span{font-size:10.5px;}
.o2p-crm-dashboard .o2p-crm-compare-pills b{font-size:9.5px;}
.o2p-crm-dashboard .o2p-crm-director-actions ul{font-size:12px;line-height:1.6;}
.o2p-crm-dashboard .o2p-crm-diagnostic-grid span{font-size:10px;}
.o2p-crm-dashboard .o2p-crm-diagnostic-grid strong{font-size:17px;}
.o2p-crm-dashboard .o2p-crm-actions-head h3{font-size:19px;}
.o2p-crm-dashboard .o2p-crm-actions-total strong{font-size:25px;}
.o2p-crm-dashboard .o2p-crm-action-summary span{font-size:11px;}
.o2p-crm-dashboard .o2p-crm-action-summary span b{font-size:12.5px;}
.o2p-crm-dashboard .o2p-crm-action-item .o2p-crm-action-main strong{font-size:12.5px;}
.o2p-crm-dashboard .o2p-crm-action-item .o2p-crm-action-main span{font-size:11.5px;}
.o2p-crm-dashboard .o2p-crm-action-side b{font-size:11px;}
.o2p-crm-dashboard .o2p-crm-insight-grid .o2p-crm-insight-card h3{font-size:16px;}
.o2p-crm-dashboard .o2p-crm-insight-grid .o2p-admin-table th{font-size:10px;}
.o2p-crm-dashboard .o2p-crm-insight-grid .o2p-admin-table td{font-size:11.5px;}

@media(max-width:1200px){
    .o2p-crm-dashboard .o2p-crm-executive-kpi strong{font-size:19px;}
}
@media(max-width:700px){
    .o2p-crm-dashboard .o2p-crm-executive-kpi{padding:11px;}
    .o2p-crm-dashboard .o2p-crm-executive-kpi strong{font-size:17px;}
    .o2p-crm-dashboard .o2p-crm-executive-kpi small{font-size:9.5px;}
    .o2p-crm-dashboard .o2p-crm-help{font-size:12px;}
    .o2p-crm-dashboard .o2p-crm-insight-grid .o2p-admin-table th{font-size:9.5px;}
    .o2p-crm-dashboard .o2p-crm-insight-grid .o2p-admin-table td{font-size:11px;}
}

/* v8.10.42 — plusieurs demandes pour une même personne */
.o2p-crm-related-requests{margin-top:14px}.o2p-crm-related-list{display:flex;flex-direction:column;gap:7px;margin-top:10px}.o2p-crm-related-item{display:grid;grid-template-columns:1.1fr 1.4fr 1.5fr auto;gap:10px;align-items:center;padding:9px 10px;border:1px solid var(--o2p-slate-100);border-radius:10px;background:#fff;font-size:12px}.o2p-crm-related-item.current{background:#f8fbff;border-color:#bfdbfe}.o2p-crm-related-item .button{margin:0!important}.o2p-crm-dialog select[disabled]{background:#f8fafc;cursor:not-allowed;opacity:1}.o2p-crm-dialog input[readonly]{background:#f8fafc;cursor:default;opacity:1}.o2p-crm-dialog input:not([disabled]):not([readonly]),.o2p-crm-dialog textarea:not([disabled]){cursor:text}.o2p-crm-dialog select:not([disabled]){cursor:pointer}
@media(max-width:700px){.o2p-crm-related-item{grid-template-columns:1fr;gap:4px}.o2p-crm-related-item .button{width:100%}}

/* v8.10.45 — formulaire CRM : états d'édition clairs et boutons professionnels */
.o2p-crm-dialog .o2p-crm-field input:not([disabled]):not([readonly]),
.o2p-crm-dialog .o2p-crm-field select:not([disabled]),
.o2p-crm-dialog .o2p-crm-field textarea:not([disabled]){cursor:auto;}
.o2p-crm-dialog .o2p-crm-field select:not([disabled]){cursor:pointer;}
.o2p-crm-dialog .o2p-crm-field input[type="text"]:not([disabled]):not([readonly]),
.o2p-crm-dialog .o2p-crm-field input[type="tel"]:not([disabled]):not([readonly]),
.o2p-crm-dialog .o2p-crm-field input[type="email"]:not([disabled]):not([readonly]),
.o2p-crm-dialog .o2p-crm-field input[type="number"]:not([disabled]):not([readonly]),
.o2p-crm-dialog .o2p-crm-field input[type="date"]:not([disabled]):not([readonly]),
.o2p-crm-dialog .o2p-crm-field input[type="time"]:not([disabled]):not([readonly]),
.o2p-crm-dialog .o2p-crm-field textarea:not([disabled]):not([readonly]){cursor:text;}
.o2p-crm-dialog-actions .button{min-height:40px;padding:9px 18px;border-radius:9px;font-weight:700;transition:transform .15s ease,box-shadow .15s ease,background .15s ease;}
.o2p-crm-dialog-actions .button:not(:disabled):hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(15,23,42,.10);}
.o2p-crm-dialog-actions .button-primary{border:1px solid #1d4ed8;background:#2563eb;color:#fff;box-shadow:0 2px 7px rgba(37,99,235,.20);}
.o2p-crm-dialog-actions .button-primary:hover:not(:disabled){background:#1d4ed8;color:#fff;}
.o2p-crm-dialog-actions .o2p-crm-close{background:#fff;color:#334155;}
@media(max-width:700px){.o2p-crm-dialog-actions{display:grid;grid-template-columns:1fr 1.35fr}.o2p-crm-dialog-actions .button{width:100%;justify-content:center;}}

/* v8.10.59 — statuts de mise en place : lecture immédiate dans la liste CRM */
.o2p-crm-setup-status{display:inline-flex;align-items:center;max-width:230px;padding:6px 9px;border-radius:9px;font-size:11px;line-height:1.25;font-weight:800;white-space:normal;border:1px solid transparent;}
.o2p-crm-setup-status.search{background:#fff7ed;color:#c2410c;border-color:#fed7aa;}
.o2p-crm-setup-status.found{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe;}
.o2p-crm-setup-status.planned{background:#f5f3ff;color:#6d28d9;border-color:#ddd6fe;}
.o2p-crm-setup-status.started{background:#dcfce7;color:#166534;border-color:#bbf7d0;}
.o2p-crm-setup-status.cancelled{background:#fee2e2;color:#b91c1c;border-color:#fecaca;}
.o2p-crm-setup-status.neutral{background:#f8fafc;color:#64748b;border-color:#e2e8f0;}
.o2p-crm-status-help{display:block;margin-top:7px;padding:7px 9px;border-radius:8px;background:var(--o2p-slate-50);color:var(--o2p-slate-500);font-size:11px;line-height:1.4;}



/* CRM — période explicite des KPI du mois en cours */
.o2p-crm-kpis-mini-head{display:flex;align-items:center;justify-content:space-between;margin:0 0 10px;padding:0 4px;gap:12px}.o2p-crm-kpis-mini-head>div{display:flex;flex-direction:column;gap:2px}.o2p-crm-kpis-mini-head strong{font-size:16px;color:var(--o2p-blue,#005b9a)}.o2p-crm-kpis-mini-head span{font-size:12px;color:var(--o2p-slate-500,#64748b)}.o2p-crm-mini-card small{display:block;margin-top:5px;font-size:10px;line-height:1.3;color:var(--o2p-slate-500,#64748b)}
@media (max-width:700px){.o2p-crm-kpis-mini-head strong{font-size:14px}.o2p-crm-kpis-mini-head span{font-size:11px}}
