/* =============================================================================
   Gérance360 - feuille de style du logiciel (agences, console RMZ, pages simples)
   ============================================================================= */
:root {
  --lagune: #0B4F5C;        /* couleur de la plateforme (remplacée par celle de l'agence) */
  --lagune-fonce: #083A44;
  --or: #E0A526;            /* accent : un seul usage par écran */
  --encre: #13232B;
  --encre-2: #4A5A63;
  --brume: #F3F6F6;
  --carte: #FFFFFF;
  --ligne: #DCE3E4;
  --paye: #2E7D4F;
  --retard: #B83A25;
  --alerte: #A86B00;
  --rayon: 10px;
  --police: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--police); font-size: 15px; line-height: 1.5;
  color: var(--encre); background: var(--brume);
  font-variant-numeric: tabular-nums;
}
a { color: var(--lagune); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

/* --- marque ---------------------------------------------------------------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.marque { display: inline-flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; }
.marque-nom { font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.marque-nom b { font-weight: 800; }

/* --- boutons et formulaires ------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; padding: .62rem 1.1rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--lagune); background: var(--lagune); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--lagune-fonce); border-color: var(--lagune-fonce); }
.btn-second { background: transparent; color: var(--lagune); }
.btn-second:hover { background: rgba(11, 79, 92, .07); color: var(--lagune); }
.btn-danger { background: var(--retard); border-color: var(--retard); }
.btn-danger:hover { background: #962E1C; border-color: #962E1C; }
.btn-plein { width: 100%; }
.btn-lien { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }

.champ { margin-bottom: 1rem; }
.champ label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.champ .aide { font-size: .82rem; color: var(--encre-2); margin-top: .25rem; }
.champ .erreur-champ { font-size: .84rem; color: var(--retard); margin-top: .25rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: .6rem .7rem; border: 1px solid #B9C5C8; border-radius: 8px;
  background: #fff; color: var(--encre);
}
input:focus, select:focus, textarea:focus { border-color: var(--lagune); outline: 2px solid rgba(11, 79, 92, .25); outline-offset: 0; }
.champ.en-erreur input, .champ.en-erreur select { border-color: var(--retard); }
.champ.inactif label, .champ.inactif .aide { opacity: .5; }
input:disabled, select:disabled, textarea:disabled { background: #EEF2F3; color: #8A979D; border-color: #D3DCDE; cursor: not-allowed; }
.apercu-adresse { margin: -.6rem 0 1rem; font-size: .88rem; color: var(--lagune); font-weight: 600; min-height: 1.2em; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
legend { font-weight: 700; font-size: 1.02rem; margin-bottom: .8rem; padding: 0; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* --- messages --------------------------------------------------------------- */
.message { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border-left: 4px solid; background: #fff; }
.message.ok { border-color: var(--paye); }
.message.erreur { border-color: var(--retard); color: #7A2414; background: #FBEDEA; }
.message.info { border-color: var(--lagune); }
.bandeau { padding: .55rem 1rem; font-size: .9rem; text-align: center; }
.bandeau.alerte { background: #FCEFD2; color: #6B4600; }
.bandeau.critique { background: var(--retard); color: #fff; }

/* --- page simple (connexion, erreurs) --------------------------------------- */
.page-simple { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.carte-simple { width: 100%; max-width: 420px; background: var(--carte); border-radius: 14px; padding: 28px; box-shadow: 0 1px 0 var(--ligne), 0 12px 32px -18px rgba(8, 58, 68, .35); }
.carte-simple .entete { display: flex; flex-direction: column; gap: .2rem; margin-bottom: 1.4rem; }
.carte-simple .entete .agence-nom { font-size: 1.25rem; font-weight: 700; }
.carte-simple .entete .agence-sous { color: var(--encre-2); font-size: .9rem; }
.pied-simple { margin-top: 1.4rem; font-size: .82rem; color: var(--encre-2); text-align: center; }
.pied-simple .marque { color: var(--lagune); }
.texte-erreur { white-space: pre-wrap; }

/* --- logiciel : menu fixe à gauche + contenu --------------------------------- */
.appli { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.menu {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--lagune-fonce); color: #E6EFF0; display: flex; flex-direction: column;
}
.menu-entete { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.menu-agence { font-weight: 700; font-size: 1.02rem; color: #fff; line-height: 1.25; }
.menu-sous { font-size: .8rem; color: #A9C3C7; margin-top: 2px; }
.menu nav { padding: 10px 8px; flex: 1; }
.menu-titre { font-size: .78rem; color: #8FB0B5; padding: 14px 10px 4px; }
.menu a.menu-lien {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; border-radius: 7px;
  color: #E6EFF0; text-decoration: none; font-size: .93rem;
}
.menu a.menu-lien svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.menu a.menu-lien:hover { background: rgba(255,255,255,.07); }
.menu a.menu-lien.actif { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--or); }
.menu .menu-lien.bientot { opacity: .45; pointer-events: none; }
.menu-pied { padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: .78rem; color: #8FB0B5; }
.menu-pied .marque { color: #CFE0E2; }

.zone { min-width: 0; display: flex; flex-direction: column; }
.barre {
  height: 58px; background: #fff; border-bottom: 1px solid var(--ligne);
  display: flex; align-items: center; gap: 1rem; padding: 0 24px; position: sticky; top: 0; z-index: 5;
}
.barre-titre { font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-moi { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.pastille { width: 34px; height: 34px; border-radius: 50%; background: var(--lagune); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.contenu { padding: 24px; max-width: 1180px; width: 100%; }
.bouton-menu { display: none; background: none; border: 0; padding: 6px; margin-left: -6px; color: var(--encre); cursor: pointer; }

/* --- blocs de contenu --------------------------------------------------------- */
.panneau { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 20px; margin-bottom: 20px; }
.panneau > h2:first-child { margin-top: 0; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--ligne); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; margin-bottom: 20px; }
.chiffre { background: #fff; padding: 16px 18px; }
.chiffre-valeur { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.chiffre-libelle { font-size: .88rem; color: var(--encre-2); }

table.liste { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.liste th { text-align: left; font-weight: 600; color: var(--encre-2); font-size: .82rem; padding: .55rem .7rem; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
table.liste td { padding: .6rem .7rem; border-bottom: 1px solid #EDF1F2; vertical-align: top; }
table.liste tr:hover td { background: #F8FAFA; }
table.liste .nombre { text-align: right; }
.tableau-defile { overflow-x: auto; }
.vide { padding: 28px 12px; text-align: center; color: var(--encre-2); }

.etiquette { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.etiquette.essai { color: var(--alerte); border-color: #E7C887; background: #FDF6E6; }
.etiquette.active { color: var(--paye); border-color: #A9D3B9; background: #EEF7F1; }
.etiquette.suspendue { color: var(--retard); border-color: #E9B3A8; background: #FBEDEA; }
.etiquette.resiliee, .etiquette.a_confirmer { color: var(--encre-2); border-color: var(--ligne); background: #F3F5F6; }

.onglets-filtre { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.onglets-filtre a { padding: .35rem .75rem; border-radius: 99px; border: 1px solid var(--ligne); background: #fff; text-decoration: none; color: var(--encre); font-size: .88rem; }
.onglets-filtre a.actif { background: var(--encre); border-color: var(--encre); color: #fff; }

.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.15rem; background: #FFF8E6; border: 1px dashed var(--or); padding: .5rem .8rem; border-radius: 8px; display: inline-block; letter-spacing: .04em; }
dl.fiche { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; }
dl.fiche dt { color: var(--encre-2); }
dl.fiche dd { margin: 0; font-weight: 500; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.resultat-test td:first-child { width: 2.2rem; }
.ok-texte { color: var(--paye); font-weight: 700; }
.ko-texte { color: var(--retard); font-weight: 700; }

/* --- console RMZ : même ossature, menu encre pour ne pas la confondre ------- */
.console .menu { background: var(--encre); }
.console .menu a.menu-lien.actif { box-shadow: inset 3px 0 0 var(--or); }

/* --- téléphone ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .appli { grid-template-columns: 1fr; }
  .menu { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; }
  .appli.menu-ouvert .menu { transform: none; box-shadow: 0 0 0 100vmax rgba(8, 30, 36, .45); }
  .bouton-menu { display: inline-flex; }
  .barre { padding: 0 16px; }
  .contenu { padding: 16px; }
  .barre-moi .nom-complet { display: none; }
  table.liste.empilable thead { display: none; }
  table.liste.empilable tr { display: block; border-bottom: 1px solid var(--ligne); padding: .4rem 0; }
  table.liste.empilable td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .25rem .2rem; }
  table.liste.empilable td::before { content: attr(data-libelle); color: var(--encre-2); font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
