/* ═══════════════════════════════════════════════════════════════════════════════════════════
   Comptabilité analytique : paramétrage, saisie (fenêtre de ventilation), éditions, budgets, pilotage.
   Même langage que le tableau de bord (fond gris clair, cartes blanches, accent indigo). Préfixe .ana-
   ═══════════════════════════════════════════════════════════════════════════════════════════ */
.ana-page { height: 100%; overflow-y: auto; background: #eef1f5; padding: 20px 24px 32px; }
.ana-root { max-width: 1680px; margin: 0 auto; color: #1f2937; font-size: 14px; }

/* ── En-tête fixe ── */
.ana-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    position: sticky; top: -20px; z-index: 6; margin: -20px -24px 16px; padding: 14px 24px 12px;
    background: rgba(238, 241, 245, .94); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 1px 0 #dde2e9; }
.ana-titre { display: flex; align-items: center; gap: 12px; }
.ana-titre-icone { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px;
    background: var(--ax-primary-50, #e8eaf6); color: var(--ax-primary, #3f51b5); font-size: 20px; }
.ana-titre h2 { margin: 0; padding: 0; font-size: 22px; font-weight: 700; color: #111827; line-height: 1.2; }
.ana-sous-titre { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; color: #64748b; }
.ana-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ana-actions .ax-btn { min-height: 40px; }

/* Interrupteur d'activation */
.ana-activation { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 6px 10px; cursor: pointer;
    background: #fff; border: 1px solid #d5d8e0; border-radius: 12px; text-align: left; transition: border-color .15s ease, box-shadow .15s ease; }
.ana-activation:hover:not([disabled]) { border-color: var(--ax-primary, #3f51b5); box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.ana-activation:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); outline-offset: 2px; }
.ana-activation[disabled] { cursor: not-allowed; opacity: .8; }
.ana-activation-texte { display: flex; flex-direction: column; line-height: 1.25; }
.ana-activation-texte b { font-size: 13.5px; color: #111827; }
.ana-activation-texte small { font-size: 12px; color: #64748b; }
.ana-interrupteur { position: relative; width: 38px; height: 22px; border-radius: 11px; background: #cbd5e1; transition: background .2s ease; flex: 0 0 38px; }
.ana-interrupteur span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s ease; }
.ana-activation-on { border-color: #86efac; background: #f0fdf4; }
.ana-activation-on .ana-interrupteur { background: #16a34a; }
.ana-activation-on .ana-interrupteur span { transform: translateX(16px); }

.ana-pulse { box-shadow: 0 0 0 0 rgba(63, 81, 181, .45); animation: ana-pulse 2s infinite; }
@keyframes ana-pulse { 70% { box-shadow: 0 0 0 10px rgba(63, 81, 181, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 81, 181, 0); } }

.ana-bandeau-lecture { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 14px; border-radius: 10px;
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; }

/* ── Onglets = étapes ── */
.ana-onglets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; padding: 5px; background: #fff; border: 1px solid #e2e6ed; border-radius: 12px; }
.ana-onglet { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px;
    background: transparent; color: #475569; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.ana-onglet:hover { background: #f1f5f9; color: #111827; }
.ana-onglet:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); outline-offset: 1px; }
.ana-onglet-actif, .ana-onglet-actif:hover { background: var(--ax-primary-50, #e8eaf6); color: var(--ax-primary, #3f51b5); }
.ana-onglet-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
    background: #e2e8f0; color: #475569; font-size: 11px; }
.ana-onglet-actif .ana-onglet-num { background: var(--ax-primary, #3f51b5); color: #fff; }
.ana-compteur { padding: 1px 7px; border-radius: 10px; background: #f1f5f9; color: #64748b; font-size: 11.5px; }

/* ── Cartes ── */
.ana-carte { background: #fff; border: 1px solid #e2e6ed; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); padding: 16px 18px; margin-bottom: 16px; }
.ana-carte-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ana-carte-tete h3 { margin: 0; padding: 0; font-size: 16px; font-weight: 700; color: #111827; }
.ana-carte-tete small { display: block; margin-top: 2px; font-size: 12.5px; color: #64748b; }
.ana-boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.ana-btn-petit { min-height: 36px; padding: 0 12px; font-size: 13px; }

.ana-plans-sections { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 991px) { .ana-plans-sections { grid-template-columns: 1fr; } .ana-page { padding: 16px; } .ana-tete { top: -16px; margin: -16px -16px 14px; padding: 12px 16px; } }

.ana-plan-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ana-plan { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px; text-align: left; cursor: pointer;
    background: #fff; border: 1px solid #e2e6ed; border-radius: 10px; transition: border-color .15s ease, background .15s ease; }
.ana-plan:hover { border-color: #c5cae9; background: #fafbff; }
.ana-plan:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); outline-offset: 1px; }
.ana-plan-actif, .ana-plan-actif:hover { border-color: var(--ax-primary, #3f51b5); background: var(--ax-primary-50, #e8eaf6); }
.ana-plan-libelle { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; color: #111827; }
.ana-plan-libelle small { font-weight: 400; color: #64748b; font-size: 12px; }
.ana-ligne-actions i { padding: 8px; border-radius: 6px; color: #64748b; }
.ana-ligne-actions i:hover { background: #fff; color: var(--ax-primary, #3f51b5); }

.ana-code { display: inline-block; min-width: 42px; padding: 2px 7px; border-radius: 6px; background: #f1f5f9; color: #334155;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; text-align: center; }
.ana-inactif { opacity: .55; }
.ana-etiquette { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #f1f5f9; color: #64748b; font-size: 11.5px; }

/* ── Tables ── */
.ana-table-zone { max-height: calc(100vh - 330px); overflow: auto; border: 1px solid #eef1f5; border-radius: 10px; }
.ana-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ana-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: #475569; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .03em; text-align: left; padding: 9px 12px; border-bottom: 1px solid #e2e6ed; }
.ana-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ana-table tbody tr:hover td { background: #fafbff; }
.ana-table .ana-montant, .ana-table th.ana-montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ana-num { font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; color: #334155; white-space: nowrap; }
.ana-gris { color: #64748b; font-size: 13px; }
.ana-col-actions { width: 1%; white-space: nowrap; text-align: right; }
.ana-ligne-total td { background: #f8fafc; font-weight: 600; }
.ana-ligne-soumise td:first-child { box-shadow: inset 3px 0 0 var(--ax-primary, #3f51b5); }
.ana-arbre { display: inline-flex; align-items: center; gap: 8px; }
.ana-puce { font-size: 6px; color: #94a3b8; }
.ana-type { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.ana-type-DETAIL { background: #ecfdf5; color: #047857; }
.ana-type-TOTAL { background: #eef2ff; color: #4338ca; }
.ana-icone-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px;
    background: transparent; color: #64748b; cursor: pointer; transition: background .15s ease, color .15s ease; }
.ana-icone-btn:hover { background: #f1f5f9; color: var(--ax-primary, #3f51b5); }
.ana-icone-btn:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); }
.ana-icone-btn.ana-danger:hover { background: #fef2f2; color: #dc2626; }

.ana-liste-vide, .ana-vide, .ana-chargement { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 28px 16px; color: #64748b; text-align: center; font-size: 13.5px; }
.ana-liste-vide i, .ana-vide i { font-size: 26px; color: #c7cede; }
.ana-vide { background: #fff; border: 1px dashed #d5d8e0; border-radius: 12px; padding: 48px 16px; }
.ana-vide b { color: #111827; font-size: 15px; }
.ana-note { padding: 8px 12px; color: #64748b; font-size: 12.5px; }
.ana-aide { margin: 4px 0 10px; color: #64748b; font-size: 12.5px; }

/* ── Filtres, segments ── */
.ana-filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.ana-recherche { position: relative; flex: 1 1 260px; max-width: 420px; margin: 0; }
.ana-recherche i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.ana-recherche input { width: 100%; height: 40px; padding: 0 12px 0 34px; border: 1px solid #d5d8e0; border-radius: 10px; font-size: 14px; }
.ana-recherche input:focus, .ana-select:focus, .ana-champ input:focus, .ana-champ textarea:focus, .ana-pourcent input:focus {
    outline: none; border-color: var(--ax-primary, #3f51b5); box-shadow: 0 0 0 3px rgba(63, 81, 181, .15); }
.ana-segment { display: inline-flex; padding: 3px; gap: 2px; background: #f1f5f9; border-radius: 10px; flex-wrap: wrap; }
.ana-segment button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #475569;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease; }
.ana-segment button:hover:not([disabled]) { color: #111827; }
.ana-segment button:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); }
.ana-segment button[disabled] { cursor: not-allowed; }
.ana-segment .ana-segment-actif { background: #fff; color: var(--ax-primary, #3f51b5); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.ana-segment .ana-segment-actif.ana-oblig { color: #b45309; }
.ana-segment-petit button { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.ana-select { height: 36px; min-width: 160px; padding: 0 8px; border: 1px solid #d5d8e0; border-radius: 8px; background: #fff; font-size: 13px; }

/* ── Journaux ── */
.ana-journaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ana-journal { display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 0; padding: 8px 12px; cursor: pointer;
    border: 1px solid #e2e6ed; border-radius: 10px; font-weight: 400; transition: border-color .15s ease, background .15s ease; }
.ana-journal:hover { border-color: #c5cae9; }
.ana-journal input { width: 18px; height: 18px; margin: 0; accent-color: var(--ax-primary, #3f51b5); }
.ana-journal-off { background: #f8fafc; color: #94a3b8; }
.ana-journal-libelle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Grilles ── */
.ana-grilles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ana-grille { position: relative; padding: 14px; border: 1px solid #e2e6ed; border-radius: 12px; transition: box-shadow .15s ease, border-color .15s ease; }
.ana-grille:hover { border-color: #c5cae9; box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }
.ana-grille-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 70px; }
.ana-grille-barre { display: flex; height: 10px; margin: 12px 0 8px; border-radius: 5px; overflow: hidden; background: #f1f5f9; }
.ana-barre-0 { background: #3f51b5; } .ana-barre-1 { background: #0ea5e9; } .ana-barre-2 { background: #10b981; }
.ana-barre-3 { background: #f59e0b; } .ana-barre-4 { background: #ec4899; } .ana-barre-5 { background: #8b5cf6; }
.ana-grille-resume { color: #475569; font-size: 12.5px; }
.ana-grille-actions { position: absolute; top: 8px; right: 8px; }
.ana-grille-lignes { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.ana-grille-ligne { display: flex; align-items: center; gap: 8px; }
.ana-grille-ligne .ana-select { flex: 1; }
.ana-pourcent { display: inline-flex; align-items: center; gap: 4px; }
.ana-pourcent input { width: 96px; height: 36px; padding: 0 8px; border: 1px solid #d5d8e0; border-radius: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.ana-grille-outils { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ana-total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.ana-ok { color: #15803d; }
.ana-ko { color: #b45309; }

/* ── Réglages : cartes de choix ── */
.ana-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.ana-choix-carte { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; text-align: left; cursor: pointer;
    background: #fff; border: 1.5px solid #e2e6ed; border-radius: 12px; transition: border-color .15s ease, background .15s ease; }
.ana-choix-carte i { font-size: 20px; color: #94a3b8; }
.ana-choix-carte b { font-size: 14.5px; color: #111827; }
.ana-choix-carte span { color: #64748b; font-size: 13px; line-height: 1.45; }
.ana-choix-carte:hover:not([disabled]) { border-color: #c5cae9; }
.ana-choix-carte:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); outline-offset: 2px; }
.ana-choix-actif, .ana-choix-actif:hover { border-color: var(--ax-primary, #3f51b5) !important; background: #fafbff; }
.ana-choix-actif i { color: var(--ax-primary, #3f51b5); }

/* ── Tiroir d'édition ── */
.ana-voile { position: fixed; inset: 0; z-index: 1040; background: rgba(15, 23, 42, .35); animation: ana-fondu .15s ease; }
.ana-tiroir { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1041; width: min(520px, 100vw); background: #fff;
    box-shadow: -8px 0 30px rgba(15, 23, 42, .18); animation: ana-glisse .2s ease-out; display: flex; flex-direction: column; }
.ana-tiroir form { display: flex; flex-direction: column; height: 100%; margin: 0; }
.ana-tiroir-tete { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #eef1f5; }
.ana-tiroir-tete h3 { margin: 0; font-size: 17px; font-weight: 700; color: #111827; }
.ana-tiroir-corps { flex: 1; overflow-y: auto; padding: 16px 20px; }
.ana-tiroir-pied { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid #eef1f5; background: #fafbfc; }
.ana-espace { flex: 1; }
@keyframes ana-glisse { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ana-fondu { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ana-tiroir, .ana-voile, .ana-pulse { animation: none; } }

.ana-champ { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; font-weight: 400; flex: 1; min-width: 0; }
.ana-champ > span { font-size: 12.5px; font-weight: 600; color: #374151; }
.ana-champ input, .ana-champ textarea { width: 100%; min-height: 38px; padding: 6px 10px; border: 1px solid #d5d8e0; border-radius: 8px; font-size: 14px; }
.ana-champ .ana-select { width: 100%; height: 38px; }
.ana-champ-ligne { display: flex; gap: 12px; }
.ana-champ-code { flex: 0 0 140px; }
.ana-champ-court { max-width: 160px; }
.ana-majuscules { text-transform: uppercase; }
.ana-case { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 0; font-weight: 400; color: #374151; font-size: 13px; cursor: pointer; }
.ana-case input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ax-primary, #3f51b5); }
@media (max-width: 575px) { .ana-champ-ligne { flex-direction: column; gap: 0; } .ana-champ-code { flex: 1; } }

/* ── Fenêtre « Saisie analytique » ── */
.ana-dialog { width: min(760px, 96vw); max-width: 96vw; border-radius: 14px; overflow: hidden; }
/* les listes nya-bs-select s'ouvrent dans le corps : la fenêtre les laisse déborder au lieu de les couper */
md-dialog.ana-dialog, md-dialog.ana-dialog > form { overflow: visible !important; max-height: none; } /* la charte impose overflow hidden !important aux md-dialog */
md-dialog.ana-dialog md-dialog-content.ana-dialog-corps { overflow: visible; max-height: none; }
md-dialog.ana-dialog .ana-dialog-tete { border-radius: 14px 14px 0 0; }
.ana-dialog form { display: flex; flex-direction: column; margin: 0; min-height: 0; }
.ana-dialog-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #eef1f5; }
.ana-dialog-tete h3 { margin: 0; font-size: 17px; font-weight: 700; color: #111827; }
.ana-dialog-tete h3 i { color: var(--ax-primary, #3f51b5); margin-right: 4px; }
.ana-dialog-compte { margin-top: 4px; color: #475569; font-size: 13px; }
.ana-etiquette-oblig { background: #fffbeb; color: #b45309; }
.ana-dialog-montant { display: flex; flex-direction: column; align-items: flex-end; }
.ana-dialog-montant small { color: #64748b; font-size: 12px; }
.ana-dialog-montant b { font-size: 20px; font-variant-numeric: tabular-nums; color: #111827; }
.ana-dialog-onglets { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 16px 0; }
.ana-dialog-corps { padding: 12px 20px 8px; max-height: 60vh; }
.ana-dialog-outils { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.ana-champ-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; color: var(--ax-primary, #3f51b5); }
.ana-compteurs { display: flex; gap: 18px; }
.ana-compteurs span { display: flex; flex-direction: column; align-items: flex-end; }
.ana-compteurs small { color: #64748b; font-size: 11.5px; }
.ana-compteurs b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ana-table-saisie td { padding: 6px 8px; }
.ana-select-large { width: 100%; }
.ana-saisie-nombre { width: 120px; height: 36px; padding: 0 8px; border: 1px solid #d5d8e0; border-radius: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.ana-saisie-nombre:focus { outline: none; border-color: var(--ax-primary, #3f51b5); box-shadow: 0 0 0 3px rgba(63, 81, 181, .15); }
.ana-messages { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ana-message-erreur { color: #b91c1c; font-size: 13px; }
.ana-message-alerte { color: #b45309; font-size: 13px; }

/* ── Colonne « A » de la saisie des écritures ── */
.td-t th.tc-ana, .td-t td.tc-ana { width: 44px; min-width: 44px; max-width: 44px; padding: 0 4px; text-align: center; }
.ana-a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
    border: 1px solid #c7cede; background: #fff; color: #64748b; font-weight: 700; font-size: 12.5px; transition: background .15s ease, border-color .15s ease; }
.ana-a:hover { border-color: var(--ax-primary, #3f51b5); color: var(--ax-primary, #3f51b5); }
.ana-a:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); outline-offset: 1px; }
/* Badges du cahier des charges (EF-6.2) : Ventilé vert, Attente bleu, Partiel orange, À ventiler rouge. */
.ana-a-VENTILEE { background: #16a34a; border-color: #16a34a; color: #fff; }
.ana-a-VENTILEE:hover { color: #fff; filter: brightness(1.1); }
.ana-a-ATTENTE { background: #2563eb; border-color: #2563eb; color: #fff; }
.ana-a-ATTENTE:hover { color: #fff; filter: brightness(1.1); }
.ana-a-PARTIEL { border-color: #f59e0b; background: #fffbeb; color: #b45309; }
.ana-a-AUTO { border-style: dashed; border-color: var(--ax-primary, #3f51b5); color: var(--ax-primary, #3f51b5); }
.ana-a-A_FAIRE { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
.ana-a-ECART { border-color: #dc2626; background: #dc2626; color: #fff; }

/* ═════ Éditions, contrôle, budgets, pilotage, portefeuille ═════ */
.ana-filtres-sans-marge { margin-bottom: 0; align-items: flex-end; }
.ana-champ-filtre { flex: 0 0 auto; margin: 0; min-width: 170px; }
.ana-champ-filtre input { height: 36px; }
.ana-case-filtre { margin: 0 0 8px; align-self: center; }
.ana-champ-inline span { color: #475569; font-size: 13px; font-weight: 600; }
.ana-table-zone-haute { max-height: calc(100vh - 300px); }
.ana-ligne-cliquable { cursor: pointer; }
.ana-ligne-compte td { background: #fcfcfe; font-size: 13px; }
.ana-ligne-sous-total td { background: #fafbfc; font-weight: 600; font-size: 13px; }
.ana-negatif { color: #b91c1c; }
.ana-brouillon td { color: #64748b; font-style: italic; }
.ana-filtre-actif { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--ax-primary-50, #e8eaf6); color: var(--ax-primary, #3f51b5); font-weight: 600; font-size: 13px; }
.ana-table tfoot td { position: sticky; bottom: 0; background: #f1f5f9; font-weight: 700; padding: 9px 12px; border-top: 1px solid #e2e6ed; }
.ana-table tfoot td.ana-montant, .ana-table td.ana-montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ana-table-compacte td, .ana-table-compacte th { padding: 6px 10px; font-size: 13px; }
.ana-table-croisee th, .ana-table-croisee td { min-width: 96px; }
.ana-table-croisee td:first-child, .ana-table-croisee th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 240px; }
.ana-table-croisee thead th:first-child { background: #f8fafc; z-index: 2; }
.ana-col-barre { width: 160px; }
.ana-barre-resultat, .ana-barre-part { display: inline-block; height: 8px; border-radius: 4px; background: #10b981; vertical-align: middle; max-width: 110px; }
.ana-barre-neg { background: #ef4444; }
.ana-tri { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.ana-tri:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); }

/* Indicateurs */
.ana-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ana-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; text-align: left; background: #fff;
    border: 1px solid #e2e6ed; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.ana-kpi small { color: #64748b; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ana-kpi b { font-size: 22px; font-weight: 700; color: #111827; font-variant-numeric: tabular-nums; }
.ana-kpi > span { font-size: 12.5px; }
.ana-kpi:hover { border-color: #c5cae9; }
.ana-kpi:focus-visible { outline: 2px solid var(--ax-primary, #3f51b5); outline-offset: 2px; }
.ana-kpi-actif, .ana-kpi-actif:hover { border-color: var(--ax-primary, #3f51b5); box-shadow: 0 0 0 3px rgba(63, 81, 181, .12); }
.ana-kpi-zero b { color: #94a3b8; }
.ana-kpi-statique { cursor: default; }
.ana-kpi-statique:hover { border-color: #e2e6ed; }
.ana-kpi-alerte { border-color: #fcd34d; background: #fffbeb; }
.ana-kpi-alerte b { color: #b45309; }
.ana-vide-ok i { color: #16a34a; }

/* Statuts */
.ana-statut { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.ana-statut-NON_VENTILEE { background: #fef2f2; color: #b91c1c; }
.ana-statut-INCOMPLETE { background: #fffbeb; color: #b45309; }
.ana-statut-DEPASSEE { background: #fdf2f8; color: #be185d; }
.ana-statut-BROUILLON { background: #f1f5f9; color: #475569; }
.ana-statut-APPROUVE { background: #ecfdf5; color: #047857; }
.ana-statut-ARCHIVE { background: #f8fafc; color: #94a3b8; }

/* Budgets : jauge de consommation */
.ana-col-conso { min-width: 190px; }
.ana-jauge { display: inline-block; width: 110px; height: 8px; border-radius: 4px; background: #eef1f5; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.ana-jauge span { display: block; height: 100%; border-radius: 4px; }
.ana-jauge-OK { background: #10b981; } .ana-jauge-SEUIL { background: #f59e0b; } .ana-jauge-DEPASSE { background: #ef4444; } .ana-jauge-NON_CALCULABLE { background: #cbd5e1; }
.ana-conso { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ana-conso-SEUIL { color: #b45309; } .ana-conso-DEPASSE { color: #b91c1c; } .ana-conso-NON_CALCULABLE { color: #94a3b8; font-weight: 400; }
.ana-ligne-detail > td { background: #fafbfc; padding: 14px 18px; }
.ana-tiroir-large { width: min(720px, 100vw); }
.ana-mois-saisie { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0 10px; margin-top: 10px; }
.ana-mois-saisie .ana-champ { margin-bottom: 8px; }
.ana-mois-saisie input { text-align: right; }

/* Graphiques en barres (sans bibliothèque) */
.ana-graphe-mois { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 6px 2px 0; overflow-x: auto; }
.ana-graphe-haut { height: 230px; }
.ana-graphe-col { flex: 1 0 44px; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; }
.ana-graphe-col small { font-size: 11px; color: #64748b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ana-graphe-barres { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid #e2e6ed; }
.ana-graphe-barres > span { width: 40%; max-width: 18px; min-height: 1px; border-radius: 4px 4px 0 0; transition: height .3s ease; }
.ana-hors-periode { opacity: .4; }
.ana-barre-prevu { background: #c7d2fe; } .ana-barre-realise { background: #3f51b5; }
.ana-barre-produits { background: #10b981; } .ana-barre-charges { background: #f97316; } .ana-barre-n1 { background: #334155; }
.ana-repere-n1 { position: absolute; left: 12%; right: 12%; height: 2px; background: #334155; border-radius: 1px; }
.ana-legende { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #475569; font-size: 12.5px; margin: 6px 0; }
.ana-pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .ana-graphe-barres > span { transition: none; } }

.ana-grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .ana-grille-2 { grid-template-columns: 1fr; } }
.ana-palmares { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.ana-palmares-libelle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-palmares-barre { height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.ana-palmares-barre span { display: block; height: 100%; border-radius: 4px; }

/* Impression / PDF : seule la zone .ana-imprimable */
.ana-titre-impression { display: none; }
@media print {
    body.ana-impression * { visibility: hidden; }
    body.ana-impression .ana-imprimable, body.ana-impression .ana-imprimable * { visibility: visible; }
    body.ana-impression .ana-imprimable { position: absolute; left: 0; top: 0; width: 100%; border: 0; box-shadow: none; }
    body.ana-impression .ana-titre-impression { display: block; margin-bottom: 8px; font-size: 12px; }
    body.ana-impression .ana-table-zone { max-height: none; overflow: visible; border: 0; }
    body.ana-impression .ana-table th { position: static; }
    body.ana-impression .ana-table tfoot td { position: static; }
}
.ana-jauge-SOUS_OBJECTIF { background: #f59e0b; } .ana-conso-SOUS_OBJECTIF { color: #b45309; }
.ana-a-signe { font-size: 9px; margin-right: 1px; }
.ana-a-CHARGEMENT { opacity: .5; cursor: progress; }
.ana-a-A_FAIRE { border-style: dashed; }
/* Fenêtre « Ventiler… » : ligne d'attente, confirmation MSG-01, aide clavier */
.ana-ligne-attente td { background: #eff6ff; }
.ana-confirmation { margin: 8px 0; }
.ana-aide-clavier { color: #64748b; font-size: 12px; margin-right: 8px; }
.ana-dialog-actions-plan { flex-wrap: wrap; gap: 6px; }
.ana-table-saisie tfoot td { font-weight: 600; color: #475569; border-top: 1px solid #e2e8f0; }
.ana-plan-ligne { display: flex; align-items: center; gap: 4px; }
.ana-plan-ligne .ana-plan { flex: 1; min-width: 0; }
.ana-plan-modifier { flex: 0 0 36px; height: 36px; }

/* Règle de l'application : les boutons d'action sont toujours en haut (sous le titre du tiroir ou de la fenêtre). */
.ana-tiroir-pied.ana-barre-actions { border-top: 0; border-bottom: 1px solid #eef1f5; padding: 10px 20px; }
.ana-dialog .ana-barre-actions { padding: 10px 20px; }

/* Erreurs affichées au clic sur Enregistrer (le bouton n'est jamais grisé) */
.ana-erreurs { margin: 12px 20px 0; padding: 10px 14px; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 13px; }
.ana-dialog-corps .ana-erreurs { margin: 0 0 10px; }
.ana-erreurs b { display: block; margin-bottom: 4px; }
.ana-erreurs ul { margin: 0; padding-left: 18px; }
.ana-champ-erreur input, .ana-champ-erreur select, .ana-champ-erreur textarea, .ana-champ-erreur.ana-grille-lignes .ana-select,
.ana-champ-erreur.ana-mois-saisie input { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.ana-champ-erreur > span { color: #b91c1c; }
.ana-total-erreur { color: #b91c1c; text-decoration: underline; }

/* Recherche : le CSS de base donne box-sizing: content-box aux input[type=search] → le champ débordait sur les filtres. */
.ana-filtres { gap: 12px; }
.ana-recherche { display: flex; align-items: center; min-width: 0; }
.ana-recherche input, .ana-root input, .ana-root select, .ana-root textarea, .ana-dialog input, .ana-dialog select { box-sizing: border-box; }
.ana-recherche input { -webkit-appearance: none; appearance: none; max-width: 100%; margin: 0; }
.ana-segment { flex: 0 0 auto; }
/* En-tête de tableau collé en haut : aucune ligne visible au-dessus pendant le défilement. */
.ana-table-zone > .ana-table { margin: 0; }
.ana-table thead th { top: -1px; z-index: 2; background: #f8fafc; box-shadow: 0 1px 0 #e2e6ed; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════
   Écrans analytique / pilotage sur le design général de l'application (17/10/2026) :
   ax-container > ax-toolbar > ax-table-wrapper (header-bar, ax-tabs-bar, ax-table-scroll + table.table)
   > ax-kpi-row-fixed. Seuls quelques compléments sont définis ici.
   ═══════════════════════════════════════════════════════════════════════════════════════════ */
.ana-ecran .ax-table-wrapper { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ana-ecran .ax-table-zone { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ana-ecran .ax-table-scroll .table > tbody > tr { cursor: default; }
.ana-ecran .ax-table-scroll .table > tbody > tr[ng-click], .ana-ecran .ax-table-scroll .table td[ng-click] { cursor: pointer; }
.ana-toolbar-info { display: inline-flex; align-items: center; gap: 6px; color: var(--ax-text-sec, #64748b); font-size: 12.5px; }
.ana-toolbar-champ { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 12.5px; color: var(--ax-text-sec, #475569); }
.ana-toolbar-champ .form-control { height: 32px; min-width: 140px; padding: 4px 8px; font-size: 13px; }
.ana-switch { margin: 0 !important; color: var(--ax-primary); font-weight: 600; }
.ana-tab-compteur { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 10px; background: var(--ax-primary-50, #e8eaf6);
    color: var(--ax-primary, #3f51b5); font-size: 11px; font-weight: 700; text-align: center; }
.ana-tab-compteur-zero { background: #f1f5f9; color: #94a3b8; }
.ana-sous-titre-tableau { color: var(--ax-text-sec, #64748b); font-size: 12.5px; }
.ana-code-dossier { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 5px; background: #f1f5f9; color: #334155;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 11.5px; }
.ana-alerte-texte { color: #b45309; }
.ana-ecran .ax-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Plans et sections : liste des plans à gauche, sections à droite */
.ana-deux-panneaux { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
.ana-panneau-plans { border-right: 1px solid var(--ax-border, #e5e7eb); padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.ana-panneau-titre { font-weight: 700; color: var(--ax-text-strong, #111827); font-size: 13px; padding: 4px 4px 8px; }
.ana-panneau-titre small { display: block; font-weight: 400; color: var(--ax-text-sec, #64748b); font-size: 12px; }
.ana-plan-ligne .ana-plan { min-height: 44px; border-radius: 8px; }
@media (max-width: 991px) { .ana-deux-panneaux { grid-template-columns: 1fr; } .ana-panneau-plans { border-right: 0; border-bottom: 1px solid var(--ax-border, #e5e7eb); } }

/* Pilotage : contenu défilant avec des blocs */
.ana-zone-defilante { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.ana-bloc { border: 1px solid var(--ax-border, #e5e7eb); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fff; }
.ana-bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ana-bloc-tete h4 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ax-text-strong, #111827); }
.ana-bloc .table { margin-bottom: 0; }
.ana-zone-defilante .table > tfoot > tr > td { font-weight: 700; background: #f8fafc; border-top: 1px solid var(--ax-border, #e5e7eb); }
.ana-table-detail { margin: 8px 0 0; font-size: 12.5px; }
.ana-ligne-detail > td { background: #fafbfc !important; }
.ana-ecran .ana-graphe-mois { height: 190px; }

/* Impression : la zone imprimable est le bloc tableau standard */
@media print {
    body.ana-impression .ana-imprimable .ax-table-scroll, body.ana-impression .ana-imprimable .ana-zone-defilante { overflow: visible; max-height: none; }
}

/* ═══════════ Listes (nya-bs-select) et calendrier de l'application (uib-datepicker-popup), comme le Grand livre ═══════════ */
.ana-toolbar-champ > span { white-space: nowrap; }
/* listes nya-bs-select (composant de liste de l'application) */
.ana-nya.nya-bs-select { width: auto; min-width: 200px; vertical-align: middle; }
.ana-nya > .dropdown-toggle { height: 36px; padding: 6px 28px 6px 10px; border: 1px solid #d5d8e0; border-radius: 8px; background: #fff; box-shadow: none;
    color: #1e293b; font-size: 13px; text-align: left; transition: border-color .12s ease, box-shadow .12s ease; }
.ana-nya.nya-bs-select > .dropdown-toggle.btn-default:hover, .ana-nya.nya-bs-select > .dropdown-toggle.btn-default:focus, .ana-nya.nya-bs-select > .dropdown-toggle.btn-default:active,
.ana-nya.nya-bs-select.open > .dropdown-toggle.btn-default, .ana-nya.nya-bs-select.open > .dropdown-toggle.btn-default:focus, .ana-nya.nya-bs-select.open > .dropdown-toggle.btn-default:hover {
    border-color: var(--ax-primary, #3f51b5); background: #fff; color: #1e293b; outline: none; }
.ana-nya.nya-bs-select.open > .dropdown-toggle.btn-default, .ana-nya.nya-bs-select > .dropdown-toggle.btn-default:focus { box-shadow: 0 0 0 3px rgba(63, 81, 181, .12); }
.ana-nya > .dropdown-toggle.disabled { background: #f8fafc; color: #94a3b8; }
.ana-nya .filter-option, .ana-nya .special-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-nya .special-title { color: #94a3b8; }
.ana-nya > .dropdown-menu { z-index: 1100; min-width: 100%; max-width: 420px; margin-top: 4px; padding: 6px; border: 1px solid #e2e6ed; border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14); }
.ana-nya > .dropdown-menu li a { padding: 7px 10px; border-radius: 6px; color: #1e293b; font-size: 13px; white-space: normal; }
.ana-nya > .dropdown-menu li a:hover, .ana-nya > .dropdown-menu li a:focus { background: var(--ax-primary-50, #e8eaf6); color: var(--ax-primary, #3f51b5); }
.ana-nya > .dropdown-menu li.active a, .ana-nya > .dropdown-menu li.active a:hover, .ana-nya > .dropdown-menu li a:active { background: var(--ax-primary-50, #e8eaf6); color: var(--ax-primary, #3f51b5); }
.ana-nya > .dropdown-menu li.selected a { background: var(--ax-primary-50, #e8eaf6); color: var(--ax-primary, #3f51b5); font-weight: 600; }
.ana-nya .bs-searchbox { padding: 2px 2px 6px; }
.ana-nya .bs-searchbox input { height: 32px; border: 1px solid #d5d8e0; border-radius: 8px; box-shadow: none; font-size: 13px; }
.ana-nya-barre > .dropdown-toggle { height: 32px; padding: 4px 28px 4px 10px; }
.ana-nya-court.nya-bs-select { min-width: 130px; }
.ana-champ .ana-nya.nya-bs-select, .ana-nya-large.nya-bs-select { width: 100%; }
.ana-champ .ana-nya > .dropdown-toggle { height: 38px; font-size: 14px; }
.ana-nya-sm.nya-bs-select { min-width: 180px; }
.ana-nya-sm > .dropdown-toggle { height: 30px; padding: 4px 26px 4px 8px; font-size: 12.5px; }
.ana-grille-ligne .ana-nya.nya-bs-select { flex: 1; min-width: 0; }
.ana-nya-grille.nya-bs-select { min-width: 240px; }
.ana-champ-erreur .ana-nya > .dropdown-toggle { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
/* la barre laisse déborder les listes ouvertes (nya-bs-select ne se rattache pas au body) */
.ana-ecran .ax-toolbar { overflow: visible; }

.ana-date { display: inline-flex; align-items: stretch; }
.ana-date input.form-control, .ana-champ .ana-date input { width: 120px; min-width: 0; border-radius: 8px 0 0 8px; }
.ana-champ .ana-date { display: flex; }
.ana-champ .ana-date input { flex: 1; width: auto; }
.ana-toolbar-champ .ana-date input.form-control { height: 32px; }
.ana-date-btn { display: flex; align-items: center; padding: 0 10px; border: 1px solid #d5d8e0; border-left: 0; border-radius: 0 8px 8px 0; background: #fff; color: var(--ax-primary, #3f51b5); }
.ana-date-btn:hover { background: var(--ax-primary-50, #e8eaf6); }

/* ═══════════ Calendrier (gabarit views/analytique/calendrierPopup.html) ═══════════ */
.ana-calendrier.dropdown-menu { z-index: 1100; min-width: 292px; margin-top: 6px; padding: 12px 12px 10px; border: 1px solid #e2e6ed; border-radius: 12px;
    background: #fff; box-shadow: 0 16px 40px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06); animation: ana-fondu .12s ease; }
.ana-calendrier table { width: 100%; border-collapse: separate; border-spacing: 2px; outline: none; }
.ana-calendrier .btn { height: 34px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; box-shadow: none !important;
    color: #1e293b; font-size: 13px; font-weight: 500; transition: background-color .12s ease, color .12s ease; }
.ana-calendrier .btn:hover, .ana-calendrier .btn:focus { background: var(--ax-primary-50, #e8eaf6); color: var(--ax-primary, #3f51b5); outline: none; }
.ana-calendrier .btn[disabled] { opacity: .35; background: transparent; }
/* en-tête : mois / année et flèches */
.ana-calendrier thead tr:first-child th { padding-bottom: 6px; }
.ana-calendrier thead tr:first-child .btn { width: 34px; color: #475569; }
.ana-calendrier thead tr:first-child .btn[role="heading"] { width: 100%; color: #0f172a; text-transform: capitalize; }
.ana-calendrier thead tr:first-child .btn strong { font-size: 14px; font-weight: 700; }
.ana-calendrier .glyphicon { top: 0; font-size: 11px; }
.ana-calendrier thead small { display: block; padding: 2px 0 6px; color: #94a3b8; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
/* jours, mois, années */
.ana-calendrier tbody .btn { min-width: 36px; }
.ana-calendrier tbody .text-muted { color: #c0c7d2; }
.ana-calendrier tbody .text-info { position: relative; color: var(--ax-primary, #3f51b5); font-weight: 700; }
.ana-calendrier tbody .text-info::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 4px; height: 4px; margin-left: -2px;
    border-radius: 50%; background: currentColor; }
.ana-calendrier tbody .btn.active { background: transparent; box-shadow: inset 0 0 0 1px #cbd5e1 !important; }
.ana-calendrier tbody .btn.btn-info, .ana-calendrier tbody .btn.btn-info:hover, .ana-calendrier tbody .btn.btn-info.active {
    background: var(--ax-primary, #3f51b5); color: #fff; box-shadow: 0 2px 6px rgba(63, 81, 181, .35) !important; }
.ana-calendrier tbody .btn.btn-info span { color: #fff; }
/* pied : Aujourd'hui · Effacer · Fermer */
.ana-calendrier-pied { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid #eef0f4; }
.ana-calendrier-pied .ax-btn-primary { margin-left: auto; }
.ana-calendrier-effacer { padding: 4px 6px; border: 0; background: none; color: #b91c1c; font-size: 12.5px; font-weight: 600; }
.ana-calendrier-effacer:hover { text-decoration: underline; }
/* champ date : focus visible */
.ana-date input.form-control:focus { border-color: var(--ax-primary, #3f51b5); box-shadow: 0 0 0 3px rgba(63, 81, 181, .12); }
.ana-date input.form-control:focus + .ana-date-btn { border-color: var(--ax-primary, #3f51b5); }

/* ═══════════ État vide guidé (Budgets) ═══════════ */
.ana-vide { max-width: 760px; margin: 0 auto; padding: 48px 20px; gap: 12px; }
.ana-vide > i { width: 64px; height: 64px; font-size: 30px; color: var(--ax-primary, #3f51b5); background: var(--ax-primary-50, #e8eaf6); }
.ana-vide p.ana-vide-titre { color: #0f172a; font-size: 17px; font-weight: 700; }
.ana-vide p.ana-vide-texte { max-width: 560px; color: #64748b; font-size: 14px; font-weight: 400; line-height: 1.55; }
.ana-vide-etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; margin: 10px 0 4px; padding: 0; list-style: none; counter-reset: none; }
.ana-vide-etapes li { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 12px; border: 1px solid #e2e6ed; border-radius: 12px; background: #fff; text-align: center; }
.ana-vide-etapes b { color: #1e293b; font-size: 14px; }
.ana-vide-etapes small { color: #64748b; font-size: 12.5px; line-height: 1.4; }
.ana-vide-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-bottom: 4px; border-radius: 50%;
    background: var(--ax-primary, #3f51b5); color: #fff; font-size: 13px; font-weight: 700; }
.ana-vide p.ana-vide-aide { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 13px; font-weight: 600; }
.ana-vide .ana-vide-aide i { display: inline-block; width: auto; height: auto; border-radius: 0; background: none; color: var(--ax-primary, #3f51b5); font-size: 14px; }
@media (max-width: 640px) { .ana-vide-etapes { grid-template-columns: 1fr; } }
/* barre d'actions : passe à la ligne plutôt que de couper filtres et boutons sur écran étroit */
.ana-ecran .ax-toolbar { height: auto; flex-wrap: wrap; row-gap: 8px; }
.ana-ecran .ax-toolbar-left { flex-wrap: wrap; row-gap: 8px; min-width: 0; }

/* ═════ Cahier des charges v1.0 : attente, grilles typées, grilles par plan ═════ */
.ana-etiquette-attente { background: #dbeafe; color: #1d4ed8; }
.ana-grilles-compte { display: flex; flex-direction: column; gap: 4px; }
.ana-grille-plan { display: flex; align-items: center; gap: 6px; }
.ana-grille-plan .ana-code { min-width: 42px; }
.ana-segment-petit button { padding: 4px 8px; font-size: 12px; }
.ana-equilibre { color: #64748b; font-style: italic; min-width: 70px; }
.ana-apercu { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-top: 10px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; font-size: 13px; }
.ana-apercu-titre { color: #64748b; }
.ana-statut-ATTENTE { background: #eff6ff; color: #1d4ed8; }
.ana-statut-OK { background: #ecfdf5; color: #047857; }
/* Encadré d'information en tête d'onglet (remplace les aides grises en pied de tableau) */
.ana-note-info { display: flex; gap: 12px; align-items: flex-start; margin: 14px 16px; padding: 12px 16px;
    background: #eff6ff; border: 1px solid #bfdbfe; border-left: 4px solid #3b82f6; border-radius: 8px; color: #1e3a5f; font-size: 13px; line-height: 1.5; }
.ana-note-info-icone { color: #3b82f6; font-size: 18px; margin-top: 1px; }
.ana-note-info > div > b:first-child { display: block; margin-bottom: 2px; color: #1e40af; }
.ana-note-info ul { margin: 0; padding-left: 18px; }
.ana-note-info li { margin: 1px 0; }
/* OD analytiques et répartition secondaire */
.ana-tiroir-large { width: min(880px, 100vw); }
.ana-table-od td { vertical-align: middle; }
.ana-aide-tableau { padding: 0 16px 12px; }
.ana-ecran > .ana-note-info { margin: 0 0 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   STYLE SAAS MODERNE (inspiré de Notion / Pennylane) — écrans analytiques seulement
   Minimalisme : fond gris chaud, cartes blanches à liseré fin, aucune ombre lourde,
   une seule couleur d'accent (primaire de l'application), onglets soulignés,
   pastilles douces, chiffres tabulaires, hiérarchie typographique nette.
   Tout est préfixé par .ana-ecran / .ana-dialog / .ana-tiroir : aucun autre écran touché.
   ═══════════════════════════════════════════════════════════════════════════ */
.ana-ecran, .ana-dialog, .ana-tiroir {
    --ana-fond: #f7f7f5;
    --ana-surface: #ffffff;
    --ana-liseré: #e9e9e7;
    --ana-liseré-fort: #dededb;
    --ana-texte: #37352f;
    --ana-texte-doux: #787774;
    --ana-survol: #f5f5f3;
    --ana-accent: var(--ax-primary, #3f51b5);
    --ana-accent-doux: rgba(var(--ax-primary-rgb, 63, 81, 181), 0.08);
    --ana-rayon: 12px;
    --ana-rayon-petit: 8px;
    --ana-ombre: 0 1px 2px rgba(15, 15, 15, 0.04), 0 0 0 1px rgba(15, 15, 15, 0.02);
    color: var(--ana-texte);
}
.ana-ecran { background: var(--ana-fond); min-height: 100%; font-feature-settings: "tnum" 1; }

/* Barre d'actions : posée sur le fond, liseré fin, sans ombre */
.ana-ecran .ax-toolbar { background: var(--ana-surface); border-bottom: 1px solid var(--ana-liseré); box-shadow: none; padding: 10px 28px; }
.ana-ecran .ax-btn { border-radius: var(--ana-rayon-petit); font-weight: 500; box-shadow: none; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.ana-ecran .ax-btn-outline { border-color: var(--ana-liseré-fort); color: var(--ana-texte); background: var(--ana-surface); }
.ana-ecran .ax-btn-outline:hover:not([disabled]) { background: var(--ana-survol); border-color: var(--ana-liseré-fort); color: var(--ana-texte); }
.ana-ecran .ax-btn-primary:hover:not([disabled]) { box-shadow: none; filter: brightness(1.06); }
.ana-ecran .ax-btn:focus-visible, .ana-ecran [role="tab"]:focus-visible, .ana-ecran [role="button"]:focus-visible,
.ana-dialog .ax-btn:focus-visible, .ana-tiroir .ax-btn:focus-visible { outline: 2px solid var(--ana-accent); outline-offset: 2px; }

/* Cartes : blanc, liseré fin, grand rayon, ombre presque invisible */
.ana-ecran .ax-table-wrapper { background: var(--ana-surface); border: 1px solid var(--ana-liseré); border-radius: var(--ana-rayon); box-shadow: var(--ana-ombre); margin: 16px 28px 6px; }
.ana-ecran .ax-table-header-bar { background: transparent; border-bottom: 1px solid var(--ana-liseré); box-shadow: none; padding: 14px 22px; height: auto; min-height: 52px; }
.ana-ecran .ax-table-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ana-texte); }
.ana-ecran .ax-table-title > i { color: var(--ana-texte-doux); font-size: 14px; }
.ana-ecran .ax-table-count { background: var(--ana-survol); color: var(--ana-texte-doux); border-radius: 999px; font-weight: 500; padding: 1px 8px; font-size: 12px; }

/* Onglets soulignés (Pennylane) au lieu des pilules dégradées */
.ana-ecran .ax-tabs-bar { background: transparent; border-bottom: 1px solid var(--ana-liseré); padding: 0 18px; gap: 4px; }
.ana-ecran .ax-tab-item { border-radius: 0; border: none; border-bottom: 2px solid transparent; padding: 12px 10px; font-weight: 500; color: var(--ana-texte-doux); background: transparent; box-shadow: none; margin-bottom: -1px; }
.ana-ecran .ax-tab-item:hover { background: transparent; color: var(--ana-texte); border-color: transparent; border-bottom-color: var(--ana-liseré-fort); }
.ana-ecran .ax-tab-item.active { background: transparent; color: var(--ana-texte); box-shadow: none; border-bottom: 2px solid var(--ana-accent); }
.ana-ecran .ax-tab-item.active i { color: var(--ana-accent); }
.ana-ecran .ana-tab-compteur { background: var(--ana-survol); color: var(--ana-texte-doux); font-weight: 500; }

/* Tableaux : en-têtes discrets, lignes aérées, séparateurs fins, survol doux, sans zébrure */
.ana-ecran .table > thead > tr > th, .ana-ecran .ax-table-scroll table.table > thead > tr > th, .ana-tiroir .ana-table th, .ana-dialog .ana-table th {
    background: var(--ana-surface); color: var(--ana-texte-doux); font-weight: 500; font-size: 12.5px; text-transform: none; letter-spacing: 0;
    border-bottom: 1px solid var(--ana-liseré); padding: 10px 14px; }
.ana-ecran .table > tbody > tr > td, .ana-ecran .ax-table-scroll table.table > tbody > tr > td { border-top: none; border-bottom: 1px solid #f1f1ef; padding: 11px 14px; vertical-align: middle; font-size: 13.5px; }
.ana-ecran .table > tbody > tr:nth-child(even) > td, .ana-ecran .ax-table-scroll table.table > tbody > tr:nth-child(even) > td { background: transparent; }
.ana-ecran .table > tbody > tr:hover > td, .ana-ecran .ax-table-scroll table.table > tbody > tr:hover > td { background: var(--ana-survol); }
.ana-ecran .table > tfoot > tr > td { border-top: 1px solid var(--ana-liseré); font-weight: 600; padding: 11px 14px; }
.ana-ecran .ana-ligne-total > td { background: #fafaf9; font-weight: 600; }
.ana-ecran .ax-text-right, .ana-ecran .ana-montant { font-variant-numeric: tabular-nums; }

/* Pastilles et étiquettes douces */
.ana-ecran .ana-statut, .ana-tiroir .ana-statut, .ana-dialog .ana-statut { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.ana-ecran .ana-etiquette, .ana-tiroir .ana-etiquette, .ana-dialog .ana-etiquette { border-radius: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 500; background: var(--ana-survol); color: var(--ana-texte-doux); }
.ana-ecran .ana-code { border-radius: 6px; background: var(--ana-survol); color: var(--ana-texte); font-weight: 600; }

/* Indicateurs : cartes plates, libellé discret, valeur forte (au lieu des badges à bande colorée) */
.ana-ecran .ax-kpi-row { background: rgba(247, 247, 245, 0.92); backdrop-filter: blur(6px); border-top: 1px solid var(--ana-liseré); gap: 10px; padding: 8px 28px; }
.ana-ecran .ax-badge-kpi { background: var(--ana-surface); border: 1px solid var(--ana-liseré); border-radius: var(--ana-rayon-petit); box-shadow: none; padding: 6px 14px; justify-content: flex-start; }
.ana-ecran .ax-badge-kpi::before { display: none; }
.ana-ecran .ax-badge-kpi-icon { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.ana-ecran .ax-badge-kpi-label { font-weight: 500; color: var(--ana-texte-doux); font-size: 12.5px; }
.ana-ecran .ax-badge-kpi-value { font-weight: 600; font-size: 15px; margin-left: auto; }

/* États vides : centrés, aérés, sobres */
.ana-ecran .ana-vide .fa { color: #c9c9c6; }
.ana-ecran .ana-vide-titre { color: var(--ana-texte); font-weight: 600; letter-spacing: -0.01em; }
.ana-ecran .ana-vide-texte, .ana-ecran .ana-aide { color: var(--ana-texte-doux); }

/* Encadré d'information : sobre, accent fin */
.ana-ecran .ana-note-info, .ana-tiroir .ana-note-info { background: var(--ana-surface); border: 1px solid var(--ana-liseré); border-left: 3px solid var(--ana-accent); color: var(--ana-texte); box-shadow: var(--ana-ombre); }
.ana-ecran .ana-note-info-icone, .ana-tiroir .ana-note-info-icone { color: var(--ana-accent); }
.ana-ecran .ana-note-info > div > b:first-child, .ana-tiroir .ana-note-info > div > b:first-child { color: var(--ana-texte); }
.ana-ecran > .ana-note-info { margin: 16px 28px 0; }
.ana-ecran .ax-alert { margin: 12px 28px 0; border-radius: var(--ana-rayon-petit); }

/* Tiroirs et fenêtre « Ventiler… » : panneau blanc, en-tête aéré, champs à liseré fin */
.ana-tiroir { border-left: 1px solid var(--ana-liseré); box-shadow: -12px 0 32px rgba(15, 15, 15, 0.08); }
.ana-tiroir .ana-tiroir-tete h3, .ana-dialog .ana-dialog-tete h3 { font-weight: 600; letter-spacing: -0.015em; color: var(--ana-texte); }
.ana-tiroir .ana-champ > span, .ana-tiroir .ana-champ-ligne .ana-champ > span { color: var(--ana-texte-doux); font-weight: 500; font-size: 12.5px; }
.ana-tiroir input[type="text"], .ana-tiroir input[type="number"], .ana-tiroir textarea, .ana-dialog input[type="text"] {
    border: 1px solid var(--ana-liseré-fort); border-radius: var(--ana-rayon-petit); box-shadow: none; transition: border-color .15s ease, box-shadow .15s ease; }
.ana-tiroir input:focus, .ana-tiroir textarea:focus, .ana-dialog input:focus { border-color: var(--ana-accent); box-shadow: 0 0 0 3px var(--ana-accent-doux); outline: none; }
.ana-voile { background: rgba(15, 15, 15, 0.18); backdrop-filter: blur(1px); }
md-dialog.ana-dialog { border-radius: 14px; box-shadow: 0 24px 64px rgba(15, 15, 15, 0.18); }

/* Segments (sélecteurs à boutons) : style « pilule » discret */
.ana-ecran .ana-segment, .ana-tiroir .ana-segment { background: var(--ana-survol); border-radius: var(--ana-rayon-petit); padding: 3px; gap: 2px; border: none; }
.ana-ecran .ana-segment button, .ana-tiroir .ana-segment button { border: none; border-radius: 6px; background: transparent; color: var(--ana-texte-doux); font-weight: 500; }
.ana-ecran .ana-segment .ana-segment-actif, .ana-tiroir .ana-segment .ana-segment-actif { background: var(--ana-surface); color: var(--ana-texte); box-shadow: 0 1px 2px rgba(15, 15, 15, 0.08); }
.ana-segment-barre { display: inline-flex; margin: 14px 18px 4px; }

/* Tableau de bord analytique (onglet des éditions) */
.ana-tdb { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.ana-tdb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ana-tdb-kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--ana-surface); border: 1px solid var(--ana-liseré); border-radius: var(--ana-rayon); }
.ana-tdb-label { color: var(--ana-texte-doux); font-size: 12.5px; font-weight: 500; }
.ana-tdb-valeur { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ana-texte); }
.ana-tdb-valeur.ana-alerte { color: #c2410c; }
.ana-tdb-grille { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 1100px) { .ana-tdb-grille { grid-template-columns: 1fr; } }
.ana-tdb-carte { background: var(--ana-surface); border: 1px solid var(--ana-liseré); border-radius: var(--ana-rayon); padding: 16px 18px; }
.ana-tdb-carte h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--ana-texte); letter-spacing: -0.01em; }
.ana-tdb-barres { display: flex; flex-direction: column; gap: 4px; }
.ana-tdb-barre-ligne { display: grid; grid-template-columns: minmax(140px, 2fr) minmax(80px, 3fr) minmax(110px, 1fr); align-items: center; gap: 12px; padding: 6px 8px; border-radius: var(--ana-rayon-petit); cursor: pointer; transition: background .15s ease; }
.ana-tdb-barre-ligne:hover { background: var(--ana-survol); }
.ana-tdb-barre-libelle { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-tdb-barre-piste { height: 8px; background: #f1f1ef; border-radius: 999px; overflow: hidden; }
.ana-tdb-barre { display: block; height: 100%; background: var(--ana-accent); border-radius: 999px; transition: width .3s ease; }
.ana-tdb-barre-neg { background: #e5484d; }
.ana-tdb-barre-valeur { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.ana-tdb-dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0 0 10px; font-size: 13px; }
.ana-tdb-dl dt { color: var(--ana-texte-doux); font-weight: 400; }
.ana-tdb-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ana-tdb-dl .ana-tdb-dl-fort { padding-top: 8px; border-top: 1px solid var(--ana-liseré); color: var(--ana-texte); font-weight: 600; }
.ana-retrait { padding-left: 18px; color: var(--ana-texte-doux); }
.ana-ecran .ana-ligne-sous-total > td { font-weight: 600; background: #fcfcfb; }

@media (prefers-reduced-motion: reduce) {
    .ana-ecran *, .ana-tiroir *, .ana-dialog * { transition: none !important; animation: none !important; }
}
/* Paramétrage : import / export, historique, journaux analytiques */
.ana-echanges { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; padding: 18px 22px; }
.ana-echanges h4 i { color: var(--ana-texte-doux); margin-right: 6px; }
.ana-btn-fichier { position: relative; overflow: hidden; cursor: pointer; margin: 0; }
.ana-fichier-cache { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ana-rapport { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ana-liseré, #e9e9e7); font-size: 13px; }
.ana-rapport .ana-statut { margin-right: 6px; }
.ana-liste-compacte { max-height: 180px; overflow: auto; margin: 6px 0 10px; padding-left: 18px; font-size: 12.5px; color: var(--ana-texte-doux, #787774); }
.ana-barre-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.ana-titre-section { margin: 22px 0 6px; }
.ana-audit-valeur { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--ana-texte-doux, #787774); max-width: 560px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- Unités de quantité (liste du cabinet + unités du dossier) ----- */
.ana-ecran .ana-unites { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ana-liseré, #e9e9e7); }
.ana-ecran .ana-unites-liste { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.ana-ecran .ana-unite { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px;
    background: var(--ana-survol, #f5f5f3); color: var(--ana-texte, #37352f); border: 1px solid var(--ana-liseré, #e9e9e7); }
.ana-ecran .ana-unite-CABINET { background: var(--ana-accent-doux, rgba(63, 81, 181, 0.08)); border-color: transparent; }
.ana-ecran .ana-unite-DOSSIER { background: #ecfdf5; color: #047857; border-color: transparent; }
.ana-ecran .ana-unite-retirer { border: 0; background: transparent; padding: 0 0 0 2px; color: inherit; opacity: .55; cursor: pointer; line-height: 1; }
.ana-ecran .ana-unite-retirer:hover, .ana-ecran .ana-unite-retirer:focus-visible { opacity: 1; }
.ana-ecran .ana-unite-ajout { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ana-ecran .ana-unite-ajout input[type="text"] { flex: 1 1 140px; min-width: 120px; height: 32px; padding: 0 10px; border-radius: 8px;
    border: 1px solid var(--ana-liseré-fort, #dededb); font-size: 13px; }
.ana-ecran .ana-unite-cabinet { display: inline-flex; align-items: center; gap: 4px; font-weight: normal; font-size: 12.5px; color: var(--ana-texte-doux, #787774); margin: 0; }
.ana-recommande { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: 11px; font-weight: 600; }
.ana-unite-qte { margin-left: 3px; color: #64748b; font-size: 11.5px; }

/* ----- Recette Si Saber (20/10/2026) ----- */
/* Fenêtre « Nouvelle OD analytique » : tout tient dans le tiroir (plus de défilement horizontal), compte de nature lisible. */
.ana-tiroir-large { width: min(1040px, 100vw); }
.ana-table-od { width: 100%; table-layout: fixed; }
.ana-table-od .ana-od-col-section { width: 25%; }
.ana-table-od .ana-od-col-compte { width: 33%; }
.ana-table-od .ana-od-col-montant { width: 14%; }
.ana-table-od .ana-od-col-qte { width: 9%; }
.ana-table-od .ana-od-col-action { width: 44px; }
.ana-table-od td, .ana-table-od th { padding-left: 4px; padding-right: 4px; }
.ana-table-od .ana-saisie-nombre { width: 100%; min-width: 0; }
.ana-table-od .nya-bs-select, .ana-table-od .nya-bs-select .dropdown-toggle { width: 100% !important; max-width: 100%; }
.ana-table-od .nya-bs-select .filter-option { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Colonne « A » : un vrai badge coloré pour chaque état (plus de carré en pointillés). */
.ana-a-AUTO { border-style: solid; background: #eef2ff; border-color: #a5b4fc; color: #3730a3; }
.ana-a-A_FAIRE { border-style: solid; }
.ana-unite-qte { white-space: nowrap; }

/* Pièce d'origine facultative d'une ligne d'OD sur la section d'attente (recette de Si Saber du 23/10/2026) */
.ana-od-origine { margin-top: 4px; }

/* Les listes ouvertes de la barre d'outils passent au-dessus de l'en-tête collant des tableaux (th sticky z-index 2,
   même niveau que la barre) — recette de Si Saber du 24/10/2026 : « juil. 26 » masqué dans « Comparer jusqu'à fin ». */
.ana-ecran .ax-toolbar { position: relative; z-index: 20; }

/* Rafraîchissement discret au retour sur l'écran : les chiffres restent affichés (recette Si Saber du 24/10/2026). */
.ana-maj { color: var(--ax-primary, #3f51b5); white-space: nowrap; }
