/* AÉC — écran (§5.2.1) et impression (§5.1.10). */

:root {
    --aec-bleu: #1f3a5f;
    --aec-fond: #f5f6f8;
    --aec-largeur-menu: 13rem;
}

body { background: var(--aec-fond); }

.marque { display: block; font-weight: 700; font-size: 1.4rem; color: var(--aec-bleu); text-decoration: none; }
.marque small { font-weight: 400; font-size: .85rem; color: #6c757d; }

/* Écran du cabinet : menu à gauche, barre de recherche en haut, contenu au centre. */
.cadre { display: flex; min-height: 100vh; }
.menu-lateral { width: var(--aec-largeur-menu); flex-shrink: 0; background: #fff; border-right: 1px solid #dee2e6; padding: 1rem; }
.menu-lateral .marque { margin-bottom: 1.5rem; }
.menu-lateral .nav-link { color: #212529; padding: .4rem .5rem; border-radius: .375rem; }
.menu-lateral .nav-link.active { background: var(--aec-bleu); color: #fff; }
.menu-lateral .nav-link.disabled { color: #adb5bd; }
.zone-principale { flex-grow: 1; min-width: 0; }
.barre-haute { display: flex; gap: 1rem; align-items: center; padding: .75rem 1.5rem; background: #fff; border-bottom: 1px solid #dee2e6; }
.barre-haute .recherche { max-width: 32rem; }
.barre-haute .dropdown { margin-left: auto; }
.fil-ariane { padding: .75rem 1.5rem 0; font-size: .9rem; }
.contenu { padding: 1rem 1.5rem 2rem; }
.entete-impression { display: none; }

/* Écran étroit (téléphone, tablette) : le menu se replie derrière le bouton ☰, les tableaux défilent dans leur cadre. */
.bouton-menu, .voile-menu { display: none; }
@media screen and (max-width: 991.98px) {
    .bouton-menu { display: inline-block; }
    .menu-lateral { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1045; overflow-y: auto;
        transform: translateX(-100%); transition: transform .2s ease; }
    body.menu-ouvert .menu-lateral { transform: none; box-shadow: 0 0 1.5rem rgba(0, 0, 0, .2); }
    body.menu-ouvert .voile-menu { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(0, 0, 0, .3); }
    .barre-haute { gap: .5rem; padding: .5rem .75rem; }
    .barre-haute .recherche { min-width: 0; }
    .barre-haute .dropdown-toggle { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .fil-ariane { padding: .5rem .75rem 0; }
    .contenu { padding: .75rem .75rem 2rem; }
    .contenu table { display: block; overflow-x: auto; }
    .card[style*="max-width"] { max-width: 100% !important; }
}

/* Textes libres et listes : un mot très long ou une option très large n'élargit pas la page. */
.contenu select, .contenu form { max-width: 100%; }
.contenu { overflow-wrap: break-word; }
/* À toute largeur, un tableau trop large (adresses, noms très longs) défile dans son cadre au lieu d'élargir la page. */
@media screen { .contenu :has(> table) { overflow-x: auto; } }
.actions-membre { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: flex-end; }
.actions-membre .btn, .qualite-membre select { white-space: nowrap; }
.qualite-membre select { min-width: 9rem; }

/* Pages avant connexion : une carte centrée. */
.page-publique { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; padding: 3rem 1rem; }
.carte-publique { width: 100%; max-width: 40rem; background: #fff; border: 1px solid #dee2e6; border-radius: .5rem; padding: 2rem; }
.carte-publique .fil-ariane { padding: .5rem 0 1rem; }
.carte-publique h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.section-formulaire { font-size: .8rem; font-weight: 600; letter-spacing: .05em; color: #6c757d; text-transform: uppercase; margin: 1.25rem 0 .5rem; }
.tableau-trouve { font-size: .9rem; }

/* Impression : menus et boutons masqués, noir sur blanc, en-tête et numéro de page. */
@media print {
    @page { margin: 1.5cm; @bottom-center { content: "Page " counter(page) " / " counter(pages); font-size: 9pt; } }
    body, .page-publique { background: #fff !important; color: #000 !important; display: block; padding: 0; }
    .menu-lateral, .barre-haute, .btn, form button, .alert .btn-close, .no-print { display: none !important; }
    .cadre { display: block; }
    .entete-impression { display: block; font-size: 9pt; border-bottom: 1px solid #000; padding-bottom: .25rem; margin-bottom: .5rem; }
    .fil-ariane, .contenu { padding: 0; }
    .carte-publique { border: 0; padding: 0; max-width: none; }
    a { color: #000 !important; text-decoration: none; }
}

/* Recherche, suggestions pendant la frappe, dossiers (W3 à W7). */
.barre-haute .recherche { flex-grow: 1; max-width: 32rem; }
.champ-suggestion { position: relative; }
.suggestions { position: absolute; z-index: 1050; left: 0; right: 0; max-height: 20rem; overflow-y: auto; }
.suggestions .list-group-item.active small { color: #fff !important; }
.indice-nouveau { font-size: .85rem; color: #6c757d; min-height: 1.2em; }
kbd.touche { background: #e9ecef; color: #212529; border: 1px solid #ced4da; font-size: .75rem; padding: .05rem .3rem; }
.tableau-dossiers th a { color: inherit; text-decoration: none; }
.tableau-dossiers tbody tr { cursor: pointer; }
.entete-dossier .info { color: #495057; }
.audience { border-left: 3px solid #dee2e6; padding: .6rem .9rem; margin-bottom: .5rem; background: #fff; border-radius: .25rem; }
.audience.a-venir { border-left-color: var(--aec-bleu); }
.audience.passee-sans-issue { border-left-color: #dc3545; }
.audience .issue { color: #198754; }
.audience .notes-audience { font-size: .9rem; border-top: 1px dashed #dee2e6; margin-top: .5rem; padding-top: .4rem; }
.note-sonore { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; vertical-align: middle; margin-right: .5rem; }
.note-sonore audio { height: 2rem; max-width: 100%; width: 18rem; }
.choix-issue .btn { margin: 0 .25rem .25rem 0; }
.note { background: #fff; border: 1px solid #dee2e6; border-radius: .25rem; padding: .6rem .9rem; margin-bottom: .5rem; }
.note .auteur { font-size: .8rem; color: #6c757d; }
.texte-note { white-space: pre-line; }
@media print {
    .onglets-dossier, .formulaire-ajout, form[data-issue] { display: none !important; }
    .audience, .note { border: 0; border-bottom: 1px solid #999; border-radius: 0; break-inside: avoid; }
}

/* W6 — Calendrier, W7 — Panneau de l'audience. */
.imprime-seulement { display: none; }
.text-transform-none { text-transform: none; }
.grille-semaine { display: grid; grid-template-columns: repeat(var(--colonnes), minmax(0, 1fr)); gap: .5rem; }
.grille-semaine .jour { background: #fff; border: 1px solid #dee2e6; border-radius: .375rem; min-height: 12rem; padding: .4rem; }
.jour.aujourdhui, .case.aujourdhui { border-color: var(--aec-bleu); box-shadow: inset 0 3px 0 var(--aec-bleu); }
.entete-jour { display: flex; justify-content: space-between; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.entete-jour a { color: inherit; text-decoration: none; }
.entete-jour .ajout { color: #6c757d; padding: 0 .3rem; }
.carte-audience { display: block; border-left: 4px solid #adb5bd; background: #f8f9fa; border-radius: .25rem; padding: .3rem .45rem;
    margin-bottom: .35rem; color: #212529; text-decoration: none; font-size: .85rem; line-height: 1.25; }
.carte-audience:hover { background: #e9ecef; }
.carte-audience .heure { font-weight: 600; margin-right: .3rem; }
.carte-audience .detail { display: block; color: #6c757d; font-size: .78rem; }
.carte-audience .issue { color: #198754; }
.carte-audience.tenue { opacity: .75; }
.grille-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; background: #dee2e6; border: 1px solid #dee2e6; }
.grille-mois .nom-jour { background: #f1f3f5; text-align: center; font-size: .8rem; font-weight: 600; padding: .25rem; }
.grille-mois .case { background: #fff; min-height: 6.5rem; padding: .25rem; }
.grille-mois .case.hors-mois { background: #f8f9fa; color: #adb5bd; }
.grille-mois .numero { font-size: .8rem; color: inherit; text-decoration: none; font-weight: 600; }
.grille-mois .carte-audience { font-size: .75rem; padding: .15rem .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feuille-juridiction { background: #fff; border-left: 5px solid #adb5bd; border-radius: .25rem; padding: .6rem .9rem; margin-bottom: 1rem; }
.feuille-audiences caption { font-weight: 600; color: #495057; }
.panneau-lateral { --bs-offcanvas-width: 34rem; }
@media print {
    .imprime-seulement { display: block; }
    .offcanvas, .fil-ariane { display: none !important; }
    .grille-semaine { display: block; }
    .grille-semaine .jour { min-height: 0; border: 0; border-bottom: 1px solid #999; border-radius: 0; break-inside: avoid; }
    .carte-audience { background: none; border-left-width: 2px; }
    .grille-mois .case { min-height: 4rem; }
    .feuille-juridiction { border: 0; border-top: 2px solid #000; border-radius: 0; padding: .3rem 0; break-inside: avoid; }
}

/* W9 — Tâches. */
.liste-taches { list-style: none; padding: 0; margin: 0 0 1rem; }
.ligne-tache { display: flex; gap: .6rem; align-items: flex-start; background: #fff; border: 1px solid #dee2e6;
    border-radius: .25rem; padding: .45rem .7rem; margin-bottom: .35rem; }
.ligne-tache form { margin: .15rem 0 0; }
.ligne-tache .form-check-input { width: 1.15rem; height: 1.15rem; cursor: pointer; }
.ligne-tache .detail { font-size: .8rem; color: #6c757d; }
.ligne-tache.faite .intitule { text-decoration: line-through; color: #6c757d; }
.ligne-tache.en-retard { border-left: 4px solid #dc3545; }
.ligne-tache.priorite-haute:not(.faite) .intitule { font-weight: 600; }
.groupe-taches h2 { color: #6c757d; }
.groupe-taches.groupe-retard h2 { color: #dc3545; }
@media print { .ligne-tache { border: 0; border-bottom: 1px solid #999; border-radius: 0; } }

/* W11 — Listes. */
.tableau-liste tr.masquee input[type=text] { color: #6c757d; text-decoration: line-through; }

/* Pièces : zone de dépôt et écran de consultation. */
.zone-depot { border: 2px dashed #adb5bd; border-radius: .5rem; padding: 1rem 1.25rem; background: #fff; transition: background .15s, border-color .15s; }
.zone-depot.survol { border-color: var(--aec-bleu); background: #eef3f9; }
.zone-depot .lien-choisir { color: var(--aec-bleu); text-decoration: underline; cursor: pointer; }
.apercu-piece { background: #fff; border: 1px solid #dee2e6; border-radius: .375rem; min-height: 20rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.apercu-piece iframe { width: 100%; height: 80vh; border: 0; }
.apercu-piece iframe.texte { height: 60vh; }
.apercu-piece img { max-width: 100%; max-height: 80vh; }
@media print { .zone-depot { display: none !important; } .apercu-piece iframe { height: auto; } }

/* Bordereau de pièces. */
.bordereau { background: #fff; max-width: 48rem; padding: 2rem 2.5rem; border: 1px solid #dee2e6; }
.bordereau .rappel-dossier th { font-weight: 600; padding-left: 0; }
.bordereau .tableau-bordereau th { background: #f1f3f5; }
.bordereau .signature { margin-left: auto; width: 18rem; margin-top: 2rem; }
@media print {
    .bordereau { border: 0; padding: 0; max-width: none; }
    .bordereau .tableau-bordereau th { background: none; }
}

/* Pages d'information. */
.texte-information h2 { font-size: 1.05rem; margin-top: 1.4rem; }
.texte-information .a-completer { background: #fff3cd; padding: 0 .3rem; border-radius: .2rem; font-style: italic; }
.pied-public { margin-top: 1.5rem; padding-top: .75rem; border-top: 1px solid #dee2e6; font-size: .85rem; }
.pied-menu { margin-top: 2rem; font-size: .8rem; }
.pied-menu a { color: #6c757d; }
@media print { .pied-public, .pied-menu { display: none; } }

/* Pages d'erreur. */
.page-erreur { max-width: 36rem; padding: 2rem 0; }
.page-erreur .code-erreur { font-size: 3rem; font-weight: 700; color: #adb5bd; line-height: 1; margin-bottom: .5rem; }

/* Écran étroit, calendrier (après les règles de la grille, qu'il remplace) :
   les jours de la semaine les uns sous les autres, les cases du mois resserrées. */
@media (max-width: 767.98px) {
    .grille-semaine { grid-template-columns: 1fr; }
    .grille-semaine .jour { min-height: 0; }
    .grille-mois .case { min-height: 4rem; }
}

/* Tableau d'audiences : par jour, puis par juridiction et chambre. */
.tableau-jour { margin-bottom: 1.25rem; }
.tableau-jour .tableau-date { border-bottom: 2px solid #212529; padding-bottom: .25rem; margin-bottom: .5rem; }
.tableau-jour .tableau-date a { color: inherit; text-decoration: none; }
.tableau-jour.aujourdhui .tableau-date { border-bottom-color: #0d6efd; }
.tableau-lieu { background: #fff; border-left: 5px solid #adb5bd; border-radius: .25rem; padding: .5rem .75rem; margin-bottom: .6rem; }
.tableau-audiences { font-size: .875rem; }
.tableau-audiences tr.tenue td { color: #6c757d; }
.agenda-mois { display: none; }
.agenda-mois .jour-agenda { background: #fff; border: 1px solid #dee2e6; border-radius: .375rem; padding: .4rem; margin-bottom: .5rem; }
.agenda-mois .jour-agenda.aujourdhui { border-color: #212529; }
.agenda-mois .entete-jour { display: flex; justify-content: space-between; font-weight: 600; color: inherit; text-decoration: none; margin-bottom: .3rem; }

/* Téléphone : chaque ligne d'une feuille ou d'un tableau d'audiences devient une fiche ; la grille du mois laisse
   place à l'agenda. */
@media screen and (max-width: 767.98px) {
    .grille-mois { display: none; }
    .agenda-mois { display: block; }
    .tableau-fiches thead { display: none; }
    .tableau-fiches caption { display: block; width: 100%; }
    .tableau-fiches, .tableau-fiches tbody, .tableau-fiches tr, .tableau-fiches td { display: block; width: 100% !important; }
    .tableau-fiches tr { border: 1px solid #dee2e6; border-radius: .375rem; padding: .35rem .5rem; margin-bottom: .5rem; background: #fff; }
    .tableau-fiches td { border: 0; padding: .1rem 0 .1rem 7.5rem; position: relative; min-height: 1.4rem; }
    .tableau-fiches td::before { content: attr(data-label); position: absolute; left: 0; width: 7rem; color: #6c757d; font-size: .78rem; padding-top: .1rem; }
    .tableau-fiches td:not([data-label]) { padding-left: 0; text-align: right; }
    .tableau-lieu, .feuille-juridiction { padding: .4rem .5rem; }
}
@media print {
    /* Le tableau d'audiences s'imprime à l'italienne ; les autres pages gardent leur format. */
    @page paysage { size: landscape; }
    body:has(.tableau-jour) { page: paysage; }
    .tableau-lieu { border: 0; border-top: 1px solid #000; border-radius: 0; padding: .2rem 0; break-inside: avoid; }
    .tableau-audiences { font-size: 9pt; }
    .tableau-jour { break-inside: avoid-page; }
}

/* Finances : chiffres clés, documents (facture, reçu, appel de provision, relevé). */
.chiffres-finances .chiffre { background: #fff; border: 1px solid #dee2e6; border-radius: .375rem; padding: .5rem .75rem; height: 100%; }
.chiffres-finances .libelle { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; }
.chiffres-finances .valeur { font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.chiffres-finances .detail { font-size: .75rem; color: #6c757d; }
.chiffres-finances .a-payer .valeur { color: #b02a37; }
.document-financier { position: relative; }
.document-financier .destinataire { min-width: 14rem; border: 1px solid #dee2e6; padding: .5rem .75rem; }
.document-financier tfoot th { font-weight: 600; }
.document-financier tfoot .total td, .document-financier tfoot .total th { border-top: 2px solid #212529; }
.document-financier .filigrane { position: absolute; top: 40%; left: 0; right: 0; text-align: center; font-size: 5rem; font-weight: 700;
    color: rgba(176, 42, 55, .15); transform: rotate(-20deg); pointer-events: none; }
@media print { .document-financier .destinataire { border-color: #000; } }

/* Parcours du procès (en-tête du dossier) et délais. */
.parcours-proces { list-style: none; padding: 0; margin: .35rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .9rem; }
.parcours-proces li { background: #fff; border: 1px solid #dee2e6; border-radius: .375rem; padding: .15rem .5rem; }
.parcours-proces li + li::before { content: "→"; margin-right: .4rem; color: #6c757d; }
.parcours-proces .recours { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; margin-right: .3rem; }
.parcours-proces .sens-favorable { color: #146c43; }
.parcours-proces .sens-defavorable { color: #b02a37; }
.parcours-proces .sens-partiel { color: #997404; }
.bandeau-delais { border-left: 4px solid #b02a37; }
.bandeau-delais ul { margin: 0; padding-left: 1.1rem; }
.rappels-directeur { border-left: 0; }

/* En-tête du dossier : avocats constitués, membres intéressés, adversaires. */
.bloc-intervenants { background: #fff; border: 1px solid #dee2e6; border-radius: .375rem; padding: .35rem .6rem; height: 100%; }
.bloc-intervenants .titre { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; margin-bottom: .15rem; }

/* Suites d'une décision : chronologie (signification, exécution, délais). */
.suites-decision { border-top: 1px dashed #dee2e6; padding-top: .4rem; }
.chronologie { list-style: none; padding-left: 0; }
.chronologie li { padding: .1rem 0 .1rem .9rem; border-left: 2px solid #dee2e6; }
.chronologie .date { display: inline-block; min-width: 5.5rem; font-weight: 600; }

/* Menu de l'utilisateur : la liste « Voir en tant que » (démo) peut être longue. */
.barre-haute .dropdown-menu { max-height: 80vh; overflow-y: auto; }

/* Panneau d'audience : qui a saisi le juge, et contre qui. */
.parties-audience { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; }
.parties-audience dt { font-weight: 600; color: var(--bs-secondary-color); }
.parties-audience dd { margin: 0; }

/* Chevauchements : un avocat attendu le même jour dans deux juridictions. */
.chevauchement { font-size: .8rem; margin-top: .2rem; padding: .1rem .35rem; border-radius: .25rem; }
.chevauchement.impossible { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.chevauchement.a_organiser { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.chevauchement-signe.impossible { color: var(--bs-danger); }
.chevauchement-signe.a_organiser { color: var(--bs-warning-text-emphasis); }
