:root {
  --marine: #1a2b4a; --marine-fonce: #12203a; --or: #b4924c; --or-clair: #d4b878;
  --fond: #f4f5f7; --carte: #ffffff; --texte: #22293a; --texte-doux: #6b7280;
  --bord: #e2e5ea; --rouge: #b0413e; --vert: #2e7d52; --orange: #c07b28; --bleu: #2b5f8f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Georgia, 'Times New Roman', serif; background: var(--fond); color: var(--texte); line-height: 1.55; }
h1 { font-size: 1.55rem; color: var(--marine); margin-bottom: .6rem; }
h2 { font-size: 1.08rem; color: var(--marine); margin-bottom: .7rem; border-bottom: 2px solid var(--or); display: inline-block; padding-bottom: .15rem; }
a { color: var(--bleu); }
code { font-family: ui-monospace, Menlo, monospace; background: #eef0f4; padding: .1rem .35rem; border-radius: 4px; font-size: .95em; }

.topbar { background: var(--marine); color: #fff; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .6rem 1.2rem; display: flex; align-items: center; gap: 1.3rem; row-gap: .35rem; flex-wrap: wrap; }
.marque { color: #fff; text-decoration: none; font-size: 1.05rem; letter-spacing: .02em; white-space: nowrap; font-weight: 600; }
.marque-accent { color: var(--or-clair); }
.topbar nav { display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: center; }
.topbar nav a { color: #d7dce6; text-decoration: none; font-size: .92rem; padding: .3rem 0; border-bottom: 2px solid transparent; white-space: nowrap; line-height: 1.2; }
.topbar nav a:hover { color: #fff; border-bottom-color: var(--or); }
.topbar-user { display: flex; align-items: center; gap: .9rem; font-size: .88rem; color: #c6cddb; white-space: nowrap; }
.topbar-user .lien-discret { color: #c6cddb; }

.contenu { max-width: 1200px; margin: 1.6rem auto; padding: 0 1.2rem; }
.pied { max-width: 1200px; margin: 2.5rem auto 1.5rem; padding: 0 1.2rem; color: var(--texte-doux); font-size: .8rem; border-top: 1px solid var(--bord); padding-top: 1rem; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: 1.2rem 1.4rem; margin-bottom: 1.3rem; box-shadow: 0 1px 3px rgba(20,30,55,.05); }
.carte-connexion { max-width: 430px; margin: 3.5rem auto; }
.carte-mdp { border-left: 4px solid var(--or); background: #fdf9f0; }
.identifiants { font-size: 1.05rem; margin: .6rem 0; }

.entete-page { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; flex-wrap: wrap; }
.entete-page h1 { margin-bottom: 0; }
.entete-page .btn { margin-left: auto; }
.entete-section { display: flex; align-items: baseline; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }
.sous-titre { color: var(--texte-doux); margin-bottom: 1.1rem; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--texte-doux); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: .45rem .6rem; border-bottom: 2px solid var(--bord); font-family: system-ui, sans-serif; }
td { padding: .55rem .6rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.ligne-urgente td { background: #fdf6ee; }
.ligne-passee td { color: var(--texte-doux); }
.ligne-attente td { background: #fdf9f0; }

label { display: block; margin-bottom: .8rem; font-size: .92rem; font-weight: 600; color: var(--marine); font-family: system-ui, sans-serif; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: .5rem .6rem; margin-top: .25rem; border: 1px solid #c8cdd6; border-radius: 6px;
  font-size: .95rem; font-family: system-ui, sans-serif; background: #fff; color: var(--texte);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--or); outline-offset: 1px; border-color: var(--or); }
input[type=file] { margin-top: .3rem; font-family: system-ui, sans-serif; font-size: .9rem; }
.case { font-weight: 400; display: flex; align-items: center; gap: .45rem; }
.case input { width: auto; margin: 0; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.grille-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1.2rem; }
@media (max-width: 720px) { .grille-2, .grille-3 { grid-template-columns: 1fr; } .colonnes { grid-template-columns: 1fr !important; } }

.btn { display: inline-block; border: 1px solid transparent; border-radius: 6px; padding: .5rem 1.1rem; font-size: .92rem;
  cursor: pointer; text-decoration: none; font-family: system-ui, sans-serif; background: #e8eaef; color: var(--marine); }
.btn:hover { filter: brightness(.96); }
.btn-principal { background: var(--marine); color: #fff; }
.btn-large { width: 100%; padding: .65rem; font-size: 1rem; }
.btn-secondaire { background: #fff; border-color: #c8cdd6; }
.btn-petit { padding: .18rem .55rem; font-size: .8rem; }
.btn-danger { background: #fbeeee; color: var(--rouge); }
.btn-valider { background: #e8f4ed; color: var(--vert); }
.btn-eteint { opacity: .45; }
.btn-discret { background: none; border: none; color: #c6cddb; cursor: pointer; font-size: .88rem; padding: 0; text-decoration: underline; }
.lien-discret { font-size: .85rem; color: var(--bleu); }
.inline { display: inline; }

.badge { display: inline-block; padding: .12rem .5rem; border-radius: 10px; font-size: .74rem; font-family: system-ui, sans-serif; font-weight: 600; white-space: nowrap; }
.badge-audience { background: #eaf1f8; color: var(--bleu); }
.badge-expiration_delai { background: #fbeeee; color: var(--rouge); }
.badge-depot_conclusions { background: #f3eefa; color: #6b4f9e; }
.badge-expertise { background: #eef7f1; color: var(--vert); }
.badge-rdv { background: #fdf4e7; color: var(--orange); }
.badge-autre { background: #eef0f4; color: var(--texte-doux); }
.badge-statut-en_cours { background: #e8f4ed; color: var(--vert); }
.badge-statut-clos { background: #eef0f4; color: var(--texte-doux); }
.badge-statut-archive { background: #eef0f4; color: var(--texte-doux); }
.badge-piece-validee { background: #e8f4ed; color: var(--vert); }
.badge-piece-en_attente { background: #fdf4e7; color: var(--orange); }
.badge-piece-refusee { background: #fbeeee; color: var(--rouge); }

.stats { display: flex; gap: 1.2rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.stat { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: .9rem 1.5rem; min-width: 150px; }
.stat-alerte { border-left: 4px solid var(--orange); }
.stat-chiffre { display: block; font-size: 1.9rem; color: var(--marine); font-weight: 700; }
.stat-libelle { color: var(--texte-doux); font-size: .85rem; font-family: system-ui, sans-serif; }

.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1.1rem; font-family: system-ui, sans-serif; font-size: .92rem; }
.flash-succes { background: #e8f4ed; color: var(--vert); border: 1px solid #bfe0cd; }
.flash-erreur { background: #fbeeee; color: var(--rouge); border: 1px solid #ecc8c7; }
.flash-info { background: #eaf1f8; color: var(--bleu); border: 1px solid #c6d9ea; }

.vide { color: var(--texte-doux); font-style: italic; padding: .4rem 0; }
.note { color: var(--texte-doux); font-size: .84rem; font-family: system-ui, sans-serif; margin-top: .6rem; }
.note-inline { color: var(--texte-doux); font-size: .82rem; font-weight: 400; font-family: system-ui, sans-serif; }
.filtres { margin-bottom: .9rem; font-family: system-ui, sans-serif; font-size: .9rem; }
.filtres a { margin-right: 1rem; text-decoration: none; color: var(--texte-doux); padding-bottom: .15rem; }
.filtres .filtre-actif { color: var(--marine); font-weight: 700; border-bottom: 2px solid var(--or); }

.colonnes { display: grid; grid-template-columns: 1.8fr 1fr; gap: 1.3rem; align-items: start; }
.repli { margin-top: 1rem; }
.repli summary { cursor: pointer; color: var(--bleu); font-family: system-ui, sans-serif; font-size: .92rem; margin-bottom: .7rem; }
.repli-inline summary { list-style: none; display: inline-block; }
.cellule-actions { white-space: nowrap; }
.cellule-actions form { margin-bottom: .2rem; }

.fil-messages { margin-bottom: 1.1rem; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.message { border-radius: 8px; padding: .55rem .85rem; max-width: 85%; font-size: .93rem; }
.message p { white-space: pre-line; }
.message-cabinet { background: #eef2f8; align-self: flex-start; border-left: 3px solid var(--marine); }
.message-client { background: #fdf6ea; align-self: flex-end; border-right: 3px solid var(--or); }
.message-meta { display: block; font-size: .75rem; color: var(--texte-doux); font-family: system-ui, sans-serif; margin-bottom: .15rem; }

.liste-simple { list-style: none; }
.liste-simple li { padding: .3rem 0; border-bottom: 1px solid var(--bord); display: flex; justify-content: space-between; align-items: center; }
.liste-simple li:last-child { border-bottom: none; }
.liste-messages { list-style: none; }
.liste-messages li { padding: .5rem 0; border-bottom: 1px solid var(--bord); font-size: .92rem; }

.frise { list-style: none; border-left: 3px solid var(--bord); margin-left: .4rem; padding-left: 1.2rem; }
.frise-item { position: relative; padding: .45rem 0 .9rem; }
.frise-item::before { content: ''; position: absolute; left: -1.62rem; top: .72rem; width: .78rem; height: .78rem; border-radius: 50%; background: var(--bord); border: 2px solid #fff; }
.frise-avenir::before { background: var(--or); }
.frise-date { display: block; font-family: system-ui, sans-serif; font-size: .82rem; color: var(--texte-doux); text-transform: capitalize; }
.frise-passee { opacity: .6; }
.badge-facture-brouillon { background: #eef0f4; color: var(--texte-doux); }
.badge-facture-envoyee { background: #fdf4e7; color: var(--orange); }
.badge-facture-payee { background: #e8f4ed; color: var(--vert); }
.badge-email-client { background: #e8f4ed; color: var(--vert); }
.badge-email-avocat_adverse { background: #fbeeee; color: var(--rouge); }
.badge-email-juridiction { background: #eaf1f8; color: var(--bleu); }
.badge-email-autre { background: #eef0f4; color: var(--texte-doux); }
.corps-email { white-space: pre-wrap; font-size: .93rem; max-height: 60vh; overflow-y: auto; }
.separateur { border: none; border-top: 1px solid var(--bord); margin: .8rem 0; }
.branche { margin-bottom: .8rem; }
.branche summary { cursor: pointer; padding: .3rem 0; font-family: system-ui, sans-serif; }
.cellule-date { white-space: nowrap; }
.marge-haut { margin-top: .6rem; }
.sous-branche { font-size: .95rem; color: var(--orange); margin: .5rem 0 .3rem; font-family: system-ui, sans-serif; }
.champ-cache { position: absolute; left: -9999px; opacity: 0; height: 0; }
.carte-rdv { max-width: 520px; }
.cellule-barre { width: 30%; }
.cellule-barre progress { width: 100%; height: .7rem; accent-color: var(--marine); }
.tache-faite { text-decoration: line-through; color: var(--texte-doux); }
.tache-retard { color: var(--rouge); font-weight: 600; }
.form-recherche { display: flex; align-items: center; }
.form-recherche input { padding: .3rem .6rem; border-radius: 6px; border: none; font-size: .85rem; width: 140px; font-family: system-ui, sans-serif; }
.topbar-user { margin-left: auto; }
@media (max-width: 1080px) { .topbar-user { margin-left: 0; } }
.ligne-chrono { display: flex; gap: .4rem; align-items: center; }
.ligne-chrono input { flex: 1; }
.resultat-ia { background: #fbfaf7; border: 1px solid var(--bord); border-radius: 8px; padding: 1rem 1.2rem; font-family: Georgia, serif; max-height: none; }
