/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   DTISoft — Promotions (Dashboard → Promotions, chantier « Pilotage », lot 6, 2026-10-27)
   Préfixe prm- (écran, fiche .prm-overlay, fenêtres, lignes au prix promo). S'appuie sur css/pilotage.css (pil-, stat-,
   kpi-, chart-) sans le modifier.
   §7.16 : défilement INTERNE (.pil-contenu, .prm-corps) ; §7.41 : [hidden] repassé en (0,2,0) dans chaque conteneur.
   Empilement (z-index en ligne) : fiche / fenêtres 7800 (SOUS les fiches document 8000 / table de remise 8000 / tiers 9600
   qu'on ouvre depuis elles) ; lignes au prix promo 7900 ; message de refus 10600 (comme la confirmation).
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
.prm-wrap [hidden], .prm-overlay [hidden], .prm-fen-overlay [hidden], .prm-detail-overlay [hidden], .prm-msg-overlay [hidden] { display: none; }

/* ── Écran : barre et liste ── */
.prm-barre .stat-input { max-width: 170px; }
.prm-barre .prm-recherche { max-width: 230px; }
.prm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.prm-table-zone { background: var(--white); border: 1px solid var(--pil-bord); border-radius: 8px; overflow: auto; max-height: calc(100vh - 300px); min-height: 120px; }
.prm-table-zone--carte { max-height: 420px; border: none; }
.prm-table { table-layout: auto; }
.prm-table thead th { position: sticky; top: 0; z-index: 1; user-select: none; }
.prm-table thead th[tabindex] { cursor: pointer; }
.prm-table thead th[aria-sort="ascending"]::after { content: " \25B2"; font-size: 9px; }
.prm-table thead th[aria-sort="descending"]::after { content: " \25BC"; font-size: 9px; }
.prm-table th.stat-num, .prm-table td.stat-num { width: 1%; white-space: nowrap; }
.prm-table tbody tr { cursor: pointer; }
.prm-col-case { width: 1%; text-align: center; }
.prm-code, .prm-periode { white-space: nowrap; width: 1%; }
.prm-lib { width: 100%; max-width: 0; min-width: 180px; }
.prm-lib-texte { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.prm-lib-sous { font-size: 10.5px; color: var(--gray-500); }
.prm-attente { color: var(--gray-400); }
.prm-hausse { color: #15803d; }
.prm-baisse { color: #b91c1c; }
.prm-vide-cellule { text-align: center; color: var(--gray-500); font-style: italic; padding: 12px; }

/* Badge de statut */
.prm-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.prm-badge--BROUILLON { background: var(--gray-100); color: var(--gray-500); }
.prm-badge--PLANIFIEE { background: #eff6ff; color: var(--blue-dark); }
.prm-badge--ACTIVE { background: var(--pil-hausse-fond); color: var(--pil-hausse); }
.prm-badge--TERMINEE { background: #f1f5f9; color: #334155; }
.prm-badge--ANNULEE { background: var(--pil-baisse-fond); color: var(--pil-baisse); text-decoration: line-through; }

/* ── Fiche et fenêtres ── */
.prm-overlay, .prm-fen-overlay, .prm-detail-overlay {
    position: fixed; inset: 0; z-index: 7800; background: rgba(15, 23, 42, .45);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.prm-detail-overlay { z-index: 7900; }
.prm-panel {
    display: flex; flex-direction: column; width: min(1180px, 100%); max-height: 92vh; min-height: 0;
    background: var(--white); border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); overflow: hidden;
}
.prm-panel--etroit { width: min(760px, 100%); }
.prm-tete { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #7c2d12; color: #fff; }
.prm-tete-titre { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prm-tete .stat-btn--icone { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .4); }
.prm-onglets { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 16px 0; border-bottom: 1px solid var(--pil-bord); background: var(--gray-50); }
.prm-onglet { padding: 6px 14px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: transparent;
              font: inherit; font-size: 12.5px; color: var(--gray-500); cursor: pointer; }
.prm-onglet[aria-selected="true"] { background: var(--white); border-color: var(--pil-bord); color: var(--blue-dark); font-weight: 700; margin-bottom: -1px; }
.prm-corps { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.prm-pied { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--pil-bord); flex-wrap: wrap; }
.prm-pied-info { flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: var(--gray-500); }
.prm-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.prm-champ { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.prm-champ > span { font-size: 11px; font-weight: 600; color: var(--gray-500); }
.prm-champ .stat-input { max-width: none; width: 100%; }
.prm-champ--large { grid-column: 1 / -1; }
.prm-champ textarea.stat-input { height: 60px; resize: vertical; }
.prm-montant { text-align: right; font-variant-numeric: tabular-nums; }
.prm-note { font-size: 11.5px; color: var(--gray-500); margin: 4px 0 10px; line-height: 1.45; }
.prm-alerte { padding: 8px 10px; border-radius: 6px; font-size: 12.5px; margin-bottom: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.prm-alerte--info { background: #eff6ff; border-color: #bfdbfe; color: var(--blue-dark); }
.prm-alerte-mini { font-size: 11px; color: #92400e; margin-top: 2px; }
.prm-statut-ligne { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12.5px; }
.prm-actions-cellule { white-space: nowrap; text-align: right; }
.prm-actions-cellule .stat-btn { margin-left: 4px; }
.prm-recherche-zone { position: relative; margin-top: 10px; max-width: 560px; }
.prm-recherche-zone .stat-input { max-width: none; width: 100%; }
.prm-resultats { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; max-height: 260px; overflow: auto; background: var(--white);
                 border: 1px solid var(--gray-300); border-radius: 4px; box-shadow: var(--shadow-md); }
.prm-resultat { display: block; width: 100%; text-align: left; padding: 5px 8px; border: none; background: none; font: inherit; font-size: 12.5px; cursor: pointer; }
.prm-resultat:hover, .prm-resultat:focus { background: var(--blue-pale); outline: none; }
.prm-resultat small { display: block; color: var(--gray-400); }
.prm-resultat-info { padding: 6px 8px; font-size: 12px; color: var(--gray-500); }
.prm-choix { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 12.5px; }
.prm-choix strong { color: var(--blue-dark); }
.prm-puces { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.prm-puce { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 12px; background: var(--blue-pale); color: var(--blue-dark); font-size: 12px; max-width: 100%; }
.prm-puce > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prm-puce--inconnue { background: var(--pil-baisse-fond); color: var(--pil-baisse); }
.prm-puce-x { border: none; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; color: inherit; padding: 0 4px; }
.prm-liste-coches { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 12px; font-size: 12.5px; margin-bottom: 10px; max-height: 240px; overflow: auto; }
.prm-liste-coches label { display: flex; align-items: center; gap: 6px; }

/* Résultats */
.prm-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; margin: 10px 0 12px; }
.prm-tuiles .kpi-valeur { font-size: 19px; }
.prm-carte { margin-bottom: 12px; }
.prm-graphe { min-height: 240px; }
.prm-cat { white-space: normal; }
.prm-cat--n1 { padding-left: 22px !important; }
.prm-cat--n2 { padding-left: 38px !important; }
.prm-cat--n3 { padding-left: 54px !important; }
.prm-cat--n4 { padding-left: 70px !important; }
.prm-cat--n5, .prm-cat--n6 { padding-left: 86px !important; }
.prm-categories tbody tr { cursor: default; }
.prm-limites { margin: 10px 0 4px 18px; padding: 0; }
.prm-limites li { margin-bottom: 3px; }
.prm-comparaison th:first-child { white-space: nowrap; text-align: left; }
.prm-lignes tbody tr:focus { outline: 2px solid var(--blue-light); outline-offset: -2px; }

/* Message de refus / d'information (invariant 69 : jamais une boîte native) */
.prm-msg-overlay { position: fixed; inset: 0; z-index: 10600; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.prm-msg-liste { margin: 8px 0 0 18px; padding: 0; font-size: 12.5px; }

@media (max-width: 760px) {
    .prm-actions { margin-left: 0; }
    .prm-overlay, .prm-fen-overlay, .prm-detail-overlay { padding: 0; }
    .prm-panel { max-height: 100vh; height: 100%; border-radius: 0; }
}
@media print {
    .prm-actions, .prm-overlay, .prm-fen-overlay, .prm-detail-overlay { display: none !important; }
    .prm-table-zone { max-height: none; overflow: visible; }
}
