/*
 * 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;
}

/* Lien de tri sur l'en-tête « Patient » de la grille de session */
.gestion-tri-lien {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.gestion-tri-lien:hover {
    text-decoration: underline;
}

/* Filtre « Types de transport » (export Détail des transports) :
   cases à cocher espacées, libellés sans deux-points. */
.sv-types-filtre-options {
    margin-top: 4px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px 18px;
    align-items: start;
}
.sv-types-filtre-item {
    display: flex;
    align-items: baseline;
    font-weight: normal;
    margin: 0;
    cursor: pointer;
    color: #333333;
}
/* Couleur de libellé fixée dans tous les états : évite l'effet « lien orange »
   (couleur de survol/focus) sur une case identique aux autres. */
.sv-types-filtre-item:hover,
.sv-types-filtre-item:focus,
.sv-types-filtre-item span,
.sv-types-filtre-item:hover span,
.sv-types-filtre-item:focus span {
    color: #333333;
    text-decoration: none;
}
.sv-types-filtre-item input {
    flex: 0 0 auto;
    margin-right: 6px;
    vertical-align: middle;
}
.sv-types-filtre-item span {
    vertical-align: middle;
}

/* ── Badge SCOR (suivi des envois, lecture seule) ── */
.gestion-scor-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
}
.gestion-scor-ok      { background: #5cb85c; }
.gestion-scor-erreur  { background: #d9534f; }
.gestion-scor-attente { background: #f0ad4e; }

/* ── Badge « transports sans pièce jointe » (grille de saisie, lecture seule) ──
   Alimenté par GestionPiecesJointesService ; alerte informative, jamais bloquante.
   ⚠ Sur sa propre ligne : la colonne « Patient » est étroite, un badge inline passait à la ligne
   en empiétant sur le nom de la caisse (line-height 1.5 du badge contre 1.1 de l'organisme). */
.gestion-pj-ligne {
    margin-top: 3px;
    line-height: 1;
}
.gestion-pj-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.5;
    vertical-align: middle;
    white-space: nowrap;
    color: #fff;
    background: #f0ad4e;
}

/* ── Bouton « Copier le récap » : zone de texte de repli (execCommand) ──
   Hors flux et invisible, mais NON masquée par display:none (une zone
   display:none n'est pas sélectionnable, donc non copiable). */
/* ── « Copier ce texte » (nom du patient dans la grille) ──
   Variante `--texte` : le libellé affiché EST le bouton. Aucun cadre, aucun fond, police
   héritée → visuellement du texte, avec une icône fine collée au dernier mot (elle ne
   tombe donc jamais seule sur la ligne suivante dans cette colonne étroite).
   Le retour de copie passe par la classe `.is-copie` et non par le libellé : le bouton
   contient un SVG, écrire dans son textContent effacerait l'icône. */
.gestion-copie-btn {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: copy;
}
.gestion-copie-btn svg {
    width: 11px;
    height: 11px;
    margin-left: 3px;
    color: #777;
    opacity: .4;
    vertical-align: baseline;
}
.gestion-copie-btn:hover svg,
.gestion-copie-btn:focus svg {
    color: #337ab7;
    opacity: 1;
}
.gestion-copie-btn.is-copie svg {
    color: #5cb85c;
    opacity: 1;
}
.gestion-copie-btn--texte {
    display: inline;
    max-width: 100%;
    font: inherit;
    text-align: left;
    white-space: normal;
}
.gestion-copie-btn--texte:hover .gestion-copie-label,
.gestion-copie-btn--texte:focus .gestion-copie-label {
    text-decoration: underline dotted;
}

.gestion-copie-zone {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    padding: 0;
    border: 0;
    resize: none;
    pointer-events: none;
}
