/* Feu de camp — Saraïlis avocats. Palette et typographie du guide de style v1.0. */

:root {
  --marine: #16232e;
  --bleu-pale: #ecf1f5;
  --blanc: #fff;
  --orange: #e8542a;
  --orange-clair: #f0653c;
  --ocre: #d89a3a;
  --ocre-clair: #e7b24e;
  --txt: #46535f;
  --txt-2: #52616e;
  --txt-3: #7a8792;
  --txt-4: #9aa6af;
  --pict: #b0b8bf;
  --filet: #d3dbe1;
  --bordure: #dce3e9;
  --neutre: #c3cacf;
  --marine-filet: #2c3b48;
  --retard-fond: #fdf0ec;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bleu-pale);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: var(--txt);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .bricolage {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  letter-spacing: -0.02em;
  color: var(--marine);
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--marine); }

button, input, select, textarea { font: inherit; color: inherit; }

.caveat { font-family: 'Caveat', cursive; font-weight: 700; }

/* ------------------------------------------------------------------ en-tête */

.entete {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 26px;
  background: var(--blanc);
  border-bottom: 1px solid var(--bordure);
  position: sticky;
  top: 0;
  z-index: 40;
}

.marque { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }

.logo { display: block; flex: 0 0 auto; line-height: 0; }
.logo img { display: block; height: 24px; width: auto; }

.marque .filet { width: 1px; height: 22px; background: var(--filet); }

.nom-app {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--marine);
  letter-spacing: -0.02em;
}

.nom-app .flamme { display: block; flex: 0 0 auto; width: 20px; height: 20px; }

.nav { display: flex; align-items: center; gap: 6px; margin-left: 12px; }

.nav button {
  border: 0;
  background: none;
  padding: 8px 15px;
  border-radius: 7px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--txt-3);
  cursor: pointer;
  white-space: nowrap;
}
.nav button:hover:not(:disabled) { color: var(--marine); background: var(--bleu-pale); }
.nav button.actif { background: var(--marine); color: #eef2f5; }
.nav button:disabled { cursor: not-allowed; opacity: 0.75; }

.entete .droite { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.entete .droite .bouton { white-space: nowrap; }

.recherche {
  width: 300px;
  padding: 9px 13px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--blanc);
  font-size: 14px;
}
.recherche::placeholder { color: var(--txt-4); }
.recherche:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: transparent; }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--marine);
  color: #eef2f5;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
  letter-spacing: 0.03em;
  cursor: pointer;
  flex: 0 0 auto;
  border: 0;
}

/* --------------------------------------------------------------- structure */

.coquille { display: flex; align-items: stretch; min-height: calc(100vh - 63px); background: var(--blanc); }

.lateral {
  width: 322px;
  flex: 0 0 322px;
  background: var(--blanc);
  border-right: 1px solid var(--bordure);
  padding: 22px 0 40px;
}

.lateral header { padding: 0 24px; }
.lateral .ajout-dossier { margin-top: 10px; }

.lateral h2 {
  font-size: 21px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.lateral h2 span { font-family: 'Instrument Sans', sans-serif; font-size: 15px; color: var(--txt-4); font-weight: 500; letter-spacing: 0; }

.segments { display: inline-flex; gap: 4px; margin: 14px 0 6px; }
.segments button {
  border: 0; background: var(--bleu-pale); color: var(--txt-2);
  padding: 6px 15px; border-radius: 7px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.segments button.actif { background: var(--marine); color: #eef2f5; }

.liste-dossiers { margin-top: 8px; }

.item-dossier {
  display: block; width: 100%; text-align: left;
  border: 0; border-left: 3px solid transparent; background: none;
  padding: 15px 24px 15px 21px;
  border-bottom: 1px solid var(--bordure);
  cursor: pointer;
}
.item-dossier:hover { background: #f6f9fb; }
.item-dossier.actif { background: var(--bleu-pale); border-left-color: var(--orange); }
.item-dossier .titre { font-weight: 600; color: var(--marine); font-size: 15px; line-height: 1.3; }
.item-dossier .meta { font-size: 13px; color: var(--txt-3); margin-top: 4px; }
.item-dossier .alerte { font-size: 13px; color: var(--orange); font-weight: 600; margin-top: 2px; }

.vide-lateral { padding: 26px 24px; color: var(--txt-3); font-size: 14px; }

.principal { flex: 1 1 auto; min-width: 0; padding: 30px 38px 60px; background: var(--blanc); }

/* ------------------------------------------------------------------ dossier */

.surtitre { font-family: 'Caveat', cursive; font-weight: 700; font-size: 22px; color: var(--ocre); line-height: 1; }

.principal h1 { font-size: 40px; font-weight: 700; line-height: 1.0; margin: 6px 0 12px; }

.meta-dossier { display: flex; flex-wrap: wrap; gap: 8px 30px; font-size: 14px; color: var(--txt-2); }
.meta-dossier b { color: var(--marine); font-weight: 600; }

.onglets { display: flex; gap: 22px; border-bottom: 1px solid var(--bordure); margin: 26px 0 22px; }
.onglets button {
  border: 0; background: none; padding: 0 0 11px; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--txt-3);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.onglets button.actif { color: var(--marine); border-bottom-color: var(--orange); }
.onglets button:disabled { color: var(--pict); cursor: not-allowed; }

.barre-outils { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.barre-outils .pousse { margin-left: auto; }

select.filtre {
  border: 1px solid var(--bordure); background: var(--blanc);
  border-radius: 8px; padding: 8px 12px; font-size: 13.5px; color: var(--txt-2); cursor: pointer;
}

.bouton {
  border: 0; border-radius: 8px; padding: 9px 17px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--marine); color: #eef2f5;
}
.bouton:hover { background: #0d1720; }
.bouton.orange { background: var(--orange); color: #fff; }
.bouton.orange:hover { background: #cf4520; }
.bouton.fantome { background: none; color: var(--txt-2); border: 1px solid var(--bordure); }
.bouton.fantome:hover { background: var(--bleu-pale); color: var(--marine); }
.bouton:disabled { opacity: 0.5; cursor: not-allowed; }

/* -------------------------------------------------------------- le backlog */

.tableau { background: var(--blanc); border: 1px solid var(--bordure); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 24px rgba(22, 35, 46, 0.05); }

.rang { display: grid; grid-template-columns: 26px 96px minmax(0, 1fr) 168px 116px 104px; gap: 14px; align-items: center; padding: 15px 20px; }

.entete-tableau {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--txt-3); border-bottom: 1px solid var(--bordure); padding-top: 13px; padding-bottom: 13px;
}

.groupe-evenement { border-bottom: 1px solid var(--bordure); }
.groupe-evenement:last-of-type { border-bottom: 0; }

.rang-evenement { background: var(--blanc); cursor: pointer; border-left: 3px solid transparent; padding-left: 17px; }
.rang-evenement:hover { background: #f8fafc; }
.rang-evenement.ouvert { background: var(--bleu-pale); }
.rang-evenement.alerte { border-left-color: var(--orange); }

.caret { color: var(--txt-4); font-size: 11px; }
.date-evenement { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 16px; color: var(--marine); }
.date-evenement.flou { color: var(--txt-3); font-size: 14px; }
.titre-evenement { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; font-size: 17px; color: var(--marine); line-height: 1.2; }
.sous-titre { font-size: 13px; color: var(--txt-3); margin-top: 3px; }
.cellule { font-size: 14px; color: var(--txt-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cellule.marine { color: var(--marine); }
.cellule.attenue { color: var(--txt-3); }
.etat { font-size: 13px; color: var(--txt-2); }

.progression { display: flex; align-items: center; gap: 12px; margin-top: 9px; max-width: 500px; }
.progression .piste { flex: 1 1 auto; height: 6px; border-radius: 3px; background: #dfe6ec; overflow: hidden; }
.progression .barre { height: 100%; background: var(--marine); border-radius: 3px; }
.progression .pourcent { font-size: 13px; color: var(--txt-2); flex: 0 0 auto; }

.corps-evenement { background: #fbfcfd; }

.rang-action { padding-top: 11px; padding-bottom: 11px; border-top: 1px solid #eef2f5; }
.rang-action:hover { background: #f6f9fb; }
.rang-action.en-retard { background: var(--retard-fond); }
.rang-action.en-retard:hover { background: #fbe6e0; }
.rang-action .titre-action { font-size: 14.5px; color: var(--marine); }
.rang-action.faite .titre-action { color: var(--txt-3); text-decoration: line-through; }
.rang-action.en-retard .titre-action { font-weight: 600; }
.rang-action.en-retard .echeance, .rang-action.en-retard .etat { color: var(--orange); font-weight: 700; }

.case-a-cocher {
  width: 18px; height: 18px; border: 1.5px solid var(--pict); border-radius: 4px;
  background: none; cursor: pointer; display: grid; place-items: center; padding: 0;
  color: transparent; font-size: 12px; line-height: 1;
}
.case-a-cocher:hover { border-color: var(--orange); }
.case-a-cocher.cochee { border-color: transparent; color: var(--txt-3); font-size: 15px; }
.rang-action.en-retard .case-a-cocher { border-color: var(--orange); }

.rang-ajout { padding-top: 12px; padding-bottom: 14px; border-top: 1px solid #eef2f5; }
.lien-ajout { border: 0; background: none; color: var(--orange); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; }
.lien-ajout:hover { color: var(--marine); }
.lien-ajout.discret { color: var(--txt-3); font-weight: 500; }
.lien-ajout.discret:hover { color: var(--marine); }
.indice { font-size: 13px; color: var(--txt-3); }

.pied-complets {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 20px; background: var(--marine);
}
.pied-complets .gauche { display: flex; align-items: baseline; gap: 12px; }
.pied-complets .caveat { font-size: 19px; color: var(--ocre-clair); }
.pied-complets .texte { font-size: 14px; color: #c6d0da; }
.pied-complets button { border: 0; background: none; color: var(--orange-clair); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }

.vide {
  background: var(--blanc); border: 1px solid var(--bordure); border-radius: 10px;
  padding: 54px 44px; text-align: center;
}
.vide h3 { font-size: 24px; margin-bottom: 8px; }
.vide p { color: var(--txt-2); max-width: 520px; margin: 0 auto 20px; }

/* ------------------------------------------------------------------ modales */

.voile {
  position: fixed; inset: 0; background: rgba(22, 35, 46, 0.45);
  display: grid; place-items: center; padding: 24px; z-index: 90;
}
.modale {
  background: var(--blanc); border-radius: 12px; width: min(620px, 100%);
  max-height: 90vh; overflow: auto; padding: 30px 32px 26px;
  box-shadow: 0 18px 60px rgba(22, 35, 46, 0.25);
}
.modale.large { width: min(860px, 100%); }
.modale h2 { font-size: 26px; margin-bottom: 4px; }
.modale .intro { color: var(--txt-2); font-size: 14px; margin-bottom: 20px; }

.champ { margin-bottom: 15px; }
.champ label { display: block; font-size: 13px; font-weight: 600; color: var(--txt-2); margin-bottom: 5px; }
.champ input, .champ select, .champ textarea {
  width: 100%; border: 1px solid var(--bordure); border-radius: 8px;
  padding: 9px 12px; font-size: 14.5px; background: var(--blanc);
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: transparent; }
.champ textarea { min-height: 76px; resize: vertical; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.actions-modale { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--bordure); }

.erreur { background: var(--retard-fond); color: #a5391a; border-radius: 8px; padding: 10px 13px; font-size: 14px; margin-bottom: 14px; }

.tableau-simple { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau-simple th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--txt-3); border-bottom: 1px solid var(--bordure); padding: 8px 10px; font-weight: 600;
}
.tableau-simple td { padding: 9px 10px; border-bottom: 1px solid #eef2f5; }
.tableau-simple .mini { border: 0; background: none; color: var(--orange); cursor: pointer; font-size: 13px; font-weight: 600; }

/* -------------------------------------------------------------------- gate */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.carte-gate {
  background: var(--blanc); border: 1px solid var(--bordure); border-radius: 12px;
  box-shadow: 0 1px 24px rgba(22, 35, 46, 0.05); padding: 46px 44px; max-width: 560px; text-align: center;
}
.carte-gate .surtitre { font-size: 26px; }
.carte-gate h1 { font-size: 34px; margin: 8px 0 12px; }
.carte-gate p { color: var(--txt-2); margin-bottom: 22px; }

.signature {
  margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--filet);
  font-size: 14px; color: var(--txt-2);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.signature .logo-signature { height: 26px; width: auto; display: block; flex: 0 0 auto; }
.signature .caveat { color: var(--orange); font-size: 19px; }
.vide .signature, .carte-gate .signature { text-align: left; }

.chargement { padding: 60px; text-align: center; color: var(--txt-3); }

@media (max-width: 1080px) {
  .lateral { display: none; }
  .lateral.mobile-ouvert { display: block; position: fixed; inset: 63px auto 0 0; z-index: 30; }
  .rang { grid-template-columns: 22px 78px minmax(0, 1fr) 120px 92px 82px; gap: 10px; padding: 13px 14px; }
  .principal { padding: 22px 18px 50px; }
}
