/* OMK-43 : ergonomie des administrations OMINAK et LBN (menus, favoris, téléphone 390 px et tablette 820 px).
   Corrections globales (aucune règle propre à un écran) ; complète admin-lisibilite.css. */

/* Étoile « Épingler cet écran » : alignée sur les actions de l'en-tête. */
.omk-favori { display: inline-flex; align-items: center; }
.fi-header-actions-ctn { flex-wrap: wrap; align-items: center; gap: .5rem; }

/* Menu latéral : libellés longs sur deux lignes plutôt que tronqués ; groupes plus lisibles. */
.fi-sidebar-item-label { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.fi-sidebar-group-label { white-space: normal; line-height: 1.25; }
.fi-sidebar-group[data-group-label="Mes favoris"] .fi-sidebar-group-label::before { content: "\2605\00a0"; color: #B45309; }

/* Tableau de bord : emplacement « Mes favoris ». */
.omk-mes-favoris { margin-bottom: 1rem; }

/* Tablette et téléphone (< 1024 px). */
@media (max-width: 1023.98px) {
  /* En-têtes de page : titre et actions empilés, actions sur plusieurs lignes, jamais hors écran. */
  .fi-header { flex-wrap: wrap; row-gap: .75rem; }
  .fi-header > div:first-child { min-width: 0; max-width: 100%; }
  .fi-header-heading { overflow-wrap: anywhere; }
  .fi-header-actions-ctn { width: 100%; justify-content: flex-start; }
  /* Onglets de liste : défilement horizontal interne plutôt que débordement de la page. */
  .fi-tabs { max-width: 100%; overflow-x: auto; }
  /* Formulaires : champs et sections pleine largeur. */
  .fi-fo-field-wrp, .fi-section { min-width: 0; }
}

/* Téléphone (< 640 px). */
@media (max-width: 639.98px) {
  /* Fenêtres modales et volets : presque pleine largeur, pied de fenêtre en colonne, boutons pleine largeur. */
  .fi-modal-window { max-width: calc(100vw - 16px) !important; margin-inline: 8px; }
  .fi-modal-footer-actions { flex-direction: column-reverse; align-items: stretch; }
  .fi-modal-footer-actions > * { width: 100%; justify-content: center; }
  /* Boutons d'action d'en-tête : regroupés proprement. */
  .fi-header-actions-ctn .fi-btn { flex: 1 1 auto; justify-content: center; }
  /* Tableaux en cartes (stackedOnMobile) : actions de ligne visibles et regroupées en bas de la carte. */
  /* Cartes compactes : libellé à gauche, valeur à droite (au lieu de l'un sous l'autre). */
  .fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell:not(.fi-ta-selection-cell):has(> .fi-ta-cell-label) {
    display: grid; grid-template-columns: minmax(6.5rem, 36%) minmax(0, 1fr); column-gap: .75rem; align-items: baseline;
  }
  .fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell > .fi-ta-cell-label { font-size: 12.5px; font-weight: 600; color: #475569; overflow-wrap: anywhere; }
  html.dark .fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell > .fi-ta-cell-label { color: #A1A1AA; }
  .fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell > .fi-ta-cell-content { min-width: 0; }
  .fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell .fi-ta-text, .fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell .fi-ta-col { padding-block: .2rem; }
  .fi-ta-table-stacked-on-mobile .fi-ta-actions { flex-wrap: wrap; justify-content: flex-start; gap: .5rem; }
  /* OMK-44 : colonnes secondaires (visibleFrom md, lg, xl) masquées dans les cartes du téléphone : la règle « grid » ci-dessus les réaffichait. */
  .fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell:is([class*="md:fi-visible"], [class*="lg:fi-visible"], [class*="xl:fi-visible"], [class*="2xl:fi-visible"]) { display: none !important; }
  .fi-ta-header-toolbar { flex-wrap: wrap; gap: .5rem; }
  .fi-ta-header-toolbar > * { min-width: 0; }
  .fi-ta-search-field { flex: 1 1 100%; }
  /* Filtres en panneau : pleine largeur. */
  .fi-ta-filters-dropdown .fi-dropdown-panel, .fi-dropdown-panel { max-width: calc(100vw - 16px); }
  /* Infolistes, grilles et fils d'Ariane : retour à la ligne plutôt que débordement. */
  .fi-breadcrumbs ol { flex-wrap: wrap; }
  .fi-in-entry-wrp, .fi-in-text { min-width: 0; overflow-wrap: anywhere; }
  /* Notifications : pleine largeur utile. */
  .fi-no { max-width: calc(100vw - 16px); }
  /* Widgets du tableau de bord : pas de largeur minimale. */
  .fi-wi { min-width: 0; }
}
