/* ============================================================================
   LISTE DES DOSSIERS (ADM-07) — /app/dossiers, /admin/dossiers, /app/compta/dossiers
   Passation « design_handoff_dossiers » (2026-10-02).

   Tuiles, bandeau à lignes marquées et onglets à chiffre viennent du gabarit
   (modele-erp.css §11.x). Cette feuille porte la barre de recherche, la liste d'une
   ligne par dossier — le code dans sa colonne —, ses cartes sous 1024 px, et les deux
   fenêtres (reprise, création). La pastille de code empilée sur la raison sociale, la
   colonne ancrée de 260 px et la table de 960 px minimum sont retirées : la table
   tient à 1440, et en cartes au-dessous.

   AUCUNE COULEUR EN DUR : tout passe par les jetons --et-*.
   ============================================================================ */

/* --- Le bandeau -------------------------------------------------------------- */
.dc-signal-ligne { align-items: flex-start; }
.dc-signal-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* --- Onglets et barre -------------------------------------------------------- */
.dc-vues { padding: 0 8px; }
.dc-barre { flex-wrap: wrap; gap: 10px; }
.dc-recherche {
    flex: 1 1 240px; max-width: 420px; display: flex; align-items: center; gap: 8px;
    height: 44px; margin: 0; padding: 0 12px; border: 1px solid var(--et-bord-champ); background: var(--et-surface);
}
.dc-recherche .bi { color: var(--et-muted); }
.dc-recherche input { flex: 1; align-self: stretch; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--et-ink); }
.dc-recherche input:focus { outline: none; }
.dc-recherche:focus-within { border-color: var(--et-form-blue); }
.dc-barre .mx-btn { min-height: 44px; }

/* --- La liste ---------------------------------------------------------------- */
.dc-cadre { background: var(--et-surface); overflow-x: auto; }
.dc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dc-table thead th {
    padding: var(--et-cellule-tete-y) 10px; background: var(--et-table-head);
    font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap;
    color: var(--et-sur-ardoise-plein);
}
.dc-table tbody td { padding: var(--et-cellule-y) 10px; border-bottom: 1px solid var(--et-rang);
    white-space: nowrap; color: var(--et-ink);
}
@media (max-width: 1024px) { .dc-table tbody td { height: 44px; } }   /* règle tactile, sous 1024 px seulement : posée dès le bureau, la hauteur figeait la ligne (lot AK2) */
.dc-table .mono { font-family: var(--et-font-mono); font-variant-numeric: tabular-nums; }
.dc-table td.code, .dc-table td.raison { font-weight: 600; }
.dc-table td.activite { color: var(--et-muted); }
/* La raison et l'activité passent à la ligne au besoin : ce sont les deux seules colonnes
   de texte libre, et la table doit tenir dans la largeur de la coquille à 1440. */
.dc-table td.raison, .dc-table td.activite { white-space: normal; min-width: 140px; }
.dc-table td.nif, .dc-table td.date { color: var(--et-muted); }
.dc-table td.actes { width: 1%; }
.dc-table td.role.est-sans-role { font-weight: 600; color: var(--et-avertissement-ink); }
/* Le dossier ouvert : un filet bleu et un fond teinté — on sait où l'on est. */
.dc-table tr.est-ouvert > td { background: var(--et-tint); }
.dc-table tr.est-ouvert > td:first-child { box-shadow: inset 3px 0 0 var(--et-form-blue); }
.dc-table tr.est-archive > td.raison { font-weight: 500; color: var(--et-muted); }

.dc-ex-etat { margin-left: 4px; font-size: 13px; color: var(--et-succes-ink); }
.dc-ex-etat.est-clos { font-weight: 600; color: var(--et-avertissement-ink); }

.dc-etat {
    display: inline-flex; align-items: center; padding: var(--et-badge-py) var(--et-badge-px);
    border-radius: var(--et-r-pill); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.dc-etat.est-ouvert    { background: var(--et-surface); color: var(--et-form-blue-d); border: 1px solid var(--et-form-blue); }
.dc-etat.est-actif     { background: var(--et-succes-bg); color: var(--et-succes-ink); }
.dc-etat.est-sans-role { background: var(--et-avertissement-bg); color: var(--et-avertissement-ink); }
.dc-etat.est-archive   { background: var(--et-neutre-bg); color: var(--et-ink); }

.dc-actes { display: inline-flex; align-items: center; gap: 6px; }
.dc-courant { font-size: 13px; font-weight: 600; color: var(--et-form-blue-d); white-space: nowrap; }
/* « Ouvrir » : le geste de l'écran, au contour bleu. L'orange reste à « Nouveau dossier ». */
.dc-ouvrir {
    min-height: 36px; padding: 0 14px; white-space: nowrap;
    background: var(--et-surface); border: 1px solid var(--et-form-blue); color: var(--et-form-blue-d); font-weight: 600;
}
.dc-ouvrir:hover:not(:disabled) { background: var(--et-tint); }
.dc-geste { min-height: 36px; min-width: 36px; }

.dc-aucun { padding: 16px 12px; text-align: center; color: var(--et-muted); }
.dc-pied { padding: 10px 14px; font-size: 13px; color: var(--et-muted); }

/* Sous 1024 px : une carte par dossier. Ligne 1 : code, raison, état ; ligne 2 :
   activité et NIF ; ligne 3 : exercice, rôle, dernière saisie ; puis « Ouvrir ». */
@media (max-width: 1024px) {
    .dc-table, .dc-table tbody { display: block; width: 100%; }
    .dc-table thead { display: none; }
    .dc-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--et-rang); }
    .dc-table tbody tr > td { display: block; height: auto; padding: 0; border: 0; background: none; box-shadow: none; white-space: normal; }
    .dc-table tr.est-ouvert { background: var(--et-tint); box-shadow: inset 3px 0 0 var(--et-form-blue); }
    .dc-table td.code { order: 1; }
    .dc-table td.raison { order: 2; flex: 1 1 0; min-width: 0; }
    .dc-table td.etat { order: 3; }
    .dc-table td.activite { order: 4; flex: 1 1 100%; min-width: 0; font-size: 13px; }
    .dc-table td.nif::before, .dc-table td.date::before { content: attr(data-lib) " "; }
    .dc-table td.nif, .dc-table td.exercice, .dc-table td.role, .dc-table td.date { order: 5; font-size: 13px; }
    .dc-table td.exercice::before { content: "Exercice "; }
    .dc-table td.actes { order: 6; flex: 1 1 100%; width: auto; }
    .dc-table td.actes:empty { display: none; }
    .dc-actes { display: flex; width: 100%; }
    .dc-ouvrir { flex: 1 1 auto; min-height: 44px; justify-content: center; }
    .dc-geste { min-height: 44px; min-width: 44px; }
    .dc-cadre { overflow-x: visible; }
}

/* Les cartes selon la largeur DU CADRE, et plus seulement de la fenêtre (revue EasyCompta,
   2026-10-04) : à 1280 px, rail ouvert, la table débordait son cadre de 218 px. Mêmes règles
   que le palier de 1024 px, gestes tactiles mis à part. */
.dc-cadre { container: dc-cadre / inline-size; }
@container dc-cadre (max-width: 999px) {
    .dc-table, .dc-table tbody { display: block; width: 100%; }
    .dc-table thead { display: none; }
    .dc-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--et-rang); }
    .dc-table tbody tr > td { display: block; height: auto; padding: 0; border: 0; background: none; box-shadow: none; white-space: normal; }
    .dc-table tr.est-ouvert { background: var(--et-tint); box-shadow: inset 3px 0 0 var(--et-form-blue); }
    .dc-table td.code { order: 1; }
    .dc-table td.raison { order: 2; flex: 1 1 0; min-width: 0; }
    .dc-table td.etat { order: 3; }
    .dc-table td.activite { order: 4; flex: 1 1 100%; min-width: 0; font-size: 13px; }
    .dc-table td.nif::before, .dc-table td.date::before { content: attr(data-lib) " "; }
    .dc-table td.nif, .dc-table td.exercice, .dc-table td.role, .dc-table td.date { order: 5; font-size: 13px; }
    .dc-table td.exercice::before { content: "Exercice "; }
    .dc-table td.actes { order: 6; margin-left: auto; width: auto; }
    .dc-table td.actes:empty { display: none; }
}

@media (max-width: 640px) {
    .dc-recherche { max-width: none; flex-basis: 100%; }
    .dc-barre .tbl-barre-fin { width: 100%; margin-left: 0; }
    .dc-barre .tbl-barre-fin .mx-btn { flex: 1 1 auto; justify-content: center; }
}

/* --- La fenêtre de reprise (gabarit de modale, 2026-09-27) ------------------ */
.dc-rep-vide { margin-bottom: 12px; font-size: 13px; color: var(--et-muted); }
.dc-rep-elements { display: flex; flex-direction: column; }
.dc-rep-element { padding: 7px 0; border-bottom: 1px solid var(--et-rang); }
.dc-rep-element:last-child { border-bottom: 0; }
.dc-rep-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dc-rep-titre { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--et-ink); }
.dc-rep-detail { font-size: 12px; line-height: 1.45; color: var(--et-muted); }



/* À l'impression, les gestes et la barre partent : ce qu'elle a filtré, la liste imprimée
   le montre. */
@media print {
    .dc-table td.actes, .dc-barre, .dc-vues { display: none !important; }
}
