/* Console du réseau GNSS — l'identité vient de la feuille de carte topographique :
   papier froid, encre bleu de Prusse, brun des courbes de niveau, magenta de surcharge pour ce qui demande l'attention. */

@font-face { font-family: Archivo; src: url(/assets/fonts/archivo-latin.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  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: Archivo; src: url(/assets/fonts/archivo-latin-ext.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --calque: #e7ecea;      /* fond : le calque sous la feuille */
  --papier: #fbfcfb;      /* surfaces */
  --encre: #0f2a3d;       /* texte, traits forts */
  --encre-2: #4d6474;     /* texte secondaire */
  --trait: #c8d2ce;       /* filets */
  --courbe: #8c6b4a;      /* brun des courbes de niveau : lignes de base, repères discrets */
  --repere: #b3146b;      /* magenta de surcharge : action principale, sélection */
  --fixe: #1b7a57;
  --flottant: #a96a08;
  --alerte: #b3261e;
  --voile: rgba(15, 42, 61, .06);
  --ombre: 0 1px 0 rgba(15, 42, 61, .08), 0 12px 32px -18px rgba(15, 42, 61, .45);
  color-scheme: light;
}
:root[data-theme="nuit"] {
  --calque: #0b1822; --papier: #122434; --encre: #e4edf0; --encre-2: #93a9b6; --trait: #27404f;
  --courbe: #c9a27a; --repere: #ff6cb6; --fixe: #4fd0a0; --flottant: #f0b24a; --alerte: #ff7a70;
  --voile: rgba(228, 237, 240, .07); --ombre: 0 1px 0 rgba(0, 0, 0, .4), 0 16px 36px -18px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--calque); color: var(--encre); font: 400 1rem/1.5 Archivo, "Segoe UI", system-ui, sans-serif; font-stretch: 100%;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 640; font-stretch: 112%; letter-spacing: -.012em; line-height: 1.15; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; font-stretch: 106%; }
p { margin: 0; max-width: 68ch; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--repere); outline-offset: 2px; border-radius: 2px; }
.discret { color: var(--encre-2); }
.petit { font-size: .87rem; }
.nombre { font-stretch: 88%; white-space: nowrap; }

/* --- structure ------------------------------------------------------------ */
.cadre { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); min-height: 100vh; }
.marge { padding: 1.6rem 1.1rem 1.2rem 1.6rem; display: flex; flex-direction: column; gap: 1.6rem; position: sticky; top: 0; height: 100vh; }
.marge .titre { font-weight: 700; font-stretch: 118%; font-size: 1.05rem; line-height: 1.15; letter-spacing: -.01em; }
.marge .titre small { display: block; font-weight: 400; font-stretch: 100%; font-size: .8rem; color: var(--encre-2); margin-top: .25rem; letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: .1rem; margin-left: -.6rem; }
.nav a { display: flex; align-items: center; gap: .55rem; padding: .42rem .6rem; text-decoration: none; border-radius: 3px; color: var(--encre-2); }
.nav a::before { content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid transparent; }
.nav a:hover { color: var(--encre); background: var(--voile); }
.nav a[aria-current="page"] { color: var(--encre); font-weight: 600; }
.nav a[aria-current="page"]::before { border-bottom-color: var(--repere); }  /* le triangle du point géodésique */
.marge .pied { margin-top: auto; display: grid; justify-items: start; gap: .5rem; font-size: .87rem; color: var(--encre-2); }
.vue { padding: 1.6rem 2rem 3rem 1.2rem; min-width: 0; }
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.entete .etat { margin-top: .45rem; font-size: 1.05rem; color: var(--encre-2); }
.entete .etat b { color: var(--encre); font-weight: 600; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* --- boutons, champs ------------------------------------------------------- */
.btn { border: 1px solid var(--encre); background: transparent; padding: .45rem .9rem; border-radius: 3px; cursor: pointer; font-weight: 550; line-height: 1.2; }
.btn:hover { background: var(--voile); }
.btn.principal { background: var(--repere); border-color: var(--repere); color: #fff; }
:root[data-theme="nuit"] .btn.principal { color: #1a0612; }
.btn.principal:hover { filter: brightness(1.08); }
.btn.calme { border-color: var(--trait); font-weight: 450; }
.btn.danger { border-color: var(--alerte); color: var(--alerte); }
.btn[disabled] { opacity: .5; cursor: default; }
.lien { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--trait); }
.lien:hover { text-decoration-color: currentColor; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; background: var(--papier); border: 1px solid var(--trait); border-radius: 3px; padding: .45rem .6rem; }
input:hover, select:hover, textarea:hover { border-color: var(--encre-2); }
textarea { min-height: 5.5rem; resize: vertical; font-stretch: 88%; }
label.champ { display: grid; gap: .25rem; font-size: .9rem; }
label.champ > span { font-weight: 550; }
label.champ small { color: var(--encre-2); font-size: .82rem; line-height: 1.35; }
label.coche { display: flex; gap: .55rem; align-items: baseline; font-size: .95rem; }
label.coche input { accent-color: var(--repere); transform: translateY(1px); }

/* --- la feuille : carte + légende ------------------------------------------- */
.feuille { display: grid; grid-template-columns: minmax(0, 1fr) 21.5rem; gap: 1.4rem; align-items: start; }
.carte-cadre { background: var(--papier); padding: 7px; border: 1px solid var(--encre); box-shadow: var(--ombre); }  /* double filet d'une carte */
.carte { height: min(64vh, 640px); min-height: 380px; border: 1px solid var(--trait); background:
  linear-gradient(var(--trait) 1px, transparent 1px) 0 0 / 100% 64px, linear-gradient(90deg, var(--trait) 1px, transparent 1px) 0 0 / 64px 100%, var(--papier); }
.carte .leaflet-tile-pane { filter: grayscale(1) contrast(.86) brightness(1.06) sepia(.16) hue-rotate(150deg); }
:root[data-theme="nuit"] .carte .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(.82) brightness(.78) sepia(.25) hue-rotate(165deg); }
.carte.leaflet-container { font: inherit; background: var(--papier); }
.leaflet-control-attribution { font-size: .68rem; background: color-mix(in srgb, var(--papier) 82%, transparent) !important; color: var(--encre-2); }
.leaflet-control-attribution a { color: inherit; }
.leaflet-bar a { background: var(--papier); color: var(--encre); border-color: var(--trait); }
.leaflet-control-scale-line { text-shadow: none; border-color: var(--encre); background: color-mix(in srgb, var(--papier) 75%, transparent); color: var(--encre); font-size: .72rem; }
.repere { display: flex; align-items: center; gap: .3rem; white-space: nowrap; }
.repere svg { flex: none; overflow: visible; }
.repere span { font-weight: 650; font-stretch: 84%; font-size: .86rem; color: var(--encre); text-shadow: 0 0 3px var(--papier), 0 0 3px var(--papier), 0 0 2px var(--papier); }
.repere.hors span { color: var(--alerte); font-weight: 500; }
.legende { display: grid; gap: 0; }
.legende h2 { margin-bottom: .6rem; }
.station { display: grid; grid-template-columns: 1fr auto; gap: .15rem .8rem; padding: .7rem 0; border-top: 1px solid var(--trait); cursor: pointer; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; }
.station:last-child { border-bottom: 1px solid var(--trait); }
.station:hover { background: var(--voile); }
.station .nom { font-weight: 660; font-stretch: 112%; font-size: 1.02rem; display: flex; align-items: center; gap: .45rem; }
.station .quand { grid-column: 1; color: var(--encre-2); font-size: .87rem; }
.station .debit { text-align: right; font-size: .87rem; color: var(--encre-2); align-self: center; grid-row: 1 / span 2; grid-column: 2; }
.station .debit b { display: block; color: var(--encre); font-weight: 600; font-size: .98rem; }
.station.hors .nom { color: var(--alerte); font-weight: 500; }
.sats { grid-column: 1 / -1; display: flex; gap: .9rem; margin-top: .3rem; font-size: .8rem; color: var(--encre-2); }
.sats i { font-style: normal; display: inline-flex; align-items: flex-end; gap: .28rem; }
.sats i::before { content: ""; width: 5px; height: calc(var(--n) * 1.15px + 2px); background: var(--encre); border-radius: 1px; opacity: .85; }
.pastille { width: .55rem; height: .55rem; border-radius: 50%; background: var(--encre-2); flex: none; display: inline-block; }
.pastille.fixe { background: var(--fixe); } .pastille.flottant { background: var(--flottant); } .pastille.alerte { background: var(--alerte); }

/* --- tableaux --------------------------------------------------------------- */
.bloc { margin-top: 2rem; }
.bloc > h2 { margin-bottom: .7rem; }
.table { width: 100%; border-collapse: collapse; background: var(--papier); border: 1px solid var(--trait); }
.table th { text-align: left; font-weight: 550; font-size: .86rem; color: var(--encre-2); padding: .55rem .75rem; border-bottom: 1px solid var(--encre); white-space: nowrap; }
.table td { padding: .55rem .75rem; border-bottom: 1px solid var(--trait); vertical-align: top; font-stretch: 94%; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.cliquable { cursor: pointer; }
.table tbody tr.cliquable:hover { background: var(--voile); }
.table td.fin, .table th.fin { text-align: right; }
.table .fort { font-weight: 620; font-stretch: 104%; }
.defile { overflow-x: auto; }
.vide { padding: 1.6rem; border: 1px dashed var(--trait); color: var(--encre-2); background: color-mix(in srgb, var(--papier) 60%, transparent); }
.filtres { display: flex; gap: .7rem; flex-wrap: wrap; align-items: end; margin-bottom: .9rem; }
.filtres label.champ { min-width: 11rem; }
.onglets { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--trait); margin-bottom: 1.2rem; }
.onglets button { background: none; border: 0; padding: .5rem 0; cursor: pointer; color: var(--encre-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglets button[aria-selected="true"] { color: var(--encre); font-weight: 600; border-bottom-color: var(--repere); }
.etiquette { display: inline-block; padding: .05rem .45rem; border: 1px solid currentColor; border-radius: 2px; font-size: .8rem; font-stretch: 88%; line-height: 1.4; }
.etiquette.fixe { color: var(--fixe); } .etiquette.flottant { color: var(--flottant); } .etiquette.alerte { color: var(--alerte); } .etiquette.neutre { color: var(--encre-2); }

/* --- tiroir d'édition -------------------------------------------------------- */
.tiroir-fond { position: fixed; inset: 0; background: rgba(8, 22, 33, .34); z-index: 900; }
.tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(34rem, 100vw); background: var(--papier); z-index: 901; border-left: 1px solid var(--encre);
  display: grid; grid-template-rows: auto 1fr auto; box-shadow: -24px 0 48px -30px rgba(8, 22, 33, .7); animation: glisse .18s ease-out; }
@keyframes glisse { from { transform: translateX(24px); opacity: 0; } }
.tiroir header, .tiroir footer { padding: 1.1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tiroir header { border-bottom: 1px solid var(--trait); } .tiroir footer { border-top: 1px solid var(--trait); }
.tiroir .corps { overflow-y: auto; padding: 1.2rem 1.5rem 2rem; display: grid; gap: 1.6rem; align-content: start; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .85rem; grid-template-columns: 1fr 1fr; }
fieldset legend { padding: 0; font-weight: 640; font-stretch: 108%; margin-bottom: .2rem; grid-column: 1 / -1; }
fieldset .large { grid-column: 1 / -1; }
.erreur { color: var(--alerte); font-weight: 500; }
.avis { position: fixed; left: 50%; bottom: 1.6rem; transform: translateX(-50%); background: var(--encre); color: var(--papier); padding: .65rem 1.1rem; border-radius: 3px; z-index: 1000; box-shadow: var(--ombre); max-width: min(90vw, 40rem); }
.avis.erreur { background: var(--alerte); color: #fff; font-weight: 500; }
dl.fiche { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1.2rem; margin: 0; }
dl.fiche dt { color: var(--encre-2); } dl.fiche dd { margin: 0; font-stretch: 94%; overflow-wrap: anywhere; }
.messages { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .88rem; }
.messages span b { font-weight: 600; }
code.url { display: block; padding: .7rem .8rem; background: var(--calque); border: 1px solid var(--trait); overflow-wrap: anywhere; font: inherit; font-stretch: 86%; user-select: all; }

/* --- porte d'entrée ----------------------------------------------------------- */
.porte { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(22rem, .85fr); }
.porte .plan { position: relative; overflow: hidden; border-right: 1px solid var(--encre);
  background: linear-gradient(var(--trait) 1px, transparent 1px) 0 -1px / 100% 72px, linear-gradient(90deg, var(--trait) 1px, transparent 1px) -1px 0 / 72px 100%, var(--calque); }
.porte .plan svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.porte .plan .coord { position: absolute; left: 1.6rem; bottom: 1.4rem; color: var(--encre-2); font-size: .85rem; font-stretch: 88%; }
.porte .cartouche { background: var(--papier); padding: clamp(2rem, 6vw, 5rem) clamp(1.6rem, 4vw, 4rem); display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; }
.porte h1 { font-size: clamp(2.1rem, 3.6vw, 3.1rem); font-stretch: 122%; font-weight: 720; letter-spacing: -.025em; line-height: 1.02; }
.porte .cartouche p { font-size: 1.05rem; color: var(--encre-2); }
.porte .btn { align-self: flex-start; padding: .8rem 1.3rem; font-size: 1.05rem; }
.porte .note { font-size: .88rem; border-top: 1px solid var(--trait); padding-top: 1rem; margin-top: .5rem; }
@keyframes trace { to { stroke-dashoffset: 0; } }
.porte .ligne { stroke-dasharray: 1; stroke-dashoffset: 1; animation: trace 1.6s .2s ease-out forwards; }
.porte .pt { opacity: 0; animation: paru .5s ease-out forwards; }
@keyframes paru { to { opacity: 1; } }

/* --- écrans étroits ------------------------------------------------------------ */
@media (max-width: 1100px) { .feuille { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .cadre { grid-template-columns: 1fr; }
  .marge { position: static; height: auto; padding: 1rem 1rem .4rem; gap: .8rem; }
  .nav { flex-direction: row; flex-wrap: wrap; margin-left: -.4rem; }
  .marge .pied { margin-top: 0; grid-auto-flow: column; justify-content: start; gap: 1rem; }
  .vue { padding: 1rem; }
  .porte { grid-template-columns: 1fr; } .porte .plan { min-height: 30vh; border-right: 0; border-bottom: 1px solid var(--encre); }
  fieldset { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } .porte .ligne { stroke-dashoffset: 0; } .porte .pt { opacity: 1; } }
