/* ==========================================================================
   Espace Gouvernorat — « Registres de l'État du Texas », 1904.
   Même livre, même bougie : on passe du carnet de commerçant au registre
   officiel. Accents vert bouteille + or vieilli, alertes rouge sang séché.
   Tout est surcharge de variables : aucune feuille SIC n'est dupliquée.
   ========================================================================== */

:root {
  --gouv-vert: #1f5c3d;        /* vert bouteille profond */
  --gouv-vert-clair: #2e7a52;
  --gouv-or: #a8862f;          /* or vieilli */
  --gouv-or-clair: #c8a94f;
  --gouv-rouge: #7c2d26;       /* rouge sang séché */
  --gouv-rouge-vif: #a3352b;
  --gouv-ardoise: #46627a;
  --gouv-brun: #6b5744;
}

/* ---- Accueil officiel (page de connexion) ------------------------------ */
.accueil-officiel { gap: 12px; padding-bottom: 18px; }
.accueil-officiel::before { border-color: var(--gouv-or); border-width: 2px; opacity: 0.8; }
.accueil-officiel::after { border-color: rgba(31, 92, 61, 0.35); }

.accueil-sceau {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.accueil-officiel h1 {
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 2rem;
  margin: 2px 0;
}

.accueil-officiel .brand-tagline {
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
}

.accueil-filet {
  width: 70%;
  height: 7px;
  border-top: 2px solid var(--gouv-or);
  border-bottom: 1px solid var(--gouv-or);
  opacity: 0.75;
}

.accueil-mention {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.55;
}

#view-login .accueil-officiel .eyebrow { letter-spacing: 0.3em; }

/* ---- Bascule d'espace ------------------------------------------------- */
.espace-off { display: none !important; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.espace-switch {
  border: 1px solid var(--brass);
  color: var(--brass-light);
  letter-spacing: 0.04em;
}

body.espace-gouv .espace-switch { border-color: var(--gouv-or); color: var(--gouv-or-clair); }

/* Teinte institutionnelle du chrome en espace gouvernorat */
body.espace-gouv .topbar { border-bottom: 2px solid var(--gouv-or); }
body.espace-gouv .brand-compact { color: var(--gouv-or-clair); }

/* Sceau miniature devant le nom de l'État dans la barre du haut */
body.espace-gouv .brand-compact::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 9px;
  vertical-align: -5px;
  background: url("../icons/gouv-seal.svg") no-repeat center / contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Rail de 7 marque-pages : légèrement plus compact que les 5 de la SIC
   pour tenir à l'écran sans rien perdre en zone tactile (≥ 44 px). */
.gouv-tabs { gap: 10px; }
.gouv-tabs .nav-item { min-height: 106px; width: 94px; font-size: 0.86rem; }

/* Onglets marque-pages du gouvernorat : teintes institutionnelles */
#gouv-nav .nav-item[data-view="gouv-cabinet"] { background-color: var(--gouv-or); }
#gouv-nav .nav-item[data-view="gouv-entreprises"] { background-color: var(--gouv-vert); }
#gouv-nav .nav-item[data-view="gouv-personnel"] { background-color: var(--gouv-ardoise); }
#gouv-nav .nav-item[data-view="gouv-compta"] { background-color: #7a6420; }
#gouv-nav .nav-item[data-view="gouv-institutions"] { background-color: var(--gouv-brun); }
#gouv-nav .nav-item[data-view="gouv-calendrier"] { background-color: #67744a; }
#gouv-nav .nav-item[data-view="gouv-registre"] { background-color: #74424e; }
#gouv-nav .nav-item[data-view="gouv-parametres"] { background-color: #55524a; }

/* Les vues gouvernorat reprennent le parchemin, avec l'accent de l'État */
.gouv-view {
  --accent: var(--gouv-vert);
  --accent-strong: #17452e;
  --brass: var(--gouv-or);
  --brass-light: var(--gouv-or-clair);
}

.gouv-view .eyebrow { color: var(--gouv-or); }
.gouv-view h2, .gouv-view h3 { color: var(--ink-1904, #2b1f14); }

/* ---- Ornements officiels de l'État (immersion 1904) -------------------- */
/* Pied de page du livre : plus aucune mention de la compagnie ici — on est
   sur un document du gouvernement. */
body.espace-gouv .main-content::after {
  content: "★ \2002 ÉTAT DU TEXAS · BUREAU DU GOUVERNEUR · ANNO 1904 \2002 ★";
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: 0.24em;
  font-size: 0.78rem;
  color: rgba(122, 96, 38, 0.78);
}

/* Filigrane du sceau du Gouverneur sur CHAQUE page du gouvernorat, comme un
   gaufrage discret du papier officiel. */
.gouv-view .page-block { position: relative; }

.gouv-view .page-block::before {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 4px;
  width: 180px;
  height: 180px;
  background: url("../icons/gouv-seal.svg") no-repeat center / contain;
  opacity: 0.05;
  pointer-events: none;
}

/* Filet officiel sous chaque titre de page : double trait d'or interrompu
   par une étoile-médaillon, façon papier à en-tête d'administration. */
.gouv-view .section-header {
  border-bottom: 3px double var(--gouv-or);
}

.gouv-view .section-header::after {
  content: "★";
  width: auto;
  left: 50%;
  transform: translateX(-50%);
  bottom: -10px;
  border: none;
  color: var(--gouv-or);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 12px;
  background: linear-gradient(180deg, var(--paper, #ece0c6), var(--paper, #ece0c6));
}

/* Les cartes-panneaux du gouvernorat prennent un fin double cadre d'or aux
   angles adoucis, comme des encarts de registre officiel. */
.gouv-view .card-panel {
  box-shadow: inset 0 0 0 1px rgba(168, 134, 47, 0.22);
}

/* ---- Bandeau CYCLE EN COURS ------------------------------------------- */
.gouv-cycle-bandeau {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  border: 1px solid var(--gouv-or);
  background: linear-gradient(180deg, rgba(168, 134, 47, 0.10), rgba(168, 134, 47, 0.03));
  margin-bottom: 16px;
}

.gouv-cycle-eyebrow {
  margin: 0;
  font-variant: small-caps;
  letter-spacing: 0.35em;
  font-size: 0.8rem;
  color: var(--gouv-or);
  font-weight: 700;
}

.gouv-cycle-dates {
  margin: 2px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}

.gouv-cycle-fleche { color: var(--gouv-or); padding: 0 6px; }

/* ---- Compteurs / cartes stats ------------------------------------------ */
.gouv-compteurs { margin-bottom: 16px; }
.gouv-carte-lien { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.gouv-carte-lien:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.gouv-repartition { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }

.gouv-repartition-item {
  flex: 1 1 120px;
  border-left: 4px solid var(--col-couleur, var(--gouv-brun));
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.gouv-repartition-nombre { display: block; font-size: 1.5rem; font-weight: 700; font-family: "Playfair Display", serif; }
.gouv-repartition-libelle { font-size: 0.85rem; color: var(--text-muted); }

.gouv-echeances li { margin-bottom: 4px; }

/* ---- Tableau de statuts générique (gboard) ------------------------------
   Les colonnes se calent sur la largeur de la page : jamais de défilement
   horizontal — s'il y a trop de colonnes, elles passent à la ligne. */
.gboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: start;
  padding-bottom: 10px;
}

.gboard-col {
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid var(--border, #cbb98f);
  border-top: 3px solid var(--col-couleur, var(--gouv-brun));
  border-radius: 8px;
  min-height: 130px;
}

.gboard-col-over { outline: 2px dashed var(--col-couleur, var(--gouv-or)); outline-offset: -3px; }

/* Administrateur de la zone, en tête de colonne */
.gboard-col-extra:empty { display: none; }
.gouv-col-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 6px;
  font-size: 0.8rem;
  color: var(--text-muted, #6b5744);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: color-mix(in srgb, var(--col-couleur, #6b5744) 7%, transparent);
}
.gouv-col-admin strong { color: color-mix(in srgb, var(--col-couleur, #6b5744) 60%, var(--ink, #2c2118)); }
.gouv-col-admin-editable { cursor: pointer; }
.gouv-col-admin-editable:hover { background: color-mix(in srgb, var(--col-couleur, #6b5744) 14%, transparent); }
.gouv-col-admin-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border, #cbb98f);
  border-radius: 5px;
  background: var(--bg-2, #f6eed9);
  color: inherit;
  font: inherit;
  padding: 2px 7px;
}

.gboard-col-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.gboard-col-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--col-couleur); flex: none; }
.gboard-col-title { font-weight: 700; font-size: 0.92rem; flex: 1; min-width: 0; }
.gboard-col-count {
  background: var(--col-couleur);
  color: #f6efdc;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
  font-size: 0.8rem;
  padding: 1px 7px;
  font-weight: 700;
}

.gboard-col-edit {
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.45;
  font-size: 0.9rem;
}
.gboard-col-edit:hover { opacity: 1; }

.gboard-col-body { padding: 8px; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.gboard-empty { color: var(--text-subtle); font-size: 0.85rem; font-style: italic; margin: 8px 4px; }

.gboard-card {
  position: relative;
  background: var(--surface, #f3ead2);
  border: 1px solid var(--border, #cbb98f);
  border-left: 4px solid var(--col-couleur, var(--gouv-brun));
  border-radius: 6px;
  padding: 9px 11px 9px 24px;
  cursor: pointer;
  touch-action: pan-y;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  user-select: none;
  -webkit-user-select: none;
}

.gboard-card:hover { box-shadow: 0 3px 9px rgba(0, 0, 0, 0.18); }

.gboard-grip {
  position: absolute;
  left: 6px;
  top: 10px;
  color: var(--text-subtle);
  font-size: 0.85rem;
  cursor: grab;
}

.gboard-dragging { opacity: 0.35; border-style: dashed; }

.gboard-ghost {
  position: fixed;
  z-index: 400;
  pointer-events: none;
  transform: rotate(2.5deg) scale(1.03);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  opacity: 0.95;
}

body.gboard-drag-live { cursor: grabbing; }

.gboard-col-add {
  align-self: start;
  border: 1px dashed var(--border-strong, #a8977a);
  background: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-muted);
  font: inherit;
}
.gboard-col-add:hover { color: var(--ink-1904, #2b1f14); border-color: var(--gouv-or); }

/* Carte entreprise / agent */
.gouv-carte-haut { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.gouv-carte-nom { font-size: 1.05rem; }
.gouv-carte-meta { margin: 2px 0; font-size: 0.9rem; color: var(--text-muted); }
.gouv-carte-patron { margin: 2px 0; font-size: 0.92rem; }

.gouv-carte-gerant {
  margin: 2px 0;
  font-size: 0.85rem;
  color: var(--gouv-ardoise);
  font-weight: 600;
  border-left: 2px solid var(--gouv-ardoise);
  padding-left: 6px;
}
.gouv-carte-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; align-items: center; }
.gouv-carte-picto { color: var(--gouv-rouge-vif); font-size: 1.05rem; }

/* Contrôle fiscal demandé : bordure rouge vif partout */
.gboard-card.gouv-carte-controle { border-color: var(--gouv-rouge-vif); border-left-color: var(--gouv-rouge-vif); box-shadow: 0 0 0 1px var(--gouv-rouge-vif); }
.gouv-tr-controle td:first-child { box-shadow: inset 3px 0 0 var(--gouv-rouge-vif); }

.gouv-stamp-controle {
  display: inline-block;
  border: 2px solid var(--gouv-rouge-vif);
  color: var(--gouv-rouge-vif);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  transform: rotate(-3deg);
  border-radius: 2px;
  background: rgba(163, 53, 43, 0.06);
}

.gouv-stamp-fiche { font-size: 0.8rem; transform: rotate(-2deg); margin: 4px 0 10px; }

/* Sous surveillance (absence / sans nouvelles) : signalé en ambre partout */
.gboard-card.gouv-carte-surveillance { border-color: #b07d2a; border-left-color: #b07d2a; box-shadow: 0 0 0 1px #b07d2a; }
.gouv-stamp-surveillance {
  display: inline-block;
  border: 2px solid #b07d2a;
  color: #8a6d1f;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  transform: rotate(-3deg);
  border-radius: 2px;
  background: rgba(176, 125, 42, 0.08);
}
.gouv-ambre { color: #8a6d1f; }
.gouv-check-surveillance input:checked + * { color: #8a6d1f; }

.gouv-badge-licence {
  background: linear-gradient(180deg, var(--gouv-or-clair), var(--gouv-or));
  color: #241a06;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  border: 1px solid #7a6420;
}

.gouv-badge-grade {
  background: var(--col-couleur, var(--gouv-brun));
  color: #f6efdc;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 3px;
  white-space: nowrap;
}

.gouv-badge-sic { font-size: 0.7rem; color: #2f6275; font-weight: 700; }
.gouv-badge-auto {
  font-size: 0.66rem;
  border: 1px solid var(--gouv-ardoise);
  color: var(--gouv-ardoise);
  border-radius: 3px;
  padding: 0 4px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}
.gouv-badge-verrouille { font-size: 0.8rem; color: var(--gouv-vert); font-weight: 700; }

.gouv-pastille-impaye { color: var(--gouv-rouge-vif); font-weight: 700; font-size: 0.78rem; }
.gouv-pastille-retard { color: var(--gouv-rouge-vif); font-size: 0.72rem; font-weight: 700; }
.gouv-pastille-bientot { color: #9a6b23; font-size: 0.72rem; font-weight: 700; }
.gouv-rouge { color: var(--gouv-rouge-vif); }

/* ---- Tableaux registres -------------------------------------------------- */
.gouv-table-wrap { overflow-x: auto; }

.gouv-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }

/* Vue registre « lecture rapide » : gros, aéré, une ligne = une entreprise */
.gouv-table-simple { font-size: 1.08rem; }
.gouv-table-simple td { padding: 12px 14px; }
.gouv-table-simple tbody tr { cursor: pointer; }
.gouv-table-simple th { font-size: 0.8rem; }

.gouv-table th {
  text-align: left;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 10px;
  border-bottom: 2px solid var(--gouv-or);
  position: sticky;
  top: 0;
  background: var(--surface, #f3ead2);
  z-index: 2;
}

.gouv-table td { padding: 7px 10px; border-bottom: 1px solid rgba(90, 66, 32, 0.16); vertical-align: middle; }
.gouv-table tbody tr:nth-child(even) { background: rgba(90, 66, 32, 0.045); }
.gouv-table tbody tr:hover { background: rgba(168, 134, 47, 0.09); }
.gouv-table tfoot td { border-top: 2px solid var(--gouv-or); font-weight: 600; }
.gouv-table-mini { font-size: 0.86rem; }

.gouv-td-droite { text-align: right; font-variant-numeric: tabular-nums; }
.gouv-td-centre { text-align: center; }
.gouv-td-retard { color: var(--gouv-rouge-vif); font-weight: 700; }
.gouv-th-tri { cursor: pointer; user-select: none; }
.gouv-th-actif { color: var(--gouv-vert); }
.gouv-tr-inactif { opacity: 0.55; }
.gouv-tr-annulation { opacity: 0.75; font-style: italic; }
.gouv-mono { font-family: "Courier New", monospace; font-size: 0.88em; letter-spacing: 0.02em; }
.gouv-vide { padding: 18px 6px; text-align: center; }

.gouv-table-tete { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.gouv-total-permanent { margin: 0; }

.gouv-statut-puce {
  display: inline-block;
  border-left: 3px solid var(--col-couleur);
  padding-left: 6px;
  font-size: 0.85rem;
}

/* Édition en ligne */
.gouv-inline { border-bottom: 1px dashed var(--gouv-or); cursor: text; padding-bottom: 1px; }
.gouv-inline:hover { background: rgba(168, 134, 47, 0.12); }
.gouv-inline-input { width: 110px; font: inherit; padding: 1px 4px; }

/* Le Gouverneur fixe le solde à sa convenance : petit crayon sur les cartes */
.gouv-solde-editer {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gouv-or);
  font-size: 0.9rem;
  padding: 0 2px;
  vertical-align: baseline;
  opacity: 0.7;
}
.gouv-solde-editer:hover { opacity: 1; color: var(--gouv-vert); }

/* Bouton copier */
.gouv-copy {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gouv-or);
  font-size: 0.95rem;
  padding: 0 3px;
  vertical-align: middle;
}
.gouv-copy:hover { color: var(--gouv-vert); }

/* ---- Saisie comptable rapide -------------------------------------------- */
.gouv-saisie { margin-bottom: 14px; border-left: 4px solid var(--gouv-vert); }

.gouv-saisie-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}

.gouv-saisie-libelle { grid-column: span 2; }
.gouv-saisie-bouton { height: 42px; }

.gouv-budget-alerte {
  margin: 8px 0 0;
  font-size: 0.88rem;
  padding: 6px 10px;
  border-left: 3px solid var(--gouv-ardoise);
  background: rgba(70, 98, 122, 0.08);
}
.gouv-budget-depasse { border-left-color: var(--gouv-rouge-vif); background: rgba(163, 53, 43, 0.09); color: var(--gouv-rouge); font-weight: 600; }

/* Jauges budgétaires */
.gouv-budget-ligne { padding: 10px 4px; border-bottom: 1px solid rgba(90, 66, 32, 0.14); }
.gouv-budget-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.gouv-jauge { height: 9px; background: rgba(0, 0, 0, 0.09); border-radius: 5px; margin-top: 7px; overflow: hidden; }
.gouv-jauge-barre { height: 100%; border-radius: 5px; transition: width 0.3s ease; }
.gouv-jauge-vert { background: var(--gouv-vert-clair); }
.gouv-jauge-ambre { background: #b07d2a; }
.gouv-jauge-rouge { background: var(--gouv-rouge-vif); }

/* Grille des impositions */
.gouv-grille-impo .gouv-cell { min-width: 96px; }
.gouv-cell-label { display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.gouv-cell-payee { background: rgba(31, 92, 61, 0.14) !important; }
.gouv-cell-echue { background: rgba(163, 53, 43, 0.16) !important; }
.gouv-cell-encours { background: rgba(176, 125, 42, 0.16) !important; }

/* Graphique SVG */
.gouv-svg-chart { width: 100%; height: auto; margin: 8px 0 14px; color: var(--text-muted); }

/* ---- Fiches (document administratif) ------------------------------------ */
/* La fenêtre du gouvernorat est une feuille de registre : mêmes variables
   parchemin que .form-modal (book.css), accents institutionnels par-dessus. */
.gouv-modal {
  --bg-2: #f2e9d4;
  --surface: var(--paper);
  --surface-2: #e3d6b8;
  --surface-3: #d8c8a4;
  --ink: var(--ink-1904);
  --text: var(--ink-1904);
  --text-muted: #574329;
  --text-subtle: #7a6442;
  --frost: #241a0e;
  --border: #bca981;
  --border-strong: #9d855c;
  --rule: #b09a72;
  --accent: var(--gouv-vert);
  --accent-strong: #17452e;
  --accent-soft: #2e7a52;
  color: var(--ink);
  color-scheme: light;
}

.gouv-modal .cal-modal-card {
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, var(--paper-line) 31px 32px),
    radial-gradient(120% 80% at 30% 8%, rgba(255, 250, 236, 0.6), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(60, 42, 22, 0.5),
    inset 0 0 46px rgba(120, 90, 50, 0.16);
}

.gouv-modal .cal-modal-title,
.gouv-modal h3, .gouv-modal h4, .gouv-modal strong { color: var(--ink); }
.gouv-modal .cal-modal-close { color: var(--ink); }

.gouv-modal input,
.gouv-modal select,
.gouv-modal textarea {
  background-color: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(80, 55, 25, 0.2);
}

.gouv-modal input[type="date"]::-webkit-calendar-picker-indicator,
.gouv-modal input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  filter: sepia(1) saturate(2.2) hue-rotate(-12deg) brightness(0.55);
}

.gouv-modal .btn { border-radius: 7px 5px 8px 4px; }
.gouv-modal .btn-ghost { color: var(--ink); }
.gouv-modal .btn-danger { color: #962a20; border-color: rgba(140, 47, 36, 0.55); }
.gouv-modal .gouv-table th { background: var(--paper); }

.gouv-modal-card { max-width: 560px; }
.gouv-modal-large { max-width: 860px; width: min(94vw, 860px); }

.gouv-fiche-entete {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--gouv-or);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.gouv-fiche-sceau {
  width: 44px;
  height: 44px;
  flex: none;
  background: url("../icons/gouv-seal.svg") no-repeat center / contain;
  opacity: 0.85;
}

.gouv-fiche-etat { margin: 0; font-size: 0.72rem; letter-spacing: 0.22em; font-weight: 700; color: var(--gouv-vert); }
.gouv-fiche-dossier { margin: 1px 0 0; font-size: 0.8rem; color: var(--text-muted); }

.gouv-tampon {
  margin-left: auto;
  border: 3px solid var(--col-couleur);
  color: var(--col-couleur);
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  padding: 4px 12px;
  transform: rotate(-8deg);
  border-radius: 3px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.25);
}

.gouv-fiche-titre { display: flex; align-items: center; gap: 12px; }
.gouv-fiche-photo { width: 68px; height: 68px; object-fit: cover; border-radius: 6px; border: 2px solid var(--gouv-or); }
.gouv-fiche-sic { font-size: 0.88rem; border-left: 3px solid #2f6275; padding: 4px 10px; background: rgba(47, 98, 117, 0.07); }

.gouv-fiche-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px 20px;
  margin-top: 12px;
}

.gouv-fiche-bloc h4 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gouv-vert);
  border-bottom: 1px solid rgba(31, 92, 61, 0.35);
  padding-bottom: 3px;
}

.gouv-fiche-bloc-large { grid-column: 1 / -1; }
.gouv-fiche-bloc .field-label { margin-bottom: 7px; }
.gouv-ligne-info { margin: 4px 0; font-size: 0.92rem; }
.gouv-fiche-actions { margin-top: 14px; border-top: 1px solid rgba(90, 66, 32, 0.2); padding-top: 10px; }

.gouv-check-controle input:checked + * { color: var(--gouv-rouge-vif); }

.gouv-sousform { border: 1px dashed var(--border-strong, #a8977a); border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.gouv-sousform-grille { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 6px; }
.gouv-sousform-grille input[type="text"] { flex: 1 1 150px; }
.gouv-sousform-grille input, .gouv-sousform-grille select { padding: 6px 8px; }

.gouv-impo-duo { display: flex; gap: 6px; }
.gouv-impo-duo input { flex: 1; }

.gouv-licence-ligne { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 6px; }

/* Étapes d'une licence : Demandée → Mise en place → Payée (en dernier) */
.gouv-licence-etapes { border-bottom: 1px dashed rgba(90, 66, 32, 0.2); padding-bottom: 6px; }
.gouv-licence-titre { min-width: 150px; }
.gouv-licence-cases { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.gouv-licence-payee { font-weight: 700; color: var(--gouv-vert); }

.gouv-badge-licence-encours {
  border: 1px dashed var(--gouv-or);
  color: #7a6420;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.gouv-details { margin: 8px 0; }
.gouv-details summary { cursor: pointer; color: var(--gouv-vert); font-size: 0.88rem; }
.gouv-historique { margin: 6px 0 0; padding-left: 18px; font-size: 0.85rem; }
.gouv-historique li { margin-bottom: 3px; }

.gouv-demande { border-left: 3px solid var(--gouv-ardoise); padding: 6px 10px; margin-bottom: 8px; background: rgba(0, 0, 0, 0.03); border-radius: 0 5px 5px 0; }
.gouv-demande-accordee { border-left-color: var(--gouv-vert); }
.gouv-demande-refusee { border-left-color: var(--gouv-rouge-vif); }
.gouv-demande-tete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.gouv-demande-prio { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; }
.gouv-prio-haute { color: var(--gouv-rouge-vif); }
.gouv-prio-normale { color: var(--gouv-ardoise); }
.gouv-prio-basse { color: var(--text-subtle); }
.gouv-demande-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.gouv-demande-actions input { flex: 1 1 140px; }

.gouv-autosave { font-size: 0.7rem; color: var(--gouv-vert); }

/* ---- Institutions -------------------------------------------------------- */
.gouv-ville-bloc { margin-bottom: 16px; }
.gouv-ville-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }

.gouv-inst-bloc { border: 1px solid var(--border, #cbb98f); border-radius: 7px; padding: 10px 12px; }
.gouv-inst-banque { border-top: 3px solid var(--gouv-or); }
.gouv-inst-forces { border-top: 3px solid var(--gouv-ardoise); }
.gouv-inst-dispensaire { border-top: 3px solid var(--gouv-vert); }
.gouv-inst-bloc h4 { margin: 0 0 8px; font-size: 0.85rem; letter-spacing: 0.06em; }
.gouv-inst-carte { border-bottom: 1px dashed rgba(90, 66, 32, 0.25); padding: 5px 0; }
.gouv-inst-carte:last-of-type { border-bottom: none; }
.gouv-inst-nom { margin: 0; font-weight: 700; font-size: 0.92rem; }
.gouv-inst-carte p { margin: 2px 0; }
.gouv-inst-actions { margin-top: 4px; display: flex; gap: 6px; }

/* ---- Calendrier gouvernorat ---------------------------------------------- */
.gouv-cal-mois { padding: 0 10px; font-family: "Playfair Display", serif; }
.gouv-cal-legende { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.78rem; }
.gouv-cal-pastille::before { content: "●"; color: var(--c); margin-right: 4px; }

.gouv-cal-entetes { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 0 2px 6px; }
.gouv-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.gouv-cal-jour {
  min-height: 86px;
  border: 1px solid rgba(90, 66, 32, 0.18);
  border-radius: 4px;
  padding: 3px 4px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
}

.gouv-cal-jour:hover { background: rgba(168, 134, 47, 0.07); }
.gouv-cal-vide { visibility: hidden; }
.gouv-cal-aujourdhui { outline: 2px solid var(--gouv-or); outline-offset: -2px; }
.gouv-cal-num { font-weight: 700; }

.gouv-cal-evt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  border-left: 3px solid var(--c, var(--gouv-or));
  background: rgba(0, 0, 0, 0.04);
  border-radius: 0 3px 3px 0;
  font: inherit;
  font-size: 0.72rem;
  padding: 1px 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.gouv-cal-evt:hover { background: rgba(0, 0, 0, 0.09); }
.gouv-cal-evt-sic { opacity: 0.85; font-style: italic; }
.gouv-cal-tache { border-left-style: dotted; }
.gouv-cal-tache-faite { opacity: 0.55; text-decoration: line-through; }

/* ---- Budget hebdomadaire des institutions --------------------------------- */
.gouv-bud-scroll { overflow-x: auto; }
.gouv-bud-table { min-width: 720px; }
.gouv-bud-table th.gouv-bud-entite,
.gouv-bud-table td.gouv-bud-entite {
  text-align: left;
  min-width: 190px;
  position: sticky;
  left: 0;
  background: var(--surface, #f3ead3);
  z-index: 1;
}
.gouv-bud-ville { font-weight: normal; font-size: 0.82rem; color: var(--text-muted, #6b5744); }
.gouv-bud-section th {
  text-align: left;
  padding-top: 14px;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gouv-vert, #1f5c3d);
  border-bottom: 2px solid var(--gouv-or, #a8862f);
  position: sticky;
  left: 0;
}
.gouv-bud-cell { text-align: right; min-width: 108px; }
.gouv-bud-input {
  width: 96px;
  text-align: right;
  border: 1px solid var(--border, #cbb98f);
  border-radius: 5px;
  background: var(--bg-2, #fbf6e7);
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  padding: 4px 7px;
}
.gouv-bud-input:focus { border-color: var(--gouv-or, #a8862f); outline: none; }
.gouv-bud-input::placeholder { color: var(--text-subtle, #a09274); }
.gouv-bud-courante { background: color-mix(in srgb, var(--gouv-or, #a8862f) 12%, transparent); }
.gouv-bud-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gouv-or, #8a6d1f);
}
.gouv-bud-total { white-space: nowrap; }
.gouv-bud-soustotal td {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.045);
  border-top: 1px solid var(--gouv-or, #a8862f);
}
.gouv-bud-soustotal td.gouv-bud-entite { font-size: 0.85rem; color: var(--gouv-vert, #1f5c3d); }
.gouv-cal-evt-extra { font-size: 0.62rem; opacity: 0.85; white-space: nowrap; }

/* ---- Registre des actes --------------------------------------------------- */
.gouv-acte { margin-bottom: 12px; border-left: 4px solid #74424e; }
.gouv-acte-epingle { border-left-color: var(--gouv-or); box-shadow: 0 0 0 1px var(--gouv-or); }
.gouv-acte-tete { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.gouv-acte-type { font-size: 0.78rem; color: var(--gouv-vert); font-weight: 700; letter-spacing: 0.04em; }
.gouv-acte-contenu { margin-top: 6px; font-size: 0.94rem; line-height: 1.5; }
.gouv-acte-actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Documents officiels --------------------------------------------------- */
.gouv-doc-ligne {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(90, 66, 32, 0.16);
}

.gouv-doc-ligne:last-child { border-bottom: none; }
.gouv-doc-icone { font-size: 1.7rem; flex: none; }
.gouv-doc-texte { flex: 1; min-width: 0; }
.gouv-doc-texte p { margin: 1px 0 0; overflow: hidden; text-overflow: ellipsis; }
.gouv-doc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 720px) {
  .gouv-doc-ligne { flex-wrap: wrap; }
  .gouv-doc-actions { width: 100%; justify-content: flex-start; }
}

/* ---- Paramètres ----------------------------------------------------------- */
.gouv-etiquettes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }

.gouv-etiquette {
  border: 1px solid var(--border, #cbb98f);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.84rem;
  background: rgba(0, 0, 0, 0.03);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gouv-etiquette button { border: none; background: none; cursor: pointer; color: var(--gouv-rouge-vif); font-size: 0.8rem; padding: 0; }
.gouv-etiquette .gpar-type-bareme { color: var(--gouv-or); }
.gouv-etiquette-bareme { font-style: normal; font-size: 0.75rem; color: var(--gouv-vert); font-weight: 700; }

.gouv-bareme { border-left: 3px solid var(--gouv-or); padding-left: 8px; background: rgba(168, 134, 47, 0.07); }

/* ---- Divers ---------------------------------------------------------------- */
.section-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gouv-filtres .checkbox-label { align-self: end; padding-bottom: 10px; }
.gouv-vert { color: var(--gouv-vert); }

/* ---- Sélecteur de vues (Entreprises : Statuts · Registre · Imposition) ----- */
.gouv-vues { margin: 0; padding: 0; border: none; }

/* ---- Tableau d'imposition (entreprises × périodes fiscales) ---------------- */
.gouv-impo-nav { display: flex; gap: 6px; align-items: center; }
.gouv-impo-recherche { max-width: 240px; font: inherit; padding: 6px 10px; }
.gouv-impo-table th { vertical-align: bottom; }
.gouv-impo-table .gouv-impo-th-titre { display: block; font-size: 0.82rem; }
.gouv-impo-table .gouv-impo-th-dates { display: block; font-weight: 400; font-size: 0.74rem; letter-spacing: 0; text-transform: none; opacity: 0.85; }
.gouv-impo-th-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--gouv-or);
  color: #fdf8ec;
}
.gouv-impo-th-close { background: var(--gouv-brun); }
.gouv-impo-th-avenir { background: var(--gouv-ardoise); }
.gouv-impo-th-courant, .gouv-impo-td-courant { box-shadow: inset 2px 0 0 var(--gouv-or), inset -2px 0 0 var(--gouv-or); }
.gouv-impo-colnom { min-width: 160px; }
.gouv-impo-colreste { white-space: nowrap; font-variant-numeric: tabular-nums; border-right: 2px solid rgba(90, 66, 32, 0.25); }
.gouv-impo-reste-zero { color: inherit; opacity: 0.45; font-weight: 500; }

/* Colonne de saisie compacte : « ✎ Inscrire » ouvre l'infobulle — le tableau
   garde sa largeur pour les périodes. */
.gouv-impo-colsaisie { white-space: nowrap; }
.gi-ouvrir-saisie { padding: 3px 9px; font-size: 0.78rem; }

.gouv-impo-pop {
  position: fixed;
  z-index: 120;
  width: 250px;
  padding: 12px 14px;
  border: 1px solid var(--gouv-or);
  border-radius: 10px;
  background: linear-gradient(180deg, #f4ead2, #ecdfc0);
  box-shadow: 0 14px 34px rgba(20, 12, 5, 0.4);
}
.gouv-impo-pop-titre { margin: 0 0 8px; font-weight: 700; font-size: 0.95rem; color: #2c2013; }
.gouv-impo-pop-form { display: grid; gap: 8px; }
.gouv-impo-pop-form label { display: grid; gap: 3px; font-size: 0.78rem; font-weight: 600; color: var(--gouv-brun); }
.gouv-impo-pop-form input, .gouv-impo-pop-form select { font: inherit; font-size: 0.92rem; padding: 6px 8px; width: 100%; }
.gouv-impo-pop-aide { margin: 2px 0 0; font-size: 0.75rem; font-weight: 400; color: #6b5744; }
.gouv-impo-cell { min-width: 120px; }
.gouv-impo-montant { display: block; font-variant-numeric: tabular-nums; font-weight: 600; }
.gouv-impo-montant.gouv-inline { display: inline-block; }
.gouv-impo-actions { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.gouv-impo-paye, .gouv-impo-exo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  padding: 1px 8px;
  border: 1px solid rgba(90, 66, 32, 0.35);
  border-radius: 10px;
  font-size: 0.74rem;
  cursor: pointer;
  user-select: none;
}
.gouv-impo-paye input, .gouv-impo-exo input { margin: 0; cursor: pointer; }
.gouv-impo-paye.est-paye { border-color: var(--gouv-vert); color: var(--gouv-vert); font-weight: 700; }
.gouv-cell-echue .gouv-impo-paye:not(.est-paye) { border-color: var(--gouv-rouge-vif); color: var(--gouv-rouge-vif); }
/* Exonération : discrète tant qu'elle n'est pas en place */
.gouv-impo-exo:not(.est-exo) { opacity: 0.5; border-style: dashed; margin-top: 1px; }
.gouv-impo-exo:not(.est-exo):hover { opacity: 0.9; }
.gouv-impo-exo.est-exo { border-color: var(--gouv-ardoise); color: var(--gouv-ardoise); font-weight: 700; }
.gouv-cell-exoneree { background: rgba(70, 98, 122, 0.13) !important; }
.gouv-impo-exo-stamp { display: block; font-style: italic; font-weight: 700; letter-spacing: 0.05em; color: var(--gouv-ardoise); }
.gouv-impo-tf-encaisse { font-size: 0.78rem; color: var(--gouv-vert); font-weight: 600; }

/* ---- Journal Entrées & Sorties --------------------------------------------- */
.gouv-mvt-type { display: flex; gap: 8px; margin-bottom: 10px; }
.gouv-mvt-choix {
  flex: 0 1 auto;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.03);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.65;
}
.gouv-mvt-choix.actif { opacity: 1; transform: translateY(1px); }
.gouv-mvt-choix-entree.actif { border-color: var(--gouv-vert); color: var(--gouv-vert); background: rgba(31, 92, 61, 0.12); box-shadow: inset 0 -2px 0 var(--gouv-vert); }
.gouv-mvt-choix-sortie.actif { border-color: var(--gouv-rouge-vif); color: var(--gouv-rouge-vif); background: rgba(163, 53, 43, 0.10); box-shadow: inset 0 -2px 0 var(--gouv-rouge-vif); }
.gouv-mvt-tr-entree td:first-child { box-shadow: inset 3px 0 0 var(--gouv-vert); }
.gouv-mvt-tr-sortie td:first-child { box-shadow: inset 3px 0 0 var(--gouv-rouge-vif); }
.gouv-mvt-table .gouv-vert, .gouv-mvt-table .gouv-rouge { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* ---- Paramètres : titres de groupes ---------------------------------------- */
.gouv-param-titre {
  margin: 18px 0 10px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gouv-or);
  border-bottom: 2px solid var(--gouv-or);
  padding-bottom: 4px;
}
.gouv-param-titre:first-child { margin-top: 0; }

/* ---- Recherche globale (topbar) --------------------------------------------- */
.gouv-recherche-wrap { position: relative; flex: 1 1 auto; max-width: 430px; display: none; min-width: 0; }
body.espace-gouv .gouv-recherche-wrap { display: block; }
.gouv-recherche-wrap input {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(200, 161, 60, 0.55);
  background: rgba(20, 14, 8, 0.5);
  color: #f0e4c8;
}
.gouv-recherche-wrap input::placeholder { color: rgba(232, 217, 186, 0.55); }
.gouv-recherche-wrap input:focus { outline: none; border-color: var(--gouv-or-clair); box-shadow: 0 0 0 2px rgba(200, 169, 79, 0.25); }
.gouv-recherche-resultats {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 80;
  max-height: 62vh;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--gouv-or);
  border-radius: 10px;
  background: linear-gradient(180deg, #f2e8d0, #eadfc2);
  box-shadow: 0 14px 34px rgba(20, 12, 5, 0.45);
}
.gouv-rech-groupe {
  margin: 8px 8px 2px;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gouv-brun);
}
.gouv-rech-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  color: #2c2013;
}
.gouv-rech-item:hover { background: rgba(168, 134, 47, 0.16); }
.gouv-rech-item strong { display: block; font-size: 0.94rem; }
.gouv-rech-item span { display: block; font-size: 0.8rem; color: #6b5744; }
.gouv-rech-vide { margin: 12px 10px; color: #6b5744; font-size: 0.9rem; }

/* ---- Vue du jour : en-tête daté + alertes du cabinet ------------------------ */
.gouv-jour-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 4px 0 6px; }
.gouv-jour-date { margin: 0; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; }
.gouv-jour-rdv { margin: 0; font-size: 0.92rem; color: var(--gouv-brun); }

.gouv-alerte {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 8px 0;
  border: 1px solid rgba(90, 66, 32, 0.35);
  border-left-width: 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gouv-alerte:hover { transform: translateX(2px); box-shadow: 0 2px 8px rgba(40, 26, 12, 0.18); }
.gouv-alerte-calme { cursor: default; border-color: var(--gouv-vert); background: rgba(31, 92, 61, 0.07); }
.gouv-alerte-calme:hover { transform: none; box-shadow: none; }
.gouv-alerte-rouge { border-color: var(--gouv-rouge-vif); background: rgba(163, 53, 43, 0.07); }
.gouv-alerte-ambre { border-color: var(--gouv-or); background: rgba(168, 134, 47, 0.08); }
.gouv-alerte-icone { font-size: 1.45rem; flex: none; }
.gouv-alerte-texte { flex: 1; min-width: 0; }
.gouv-alerte-texte p { margin: 2px 0 0; font-size: 0.88rem; color: var(--text-muted); }
.gouv-alerte-nom {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline dotted;
  cursor: pointer;
}
.gouv-alerte-nom:hover { color: var(--gouv-or); }
.gouv-alerte-fleche { font-weight: 700; opacity: 0.55; flex: none; }

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 720px) {
  /* La barre du haut ne doit jamais déborder : bascule en icône seule. */
  .espace-switch-label { display: none; }
  .espace-switch { padding: 8px 10px; font-size: 1rem; }
  .topbar-right { flex: none; }
  .topbar-left { min-width: 0; }
  .topbar-left .page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* La recherche passe sur sa propre ligne, pleine largeur. */
  body.espace-gouv .topbar { flex-wrap: wrap; padding: 10px 14px; }
  .gouv-recherche-wrap { order: 3; flex: 1 1 100%; max-width: none; }
  .gouv-recherche-wrap input { padding: 9px 12px; }

  /* Compteurs : deux par ligne plutôt qu'une colonne interminable. */
  .gouv-compteurs.grid-4 { grid-template-columns: repeat(2, 1fr); }
  .gouv-compteurs .card-panel { padding: 12px 14px; }
  .gouv-compteurs strong { font-size: 1.05rem; }

  /* L'infobulle de saisie prend toute la largeur du téléphone. */
  .gouv-impo-pop { left: 10px !important; right: 10px; width: auto; }

  .gboard { grid-template-columns: 1fr; }
  .gouv-fiche-grille { grid-template-columns: 1fr; }
  .gouv-tabs .nav-item { min-height: 60px; width: auto; }
  .gouv-cycle-dates { font-size: 1.05rem; }
  .gouv-cal-jour { min-height: 64px; }
  .gouv-saisie-libelle { grid-column: span 1; }
  .gouv-view .page-block::before { width: 110px; height: 110px; opacity: 0.04; }
  .gouv-modal-large { width: 96vw; }
  .espace-switch { font-size: 0.8rem; padding: 6px 8px; }
}

/* ---- Mouvement réduit ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .gouv-carte-lien, .gouv-jauge-barre { transition: none; }
  .gboard-ghost { transform: none; }
}
