/* ============================================================
   PLAN DE TRÉSORERIE (0.5.2.P1, PLAN) — écrans du lot 1 (dépenses)
   Jetons de tokens.css seulement : jour et nuit sans règle à part.
   ============================================================ */

/* Barre d'outils d'un onglet : filtres à gauche, gestes à droite ; elle passe à la ligne sur un téléphone. */
.plt-barre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; min-width: 0; }
.plt-barre .plt-esp { flex: 1 1 auto; }
.plt-barre .inp { height: 32px; }
.plt-sel { max-width: 100%; }
.plt-sel select, .plt-sel input { min-width: 0; }
.plt-recherche { display: flex; align-items: center; gap: 6px; flex: 0 1 220px; min-width: 140px; color: var(--encre3); }
.plt-recherche input { min-width: 0; width: 100%; }
.plt-annee { font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: center; }
.plt-fichier { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Lot 1 bis (R-1) : catégories de l'onglet « Charge », en segments ; (R-7) glyphe des boutons à icône. */
.plt-categories { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--voile); margin: 2px 0 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.plt-cat { all: unset; cursor: pointer; padding: 6px 14px; border-radius: var(--r-pill); font-size: var(--fs-sm); color: var(--encre2); white-space: nowrap; }
.plt-cat:hover { color: var(--encre); }
.plt-cat[aria-selected="true"] { background: var(--papier); color: var(--encre); box-shadow: var(--o-carte); font-weight: 500; }
.plt-cat:focus-visible { outline: 2px solid var(--encre); outline-offset: 1px; }
.plt-glyphe { display: inline-block; width: 14px; text-align: center; font-size: 13px; line-height: 1; }
.plt-rappel { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--encre2); }
.plt-lib { font-size: 12px; color: var(--encre3); }

/* Chiffres clés : cartes carrées, comme les tableaux de bord. */
.plt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.plt-kpi { background: var(--papier); box-shadow: var(--o-carte); border-radius: 6px; padding: 10px 12px; min-width: 0; }
.plt-kpi .l { font-size: var(--fs-xs); color: var(--encre3); }
.plt-kpi .v { font: 600 var(--fs-md)/1.3 var(--sans); font-variant-numeric: tabular-nums; color: var(--encre); overflow-wrap: anywhere; }
.plt-kpi .v small { font-size: var(--fs-xs); font-weight: 400; color: var(--encre3); }
.plt-kpi.alerte .v { color: var(--alerte); }
.plt-kpi.plt-acte .v { color: var(--ok); }

.plt-vide { padding: 22px 18px; color: var(--encre3); margin: 0; }
.plt-note { margin: 10px 2px 0; }
.plt-ref { font-family: var(--mono); font-size: .92em; white-space: nowrap; }
.plt-tag { font-family: var(--mono); font-size: 11px; color: var(--encre3); background: var(--voile2); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.plt-clip { display: inline-block; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.plt-calc { font-style: italic; }
.plt-prev, .plt-prev td { font-style: italic; color: var(--accent); }
.plt-acte { color: var(--ok); }
table.tbl tr.plt-ligne { cursor: pointer; }
table.tbl tr.plt-annule td { opacity: .55; }
table.tbl td.plt-etape, table.tbl th.plt-etape { text-align: center; }
.plt-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* Fiches (fenêtres) : grille de champs qui se replie seule. */
.plt-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; align-items: start; }
.plt-form .plt-large { grid-column: 1 / -1; }
/* R-8 : un tableau large (montants en lignes) défile dans son cadre sans élargir la grille de la fiche. */
.plt-form > * { min-width: 0; }
.plt-form .plt-large > .tablewrap { max-width: 100%; overflow-x: auto; }
.plt-form .hint { font-size: 11.5px; }
.plt-sep { grid-column: 1 / -1; margin: 14px 0 6px; padding-top: 10px; border-top: 1px solid var(--trait);
  font: 600 var(--fs-xs)/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--encre3); }
.plt-form .plt-sep:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.plt-ctl { background: var(--voile); border-radius: 6px; padding: 10px 12px; }
.plt-ctl-l { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 2px 0; font-size: var(--fs-sm); }
.plt-ctl-l b { font-variant-numeric: tabular-nums; }
.plt-ctl p.hint { margin: 6px 0 0; }
.plt-etapes, .plt-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.plt-col { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; }
.plt-ajout { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 10px 0 4px; }
.modal .acts .plt-gauche { margin-right: auto; }

/* Charges : grille de 12 mois, première colonne collée au bord gauche. */
table.plt-charges { min-width: 900px; font-size: 12.5px; }
table.plt-charges th, table.plt-charges td { padding: 4px 3px; vertical-align: top; }
table.plt-charges .plt-col-lib { position: sticky; left: 0; z-index: 1; background: var(--papier); min-width: 130px; max-width: 180px; }
table.plt-charges .plt-ch-nom { overflow-wrap: anywhere; }
table.plt-charges .courant { background: var(--voile); }
.plt-cel { width: 100%; min-width: 50px; box-sizing: border-box; border: 0; border-radius: 4px; padding: 4px 5px; background: var(--field, var(--panneau));
  box-shadow: 0 0 0 1px var(--trait); color: var(--encre); font: inherit; font-variant-numeric: tabular-nums; text-align: right; }
.plt-cel:focus { outline: none; box-shadow: 0 0 0 2px var(--encre); }
.plt-cel.prev { font-style: italic; color: var(--accent); }
.plt-cel.modif { box-shadow: 0 0 0 1.5px var(--ambre); }
.plt-cel.remplacee { text-decoration: line-through; opacity: .7; }
.plt-cel.bad { box-shadow: 0 0 0 1.5px var(--alerte); }
/* R-3 : périodicité. */
.plt-perio { font-size: 10.5px; color: var(--encre3); margin-top: 2px; }
.plt-sans { color: var(--encre4, var(--encre3)); }
.plt-cel.corrigee { box-shadow: 0 0 0 1px var(--accent); font-weight: 600; }
.plt-cache { display: none; }
.plt-perio-champs > .plt-form { margin-top: 2px; }
.plt-autre { font-size: 10px; color: var(--encre3); white-space: nowrap; margin-top: 2px; }
table.plt-charges tfoot .plt-total td { border-top: 1px solid var(--trait); }

/* Vue mensuelle : mois imbriqués. */
table.plt-mensuel tr.plt-mois { cursor: pointer; }
table.plt-mensuel tr.plt-mois td { font-weight: 500; }
table.plt-mensuel tr.plt-mois.courant td { background: var(--marque-voile); }
table.plt-mensuel tr.plt-hors td { color: var(--encre2); font-style: italic; }
table.plt-mensuel tr.plt-detail td { font-size: var(--fs-sm); background: var(--voile); }
table.plt-mensuel tr.plt-detail td:first-child { padding-left: 26px; }
.plt-chevron { display: inline-block; width: 1em; color: var(--encre3); }

/* Réglages : étapes éditables. */
.plt-etape-l { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.plt-etape-l .inp { flex: 1 1 auto; min-width: 0; }

@media (max-width: 599px) {
  .plt-barre { gap: 6px; }
  .plt-barre .plt-esp { display: none; }
  .plt-recherche { flex: 1 1 100%; }
  .plt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plt-form { grid-template-columns: 1fr; }
  .plt-clip { max-width: 14ch; }
  table.plt-charges .plt-col-lib { min-width: 110px; max-width: 130px; }
}

/* R-8 : montants prévus en lignes ; taux grisé dans la devise de tenue ; origine du taux d'un paiement. */
table.plt-montants { min-width: 640px; }
table.plt-montants td { padding: 4px 4px; vertical-align: middle; }
table.plt-montants .inp { height: 34px; }
table.plt-montants .plt-dev { text-transform: uppercase; max-width: 5em; }
.inp.plt-grise { background: var(--voile2); box-shadow: none; }
.inp.plt-grise input { color: var(--encre3); cursor: not-allowed; }
.plt-repris { color: var(--accent); }
.plt-sans-tenue { margin-top: 8px; }

/* R-9 : bouton « Importer » à côté des catégories ; aperçu du serveur. */
.plt-tete-charge { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.plt-tete-charge .plt-categories { margin-bottom: 10px; }
table.plt-import td { vertical-align: top; }
.imp-aide { font-weight: 500; margin: 0 0 10px; }
