/*
 * Legal Master — feuille de style unique.
 *
 * Habillage aux couleurs des Éditions Quo Vadis (quovadis1954.com) :
 *
 * - une page blanche et aérée, des angles droits, des filets fins ;
 * - une seule famille, Montserrat, avec des titres en graisse normale ;
 * - l'en-tête du site : un bandeau gris clair (recherche, alertes, compte)
 *   puis l'enseigne, logo au centre et navigation de part et d'autre ;
 * - l'or de la maison comme seul accent : rubrique active, repères, survols.
 *   Sur fond blanc il ne porte jamais de petit texte (contraste insuffisant) :
 *   le texte doré utilise --or-texte, plus soutenu ;
 * - les filets verticaux d'une page d'agenda pour séparer les colonnes
 *   (chiffres de l'accueil, repères d'un dossier, écran de connexion).
 *
 * Le rouge reste réservé à l'urgence : échéance dépassée, erreur, suppression.
 * L'écriture manuscrite (Bad Script) n'apparaît qu'à l'écran de connexion.
 */

@font-face {
  font-family: 'Montserrat';
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/montserrat-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bad Script';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/bad-script-latin-400-normal.woff2') format('woff2');
}

:root {
  color-scheme: light;

  --papier: #ffffff;
  --gris: #f5f5f5;
  --gris-clair: #fafafa;
  --filet: #e2e2e2;
  --filet-fort: #cdcdcd;
  --encre: #212529;
  --encre-douce: #666666;
  --noir: #000000;
  --or: #d0a655;
  --or-texte: #8f6b1c;
  --or-pale: #f8f1e1;
  --rouge: #c0283c;
  --rouge-pale: #fbeaec;
  --vert: #1b7355;
  --vert-pale: #e4f2ec;
  --ambre: #8a5a00;
  --ambre-pale: #faf0d9;
  --bleu: #2f4e8c;

  --texte: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --main-levee: 'Bad Script', 'Segoe Script', cursive;

  --t-xs: 0.75rem;
  --t-s: 0.8125rem;
  --t-m: 0.875rem;
  --t-l: 1rem;
  --t-xl: 1.375rem;
  --t-xxl: 2.125rem;

  --bandeau: 40px;
  --largeur-marge: 288px;
  --bord: 36px;
  --ombre: 0 14px 36px rgb(0 0 0 / 0.14), 0 1px 3px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--texte);
  font-size: var(--t-m);
  line-height: 1.55;
  color: var(--encre);
  background: var(--papier);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.15; }
h1 { font-size: var(--t-xxl); letter-spacing: -0.012em; }
h2 { font-size: var(--t-xl); letter-spacing: -0.005em; }
h3 { font-size: var(--t-l); font-weight: 600; }
p { margin: 0 0 0.75em; }
a { color: var(--encre); text-decoration-color: var(--or); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--or-texte); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--noir); outline-offset: 2px; }

.discret { color: var(--encre-douce); }
.petit { font-size: var(--t-s); }
.chiffres { font-variant-numeric: tabular-nums; }
.droite { text-align: right; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- Bandeau */

.bandeau { position: sticky; top: 0; z-index: 30; background: var(--gris); border-bottom: 1px solid var(--filet); }
.bandeau-in { display: flex; align-items: center; gap: 22px; height: var(--bandeau); padding: 0 var(--bord); }
.bandeau-nom { padding-right: 22px; border-right: 1px solid var(--filet-fort); color: var(--noir); font-size: var(--t-s); font-weight: 600; line-height: 18px; text-decoration: none; white-space: nowrap; }
a.bandeau-nom:hover { color: var(--or-texte); }
.bandeau-recherche { position: relative; flex: 0 1 360px; min-width: 0; }
.bandeau .bandeau-recherche input[type='search'] {
  width: 100%; min-height: 0; height: 26px; padding: 0 4px 0 24px;
  border: 0; border-bottom: 1px solid var(--noir); background: transparent; color: var(--encre); font: inherit; font-size: var(--t-s);
}
.bandeau .bandeau-recherche input[type='search']::placeholder { color: var(--encre-douce); }
.bandeau .bandeau-recherche input[type='search']:focus { outline: 0; box-shadow: 0 2px 0 var(--or); }
.bandeau-recherche svg { position: absolute; left: 2px; top: 5px; color: var(--encre-douce); pointer-events: none; }
.bandeau-fin { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.bandeau-mention { font-size: var(--t-s); color: var(--encre-douce); }
.bandeau-sep { width: 1px; height: 18px; margin: 0 8px; background: var(--filet-fort); }
.bandeau-bouton {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 6px;
  border: 0; background: none; color: var(--noir); font: inherit; font-size: var(--t-s); font-weight: 500; cursor: pointer; text-decoration: none;
}
.bandeau-bouton:hover { color: var(--or-texte); }
.compteur {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--or); color: var(--noir); font-size: 0.6875rem; font-weight: 700; line-height: 18px; text-align: center;
}

/* --------------------------------------------------------------- Enseigne */

.enseigne { background: var(--papier); border-bottom: 1px solid var(--filet); }
.enseigne-in {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 56px;
  max-width: 1180px; margin: 0 auto; padding: 12px var(--bord) 10px;
}
/* Les liens se rangent contre le logo, à pas égal de chaque côté. */
.enseigne-liens { display: flex; justify-content: flex-end; gap: 52px; }
.enseigne-liens:last-child { justify-content: flex-start; }
.enseigne-liens a {
  padding: 7px 2px 5px; border-bottom: 2px solid transparent;
  color: var(--encre-douce); font-size: var(--t-s); font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
.enseigne-liens a:hover { color: var(--noir); }
.enseigne-liens a[aria-current='page'] { color: var(--or-texte); border-bottom-color: var(--or); }
.enseigne-logo { display: block; }
.enseigne-logo img { display: block; height: 56px; width: auto; }

/* ---------------------------------------------------------- Marge et page */

.cahier { display: grid; grid-template-columns: var(--largeur-marge) minmax(0, 1fr); min-height: calc(100vh - 120px); }
.cahier.sans-marge { display: block; }
.cahier.sans-marge .marge { display: none; }
.cahier.sans-marge .page { max-width: 1180px; margin: 0 auto; }
.cahier.sans-marge .page-moyenne { max-width: none; }
.marge { padding: 28px 18px 48px 24px; border-right: 1px solid var(--filet); }
.page { padding: 30px var(--bord) 80px; min-width: 0; }
.page-etroite { max-width: 760px; }
.page-moyenne { max-width: 1080px; }

.marge-titre { margin: 0 0 10px; font-size: var(--t-xs); font-weight: 600; color: var(--encre-douce); }
.marge-bloc + .marge-bloc { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--filet); }
.marge-liste { list-style: none; margin: 0; padding: 0; }
.marge-liste a, .marge-liste button {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%;
  padding: 7px 10px 7px 12px; border: 0; border-left: 2px solid transparent; background: none;
  color: var(--encre); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.marge-liste a:hover, .marge-liste button:hover { background: var(--gris); color: var(--noir); }
.marge-liste a[aria-current='page'] { background: var(--gris); border-left-color: var(--or); color: var(--noir); font-weight: 600; }
.marge-liste .nb { font-size: var(--t-xs); font-weight: 400; color: var(--encre-douce); font-variant-numeric: tabular-nums; }

.entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.entete h1 + p { margin: 8px 0 0; }
.entete-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 38px; }
.section:first-child { margin-top: 0; }
.section-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--filet-fort); margin-bottom: 4px; }
.section-tete .nb { font-size: var(--t-s); color: var(--encre-douce); margin-left: 6px; }

/* ---------------------------------------------------------------- Boutons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 6px 16px;
  border: 1px solid var(--filet-fort); border-radius: 0;
  background: var(--papier); color: var(--encre);
  font: inherit; font-size: var(--t-s); font-weight: 500; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { border-color: var(--noir); color: var(--noir); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-principal { background: var(--noir); border-color: var(--noir); color: #fff; }
.btn-principal:hover { background: var(--or); border-color: var(--or); color: var(--noir); }
.btn-danger { color: var(--rouge); border-color: #e3b1b8; }
.btn-danger:hover { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-discret { padding-inline: 6px; border-color: transparent; background: transparent; color: var(--encre); text-decoration: underline; text-decoration-color: var(--or); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.btn-discret:hover { border-color: transparent; color: var(--or-texte); }
.btn-icone { width: 32px; min-height: 32px; padding: 0; border-color: transparent; background: transparent; color: var(--encre-douce); }
.btn-icone:hover { background: var(--gris); border-color: transparent; color: var(--noir); }
.btn-icone.actif { color: var(--or); }
.btn svg { flex: none; }

/* ------------------------------------------------------------- Formulaires */

label, .etiquette { display: block; font-size: var(--t-s); font-weight: 600; color: var(--encre); margin-bottom: 5px; }
.requis::after { content: ' *'; color: var(--rouge); }

input[type='text'], input[type='password'], input[type='email'], input[type='date'], input[type='number'], input[type='search'], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px;
  border: 1px solid var(--filet-fort); border-radius: 0;
  background: var(--papier); color: var(--encre); font: inherit;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select { padding-right: 24px; text-overflow: ellipsis; }
input:hover, select:hover, textarea:hover { border-color: var(--encre-douce); }
input:focus, select:focus, textarea:focus { outline: 2px solid transparent; border-color: var(--noir); box-shadow: 0 2px 0 var(--or); }
input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--rouge); }
input[type='checkbox'], input[type='radio'] { width: 16px; height: 16px; margin: 0; accent-color: var(--noir); box-shadow: none; }
input[type='checkbox']:focus-visible, input[type='radio']:focus-visible { outline: 2px solid var(--noir); outline-offset: 2px; }
input[type='file'] { font: inherit; max-width: 100%; }

.champ { min-width: 0; }
.champ-aide { font-size: var(--t-xs); color: var(--encre-douce); margin-top: 5px; }
.champ-erreur { font-size: var(--t-s); color: var(--rouge); margin-top: 5px; }
.coche { display: flex; align-items: center; gap: 9px; font-weight: 400; font-size: var(--t-m); margin: 0; cursor: pointer; }
.grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.grille .large { grid-column: 1 / -1; }
.grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.duree { display: grid; grid-template-columns: minmax(0, 1fr) 124px; gap: 8px; }
.ligne { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ligne-fin { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pied-fixe {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 30px; padding: 14px 0; background: var(--papier); border-top: 1px solid var(--filet-fort);
}

/* Sélection multiple : pastilles + champ d'ajout */
.pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
.pastilles:not(:empty) { margin-bottom: 6px; }
.pastille {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 2px 4px 2px 9px; border: 1px solid var(--filet); background: var(--gris); color: var(--encre); font-size: var(--t-s);
}
.pastille span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pastille button { display: inline-flex; width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--encre-douce); cursor: pointer; align-items: center; justify-content: center; }
.pastille button:hover { background: var(--noir); color: #fff; }
.pastille.lecture { padding-right: 9px; }

.choix { position: relative; }
.choix-liste {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 2px);
  max-height: 260px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--papier); border: 1px solid var(--filet-fort); box-shadow: var(--ombre);
}
.choix-liste li { padding: 7px 10px; cursor: pointer; }
.choix-liste li[aria-selected='true'], .choix-liste li:hover { background: var(--gris); }
.choix-liste .vide { color: var(--encre-douce); cursor: default; background: none; }
.choix-liste .creer { color: var(--or-texte); font-weight: 600; }

/* ---------------------------------------------------------------- Tableaux */

.tableau-cadre { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-m); }
th, td { padding: 10px 14px 10px 0; text-align: left; vertical-align: top; line-height: 1.45; border-bottom: 1px solid var(--filet); }
th { padding-top: 8px; padding-bottom: 8px; font-size: var(--t-xs); font-weight: 600; color: var(--encre-douce); white-space: nowrap; border-bottom-color: var(--filet-fort); }
th.tri { cursor: pointer; user-select: none; }
th.tri:hover { color: var(--noir); }
th .fleche { display: inline-block; width: 12px; margin-left: 2px; color: var(--or-texte); }
td.actions, th.actions { text-align: right; white-space: nowrap; padding-right: 0; width: 1%; }
td.actions .btn-icone { width: 28px; min-height: 28px; }
tbody tr.cliquable { cursor: pointer; }
tbody tr.cliquable:hover td { background: var(--gris-clair); }
tbody tr.archive td { color: var(--encre-douce); }
td .titre-ligne { font-weight: 600; color: var(--encre); text-decoration: none; }
td a.titre-ligne:hover { color: var(--or-texte); text-decoration: underline; }
td .sous { display: block; font-size: var(--t-s); color: var(--encre-douce); }
td.tronque { max-width: 340px; }
td.tronque > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vide-bloc { padding: 30px 0; color: var(--encre-douce); }
.vide-bloc strong { display: block; color: var(--encre); font-weight: 600; margin-bottom: 4px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: var(--t-s); color: var(--encre-douce); }

/* Fiche : couples libellé / valeur séparés par des filets */
.fiche { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; margin: 0; }
.fiche > div { display: grid; grid-template-columns: minmax(120px, 40%) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--filet); min-width: 0; }
.fiche > div.large { grid-column: 1 / -1; grid-template-columns: minmax(120px, 19%) minmax(0, 1fr); }
.fiche dt { color: var(--encre-douce); font-size: var(--t-s); padding-top: 1px; }
.fiche dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.fiche dd.vide { color: #a3a3a3; }

/* -------------------------------------------------------- Statuts et marques */

.tampon {
  display: inline-block; padding: 2px 9px; border: 1px solid currentColor;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; line-height: 1.5; white-space: nowrap;
  color: var(--encre-douce); background: var(--papier);
}
.tampon.nouveau { color: #55606e; }
.tampon.projet { color: var(--or-texte); }
.tampon.signe { color: var(--bleu); }
.tampon.en_vigueur { color: var(--vert); }
.tampon.resilie { color: var(--rouge); }
.tampon.archive { color: #767676; border-style: dashed; }
.tampon.grand { font-size: var(--t-xs); padding: 3px 12px; }
/* Statuts d'une marque */
.tampon.marque-projet { color: #55606e; }
.tampon.marque-deposee { color: var(--bleu); }
.tampon.marque-enregistree { color: var(--vert); }
.tampon.marque-opposition { color: var(--ambre); }
.tampon.marque-refusee, .tampon.marque-expiree { color: var(--rouge); }
.tampon.marque-abandonnee { color: #767676; border-style: dashed; }

.marque { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; font-size: var(--t-xs); font-weight: 500; background: var(--gris); color: var(--encre-douce); white-space: nowrap; }
.marque.violet { background: var(--or-pale); color: var(--or-texte); }
.marque.vert { background: var(--vert-pale); color: var(--vert); }
.marque.ambre { background: var(--ambre-pale); color: var(--ambre); }
.marque.rouge { background: var(--rouge-pale); color: var(--rouge); }

.echeance { white-space: nowrap; font-variant-numeric: tabular-nums; }
.echeance .dans { display: block; font-size: var(--t-xs); color: var(--encre-douce); }
.echeance.proche .dans { color: var(--ambre); font-weight: 600; }
.echeance.urgente, .echeance.urgente .dans { color: var(--rouge); font-weight: 600; }

.importance { display: inline-flex; gap: 3px; vertical-align: middle; }
.importance i { width: 7px; height: 7px; border-radius: 50%; background: var(--filet); }
.importance.n1 i:nth-child(-n + 1), .importance.n2 i:nth-child(-n + 2) { background: var(--encre-douce); }
.importance.n3 i { background: var(--rouge); }

.avis { padding: 11px 16px; border-left: 3px solid var(--or); background: var(--or-pale); margin-bottom: 18px; }
.avis.erreur { border-color: var(--rouge); background: var(--rouge-pale); }
.avis.attention { border-color: var(--ambre); background: var(--ambre-pale); }
.avis.succes { border-color: var(--vert); background: var(--vert-pale); }
.avis ul { margin: 6px 0 0; padding-left: 18px; }
.secret { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: var(--t-l); padding: 9px 13px; background: var(--gris); border: 1px dashed var(--filet-fort); user-select: all; display: inline-block; }

/* ------------------------------------------------------------ Fiche contrat */

/* L'en-tête d'un dossier occupe une bande grise, d'un bord à l'autre de la page. */
.dossier-tete { margin: -30px calc(-1 * var(--bord)) 30px; padding: 22px var(--bord) 22px; background: var(--gris); border-bottom: 1px solid var(--filet); }
.dossier-ident { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: var(--t-s); color: var(--encre-douce); margin-bottom: 10px; }
.dossier-ident .marque { background: var(--papier); }
.dossier-ident .ident { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--encre); letter-spacing: 0.02em; }
.dossier-titre { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.dossier-titre h1 { flex: 1 1 22ch; max-width: 52ch; font-size: 1.875rem; }
.dossier-titre .btn { background: var(--papier); }
.dossier-titre .btn-icone { background: transparent; }
/* Repères : autant de colonnes d'agenda, séparées par un filet. */
.dossier-reperes { display: flex; flex-wrap: wrap; gap: 12px 0; margin: 18px 0 0; padding: 0; list-style: none; }
.dossier-reperes li { min-width: 0; padding: 0 22px 0 14px; border-left: 1px solid var(--filet-fort); }
.dossier-reperes .lib { display: block; font-size: var(--t-xs); color: var(--encre-douce); }
.dossier-reperes .val { font-weight: 600; }

/* ---------------------------------------------------------------- Accueil */

/* Les chiffres-clés : quatre colonnes entre des filets verticaux. */
.synthese { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 38px; border-right: 1px solid var(--filet); }
.synthese a { display: block; padding: 6px 16px 10px 18px; border-left: 1px solid var(--filet); color: inherit; text-decoration: none; }
.synthese a:hover .val { color: var(--or-texte); }
.synthese .val { font-size: 2.75rem; font-weight: 300; line-height: 1.1; letter-spacing: -0.02em; transition: color 0.12s; }
.synthese .lib { font-size: var(--t-s); color: var(--encre-douce); }
.synthese .alerte .val { color: var(--rouge); }
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px 56px; align-items: start; }
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--filet); }
.liste-simple li > :first-child { min-width: 0; }
.liste-simple .sous { display: block; font-size: var(--t-s); color: var(--encre-douce); }
.liste-simple .echeance { text-align: right; }
.liste-simple a { text-decoration: none; font-weight: 600; color: var(--encre); }
.liste-simple a:hover { color: var(--or-texte); text-decoration: underline; }
.barres { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px 14px; align-items: center; padding-top: 12px; }
.barres .trait { height: 6px; background: var(--or); min-width: 2px; }
.histo { display: flex; align-items: flex-end; gap: 6px; height: 104px; padding-top: 12px; border-bottom: 1px solid var(--filet-fort); }
.histo div { flex: 1; min-width: 0; min-height: 2px; background: var(--filet-fort); }
.histo div:last-child { background: var(--or); } /* le mois en cours */
.histo-axe { display: flex; gap: 6px; font-size: 0.6875rem; color: var(--encre-douce); margin-top: 5px; }
.histo-axe span { flex: 1; text-align: center; min-width: 0; overflow: hidden; }

/* ------------------------------------------------------------- Calendrier */

.calendrier { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--filet-fort); border-left: 1px solid var(--filet); }
.calendrier .jour-nom { padding: 8px 9px; font-size: var(--t-xs); font-weight: 600; color: var(--encre-douce); border-right: 1px solid var(--filet); border-bottom: 1px solid var(--filet-fort); }
.calendrier .jour { min-height: 96px; padding: 6px 7px; border-right: 1px solid var(--filet); border-bottom: 1px solid var(--filet); font-size: var(--t-xs); min-width: 0; }
.calendrier .jour.hors { background: var(--gris); }
.calendrier .jour .num { display: inline-block; min-width: 22px; font-size: var(--t-s); color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.calendrier .jour.aujourdhui .num { padding: 0 6px; background: var(--or); color: var(--noir); font-weight: 600; text-align: center; }
.calendrier .evt { display: block; margin-top: 4px; padding: 2px 6px; border-left: 3px solid var(--or); background: var(--or-pale); color: var(--encre); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendrier .evt.renewal_deadline, .calendrier .evt.termination_deadline { border-color: var(--rouge); background: var(--rouge-pale); }
.calendrier .evt.end_date { border-color: var(--ambre); background: var(--ambre-pale); }
.calendrier .evt.task { border-color: var(--vert); background: var(--vert-pale); }
.calendrier .evt.trademark_expiry { border-color: var(--or); background: var(--or-pale); }

/* --------------------------------------------------- Critères de recherche */

.critere { padding: 10px; margin-bottom: 8px; background: var(--gris-clair); border: 1px solid var(--filet); }
.critere > * + * { margin-top: 6px; }
.critere select, .critere input { font-size: var(--t-s); }
.critere-tete { display: flex; gap: 4px; align-items: center; }
.critere-tete select { flex: 1; min-width: 0; }
.onglets { display: inline-flex; border: 1px solid var(--filet-fort); }
.onglets button { padding: 7px 13px; border: 0; background: var(--papier); color: var(--encre); font: inherit; font-size: var(--t-s); font-weight: 500; cursor: pointer; }
.onglets button + button { border-left: 1px solid var(--filet-fort); }
.onglets button[aria-pressed='true'] { background: var(--noir); color: #fff; }
.colonnes-choix { columns: 2; column-gap: 24px; }
.colonnes-choix .coche { break-inside: avoid; padding: 4px 0; }
.coches .coche { padding: 4px 0; }

/* -------------------------------------------------- Fenêtres, menus, avis */

.voile { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px; background: rgb(0 0 0 / 0.45); overflow-y: auto; }
.fenetre { width: min(640px, 100%); background: var(--papier); box-shadow: var(--ombre); animation: ouvrir 0.14s ease-out; }
.fenetre.large { width: min(900px, 100%); }
.fenetre-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 14px; border-bottom: 1px solid var(--filet); }
.fenetre-tete h2 { font-size: var(--t-xl); }
.fenetre-corps { padding: 20px 24px; }
.fenetre-pied { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid var(--filet); }
@keyframes ouvrir { from { opacity: 0; transform: translateY(8px); } }

.menu { position: relative; display: inline-block; }
.menu-liste { position: absolute; z-index: 40; right: 0; top: calc(100% + 4px); min-width: 236px; width: max-content; max-width: min(340px, 92vw); margin: 0; padding: 4px; list-style: none; background: var(--papier); border: 1px solid var(--filet-fort); box-shadow: var(--ombre); color: var(--encre); }
.menu-liste button, .menu-liste a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 11px; border: 0; background: none; color: var(--encre); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.menu-liste button:hover, .menu-liste a:hover { background: var(--gris); color: var(--noir); }
.menu-liste svg { flex: none; }
.menu-liste button.danger { color: var(--rouge); }
.menu-liste .sep { height: 1px; margin: 4px 0; background: var(--filet); }
.menu-liste .info { padding: 8px 11px; font-size: var(--t-s); color: var(--encre-douce); }

.annonces { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.annonce { padding: 12px 18px; border-left: 3px solid var(--or); background: var(--noir); color: #fff; box-shadow: var(--ombre); animation: ouvrir 0.14s ease-out; }
.annonce.erreur { border-left-color: #fff; background: var(--rouge); }

/* --------------------------------------------------------------- Connexion */

/* Trois colonnes d'agenda sous le logo ; le formulaire occupe celle du milieu. */
.connexion { min-height: 100vh; display: flex; flex-direction: column; }
.connexion .bandeau { position: static; }
.connexion .bandeau-nom { padding-right: 0; border-right: 0; }
.connexion-logo { display: flex; justify-content: center; padding: 30px 16px 26px; }
.connexion-logo img { display: block; height: 96px; width: auto; }
.connexion-grille { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(1080px, 100%); margin: 0 auto; border-right: 1px solid var(--filet); }
.connexion-grille .colonne { padding: 12px 30px 48px; border-left: 1px solid var(--filet); }
.heure { display: block; margin-bottom: 34px; font-size: 1.25rem; line-height: 1; color: var(--filet); user-select: none; }
.connexion-page h1 { font-size: 2.25rem; }
.connexion-note { margin: 10px 0 0; font-family: var(--main-levee); font-size: 1.1875rem; line-height: 1.5; color: var(--encre); }
.connexion-page .avis { margin: 22px 0 0; }
.connexion-page form { margin-top: 30px; display: grid; gap: 20px; }
.connexion-page input[type='text'], .connexion-page input[type='password'] { padding-inline: 0; border-width: 0 0 1px; border-color: var(--noir); background: transparent; }
.connexion-page .btn-principal { min-height: 42px; padding-inline: 26px; }
.connexion-page .ou { display: flex; align-items: center; gap: 12px; color: var(--encre-douce); font-size: var(--t-s); margin: 24px 0 0; }
.connexion-page .ou::before, .connexion-page .ou::after { content: ''; flex: 1; height: 1px; background: var(--filet-fort); }

.chargement { padding: 40px 0; color: var(--encre-douce); }
.journal-change { font-size: var(--t-s); margin: 2px 0 0; padding: 0; list-style: none; }
.journal-change li { padding: 1px 0; }
.journal-change del { color: var(--encre-douce); }
.journal-change ins { text-decoration: none; font-weight: 600; }
pre.rapport { margin: 0; white-space: pre-wrap; font: inherit; }

/* ------------------------------------------------------------- Petit écran */

@media (max-width: 900px) {
  :root { --bord: 16px; --t-xxl: 1.75rem; }
  .cahier { display: block; min-height: 0; }
  .marge { border-right: 0; border-bottom: 1px solid var(--filet); padding: 14px 16px; }
  .page { padding: 22px var(--bord) 64px; }
  .marge-liste.rubriques { display: flex; gap: 2px; overflow-x: auto; }
  .marge-liste.rubriques a { white-space: nowrap; width: auto; border-left: 0; border-bottom: 2px solid transparent; }
  .marge-liste.rubriques a[aria-current='page'] { border-bottom-color: var(--or); }
  .grille, .grille-3, .fiche, .deux-colonnes { grid-template-columns: minmax(0, 1fr); }
  .fiche > div.large { grid-template-columns: minmax(120px, 40%) minmax(0, 1fr); }
  .synthese { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .synthese .val { font-size: 2.25rem; }
  .dossier-tete { margin-top: -22px; padding-top: 20px; }
  .dossier-reperes li { padding-right: 16px; }
  /* Le bandeau garde la recherche et le compte ; l'enseigne empile logo et liens. */
  .bandeau-in { gap: 10px; }
  .bandeau-nom { display: none; }
  .bandeau-recherche { flex: 1; }
  .bandeau-fin .menu .bandeau-bouton span { display: none; }
  .enseigne-in { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 10px var(--bord) 4px; }
  .enseigne-logo { grid-row: 1; margin-bottom: 4px; }
  .enseigne-logo img { height: 44px; margin: 0 auto; }
  .enseigne-liens, .enseigne-liens:last-child { justify-content: center; gap: 24px; }
  .enseigne-liens a { font-size: var(--t-xs); }
  .calendrier .jour { min-height: 60px; }
  .colonnes-choix { columns: 1; }
  .connexion .bandeau-nom { display: block; }
  .connexion-logo { padding: 22px 16px 18px; }
  .connexion-logo img { height: 72px; }
  .connexion-grille { display: block; border-right: 0; }
  .connexion-grille .colonne { display: none; border-left: 0; padding: 4px 22px 40px; }
  .connexion-grille .connexion-page { display: block; }
  .heure { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .bandeau, .enseigne, .marge, .entete-actions, .btn, .annonces { display: none !important; }
  .cahier { display: block; }
  .page { padding: 0; }
  .dossier-tete { margin: 0 0 20px; padding: 0 0 16px; background: none; }
}
