/* Habillage legacy : gabarit commun des fiches DIMO (apps.ui.records, docs/dev/FICHE.md).
   Valeurs relevées sur DIMO le 2026-11-26 (fiche équipement). Aucune règle en attribut style (CSP). */

/* --- En-tête : « Objet » teal + « code - désignation », boutons d'enregistrement à droite --- */
.lg-rec { display: flex; flex-direction: column; gap: 10px; }
.lg-rec__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.lg-rec__title { margin: 0; font-size: 18px; font-weight: 600; line-height: 30px; }
.lg-rec__object { color: var(--accent); }
.lg-rec__name { margin-left: 8px; color: #8c9196; font-size: 16px; font-weight: 500; }
.lg-rec__form { display: none; }
.lg-rec__save { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
.lg-rec__closeform { display: inline; margin: 0; }
.lg-rec__foot { display: flex; justify-content: flex-end; }

/* Boutons DIMO : blancs, bordure #6d777f, 30 px ; Enregistrer en vert, Fermer en rouge */
.lg-rec__btn, .lg-rec__action, .lg-sg__btn { height: 30px; padding: 4px 9px; border: 1px solid #6d777f; border-radius: 3px; background: #ffffff; color: var(--text); font-size: 13px; font-weight: 400; }
.lg-rec__btn--save { border-color: #5ab77f; }
.lg-rec__btn--save .fa-solid { color: #5ab77f; }
.lg-rec__btn--close { border-color: var(--danger); }
.lg-rec__btn--close .fa-solid { color: var(--danger); }
.lg-rec__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-rec__action .fa-solid, .lg-sg__btn .fa-solid { color: var(--panel-head-bg); }

/* --- Blocs (accordéons mx-accordion) : barre #5e626b, liseré teal 10 px, Montserrat 16 px --- */
.lg-rec__blocks { display: flex; flex-direction: column; gap: 10px; }
.lg-rec-block { background: var(--bg-panel); border-radius: 3px; }
.lg-rec-block__bar { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding: 4px 16px; background: var(--panel-head-bg); color: var(--panel-head-text); border-left: 10px solid var(--accent); border-radius: 3px 3px 0 0; cursor: pointer; list-style: none; }
.lg-rec-block__bar::-webkit-details-marker { display: none; }
.lg-rec-block__title { font-family: "Montserrat", var(--font); font-size: 16px; font-weight: 500; }
.lg-rec-block__chevron { transition: transform .15s; transform: rotate(180deg); }
.lg-rec-block:not([open]) .lg-rec-block__chevron { transform: none; }
.lg-rec-block:not([open]) .lg-rec-block__bar { border-radius: 3px; }
.lg-rec-block__body { padding: 10px; border: 1px solid #dddddd; border-top: 0; }

/* --- Grille de champs : 3 colonnes, libellé au-dessus, champ pleine largeur de colonne --- */
.lg-rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 15px; }
@media (max-width: 900px) { .lg-rec-grid { grid-template-columns: minmax(0, 1fr); } }
.lg-rec-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-rec-field__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1); min-height: 18px; }
.lg-rec-field__label { color: var(--text); font-size: 13px; }
.lg-rec-field__icons { display: inline-flex; gap: 6px; }
.lg-rec-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--text); font-size: 12px; text-decoration: none; cursor: pointer; }
.lg-rec-icon[aria-disabled="true"] { color: #b5b9bd; cursor: default; }
.lg-rec-field__control { position: relative; display: flex; align-items: center; gap: 6px; min-height: 30px; }
.lg-rec-field__control input:not([type="checkbox"]):not([type="radio"]), .lg-rec-field__control select, .lg-rec-field__control textarea { width: 100%; height: 30px; padding: 5px 10px; font: inherit; color: var(--text); background: #ffffff; border: 1px solid #cccccc; border-radius: 3px; }
.lg-rec-field__control select[multiple] { height: auto; min-height: 30px; }
.lg-rec-field__control :disabled { background: var(--input-readonly); }
.lg-rec-field__control input:focus, .lg-rec-field__control select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lg-rec-field__control--check input { width: 13px; height: 13px; margin: 0; }
.lg-rec-field__control--radio > div { display: flex; gap: 12px; }
.lg-rec-field__control--radio label { display: inline-flex; align-items: center; gap: 4px; }
.lg-rec-field.has-error .lg-rec-field__control input, .lg-rec-field.has-error .lg-rec-field__control select { border-color: var(--invalid); }
.lg-rec-field__error { margin: 0; color: var(--danger); font-size: 12px; }

/* Champs composés : durée hh : mm, multi-sélection en étiquettes */
.gx-hhmm { display: inline-flex; align-items: center; gap: 4px; }
.lg-rec-field__control .gx-hhmm__part { width: 52px; text-align: center; }
.gx-hhmm__sep { font-weight: 600; }
.gx-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 100%; min-height: 30px; padding: 2px 4px; background: #ffffff; border: 1px solid #cccccc; border-radius: 3px; }
.gx-tags__tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; background: #f3f3f3; border: 1px solid #dddddd; border-radius: 2px; font-size: 12px; }
.gx-tags__remove { padding: 0; border: 0; background: none; color: var(--text-muted); cursor: pointer; }
.lg-rec-field__control .gx-tags__add { flex: 1 1 120px; width: auto; height: 24px; padding: 0 4px; border: 0; }
.lg-rec-field__control select.gx-tags__native { position: absolute; left: 0; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); }

/* --- Sous-grille (style DevExtreme) --- */
.lg-sg { display: flex; flex-direction: column; gap: 6px; }
.lg-sg__bar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-2); }
.lg-sg__toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-sg__columns { margin-left: auto; }
.lg-sg__colbtn { height: 24px; padding: 0 6px; border-color: var(--accent); color: var(--accent); }
.lg-sg__colbtn .fa-solid { color: var(--accent); }
.lg-sg__wrap { overflow-x: auto; border: 1px solid #dddddd; }
.lg-sg__table { width: 100%; border-collapse: collapse; background: #ffffff; }
.lg-sg__table th { padding: 7px 8px; border-bottom: 1px solid #dddddd; border-right: 1px solid #f0f0f0; color: #959595; font-weight: 400; text-align: left; white-space: nowrap; }
.lg-sg__table td { padding: 6px 8px; border-bottom: 1px solid #eeeeee; }
.lg-sg__table tbody tr:hover td { background: var(--row-hover); }
.lg-sg__table tbody tr[aria-selected="true"] td { background: var(--row-selected); }
.lg-sg__sort { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.lg-sg__sort .fa-solid { color: #bbbbbb; font-size: 11px; }
th[aria-sort] .lg-sg__sort .fa-solid { color: var(--text); }
.lg-sg__table .lg-sg__sort { color: #959595; }
.lg-sg__filters td { padding: 2px 4px; background: #ffffff; }
.lg-sg__filter { display: flex; align-items: center; gap: 4px; color: #959595; }
.lg-sg__filter input { flex: 1; min-width: 40px; height: 24px; padding: 0 4px; font: inherit; border: 0; background: transparent; }
.lg-sg__filter input:focus { outline: 1px solid var(--accent); }
.lg-sg__check { width: 30px; text-align: center; }
.lg-sg__actions { width: 1%; text-align: center; white-space: nowrap; }
th.lg-sg__actions { background: #eeeeee; color: var(--text); }
.lg-sg__empty { padding: 24px 8px; color: #999999; text-align: center; }
.lg-sg__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.lg-sg__sizes, .lg-sg__pager { display: flex; align-items: center; gap: 4px; }
.lg-sg__size, .lg-sg__page { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 2px; color: var(--text); text-decoration: none; }
.lg-sg__size.is-current, .lg-sg__page.is-current { background: var(--accent); color: #ffffff; }
.lg-sg__page[aria-disabled="true"] { color: #cccccc; }
.lg-sg__info { margin-right: 6px; color: var(--text-muted); }

/* --- Blocs propres : fichiers, photos (une ligne), commentaire riche simple, tableau des coûts --- */
.lg-rec-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; }
.lg-rec-photo__choose { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 4px 9px; border: 1px solid #cccccc; border-radius: 3px; background: #ffffff; cursor: pointer; }
.lg-rec-photo__drop { color: var(--text-muted); }
.lg-rec-photo__input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lg-rec-costs { width: 100%; border-collapse: collapse; }
.lg-rec-costs th, .lg-rec-costs td { padding: 6px 8px; border: 1px solid #dddddd; text-align: right; }
.lg-rec-costs th:first-child { text-align: right; }
.lg-rec-costs__total { color: var(--danger); font-weight: 600; }
.lg-rec-empty { margin: 0; padding: 12px 8px; color: #999999; text-align: center; }
.lg-mdtools { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid #cccccc; border-bottom: 0; border-radius: 3px 3px 0 0; background: #fafafa; }
.lg-mdtools__btn { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 2px; background: none; color: var(--text); cursor: pointer; }
.lg-mdtools__btn:hover { border-color: #cccccc; background: #ffffff; }

/* Saisie assistée (apps/ui/lookups, #143) : recherche au-dessus de la liste bornée. */
.ui-lookup { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ui-lookup > select, .ui-lookup > input { width: 100%; max-width: 100%; }
