/* Customisations minimales EasyAdmin v4 (ERP) */

/* Bouton "Supprimer" en rouge dans le dropdown d'actions (comme en prod) */
.dropdown-menu .action-delete,
.dropdown-menu [data-action-name="delete"] {
    color: #dc3545 !important;
}

.dropdown-menu .action-delete:hover,
.dropdown-menu [data-action-name="delete"]:hover {
    background-color: #dc3545 !important;
    color: #fff !important;
}

/* ===== Page de login : retrouver l'apparence d'avant la migration (EA v3) ===== */
body.page-login .login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 28rem;
    width: 94%;
}

body.page-login .login-wrapper .main-header #header-logo {
    margin: 0 0 1rem;
    padding: 0;
    border: none;
    text-align: center;
}

body.page-login .login-wrapper .content {
    width: 100%;
    padding: 2rem 2.5rem;
}

body.page-login label.required:after {
    content: " *";
    color: var(--color-danger, #dc2626);
}

body.page-login .content > .form-group a {
    color: var(--text-color, #1e293b);
}

body.page-login .login-wrapper button[type="submit"] {
    justify-content: center;
    text-align: center;
}

body.page-login .login-wrapper .form-group label.required:after {
    content: " *";
    color: var(--color-danger, #dc2626);
    display: inline;
    background: none;
    block-size: auto;
    inline-size: auto;
    position: static;
    filter: none;
    border-radius: 0;
}

/* ===== Dropdown d'actions du tableau (index) : items plats, sans bordure de bouton ===== */
.dropdown-actions .dropdown-menu .btn.dropdown-item {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    justify-content: flex-start;
    inline-size: 100%;
    min-block-size: 28px;
}

.dropdown-actions .dropdown-menu .btn.dropdown-item:hover,
.dropdown-actions .dropdown-menu .btn.dropdown-item:focus {
    border: 0;
    background: var(--bs-dropdown-link-hover-bg, #f1f5f9);
}

/* ===== Colonne Image des tableaux (index) : afficher une vignette, pas l'image entière ===== */
.datagrid td.field-image .ea-lightbox-thumbnail img,
.datagrid td.field-image img.img-fluid {
    max-height: 50px !important;
    max-width: 100px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

/* La copie plein format est réservée à la lightbox (zoom au clic), jamais affichée dans la cellule */
.datagrid td.field-image .ea-lightbox {
    display: none !important;
}

/* Règle reprise de l'ancienne prod Alyse, assouplie : toute image fluide dans une cellule
   de tableau est PLAFONNÉE en vignette. max-width (et non width) pour ne pas agrandir les
   petites icônes de statut (up.gif ~15px sur les index Report/Device...). */
td a .img-fluid {
    max-width: 3rem !important;
    max-height: 3rem !important;
    width: auto !important;
    height: auto;
}

/* Le survol des items du menu d'actions garde un texte lisible */
.dropdown-actions .dropdown-menu .btn.dropdown-item:hover,
.dropdown-actions .dropdown-menu .btn.dropdown-item:focus {
    color: var(--bs-dropdown-link-hover-color, inherit);
}

/* Boutons colorés du menu (ex. Publier) : retrouver leur couleur au survol */
.dropdown-actions .dropdown-menu .btn.dropdown-item.btn-success:hover,
.dropdown-actions .dropdown-menu .btn.dropdown-item.btn-success:focus {
    background: var(--color-success, #28a745);
    color: #fff;
}
.dropdown-actions .dropdown-menu .btn.dropdown-item.btn-success:hover .icon,
.dropdown-actions .dropdown-menu .btn.dropdown-item.btn-success:focus .icon {
    color: #fff;
}

/* ===== Pages de consultation (detail) : mise en page EA v3 restaurée =====
   EA v4.29 ne style quasiment plus .datalist (dt/dd bruts, serrés). On reprend la
   grille de la v3 : libellé sur 180px, valeur en face, séparateurs, respiration. */
.datalist {
    margin-bottom: 0;
}
.datalist .data-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    padding: 8px;
    box-shadow: inset 0 -1px var(--datalist-border-color, #e5e7eb);
}
.datalist .data-row:first-child {
    box-shadow: inset 0 -1px var(--datalist-border-color, #e5e7eb),
                inset 0 1px var(--datalist-border-color, #e5e7eb);
}
.datalist dt {
    color: var(--datalist-label-color, #6b7280);
    font-weight: 400;
    margin-bottom: 0;
    padding-right: 10px;
}
.datalist dd {
    color: var(--datalist-value-color, inherit);
    margin-bottom: 0;
    overflow: auto;
}
.datalist .data-help {
    color: var(--gray-600, #6b7280);
    font-size: 0.875rem;
    margin: 15px 0 0;
}

/* ===== Titres de panneaux (Profile, Visibility...) : style EA v3 restauré =====
   EA v4.29 ne style plus .form-panel-header/-title -> lien bleu par défaut, petit. */
.form-panel-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    padding: 15px 0 10px;
    position: relative;
    box-shadow: 0 1px 0 var(--form-panel-header-border-color, #e5e7eb);
}
.form-panel-header .form-panel-title {
    flex: 1;
}
.form-panel-header .form-panel-title a {
    color: var(--gray-800, #1f2937);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}
.form-panel-header .form-panel-title a.not-collapsible {
    cursor: default;
}
.form-panel-header .form-panel-title .form-panel-icon {
    margin-right: 8px;
}

/* ===== Colonne des actions toujours visible (index) =====
   Sur un petit écran le tableau déborde à droite et la barre de défilement horizontal
   se trouve tout en bas du tableau, hors de vue : les boutons Modifier/Supprimer étaient
   inaccessibles (retour client 2026-10-26). La dernière colonne reste collée au bord droit.
   NB : scripts/admin.js remplace la classe "datagrid" par "table-striped" au chargement,
   d'où des sélecteurs sur table.table (valables avant et après ce remplacement). */
.ea-index table.table thead th:last-child,
.ea-index table.table td.actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--body-bg, #fff);
    box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.15);
}
.ea-index table.table tbody tr:hover td.actions {
    background: var(--table-hover-cell-bg, #f9fafb);
}
.ea-index table.table tbody tr.selected-row td.actions {
    background: var(--table-selected-cell-bg, #eef2ff);
}
/* Le menu déroulant ouvert doit passer au-dessus des cellules collées des lignes suivantes */
.ea-index table.table td.actions:hover,
.ea-index table.table td.actions:focus-within,
.ea-index table.table td.actions:has(.dropdown-menu.show) {
    z-index: 3;
}
