/*
 * gestion.css — styles du module GestionBundle (interface V1, Bootstrap 3).
 * Évite tout style inline dans les templates Twig du bundle.
 */
.gestion-stat-number { font-size: 2rem; font-weight: bold; }

/* ── Stocks consommables (lot 7) ── */
.gestion-stock-table { font-size: 12px; }
.gestion-stock-cell { text-align: center; }
.gestion-stock-val { display: inline-block; padding: 1px 6px; border-radius: 8px; font-weight: bold; }
.gestion-stock-val.is-orange { background: #f0ad4e; color: #fff; }
.gestion-stock-val.is-rouge  { background: #d9534f; color: #fff; }
.gestion-stock-prod-th { max-width: 84px; white-space: normal; font-size: 11px; line-height: 1.1; vertical-align: bottom; }
.gestion-inline-form { display: inline; }
.gestion-stock-alertes-list { margin-top: 6px; margin-bottom: 0; }

/*
 * Maintenance des factures (support ELPS, interface V1).
 */
.maintenance-facture__acces { margin: 10px 0; }
.maintenance-facture__recherche { margin-bottom: 20px; }
.maintenance-facture__detail { margin-top: 20px; padding: 15px; border: 1px solid #ddd; border-radius: 4px; }
.maintenance-facture__titre { margin-top: 0; }
.maintenance-facture__infos { list-style: none; padding-left: 0; }
.maintenance-facture__infos li { padding: 2px 0; }
.maintenance-facture__option { margin: 10px 0; }
.maintenance-facture__boutons { margin-top: 15px; }
.maintenance-facture__boutons .btn { margin-right: 10px; }
.gestion-stock-sortie { font-size: 10px; color: #777; }

.gestion-export-toolbar { margin-bottom: 8px; }

/* Tableau croisé coût des envois (client × mois) — lot 8 */
.gestion-cout-pivot th,
.gestion-cout-pivot td {
    white-space: nowrap;
}
.gestion-cout-pivot td:nth-child(2) {
    white-space: normal;
    min-width: 180px;
}

/* ── Bouton SAV recordticket (V1) ──────────────────────────────────────────────
   Pastille FLOTTANTE de repli, utilisée UNIQUEMENT quand le widget ne trouve pas de
   déclencheur dans la page (data-trigger absent) : fond noir, point rouge, libellé
   blanc. Quand le déclencheur #recordticket-trigger existe (bouton Home / éventail),
   c'est le style « .home-fan-item--record » ci-dessous qui s'applique. La classe
   rt-recording (posée par le widget) fait pulser le point pendant l'enregistrement. */
.recordticket-trigger {
    position: fixed;
    bottom: 85px;
    right: 20px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #111;
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font: 600 14px system-ui;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    cursor: pointer;
}
.recordticket-trigger .recordticket-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f43;
}
.recordticket-trigger.rt-recording .recordticket-dot {
    animation: recordticket-pulse 1s infinite;
}
@keyframes recordticket-pulse { 50% { opacity: .3; } }

/* ── Bouton Home en éventail (V1) ──────────────────────────────────────────────
   La pastille principale (#backToHome) garde sa forme ronde bleue 60px et la pastille
   de notifications (gérée par checkNewMessage). Au clic, deux satellites de MÊME forme
   se déploient en quart de cercle (la classe .is-open est posée par scripts.js) :
   « Accueil » vers la gauche, « Signaler un souci » (record) vers le haut. */
/* Compteur de notifications (checkNewMessage) centré sur la pastille home, que ce soit
   le bouton classique (.backToHome seul) ou la bascule de l'éventail. Reprend l'ancien
   style inline retiré du template. */
.backToHome {
    text-align: center;
    color: #000;
    text-decoration: none;
}
.home-fan {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 60px;
    height: 60px;
    z-index: 1001;
}
/* Toutes les pastilles de l'éventail sont positionnées dans le conteneur (et non
   plus en position:fixed comme .backToHome / .recordticket-trigger autonomes). */
.home-fan .backToHome,
.home-fan .home-fan-item {
    position: absolute;
    bottom: 0;
    right: 0;
    margin: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
}
/* La pastille principale reste au-dessus des satellites. Le texte centré/noir reprend
   l'ancien style inline retiré du template (compteur de notifications de checkNewMessage). */
.home-fan .home-fan-toggle {
    z-index: 2;
    cursor: pointer;
    text-align: center;
    color: #000;
    line-height: 60px;
    font-weight: bold;
    text-decoration: none;
}
/* À l'ouverture, la pastille principale troque la maison pour une croix « × »
   (= refermer l'éventail). Le satellite « Accueil » garde la maison pour naviguer. */
.home-fan.is-open .home-fan-toggle {
    box-shadow: 0 0 0 3px rgba(28, 115, 182, .25);
    background-image: none;
    color: transparent; /* masque un éventuel compteur de notifs pendant l'ouverture */
}
.home-fan.is-open .home-fan-toggle::before {
    content: "\00d7";
    display: block;
    color: #fff;
    font-size: 34px;
    line-height: 60px;
    text-align: center;
}
/* Satellites : repliés sous la pastille principale au repos. */
.home-fan-item {
    display: block;
    border: 0;
    background-color: #1c73b6;
    background-repeat: no-repeat;
    background-size: 35px;
    background-position: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    opacity: 0;
    transform: translate(0, 0) scale(.4);
    pointer-events: none;
    transition: transform .25s ease, opacity .2s ease;
    z-index: 1;
}
/* Satellite « Accueil » : même icône maison que la pastille principale. */
.home-fan-item--home {
    background-image: url('../../images/v1/picto/maison.png');
    background-position: 13px 10px;
}
/* Satellite « Signaler un souci » (record) : pastille foncée + point rouge centré,
   pour le distinguer des pastilles de navigation bleues. */
.home-fan .recordticket-trigger.home-fan-item--record {
    /* neutralise le positionnement fixe du style autonome .recordticket-trigger */
    position: absolute;
    bottom: 0;
    right: 0;
    background: #111;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-fan-item--record .recordticket-dot {
    width: 16px;
    height: 16px;
}
/* Libellé du record : conservé pour le widget et les lecteurs d'écran, masqué visuellement. */
.home-fan-item--record .sr-only-rt {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* Déploiement en éventail (quart de cercle) à l'ouverture. */
.home-fan.is-open .home-fan-item--home {
    opacity: 1;
    transform: translate(-72px, 0) scale(1);
    pointer-events: auto;
}
.home-fan.is-open .home-fan-item--record {
    opacity: 1;
    transform: translate(0, -72px) scale(1);
    pointer-events: auto;
}
/* Pendant l'enregistrement, le satellite record reste visible (pour pouvoir arrêter)
   même si l'éventail est refermé. */
.home-fan .recordticket-trigger.rt-recording {
    opacity: 1;
    transform: translate(0, -72px) scale(1);
    pointer-events: auto;
}

/* Pré-remplissage OCR de prescription (PMT) */
.ocr-rempli { background-color: #eaf6ff; }
.ocr-a-verifier { border: 2px solid var(--couleurSecondaire, #d68a1e); }
.ocr-statut { margin-left: .5rem; font-style: italic; }
.ocr-rapprochement { margin-top: .5rem; font-size: .9em; }

/* ── Grille de saisie facturation : en-tête de colonnes figé au défilement ──
   Le tableau scrolle dans son propre conteneur borné en hauteur : l'en-tête
   reste collé en haut, et la barre de défilement horizontale (droite/gauche)
   reste au bas de la zone visible → toujours accessible quelle que soit la
   hauteur du tableau. */
.gestion-grille-scroll {
    max-height: calc(100vh - 260px);
    overflow: auto;
}
.gestion-grille-scroll table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f5f5f5;
    box-shadow: inset 0 -2px 0 #ddd;
}
