/* Espace OBA · charte : Lavande électrique, ambre, encre, Brume */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-400.61509fdd1338.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/archivo-600.8ea361040c93.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-500.d11b722a3a26.woff") format("woff"); font-weight: 500; font-display: swap; }
:root { --lavande: #6A2CE0; --lavande-700: #5520C2; --lavande-300: #B394F5; --ambre: #FFC23D; --encre: #140E24; --encre-700: #4A4458; --gris: #6E6782;
        --ligne: #E6E0F5; --brume: #F6F3FF; --ok: #1B7F4C; --ok-bg: #E7F4EC; --warn: #8A5A00; --warn-bg: #FFF4D6; --err: #C42B3E; --err-bg: #FBE9EC; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: "Archivo", system-ui, sans-serif; color: var(--encre); background: var(--brume); font-size: 16px; line-height: 1.5; }
a { color: var(--lavande); }
a:hover { color: var(--lavande-700); }
:focus-visible { outline: 3px solid var(--ambre); outline-offset: 2px; }
.mono { font-family: "Plex Mono", ui-monospace, monospace; font-weight: 500; }
h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); }

/* Boutons et champs */
.btn { font: inherit; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       padding: 12px 18px; border-radius: 6px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--lavande); color: #fff; }
.btn-primary:hover { background: var(--lavande-700); color: #fff; }
.btn-ghost { background: #fff; color: var(--encre); border-color: #D9D2EA; }
.btn-ghost:hover { border-color: var(--lavande-300); color: var(--encre); }
.btn-link { background: none; border: 0; color: var(--lavande); padding: 0; font-weight: 600; text-decoration: underline; cursor: pointer; font: inherit; }
.btn-danger { background: none; border: 0; color: var(--err); padding: 0; cursor: pointer; font: inherit; font-size: 14px; text-decoration: underline; }
.btn-block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field input[type=text], .field input[type=email], .field input[type=password], .field select {
  font: inherit; font-weight: 400; font-size: 16px; padding: 12px 14px; border: 1.5px solid #D9D2EA; border-radius: 6px; background: #fff; color: var(--encre); width: 100%; }
.field input:focus { border-color: var(--lavande); outline: none; box-shadow: 0 0 0 3px rgba(106,44,224,.15); }
.field .aide { font-weight: 400; font-size: 13px; color: var(--gris); }
.field .erreur, .errorlist { color: var(--err); font-weight: 600; font-size: 13px; margin: 0; padding: 0; list-style: none; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--lavande); margin: 0; }
.choix { display: flex; flex-direction: column; gap: 8px; }
.choix label { display: flex; gap: 10px; align-items: center; font-weight: 400; font-size: 15px; }
.choix input { accent-color: var(--lavande); width: 18px; height: 18px; margin: 0; }
.alerte { padding: 12px 14px; font-size: 15px; font-weight: 600; border-left: 4px solid; }
.alerte-err { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.alerte-ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.alerte-info { background: var(--warn-bg); border-color: #E8A400; color: var(--warn); }
.chip { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; white-space: nowrap; }
.chip-ok { background: var(--ok-bg); color: var(--ok); } .chip-warn { background: var(--warn-bg); color: var(--warn); } .chip-gris { background: #EFEDF4; color: var(--encre-700); }

/* Pages de connexion : panneau de marque + formulaire */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-marque { flex: 1 1 420px; background: var(--encre); color: #fff; padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; gap: 40px; }
.auth-marque h1 { font-size: clamp(32px, 4vw, 52px); line-height: 1.05; max-width: 14ch; }
.auth-marque .kicker { color: var(--lavande-300); display: flex; align-items: center; gap: 12px; }
.auth-marque .kicker::before { content: ""; width: 24px; height: 4px; background: var(--ambre); }
.auth-tel { margin-top: auto; display: flex; flex-wrap: wrap; gap: 24px 40px; }
.auth-tel .kicker { color: var(--ambre); } .auth-tel .kicker::before { display: none; }
.auth-tel .mono { font-size: 22px; margin-top: 6px; display: block; }
.auth-tel small { color: var(--lavande-300); font-size: 13px; }
.auth-form { flex: 1 1 420px; background: #fff; display: flex; align-items: center; justify-content: center; padding: clamp(28px, 5vw, 72px) 20px; }
.auth-form .carte { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.auth-form h2 { font-size: 30px; }
.auth-form p { margin: 0; color: var(--encre-700); }
.liens { font-size: 14px; color: var(--encre-700); display: flex; flex-direction: column; gap: 8px; }

/* Espace connecté */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
.app-nav { flex: 0 0 260px; background: var(--encre); color: #fff; padding: 28px 18px; display: flex; flex-direction: column; gap: 28px; }
.app-nav nav { display: flex; flex-direction: column; gap: 2px; }
.app-nav nav a { color: #CFC9DD; text-decoration: none; padding: 11px 10px 11px 26px; border-radius: 6px; }
.app-nav nav a[aria-current=page] { color: #fff; background: #241B3D; box-shadow: inset 4px 0 0 var(--ambre); }
.app-nav .moi { margin-top: auto; border-top: 1px solid #2C2442; padding: 18px 8px 0; display: flex; flex-direction: column; gap: 4px; }
.app-nav .moi span { font-size: 13px; color: var(--lavande-300); }
.app-nav .moi form button { margin-top: 10px; font: inherit; font-size: 13px; font-weight: 600; color: #CFC9DD; background: none; border: 1px solid #3A3156; border-radius: 6px; padding: 8px 12px; cursor: pointer; }
.app-main { flex: 1 1 560px; min-width: 0; padding: 32px clamp(20px, 3vw, 40px) 56px; display: flex; flex-direction: column; gap: 24px; max-width: 1200px; }
.app-main h1 { font-size: 28px; }
.carte-blanche { background: #fff; border: 1px solid var(--ligne); padding: 22px 24px; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ligne); }
.liste li:last-child { border-bottom: 0; }
.sous { font-size: 13px; color: var(--gris); }
.bandeau-socle { background: var(--warn-bg); color: var(--warn); font-size: 14px; padding: 10px 14px; border-left: 4px solid #E8A400; }
@media (max-width: 760px) { .app-nav { flex: 1 1 100%; padding: 16px; gap: 14px; } .app-nav .moi { margin-top: 0; } }

/* --- Back-office OBA */
.app-nav .nav-titre { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ambre); padding: 18px 10px 6px 26px; }
.app-nav .nav-discret { font-size: 13px; color: #8E86A6 !important; }
.entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 20px; }
.entete .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fil { font-size: 13px; color: var(--gris); margin-bottom: 6px; }
.fil a { color: var(--gris); }
.btn-petit { padding: 8px 14px; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--ligne); padding: 16px 18px; }
.stat b { display: block; font-size: 30px; line-height: 1.1; font-weight: 600; }
.stat span { font-size: 13px; color: var(--gris); }
.tableau-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--ligne); }
.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); padding: 12px 16px; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.tableau td { padding: 12px 16px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tr.inactif td { color: var(--gris); }
.tableau tr.erreur td { background: var(--err-bg); }
.tableau a { font-weight: 600; text-decoration: none; }
.tableau a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.vide { padding: 22px 24px; color: var(--encre-700); }
.form-pile { display: flex; flex-direction: column; gap: 14px; }
.form-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.field textarea { font: inherit; font-weight: 400; font-size: 16px; padding: 12px 14px; border: 1.5px solid #D9D2EA; border-radius: 6px; width: 100%; }
.field input[type=number], .field input[type=file] { font: inherit; font-weight: 400; font-size: 16px; padding: 10px 12px; border: 1.5px solid #D9D2EA; border-radius: 6px; background: #fff; width: 100%; }
.field ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.field ul label { display: flex; gap: 10px; align-items: center; font-weight: 400; font-size: 15px; }
.field ul input { accent-color: var(--lavande); width: 18px; height: 18px; margin: 0; }
.field-check { display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 400; }
.field-check input { width: 18px; height: 18px; accent-color: var(--lavande); margin: 0; }
details.ajout { background: #fff; border: 1px solid var(--ligne); }
details.ajout > summary { cursor: pointer; padding: 16px 24px; font-weight: 600; color: var(--lavande); list-style: none; }
details.ajout > summary::-webkit-details-marker { display: none; }
details.ajout > summary::before { content: "+ "; }
details.ajout[open] > summary { border-bottom: 1px solid var(--ligne); }
details.ajout > div { padding: 20px 24px; }
.recherche { display: flex; gap: 10px; flex-wrap: wrap; }
.recherche input, .recherche select { font: inherit; font-size: 15px; padding: 10px 12px; border: 1.5px solid #D9D2EA; border-radius: 6px; background: #fff; }
.recherche input[type=search] { flex: 1 1 260px; }
.pagination { display: flex; gap: 14px; align-items: center; font-size: 14px; color: var(--gris); }
.zone-danger { border-top: 1px solid var(--ligne); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.chip-err { background: var(--err-bg); color: var(--err); }
.chip-lav { background: #EEE7FD; color: var(--lavande-700); }
.deux-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .deux-col { grid-template-columns: 1fr; } }
.tableau .num { text-align: right; }

/* --- Technique */
.pastille { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 6px; border-radius: 11px; background: var(--ambre); color: var(--encre); font-size: 12px; font-weight: 600; text-align: center; }
.fiche-dl { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 0; margin: 0; }
.fiche-dl dt, .fiche-dl dd { padding: 10px 0; border-bottom: 1px solid var(--ligne); margin: 0; }
.fiche-dl dt { color: var(--gris); font-size: 14px; padding-right: 16px; }
.fiche-dl dd { font-weight: 600; }
.fiche-dl dd.vide-val { color: #B3ACC4; font-weight: 400; }
.jauge { height: 6px; background: var(--ligne); border-radius: 3px; overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--lavande); }
.app-carte { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--ligne); text-decoration: none; color: var(--encre); }
.app-carte:last-child { border-bottom: 0; }
.app-carte:hover .mono { color: var(--lavande); }
.diff td.avant { color: var(--gris); text-decoration: line-through; }
.diff td.apres { font-weight: 600; color: var(--ok); }
@media (max-width: 760px) { .app-main { padding: 20px 16px 48px; } .fiche-dl { grid-template-columns: 1fr; } .fiche-dl dt { border-bottom: 0; padding-bottom: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 1000px) { .en-premier-mobile { order: -1; } }

/* --- Pannes */
a.carte-panne { display: block; text-decoration: none; color: var(--encre); border-left: 4px solid var(--err); }
a.carte-panne:hover { border-color: var(--err); box-shadow: 0 2px 10px rgba(20,14,36,.06); }
.barres { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; margin-top: 14px; }
.barre { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.barre .colonne { width: 100%; max-width: 28px; height: 110px; background: var(--brume); display: flex; align-items: flex-end; }
.barre .rempli { width: 100%; background: var(--lavande-300); }
.barre .rempli.bas { background: var(--err); }
.barre .val { font-size: 11px; color: var(--gris); height: 14px; }
.barre .val.bas { color: var(--err); font-weight: 600; }
.barre .mois { font-size: 11px; color: var(--gris); white-space: nowrap; }
.field input[type=date], .field input[type=datetime-local] { font: inherit; font-weight: 400; font-size: 16px; padding: 11px 14px; border: 1.5px solid #D9D2EA; border-radius: 6px; background: #fff; color: var(--encre); width: 100%; min-height: 48px; }

/* --- Mode terrain : sombre, contrasté, gros boutons */
.terrain { min-height: 100vh; background: #0E0A1A; color: #F4F1FB; display: flex; flex-direction: column; font-size: 17px;
           --ligne: #2C2442; --gris: #B4ABCB; --encre-700: #D6D0E6; }
.terrain-haut { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; }
.terrain-logo svg { width: 96px; height: auto; display: block; }
.terrain-moi { font-weight: 600; color: var(--lavande-300); }
.terrain-onglets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; position: sticky; top: 0; background: #0E0A1A; z-index: 5; }
.terrain-onglets a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 10px; background: #1C1530; color: #F4F1FB; text-decoration: none; font-weight: 600; font-size: 18px; }
.terrain-onglets a[aria-current=page] { background: var(--lavande); }
.terrain-main { flex: 1; padding: 4px 12px 32px; display: flex; flex-direction: column; gap: 14px; max-width: 720px; width: 100%; margin: 0 auto; }
.terrain-bas { display: flex; justify-content: center; gap: 12px; padding: 18px 12px 28px; border-top: 1px solid #2C2442; }
.terrain-bas button { font: inherit; font-size: 14px; color: #B4ABCB; background: none; border: 1px solid #3A3156; border-radius: 8px; padding: 10px 14px; }
.terrain h1 { font-size: 26px; line-height: 1.15; }
.terrain .sous { color: #B4ABCB; }
.terrain .kicker { color: #B4ABCB; }
.terrain a { color: #C9B4FF; }
.terrain .carte-blanche { background: #1A1430; border-color: #2C2442; color: #F4F1FB; border-radius: 12px; padding: 18px; }
.terrain .liste li, .terrain .app-carte { border-color: #2C2442; color: #F4F1FB; }
.terrain .fiche-dl dt { color: #B4ABCB; } .terrain .fiche-dl dd.vide-val { color: #6E6782; }
.terrain .field { color: #F4F1FB; font-size: 16px; }
.terrain .field input, .terrain .field select, .terrain .field textarea { font-size: 18px; min-height: 52px; }
.terrain .alerte-ok { background: #123524; color: #8EE3B5; border-color: #2BB673; }
.terrain .alerte-err { background: #3A1520; color: #FFB3BE; border-color: #FF5C73; }
.terrain .alerte-info { background: #3A2E0E; color: #FFD98A; border-color: var(--ambre); }
.terrain .chip-ok { background: #123524; color: #8EE3B5; } .terrain .chip-err { background: #4A1622; color: #FFB3BE; }
.terrain .chip-warn { background: #3A2E0E; color: #FFD98A; } .terrain .chip-lav { background: #2C1F55; color: #D7C6FF; } .terrain .chip-gris { background: #2C2442; color: #D6D0E6; }
.terrain .btn-ghost { background: #1C1530; color: #F4F1FB; border-color: #3A3156; }
.terrain .recherche input { font-size: 17px; min-height: 52px; background: #fff; }
.terrain .deux-col { grid-template-columns: 1fr; }
.terrain details.ajout { background: #1A1430; border-color: #2C2442; border-radius: 12px; }
.terrain details.ajout > summary { color: #C9B4FF; font-size: 18px; min-height: 56px; display: flex; align-items: center; }
.terrain details.ajout[open] > summary { border-color: #2C2442; }
.gros-bouton { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 76px; padding: 16px; border: 0; border-radius: 14px;
               font: inherit; font-size: 22px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.gros-bouton.prendre { background: var(--ambre); color: var(--encre); }
.gros-bouton.place { background: var(--lavande); color: #fff; }
.gros-bouton.liberee { background: #FF5C73; color: #fff; }
.gros-bouton.fin { background: #2BB673; color: #06210F; }
.gros-bouton.signaler { background: #3A1520; color: #FFB3BE; border: 2px solid #FF5C73; }
.gros-bouton.neutre { background: #1C1530; color: #F4F1FB; border: 2px solid #3A3156; }
.gros-bouton:active { transform: scale(.99); }
.etat-panne { border-radius: 14px; padding: 18px; background: #3A1520; border: 2px solid #FF5C73; }
.etat-panne.prise { background: #3A2E0E; border-color: var(--ambre); }
.etat-panne.sur_place, .etat-panne.piece { background: #241848; border-color: var(--lavande-300); }
.etat-panne b.grand { display: block; font-size: 24px; line-height: 1.2; margin: 4px 0; }
.choix-gros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choix-gros label { display: flex; align-items: center; justify-content: center; min-height: 64px; border-radius: 12px; background: #1C1530; border: 2px solid #3A3156; font-size: 20px; font-weight: 600; cursor: pointer; }
.choix-gros input { position: absolute; opacity: 0; pointer-events: none; }
.choix-gros label:has(input:checked) { background: var(--lavande); border-color: var(--lavande-300); color: #fff; }
.choix-gros label:has(input:focus-visible) { outline: 3px solid var(--ambre); }
.choix-gros.oui-non label:has(input[value=True]:checked) { background: #FF5C73; border-color: #FF5C73; }
.frise { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 12px 0 0; }
.frise span { height: 6px; border-radius: 3px; background: #2C2442; }
.frise span.fait { background: #2BB673; }
.frise-libelles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 12px; color: #B4ABCB; margin-top: 4px; }

/* --- Tableau de bord personnalisable */
.tdb { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; align-items: start; }
.bloc { grid-column: span 6; min-width: 0; }
.bloc.taille-petit { grid-column: span 2; } .bloc.taille-moyen { grid-column: span 4; } .bloc.taille-large { grid-column: span 6; }
@media (max-width: 1100px) { .bloc.taille-petit { grid-column: span 3; } .bloc.taille-moyen { grid-column: span 6; } }
@media (max-width: 760px) { .tdb { grid-template-columns: 1fr; } .bloc, .bloc.taille-petit, .bloc.taille-moyen { grid-column: 1 / -1; } }
.bloc-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bloc-tete .kicker { flex: 1; }
.poignee, .bloc-masquer, .bloc-redim { display: none; }
.bloc { position: relative; }
.edition .bloc { outline: 2px dashed #D9D2EA; outline-offset: -2px; }
.edition .bloc.tire { opacity: .45; }
.edition .bloc.redim { outline-color: var(--lavande); }
.edition .bloc.masque { opacity: .5; }
.edition .poignee { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 6px;
                    background: var(--brume); color: var(--encre-700); font-size: 18px; cursor: grab; }
.edition .poignee:active { cursor: grabbing; }
.edition .bloc-masquer { display: inline; font: inherit; font-size: 13px; font-weight: 600; color: var(--lavande); background: none; border: 0; cursor: pointer; padding: 4px; }
.edition .bloc-redim { display: block; position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; border: 0; padding: 0; cursor: ew-resize; touch-action: none;
                       background: linear-gradient(135deg, transparent 50%, var(--lavande) 50%); border-bottom-right-radius: 2px; }
.edition .bloc-redim:hover, .edition .bloc-redim:focus-visible { background: linear-gradient(135deg, transparent 45%, var(--lavande-700) 45%); }
.edition .bloc-corps { pointer-events: none; }
.carte-panne-int { display: block; text-decoration: none; color: var(--encre); border-left: 4px solid var(--err); padding: 12px 14px; background: var(--err-bg); }
.carte-panne-int:hover { box-shadow: 0 2px 10px rgba(20,14,36,.08); }
.sous-carte { border: 1px solid var(--ligne); padding: 14px 16px; }
.prio { font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin: 6px 0 10px; }
.prio-1 { color: #FF5C73; } .prio-2 { color: #FFB3BE; } .prio-3 { color: var(--gris); }
.carte-prio { flex-direction: column; gap: 2px; min-height: auto; padding: 14px 16px; margin-bottom: 10px; }
.carte-prio small { font-size: 15px; font-weight: 400; opacity: .9; }
.echeance { white-space: nowrap; font-size: 14px; font-weight: 600; padding: 6px 10px; border-radius: 8px; background: #EFEDF4; color: var(--encre-700); }
.echeance.retard { background: var(--err-bg); color: var(--err); } .echeance.proche { background: var(--warn-bg); color: var(--warn); }
.terrain .echeance { background: #2C2442; color: #D6D0E6; } .terrain .echeance.retard { background: #4A1622; color: #FFB3BE; } .terrain .echeance.proche { background: #3A2E0E; color: #FFD98A; }
details.ajout > summary::before { margin-right: 6px; }
