/* OMINAK · administration (Filament) : lisibilité et zones tactiles (audit WCAG 2.2 AA du 10 octobre 2026).
   Thème clair uniquement : le thème sombre de Filament garde ses propres teintes. */
html:not(.dark) {
  /* Textes d'état (badges 12 px, descriptions des statistiques) : ≥ 5,9:1, proche de 7:1 pour les petits textes */
  /* OMK-48 : couleurs CSS complètes (Filament 4 lit var(--danger-600) directement ; l'ancien format « R, G, B » de Filament 3
     rendait la couleur invalide : boutons pleins « Suspendre », « Supprimer », « Fermer les sessions » en blanc sur blanc). */
  --success-600: #166534;   /* avant #16A34A : 3,15:1 sur fond vert pâle */
  --warning-600: #92400E;   /* avant #D97706 : 3,07:1 sur fond ambre pâle */
  --danger-600: #B91C1C;
  --info-600: #0D4AA1;      /* 7,85:1 sur fond bleu pâle (badges 12 px) */
  /* Gris des textes indicatifs (« Rechercher », « — ») : #71717A, 4,83:1 (avant #A1A1AA : 2,56:1) */
  --gray-400: #71717A;
}
/* Contour des champs : 3:1 minimum (avant anneau gris à 10 % d'opacité, environ 1,2:1) */
html:not(.dark) .fi-input-wrp:not(:focus-within):not(.ring-danger-600), html:not(.dark) .fi-checkbox-input:not(:checked), html:not(.dark) .fi-radio-input:not(:checked) {
  --tw-ring-color: #7B88A4;
}
html:not(.dark) .fi-checkbox-input:not(:checked), html:not(.dark) .fi-radio-input:not(:checked) { border-color: #7B88A4; }
/* Focus clavier visible et contrasté sur les liens, boutons et éléments du menu (avant : simple fond gris clair) */
html:not(.dark) :is(.fi-sidebar-item-button, .fi-link, .fi-btn, .fi-icon-btn, .fi-tabs-item, .fi-breadcrumbs-item-label, .fi-pagination-item-button, .fi-ta-header-cell button, .fi-ta-header-cell span[role=button], .fi-dropdown-list-item, .fi-user-menu button, .fi-ta-record a):focus-visible {
  outline: 2px solid #0A20C4; outline-offset: 2px;
}
html.dark :is(.fi-sidebar-item-button, .fi-link, .fi-btn, .fi-icon-btn):focus-visible { outline: 2px solid #A6E9FB; outline-offset: 2px; }

/* Écrans tactiles (téléphones, tablettes, ordinateurs tactiles) : zones d'au moins 44 × 44 px */
@media (pointer: coarse) {
  .fi-icon-btn, .fi-user-menu .fi-dropdown-trigger > button, .fi-pagination-item-button { min-width: 44px; min-height: 44px; }
  .fi-btn { min-height: 44px; }
  .fi-input-wrp { min-height: 44px; }
  .fi-input-wrp .fi-input, .fi-input-wrp .fi-select-input { min-height: 44px; }
  .fi-sidebar-item-button, .fi-sidebar-group-button, .fi-dropdown-list-item { min-height: 44px; }
  .fi-link, .fi-breadcrumbs-item-label, .fi-tabs-item { min-height: 44px; display: inline-flex; align-items: center; }
  .fi-ta-header-cell > span.group, .fi-ta-header-cell button { min-height: 44px; }
  .fi-sidebar-header a, .fi-topbar a:has(> img), .fi-logo { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }
  .fi-ta-cell a.flex { min-height: 44px; min-width: 44px; }
  .fi-fo-field-wrp-label:has(input[type=checkbox]), label:has(> .fi-checkbox-input) { min-height: 44px; }
  .fi-checkbox-input, .fi-radio-input { width: 1.375rem; height: 1.375rem; }
}

/* Boutons gris à anneau (pagination « Suivant », « Annuler »…) : contour à 3:1 */
html:not(.dark) .fi-btn.ring-1.fi-color-gray, html:not(.dark) label.fi-btn.ring-1, html:not(.dark) .fi-btn.ring-gray-950\/10 { --tw-ring-color: #7B88A4; }
/* Pointeur souris : liens d'action, fil d'Ariane et en-têtes triables d'au moins 28 px (2.5.8 exige 24 px) */
.fi-ta-actions .fi-link, .fi-breadcrumbs-item-label, .fi-ta-header-cell > span.group { min-height: 28px; display: inline-flex; align-items: center; }
@media (pointer: coarse) { .fi-ta-actions .fi-link, .fi-breadcrumbs-item-label, .fi-ta-header-cell > span.group { min-height: 44px; } .fi-breadcrumbs-item-label { min-width: 44px; justify-content: center; } }

/* OMK-41 : tableau de bord du centre de pilotage (indicateurs, à traiter, raccourcis). Grilles fluides : aucune largeur
   fixe, aucun dépassement horizontal sur téléphone (390 px). Contrastes AA en thème clair et sombre. */
.omk-pilotage-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.omk-pilotage-carte { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px; border-radius: 12px; background: #fff;
  border: 1px solid #E2E8F0; border-left: 4px solid var(--omk-ton, #0A20C4); text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
a.omk-pilotage-carte[href]:hover { border-color: var(--omk-ton, #0A20C4); }
.omk-pilotage-entete { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.omk-pilotage-icone { width: 18px; height: 18px; flex: none; color: var(--omk-ton, #0A20C4); }
.omk-pilotage-valeur { font-size: 26px; line-height: 1.15; font-weight: 800; color: #0F172A; overflow-wrap: anywhere; }
.omk-pilotage-desc { font-size: 12.5px; color: #475569; overflow-wrap: anywhere; }
.omk-ton-success { --omk-ton: #166534; } .omk-ton-warning { --omk-ton: #92400E; } .omk-ton-danger { --omk-ton: #B91C1C; }
.omk-ton-info { --omk-ton: #0D4AA1; } .omk-ton-primary { --omk-ton: #0A20C4; } .omk-ton-gray { --omk-ton: #52525B; }
.omk-a-traiter { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.omk-a-traiter-lien { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid #E2E8F0; text-decoration: none; color: inherit; }
.omk-a-traiter-lien:hover { background: #F8FAFC; }
.omk-a-traiter-libelle { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.omk-raccourcis { display: flex; flex-wrap: wrap; gap: 8px; }
.omk-raccourcis .fi-btn { max-width: 100%; white-space: normal; text-align: left; }
.omk-tableau-simple { width: 100%; border-collapse: collapse; font-size: 14px; }
.omk-tableau-simple th, .omk-tableau-simple td { padding: 8px 10px; border-bottom: 1px solid #E2E8F0; text-align: left; vertical-align: top; }
.omk-tableau-simple th { font-weight: 700; background: #F8FAFC; }
.omk-defilement { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.omk-etat { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.omk-etat-oui { background: #DCFCE7; color: #166534; } .omk-etat-non { background: #F1F5F9; color: #475569; } .omk-etat-alerte { background: #FEF3C7; color: #92400E; }
html.dark .omk-pilotage-carte, html.dark .omk-a-traiter-lien { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .12); }
html.dark .omk-pilotage-entete, html.dark .omk-pilotage-desc { color: #CBD5E1; } html.dark .omk-pilotage-valeur { color: #F8FAFC; }
html.dark .omk-tableau-simple th { background: rgba(255, 255, 255, .05); } html.dark .omk-tableau-simple th, html.dark .omk-tableau-simple td { border-color: rgba(255, 255, 255, .1); }
html.dark .omk-ton-success { --omk-ton: #4ADE80; } html.dark .omk-ton-warning { --omk-ton: #FBBF24; } html.dark .omk-ton-danger { --omk-ton: #F87171; }
html.dark .omk-ton-info, html.dark .omk-ton-primary { --omk-ton: #93C5FD; }

/* OMK-50 (lot responsive) : iPad paysage (1 024 à 1 366 px) : menu latéral ramené de 20 à 16 rem pour laisser au moins
   ~770 px aux tableaux (Total et Statut des commandes visibles sans défilement interne). */
@media (min-width: 1024px) and (max-width: 1366px) { :root { --sidebar-width: 16rem; } }

/* OMK-51 : « Moyens de paiement » : mention « (dont TEST …) » des totaux par moyen à 12 px (11,2 px auparavant). */
.omp-table small { font-size: 12px; }

/* OMK-51 : espaces des badges lisibles (« En cours de livraison » se lisait « Encoursdelivraison » à 12 px) */
.fi-badge { word-spacing: .14em; }

/* OMK-63 : écrans tactiles (téléphone, tablette) : cibles de 44 px au moins pour les menus déroulants de recherche
   (affectation des cas) et les liens de cellule des listes (anomalies, demandes de démonstration) affichées en cartes. */
@media (pointer: coarse) {
    .fi-select-input-btn { min-height: 44px; }
    .fi-ta-record a.fi-ta-col, .fi-ta-cell a.fi-ta-col { min-height: 44px; display: flex; align-items: center; }
}

/* OMK-64 : cases à cocher (sélection des lignes, listes de choix) au doigt : 24 px au lieu de 16-22 px. */
@media (pointer: coarse) {
    .fi-main input[type=checkbox].fi-checkbox-input { width: 24px; height: 24px; }
}
