/* ANADER SPM — compléments de style pour la version PHP native.
   Le socle visuel reste public/css/spm.css ; ce fichier n'ajoute que les
   éléments propres aux vues natives (icônes de formulaire, pagination, rapports). */

svg.ico{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none;opacity:.9;vertical-align:-3px}
.btn svg.ico,.sidebar-link svg.ico,.top-icon svg.ico{margin-right:6px}
.btn-icon svg.ico{margin-right:0}
.sidebar-link svg.ico{margin-right:8px}
.stat-icon svg.ico{width:22px;height:22px;opacity:1}
.empty-state svg.ico{width:44px;height:44px;margin:0 auto 12px;color:#94a59a;opacity:1}

/* Icônes positionnées dans les champs de connexion */
.auth-input-icon{position:absolute;left:12px;top:12px;color:#839188;width:17px;height:17px;opacity:1}

/* Pagination (les classes .pagination existent déjà dans spm.css) */
.pagination .page-link{padding:6px 11px;border:1px solid var(--bordure,#dde4de);border-radius:6px;font-size:12px;background:#fff;color:#3e5244;text-decoration:none}
.pagination .page-link.active{background:var(--vert,#124f2b);color:#fff;border-color:var(--vert,#124f2b)}
.pagination .page-dots{color:#839188;font-size:12px}

/* Tableaux : ajustements de lisibilité */
.table td .sub-cell{font-size:11px;color:#7b8c80}
.table-responsive table{table-layout:auto}
.description-list{display:grid;grid-template-columns:1fr 1.4fr;gap:7px 14px;font-size:12px;margin:0}
.description-list dt{color:#7b8c80;font-weight:600}
.description-list dd{margin:0;font-weight:500}

/* Cartes d'indicateurs dans un rapport imprimable */
@media print{.no-print{display:none!important}body{background:#fff!important}}

/* Écrans étroits : la grille de filtres repasse en colonne unique */
@media (max-width:900px){.filter-grid{grid-template-columns:repeat(2,minmax(120px,1fr))}}
@media (max-width:600px){.filter-grid{grid-template-columns:1fr}}

/* --- Page de connexion : le défilement doit rester possible ---
   Le centrage vertical d'un contenu plus haut que l'écran rognait le bas de la carte
   (panneau « Comptes de démonstration » inaccessible). Le body défile désormais et
   la carte n'est centrée que s'il reste de la place. */
.auth-body{
    align-items:flex-start;
    justify-content:center;
    height:auto;
    min-height:100vh;
    min-height:100dvh;
    padding:28px 20px;
    overflow-x:hidden;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
}
.auth-body .auth-card{margin:auto;flex:none}

/* --- Écrans étroits : aucun débordement horizontal ---
   Les cartes contenant un tableau ne pouvaient pas se réduire (min-width:auto des
   éléments de grille/flex), ce qui élargissait la page au-delà de l'écran du téléphone.
   Chaque tableau défile alors dans sa propre zone, sans déplacer la page. */
.main-content,.content,.card,.card-body,.card-header,
.grid-2>*,.grid-3>*,.grid-4>*{min-width:0}
.table-responsive{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
@media (max-width:900px){
    /* Les grilles déclarées en style inline (1.4fr 1fr, 1fr 1fr…) repassent sur une colonne */
    .grid{grid-template-columns:1fr!important}
    .grid>*{min-width:0}
    .page-header,.card-header{flex-wrap:wrap;gap:10px}
    .page-header .btn,.card-header .btn{flex:none}
    .badge{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    /* Lignes souples : les badges et boutons repassent à la ligne au lieu d'élargir la page */
    .d-flex{flex-wrap:wrap}
    .d-flex>*{min-width:0}
    .app-body{overflow-x:hidden}
}

/* --- Bandeau d'accueil : badges flottants ---
   Les deux étiquettes blanches étaient positionnées sous la carte (la carte porte un
   transform, elle est donc peinte après dans l'ordre d'empilement) : on n'en voyait qu'un
   fragment qui semblait déborder. Elles passent au-dessus et chevauchent proprement les
   angles de la carte, sans jamais être rognées par la section. */
.floating-tag{z-index:3;white-space:nowrap}
.floating-tag.one{right:-16px;top:-16px}
.floating-tag.two{left:-16px;bottom:-16px}
@media (max-width:900px){.floating-tag.one,.floating-tag.two{display:none}}


/* Libellés de tableau sur une seule ligne (point financier, retards, attribution) */
.table .titre-ligne{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:250px}
.table .cell-nowrap{white-space:nowrap}
.table .titre-ligne .sub-cell{white-space:normal}

/* Barre d'exportation : boutons compacts et alignés */
.export-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.export-bar .btn{min-height:34px;padding:6px 12px;font-size:12px}

/* Grille de filtres : aucun débordement horizontal, même avec deux boutons par cellule */
.filter-grid>.form-group{min-width:0}
.filter-grid .form-actions{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;min-width:0}
.filter-grid .d-flex{flex-wrap:wrap;min-width:0}
.filter-grid .btn{max-width:100%}

/* Boutons d'action des barres de filtres : compacts pour tenir sur une seule ligne */
.filter-grid .form-actions .btn{min-height:32px;padding:5px 10px;font-size:11.5px;gap:5px}
.filter-grid .form-actions .btn .icon{width:14px;height:14px}
.filter-grid .form-actions-large{grid-column:1/-1;justify-content:flex-end}

/* Tableaux financiers : colonnes nombreuses, compactage pour rester sur une seule ligne */
.table-compact th,.table-compact td{padding:10px 9px;font-size:12.5px}
.table-compact th{font-size:10.5px;letter-spacing:.02em}
.table-compact .sub-cell{font-size:10.5px}
.table-compact .titre-ligne{max-width:260px}

/* Import du logo de l'organisation (page Paramètres) */
.logo-import{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap;margin-top:4px}
.logo-import-apercu{flex:0 0 auto;width:112px;height:112px;border:1px solid var(--bordure,#dfe7e2);border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:center;padding:10px}
.logo-import-apercu img{max-width:100%;max-height:100%;object-fit:contain}
.logo-import-champs{flex:1 1 320px;min-width:0}
.check-line{display:flex;gap:8px;align-items:flex-start;font-size:12.5px;color:#475569;margin-top:6px;cursor:pointer}
.check-line input{margin-top:2px}

/* Courbe d'évolution (tableau de bord) */
.chart-cadre{border:1px solid #eef3ef;border-radius:10px;padding:10px 6px 4px;background:#fff}
.chart-legende{display:flex;gap:22px;flex-wrap:wrap;margin-top:12px;align-items:center}
.chart-legende-item{display:flex;align-items:center;gap:7px;font-size:12.5px;color:#475569}
.chart-legende-item strong{color:#124f2b;font-size:13px}
.chart-puce{display:inline-block;width:22px;height:4px;border-radius:2px}
.chart-legende-nom{color:#334155}
.chart-legende-fin{color:#94a3b8;font-size:11.5px}
.chart-legende-note{color:#94a3b8;font-size:11.5px;margin-left:auto}
.card-subtitle{font-size:11.5px;color:#94a3b8;margin-top:2px}

/* Légende des projets sous la courbe d'évolution */
.chart-projets{display:flex;align-items:center;gap:16px;flex-wrap:wrap;width:100%;margin-top:2px;
    padding-top:10px;border-top:1px solid #eef3ef;font-size:12px;color:#475569}
.chart-projets-titre{font-weight:600;color:#334155;font-size:11.5px;text-transform:uppercase;letter-spacing:.03em}
.chart-projet{display:inline-flex;align-items:center;gap:6px}
.chart-projet strong{color:#124f2b;font-size:12px}
