/* ==========================================================================
   Drekan Suite — même charte que Projets et Campus (rouge #E3262E, gris neutres, fonds clairs)
   ========================================================================== */
:root {
  --marine: #2b2e33; --rouge: #E3262E; --acier: #b81f26; --encre: #1f2226; --gris: #5f636a; --gris-clair: #9ea2a9;
  --trait: #e3e5e9; --fond: #f5f6f8; --grille: rgba(43, 46, 51, .055); --blanc: #ffffff;
  --ok: #2e7d4f; --ok-fond: #eaf4ee; --warn: #9a6a00; --warn-fond: #fbf3e0; --ko: #b81f26; --ko-fond: #fbeeee;
  --rayon: 3px; --ombre: 0 1px 2px rgba(31, 34, 38, .05);
  --police: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--police); color: var(--encre); background: var(--fond); min-height: 100vh; display: flex; flex-direction: column; }
body.accueil { background-color: #fff; background-image: linear-gradient(var(--grille) 1px, transparent 1px), linear-gradient(90deg, var(--grille) 1px, transparent 1px); background-size: 28px 28px; }
a { color: var(--acier); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2 { font-weight: 600; color: var(--marine); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.75rem; font-weight: 500; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small, .petit { font-size: .85rem; }
.muted { color: var(--gris); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }
.surtitre { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 600; color: var(--gris); margin-bottom: .4rem; display: block; }
form.inline { display: inline; }

/* en-tête et pied */
.entete { background: var(--blanc); border-bottom: 1px solid var(--trait); }
.entete-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 86px; }
.marque { display: flex; align-items: center; }
.marque img { height: 34px; width: auto; display: block; }
.compte { display: flex; align-items: center; gap: 16px; font-size: .85rem; }
.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 24px 56px; }
.pied { border-top: 1px solid var(--trait); background: var(--blanc); font-size: .78rem; color: var(--gris); }
.pied .entete-inner { min-height: 56px; flex-wrap: wrap; gap: 6px 20px; }
.pied a { color: var(--gris); }

/* accueil */
.intro { max-width: 760px; margin-bottom: 28px; }
.intro p { color: var(--gris); font-size: 1.02rem; }
.blocs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.bloc-acces { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; min-height: 214px; border-radius: 14px; padding: 18px 20px; color: #fff;
  background-color: var(--rouge); background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(160deg, #e9353d 0%, #c81e26 100%);
  background-size: 22px 22px, 22px 22px, 100% 100%; box-shadow: 0 6px 16px rgba(184, 31, 38, .22); text-decoration: none !important; transition: transform .15s, box-shadow .15s, background-color .15s; }
a.bloc-acces:hover { box-shadow: 0 12px 28px rgba(184, 31, 38, .35); transform: translateY(-2px); }
.bloc-acces:focus-visible { outline: 3px solid var(--marine); outline-offset: 3px; }
.bloc-acces > * { position: relative; z-index: 1; }
.bloc-acces > .ba-filigrane { position: absolute; z-index: 0; right: -20px; top: 38px; width: 132px; height: 132px; color: rgba(255, 255, 255, .11); pointer-events: none; }
.ba-filigrane svg { width: 100%; height: 100%; stroke-width: 1; }
.ba-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.ba-picto { width: 50px; height: 50px; border-radius: 50%; background: #fff; color: var(--rouge); display: grid; place-items: center; flex: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.ba-picto svg { width: 28px; height: 28px; }
.ba-etat { font-size: .72rem; font-weight: 600; border-radius: 10px; padding: 3px 9px; background: #fff; color: var(--rouge); white-space: nowrap; }
.ba-etat-ko { background: #2b2e33; color: #fff; }
.ba-famille { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .8); font-weight: 600; }
.bloc-acces b { font-weight: 600; color: #fff; line-height: 1.2; font-size: 1.3rem; }
.ba-desc { font-size: .86rem; color: rgba(255, 255, 255, .95); line-height: 1.45; flex: 1; }
.ba-pied { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .28); font-size: .8rem; color: rgba(255, 255, 255, .88); }
.ba-lien { color: #fff; font-weight: 700; white-space: nowrap; }
a.bloc-acces:hover .ba-lien { text-decoration: underline; text-underline-offset: 3px; }
/* brique en préparation : même carte, en gris, sans lien */
.bloc-acces.bientot { background-color: #eef0f3; background-image: linear-gradient(rgba(43,46,51,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(43,46,51,.05) 1px, transparent 1px);
  background-size: 22px 22px; color: var(--marine); box-shadow: none; border: 1px dashed #cdd1d7; cursor: default; }
.bloc-acces.bientot b { color: var(--marine); }
.bloc-acces.bientot .ba-famille, .bloc-acces.bientot .ba-desc, .bloc-acces.bientot .ba-pied { color: var(--gris); }
.bloc-acces.bientot .ba-pied { border-top-color: #d9dce1; }
.bloc-acces.bientot .ba-picto { color: var(--gris); }
.bloc-acces.bientot .ba-etat { background: var(--marine); color: #fff; }
.bloc-acces.bientot > .ba-filigrane { color: rgba(43, 46, 51, .06); }

.passerelle { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 40px; padding: 24px 26px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 10px; }
.passerelle p { color: var(--gris); margin: 0; }
.etages { list-style: none; margin: 0; padding: 0; counter-reset: e; }
.etages li { counter-increment: e; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--trait); }
.etages li:last-child { border-bottom: 0; }
.etages li::before { content: counter(e); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: #eef0f3; color: var(--gris); }
.etages li.fait::before { background: var(--rouge); color: #fff; }
.etages b { font-weight: 600; color: var(--marine); }
.etages span { font-size: .82rem; color: var(--gris); }

/* administration */
.titre-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.titre-page h1 { margin: 0; }
.titre-page p { margin: .3rem 0 0; color: var(--gris); max-width: 760px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.carte { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 22px 24px; box-shadow: var(--ombre); }
.carte-etroite { max-width: 520px; margin: 20px auto; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px; border-radius: var(--rayon); border: 1px solid var(--rouge); background: var(--rouge); color: #fff;
  font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: #c81e26; }
.btn-ligne { background: #fff; color: var(--encre); border-color: #cfd2d7; }
.btn-ligne:hover { background: var(--fond); border-color: var(--gris); }
.btn-lien { background: none; border: 0; color: var(--acier); padding: 0; font: inherit; cursor: pointer; }
.btn-lien:hover { text-decoration: underline; }
.btn-danger { background: transparent; color: var(--ko); border-color: #e0bcb7; }
.btn-danger:hover { background: var(--ko-fond); }
.btn-petit { height: 28px; padding: 0 10px; font-size: .8rem; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--encre); margin-bottom: 5px; }
.champ { margin-bottom: 16px; }
.grille-champs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.champ-large { grid-column: 1 / -1; }
.aide { font-size: .8rem; color: var(--gris); margin-top: 4px; }
input[type=text], input[type=password], input[type=url], input[type=number], select, textarea { width: 100%; height: 38px; padding: 0 11px; border: 1px solid #cfd2d7; border-radius: var(--rayon); font: inherit; font-size: .92rem; background: #fff; color: var(--encre); }
textarea { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(35, 31, 32, .15); border-color: var(--marine); }
.case { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: .9rem; cursor: pointer; }
.case input { margin-top: 4px; }
.actions-bas { margin: 8px 0 0; display: flex; gap: 8px; }
.flash { padding: 11px 14px; border-radius: var(--rayon); margin-bottom: 18px; font-size: .9rem; border-left: 3px solid; background: #fff; }
.flash-ok { border-color: var(--ok); background: var(--ok-fond); }
.flash-ko { border-color: var(--rouge); background: var(--ko-fond); }
.tableau-wrap { overflow-x: auto; }
.tab { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tab th { text-align: left; font-weight: 600; color: var(--gris); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.tab td { padding: 11px 12px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.tab tr:last-child td { border-bottom: 0; }
.tab .num { text-align: right; }
.badge { display: inline-block; font-size: .74rem; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--trait); color: var(--gris); background: #fff; white-space: nowrap; font-weight: 500; }
.badge-ok { color: var(--ok); background: var(--ok-fond); border-color: transparent; }
.badge-warn { color: var(--warn); background: var(--warn-fond); border-color: transparent; }
.badge-ko { color: var(--ko); background: var(--ko-fond); border-color: transparent; }
.badge-muted { color: var(--gris); background: var(--fond); }
.mini-picto { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--rouge); color: #fff; vertical-align: middle; }
.mini-picto svg { width: 16px; height: 16px; }
.choix-pictos { display: flex; flex-wrap: wrap; gap: 8px; }
.choix-picto { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; padding: 8px 4px; border: 1px solid var(--trait); border-radius: 8px; cursor: pointer; font-weight: 400; margin: 0; }
.choix-picto input { position: absolute; opacity: 0; pointer-events: none; }
.choix-picto span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #f1f2f4; color: var(--gris); }
.choix-picto svg { width: 20px; height: 20px; }
.choix-picto small { font-size: .7rem; color: var(--gris); text-align: center; line-height: 1.2; }
.choix-picto:has(input:checked) { border-color: var(--rouge); box-shadow: 0 0 0 1px var(--rouge) inset; }
.choix-picto:has(input:checked) span { background: var(--rouge); color: #fff; }
.choix-picto:has(input:focus-visible) { outline: 2px solid var(--marine); outline-offset: 2px; }

@media (max-width: 980px) { .blocs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .passerelle { grid-template-columns: minmax(0, 1fr); } .grille-champs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .entete-inner { min-height: 64px; padding: 0 16px; }
  .marque img { height: 26px; }
  .page { padding: 24px 16px 40px; }
  .blocs, .grille-champs { grid-template-columns: minmax(0, 1fr); }
  .bloc-acces { min-height: 0; }
  .pied-version { display: none; }
}
