/* icardo OPR — pages du serveur (connexion, projets, sociétés). Même identité que l'écran terrain :
   couleurs de la famille Icordia (Tradis : crème, encre, indigo, corail), police Akrobat, logo en Bricolage Grotesque. */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-ext-E7qegro.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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: 'Bricolage Grotesque'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-ZzKOOYL.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: 'Akrobat'; src: url("../fonts/akrobat-regular-JgAhQFJ.otf") format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Akrobat'; src: url("../fonts/akrobat-semibold-NBGmvWF.otf") format('opentype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Akrobat'; src: url("../fonts/akrobat-bold-nJzMWP4.otf") format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Akrobat'; src: url("../fonts/akrobat-extrabold-p03CO4P.otf") format('opentype'); font-weight: 800; font-display: swap; }
:root {
  --encre: #16171D; --texte: #26272E; --doux: #55565E; --pale: #9A9BA3;
  --trait: #ECE8E0; --trait-fort: #D9D4CA; --fond: #F1ECE3; --surface: #fff; --survol: #F7F4EE;
  --accent: #2B35D9; --accent-fonce: #1F27B0; --accent-clair: #E7E8FB; --corail: #FF7A59;
  --rouge: #B42318; --vert: #14724A;
  --ombre: 0 1px 2px rgba(22, 23, 29, .05), 0 8px 24px rgba(22, 23, 29, .07);
  --logo: 'Bricolage Grotesque', 'Helvetica Neue', sans-serif;
  font-family: 'Akrobat', 'Helvetica Neue', Helvetica, Arial, sans-serif; color: var(--texte); letter-spacing: .01em; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); min-height: 100vh; }
a { color: var(--accent-fonce); }

/* ---------- bandeau : logo façon Tradis + navigation ---------- */
.bandeau { color: var(--encre); padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 72px; }
.marque { font-family: var(--logo); font-weight: 700; font-size: 22px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; }
.marque-texte > span { font-weight: 500; }
.marque::before {
  content: ''; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(var(--fond), var(--fond)) center / 14px 2.6px no-repeat,
              linear-gradient(var(--fond), var(--fond)) center / 2.6px 14px no-repeat, var(--encre);
}
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 16px; }
.nav a { color: var(--encre); text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.nav a:hover { background: rgba(255, 255, 255, .7); }
.nav a[aria-current="page"] { background: var(--encre); color: var(--fond); }
.nav .qui { color: var(--doux); padding: 0 6px 0 14px; }
.nav .sortie { font-weight: 600; color: var(--doux); }

/* ---------- mise en page ---------- */
.page { padding: 8px 16px 48px; max-width: 960px; margin: 0 auto; }
.page-large { max-width: 1280px; }
.acces { padding: 7vh 16px; }
.carte { background: var(--surface); max-width: 440px; margin: 0 auto; padding: 34px 30px; border-radius: 20px; box-shadow: var(--ombre); }
.carte-large { max-width: 720px; }
.carte h1, .tete-page h1 { margin: 0 0 18px; font-size: 30px; font-weight: 800; color: var(--encre); letter-spacing: .01em; }
.tete-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.tete-page h1 { font-size: 40px; margin: 0; line-height: 1.05; }
.surtitre { margin: 0 0 4px; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--doux); }
.surtitre a { color: var(--doux); text-decoration: none; }
.surtitre a::before { content: '← '; }
.sous-titre { margin: 8px 0 0; color: var(--doux); font-size: 17px; }
.intro, .note { color: var(--doux); line-height: 1.45; }
.note { font-size: 14px; }

/* ---------- formulaires ---------- */
form { display: flex; flex-direction: column; }
form div { display: flex; flex-direction: column; }
label { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--doux); margin: 14px 0 6px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--encre); border: 1px solid var(--trait-fort); border-radius: 10px; padding: 10px 12px; min-height: 46px; background: #fff; transition: border-color .15s, box-shadow .15s; width: 100%; }
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-clair); }
input[type="checkbox"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); margin: 0; flex: none; }
.help-text, form small, [id$="_help"] { font-size: 13px; color: var(--doux); margin-top: 6px; text-transform: none; letter-spacing: .01em; }
button { font: inherit; font-weight: 700; font-size: 16px; letter-spacing: .03em; margin-top: 22px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--encre); background: transparent; color: var(--encre); cursor: pointer; transition: background .15s; }
button.principal { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(43, 53, 217, .25); }
button.principal:hover { background: var(--accent-fonce); }
button.danger { border-color: transparent; color: var(--rouge); background: #FDECEC; }
.grille-2, .grille-3 { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.case { flex-direction: row !important; align-items: center; gap: 10px; min-height: 46px; margin-top: 14px; }
.case label { margin: 0; text-transform: none; letter-spacing: .01em; font-size: 16px; color: var(--encre); font-weight: 600; }
.case-modele { background: var(--accent-clair); border-radius: 12px; padding: 12px 14px; margin-top: 20px; }
.lien-secondaire { margin-top: 20px; text-align: center; font-size: 15px; }
.lien-secondaire a, .carte a { color: var(--accent-fonce); font-weight: 700; }
.alerte { padding: 11px 16px; border-radius: 12px; margin: 0 auto 16px; max-width: 720px; font-weight: 600; }
.alerte-erreur { background: #FDECEC; color: var(--rouge); }
.alerte-succes { background: #E3F4EB; color: var(--vert); }
.alerte p { margin: 0; }
.alerte p + p { margin-top: 6px; font-weight: 500; }
.alerte a { color: inherit; }
/* Mot de passe : bouton « Afficher » posé dans le champ (assets/mot-de-passe.js). */
.mdp-zone { position: relative; display: block; }
.mdp-zone input { padding-right: 96px; }
.mdp-afficher { position: absolute; right: 6px; margin: 0; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.mdp-afficher:hover, .mdp-afficher:focus-visible { background: var(--accent-clair); outline: none; }
ul li { color: var(--rouge); font-size: 14px; list-style: none; margin-left: -40px; text-transform: none; letter-spacing: .01em; }
.bouton-principal { display: inline-flex; align-items: center; justify-content: center; text-align: center; background: var(--accent); color: #fff !important; text-decoration: none; min-height: 50px; padding: 0 24px; border-radius: 999px; font-weight: 700; letter-spacing: .03em; box-shadow: 0 6px 18px rgba(43, 53, 217, .25); }
.bouton-principal:hover { background: var(--accent-fonce); }
.carte .bouton-principal { display: flex; margin-top: 20px; }

/* ---------- liste des projets ---------- */
.projets { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.projets li { margin: 0; color: inherit; font-size: inherit; }
.tuile-projet { display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 22px; background: var(--surface); border-radius: 20px; box-shadow: var(--ombre); text-decoration: none; color: var(--encre); border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.tuile-projet:hover { border-color: var(--accent); transform: translateY(-2px); }
.tuile-projet.livre { opacity: .7; }
.tuile-nom { font-size: 24px; font-weight: 800; line-height: 1.1; }
.tuile-adresse { color: var(--doux); font-size: 15px; }
.tuile-meta { margin-top: auto; color: var(--doux); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pastille-etat { font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; background: var(--encre); color: var(--fond); }
.vide { background: var(--surface); border-radius: 24px; padding: 48px 32px; text-align: center; box-shadow: var(--ombre); margin-bottom: 24px; }
.vide h2 { margin: 0 0 10px; font-size: 30px; color: var(--encre); }
.vide p { max-width: 520px; margin: 0 auto 22px; color: var(--doux); line-height: 1.5; }

/* ---------- fiche projet : blocs, tableaux, édition en ligne ---------- */
.bloc { background: var(--surface); border-radius: 20px; box-shadow: var(--ombre); padding: 22px 24px; margin-bottom: 18px; }
.bloc h2 { margin: 0 0 14px; font-size: 24px; color: var(--encre); display: flex; align-items: center; gap: 10px; }
details.bloc > summary { cursor: pointer; list-style: none; }
details.bloc > summary::-webkit-details-marker { display: none; }
details.bloc > summary h2 { margin: 0; display: inline-flex; }
details.bloc > summary h2::after { content: '›'; color: var(--doux); transform: rotate(90deg); transition: transform .15s; }
details.bloc[open] > summary h2::after { transform: rotate(-90deg); }
.compte { font-size: 14px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--fond); color: var(--doux); }
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -8px; }
.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--doux); padding: 8px; border-bottom: 1px solid var(--trait); }
.tableau td { padding: 11px 8px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.tableau td a { color: var(--accent-fonce); text-decoration: none; }
.tableau strong { color: var(--encre); }
.tableau .manque { color: var(--corail); font-weight: 700; }
.nowrap { white-space: nowrap; }
.actions { text-align: right; width: 1%; }
details.modifier summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--accent-fonce); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
details.modifier summary::-webkit-details-marker { display: none; }
details.modifier summary:hover { background: var(--accent-clair); }
details.modifier[open] summary { background: var(--encre); color: var(--fond); }
/* La ligne d'édition n'apparaît que quand « Modifier » est ouvert (sans JavaScript : CSS :has). */
tr.edition { display: none; }
tr:has(details.modifier[open]) + tr.edition { display: table-row; }
tr:has(details.modifier[open]) td { border-bottom-color: transparent; }
tr.edition > td { background: var(--survol); padding: 14px 16px 16px; border-radius: 0 0 14px 14px; }
/* Champs en ligne qui passent à la ligne d'eux-mêmes (coordonnées : société, contact, e-mail, 2 téléphones, adresse). */
.ligne-form { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ligne-form .ch { display: flex; flex-direction: column; margin: 0; flex: 1 1 170px; min-width: 0; }
.ligne-form .ch-court { flex: 0 1 90px; }
.ligne-form .ch-cp { flex: 0 1 110px; }
.ligne-form .ch-tel { flex: 1 1 150px; }
.ligne-form .ch-large { flex: 2 1 260px; }
.ligne-form .ch span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); margin-bottom: 5px; }
.ligne-form input { min-height: 42px; padding: 8px 10px; font-size: 15px; }
.ligne-form button { margin: 0; min-height: 42px; flex: none; }
form.ligne-form .ch-societe input { border-color: var(--accent); background: #fff; }
.retirer { margin-top: 10px; align-items: flex-start; }
.retirer button { margin: 0; min-height: 38px; font-size: 14px; }
/* Appareils (S8) */
.appareils .retirer { margin: 6px 0 0; }
.appareils .actions { text-align: right; white-space: nowrap; }
.confirmer summary { display: inline-block; cursor: pointer; list-style: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--rouge); background: #FDECEC; }
.confirmer summary::-webkit-details-marker { display: none; }
.confirmer[open] summary { background: transparent; color: var(--doux); }
.confirmer[open] summary::before { content: '✕ '; }
.appareils tr.revoque td { color: var(--pale); }
.appareils tr.revoque strong { text-decoration: line-through; }
@media (max-width: 640px) {
  .appareils thead { display: none; }
  .appareils, .appareils tbody, .appareils tr, .appareils td { display: block; width: auto; }
  .appareils tr { padding: 12px 0; border-bottom: 1px solid var(--trait-fort); }
  .appareils td { border: 0; padding: 2px 0; }
  .appareils td[data-libelle]::before { content: attr(data-libelle) ' : '; color: var(--doux); }
  .appareils td.actions { padding-top: 8px; }
}
.badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-clair); color: var(--accent-fonce); vertical-align: 1px; }
.ajout { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--trait-fort); }
.ajout-titre { flex: 1 1 100%; margin: 0; font-weight: 800; color: var(--encre); font-size: 16px; }
.ajout-titre small { font-weight: 500; color: var(--doux); font-size: 14px; margin-left: 6px; }

/* Lots : un <tbody> par lot (une ligne par entreprise), la ligne d'édition s'ouvre pour tout le lot. */
.bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bloc-tete h2 { margin: 0; }
button.discret { margin: 0; min-height: 38px; padding: 0 16px; font-size: 14px; border-color: var(--trait-fort); color: var(--doux); }
button.discret:hover { border-color: var(--encre); color: var(--encre); }
tbody.lot:has(details.modifier[open]) tr.edition { display: table-row; }
tbody.lot:has(details.modifier[open]) td { border-bottom-color: transparent; }
tbody.lot > tr:not(.edition) > td { vertical-align: top; }
tbody.lot td.actions { padding-top: 5px; }
tr.ligne-lot-suite td { padding-top: 6px; }
tbody.lot > tr.ligne-lot:has(+ tr.ligne-lot-suite) > td:not([rowspan]) { border-bottom-style: dashed; }
tbody.lot:target > tr:first-child > td { background: var(--accent-clair); transition: background 1.5s; }
.actions-lot { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
form.ordre { display: flex; flex-direction: row; gap: 2px; margin: 0; }
.ordre button { margin: 0; min-height: 32px; width: 32px; padding: 0; border: 0; border-radius: 8px; font-size: 16px; color: var(--doux); }
.ordre button:hover:not(:disabled) { background: var(--accent-clair); color: var(--accent-fonce); }
.ordre button:disabled { opacity: .25; cursor: default; }
.telephones a { display: block; line-height: 1.5; }
.tel-type { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pale); display: inline-block; min-width: 58px; }
small.adresse { display: block; color: var(--doux); font-size: 13px; margin-top: 2px; }
.sous-bloc { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--trait); }
.sous-titre-bloc { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--doux); }
.actions-bas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--trait); }
.actions-bas button { margin: 0; min-height: 38px; font-size: 14px; }
.formulaire button { align-self: flex-start; }

@media (max-width: 900px) {
  .ligne-form .ch, .ligne-form .ch-large { flex-basis: 45%; }
  .ligne-form button { flex: 1 1 100%; }
  .grille-2, .grille-3 { grid-template-columns: 1fr; }
  .tete-page h1 { font-size: 32px; }
  .nav .qui { display: none; }
}

/* comptes rendus (lot 4) */
.empreinte { font-size: 13px; color: var(--doux); }
#comptes-rendus .ligne-form select { min-height: 42px; padding: 8px 10px; font-size: 15px; }
.actions-tete { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bouton-secondaire { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--trait-fort); background: var(--surface); color: var(--encre) !important; text-decoration: none; font-weight: 700; letter-spacing: .03em; }
.bouton-secondaire:hover { border-color: var(--accent); }
#comptes-rendus .defile { margin-top: 18px; }
.ouvrir-cr { text-align: right; }
.ouvrir-cr small { color: var(--doux); margin-left: 6px; }

/* Page Agence : aperçu du logo tel qu'il sortira en tête de fiche. */
.logo-apercu { display: flex; align-items: center; min-height: 96px; padding: 16px 20px; margin: 4px 0 16px; border: 1px dashed var(--doux); border-radius: 14px; background: #fff; }
.logo-apercu img { max-height: 72px; max-width: min(320px, 100%); object-fit: contain; }
.logo-texte { font-size: 22px; font-weight: 700; letter-spacing: 1px; color: var(--encre); }
.logo-envoi input[type=file] { padding: 8px; background: #fff; }
#logo-retirer { margin-top: 14px; }

/* Beta (APP_BETA=1) : bandeau posé par EnvironnementBeta en tête de chaque page. */
.bandeau-beta { background: #E07A1E; color: #fff; text-align: center; font-size: 13px; letter-spacing: .02em; padding: 5px 12px; line-height: 1.3; }
.bandeau-beta strong { letter-spacing: .12em; }
