/* Styles de l'écran : affaires (fiche, scellés, registre, étiquettes) */

/* ---- Lignes cliquables ---- */
.ligne-lien { cursor: pointer; }
.ligne-lien:hover td { background: #FAFAFA; }
.ligne-lien:hover td:first-child { box-shadow: inset 2px 0 0 var(--vert); }
.ligne-lien.sel td { background: var(--vert-pale); }
.lien-discret { color: inherit; text-decoration: none; }
.lien-discret:hover { color: var(--vert); text-decoration: underline; }
.gris { color: var(--texte-3); }
.gris-fonce { color: #3F3F46; }
.petit-gris { font-size: 13px; color: var(--texte-3); font-weight: 400; }
.fort-noir { color: var(--texte); }
.aide { font-size: 12px; font-weight: 400; color: #A1A1AA; }
.btn.dang { color: #B42318; }
.btn.dang:hover { background: #FEF3F2; border-color: #FECDCA; }
.btn:disabled { color: #A1A1AA; background: #fff; border-color: #EFEFEF; box-shadow: none; cursor: default; }
.sep { height: 1px; background: #F0F0F0; }

/* ---- En-tête de fiche ---- */
.fiche-id { min-width: 0; }
.fiche-num { font-weight: 500; }
.fiche-meta { margin: 6px 0 0; font-size: 14px; color: var(--texte-3); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.pill { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; background: #fff; color: var(--texte-3); border: 1px solid var(--bord); text-decoration: none; margin-left: 4px; }
a.pill:hover { filter: brightness(.97); color: inherit; }
.pill-plan { background: #ECF6F8; color: #0E5566; border-color: #BFE0E8; }
.pill-plan:hover { color: #0E5566 !important; }
.pill-loc { background: var(--vert-pale); color: var(--vert-encre); border-color: var(--vert-doux); }
.pill-loc:hover { color: var(--vert-encre) !important; }
.pill-alerte { background: #FFF8EB; color: #B45309; border-color: #F3D9A4; }
.fiche-nav { align-items: center; }
.fiche-nav a, .fiche-nav span.off { height: 30px; min-width: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--texte-2); }
.fiche-nav a:hover { background: #fff; color: var(--texte); }
.fiche-nav span.off { color: #C4C4C8; cursor: default; }
.fiche-pos { font-size: 13px; font-weight: 500; color: var(--texte-2); padding: 0 8px; white-space: nowrap; }

/* ---- Onglets (pilules) ---- */
.fiche-onglets-ligne { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.fiche-onglets { display: flex; flex-wrap: wrap; gap: 8px; }
.onglet {
    font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px;
    border-radius: 999px; background: #fff; border: 1px solid var(--bord); color: #3F3F46; text-decoration: none;
    transition: background .12s, border-color .12s;
}
.onglet:hover { border-color: #D4D4D8; color: var(--texte); }
.onglet.on { background: var(--vert); border-color: var(--vert); color: #fff; box-shadow: 0 1px 2px rgba(20, 83, 63, .25); }
.onglet-n { font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--fond-doux); color: var(--texte-2); }
.onglet.on .onglet-n { background: rgba(255, 255, 255, .2); color: #fff; }
.onglet-alerte { width: 7px; height: 7px; border-radius: 50%; background: #D92D20; }
.fiche-indice { font-size: 13px; color: #A1A1AA; }
.lecture-seule { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--fond-doux); font-size: 13px; color: var(--texte-2); flex-basis: 100%; }

/* ---- Formulaire de fiche ---- */
.nu-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.grille { padding: 24px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 16px; }
.grille h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--texte); }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c12 { grid-column: span 12; }
.lbl select, .lbl textarea { font: inherit; font-size: 14px; font-weight: 400; color: var(--texte); border: 1px solid var(--bord); border-radius: 8px; background: #fff; min-width: 0; width: 100%; box-sizing: border-box; }
.lbl select { height: 36px; padding: 0 8px; }
.lbl textarea { padding: 8px 10px; resize: vertical; line-height: 1.45; }
.lbl select:focus, .lbl textarea:focus { outline: none; border-color: var(--vert); box-shadow: 0 0 0 3px rgba(31, 111, 92, .14); }
.lbl input[readonly] { background: #FAFAFA; color: var(--texte-2); }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: #FAFAFA; color: var(--texte-2); }
.champ-btn { display: flex; gap: 4px; }
.champ-btn > input, .champ-btn > select { flex: 1; }
.case-blocage { align-self: end; display: flex; align-items: center; gap: 8px; height: 36px; font-size: 14px; cursor: pointer; color: #3F3F46; }
.case-blocage input { width: 16px; height: 16px; accent-color: #B42318; }
.case-blocage.on, .case-blocage:has(input:checked) { color: #B42318; font-weight: 500; }
.commentaire-on { background: #FFF8EB !important; border-color: #F3D9A4 !important; }
.ajout-debiteur { display: flex; gap: 8px; align-items: flex-end; padding: 12px; background: #FAFAFA; border: 1px solid #F0F0F0; border-radius: 10px; }
.ajout-debiteur .lbl { flex: 1; }

/* ---- Onglet Scellés ---- */
.scelles-grille { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.scelles-tableau { flex: 999 1 600px; }
.scelles-actions { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ph-leger { font-weight: 400; }
.col-case { width: 28px; }
.col-case input { accent-color: var(--vert); }
.pan-corps { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pan-sous { display: flex; flex-direction: column; gap: 14px; }
.pan-sous[hidden] { display: none; }
.deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.loc { display: inline-flex; align-items: center; gap: 7px; }
.loc-pt { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.loc-nonrange { color: #B45309; font-weight: 500; }
.loc-hors { color: #A1A1AA; }
.zone-alerte { margin-left: 8px; font-size: 12px; font-weight: 500; color: #B45309; }

/* ---- Chronologie (historique) ---- */
.histo { padding: 24px 24px 8px; }
.chrono { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.chrono-ev { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.chrono-ev::before { content: ''; position: absolute; left: 4px; top: 16px; bottom: 2px; width: 1px; background: #EAEAEA; }
.chrono-ev:last-child::before { display: none; }
.chrono-pt { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; box-shadow: 0 0 0 3px #fff; position: relative; }
.chrono-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chrono-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.chrono-titre { font-weight: 500; }
.chrono-titre.danger { color: #B42318; }
.chrono-date, .chrono-auteur { font-size: 12px; color: #A1A1AA; }
.chrono-detail { font-size: 13px; color: var(--texte-2); }
.chrono-diffs { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: #FAFAFA; border: 1px solid #F0F0F0; font-size: 12px; }
.chrono-diffs > div { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.d-champ { color: var(--texte-3); min-width: 130px; }
.d-avant { color: #B42318; text-decoration: line-through; }
.d-fleche { color: #A1A1AA; }
.d-apres { color: var(--vert-encre); font-weight: 500; }

/* ---- Panneau « Historique du scellé » ---- */
.scl-voile { position: fixed; inset: 0; z-index: 45; background: rgba(24, 24, 27, .25); display: flex; justify-content: flex-end; }
.scl-panneau { width: 480px; max-width: 100%; height: 100%; overflow-y: auto; background: #fff; box-shadow: -12px 0 40px rgba(24, 24, 27, .15); display: flex; flex-direction: column; }
.scl-page { max-width: 720px; }
.scl-tete { padding: 20px 20px 16px; border-bottom: 1px solid #F0F0F0; display: flex; flex-direction: column; gap: 12px; }
.scl-titre { display: flex; align-items: flex-start; gap: 12px; }
.scl-titre > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.scl-nature { font-size: 12px; color: #A1A1AA; }
.scl-libelle { font-size: 22px; font-weight: 500; }
.scl-etat { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.scl-loc { color: var(--texte-2); }
.scl-etat .zone-alerte { margin-left: 0; }
.scl-code { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.scl-code .mono { font-size: 11px; color: var(--texte-3); }
.scl-infos { width: 100%; border-collapse: collapse; font-size: 13px; }
.scl-infos td { padding: 3px 0; }
.scl-infos td:first-child { color: var(--texte-3); width: 38%; }
.scl-histo { padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 14px; }
.scl-histo-titre { font-size: 14px; font-weight: 600; }
.scl-histo-titre span { font-weight: 400; color: #A1A1AA; }
.barres { display: block; }

/* ---- Étiquettes ---- */
.etiq-panel { padding: 16px; overflow-x: auto; }
.etiq-planche { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 720px; }
.etiq { border: 1px solid var(--bord); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 11px; min-height: 120px; box-sizing: border-box; break-inside: avoid; }
.etiq-l1 { display: flex; justify-content: space-between; color: var(--texte-3); }
.etiq-lib { font-size: 18px; font-weight: 500; }
.etiq-defunt { font-weight: 600; font-size: 12px; }
.etiq-nature { color: var(--texte-3); }
.etiq-barres { margin-top: auto; }
.etiq-barres .barres { width: 100%; max-width: 52mm; height: 22px; }
.etiq-code { font-size: 10px; color: #3F3F46; }

/* ---- Petits écrans ---- */
@media (max-width: 900px) {
    .grille { padding: 16px; gap: 14px 12px; }
    .c2, .c3, .c4, .c5, .c6, .c7 { grid-column: span 6; }
}
@media (max-width: 560px) {
    .c2, .c3, .c4, .c5, .c6, .c7 { grid-column: span 12; }
}

/* ---- Impression ---- */
@media print {
    .side, .entete, .noprint, .toast, .voile, .scl-voile { display: none !important; }
    .app, .contenu { display: block; }
    .page { padding: 0; }
    .panel { border: none; }
    body { background: #fff; }
    .etiq-page .panel { padding: 0; }
    .etiq-planche { gap: 0; min-width: 0; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; }
    .etiq { border: 1px dashed #D4D4D8; border-radius: 0; min-height: 0; height: 37mm; overflow: hidden; }
    .etiq-barres .barres { height: 10mm; }
    @page { size: A4; margin: 10mm; }
}
