/* Remora — thème d'administration. Palette abyssale, sombre par nature :
   ces écrans se regardent longtemps, souvent en pleine lumière sur un bateau. */

:root {
    --fond: #081018;
    --nav: #0B1622;
    --surface: #0F1E2B;
    --surface-2: #16293A;
    --trait: #1C2F41;
    --trait-2: #24394E;

    --texte: #E8F0F7;
    --texte-2: #9DB2C6;
    --texte-3: #7C92A7;

    --turquoise: #3FD9C9;
    --bleu: #57A9F5;
    --ambre: #F2B138;
    --rouge: #FF7A7A;
    --vert: #52E0A0;
    --violet: #A78BFA;

    --rayon: 12px;
    --rayon-petit: 8px;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--fond);
    color: var(--texte);
    font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Space Grotesk', system-ui, sans-serif; margin: 0; }

a { color: #8FD8F2; text-decoration: none; }
a:hover { color: #C9EDFA; text-decoration: underline; }

code, .mono, .nombre { font-family: var(--mono); }

/* ---------- Ossature ---------- */

.coque { display: flex; min-height: 100vh; }

.barre {
    width: 232px;
    flex-shrink: 0;
    padding: 22px 14px;
    background: var(--nav);
    border-right: 1px solid var(--trait);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.barre .marque { display: flex; align-items: center; gap: 11px; padding: 2px 8px 4px; }
.barre .marque .nom {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700; font-size: 16.5px; letter-spacing: 0.1em;
}
.barre .marque .sous { font-size: 10.5px; color: var(--texte-3); }

.groupe { display: flex; flex-direction: column; gap: 3px; }
.groupe > .titre {
    font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--texte-3); padding: 0 10px 6px;
}
.groupe a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; min-height: 36px;
    border-radius: var(--rayon-petit);
    color: var(--texte-2); font-size: 13.5px; text-decoration: none;
}
.groupe a:hover { background: var(--surface); color: var(--texte); text-decoration: none; }
.groupe a.actif { background: var(--surface-2); color: var(--turquoise); font-weight: 600; }
.groupe a.actif svg { stroke: var(--turquoise); }

.identite {
    margin-top: auto;
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px;
    background: var(--surface); border: 1px solid var(--trait);
    border-radius: var(--rayon-petit);
}
.identite .pastille {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--surface-2); color: var(--turquoise);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.identite .nom { font-size: 12px; }
.identite .role { font-size: 10.5px; color: var(--texte-3); }
.identite form { margin: 0; }

.contenu {
    flex-grow: 1; min-width: 0;
    padding: 24px 28px 40px;
    display: flex; flex-direction: column; gap: 18px;
}

/* ---------- En-tête de page ---------- */

.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.entete h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.01em; }
.entete p { margin: 5px 0 0; font-size: 13px; color: var(--texte-2); }
.entete .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Cartes ---------- */

.carte {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}
.carte > h2 { font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 14px; }
.carte .chapeau {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px;
}
.carte .chapeau h2 { font-size: 13.5px; font-weight: 600; }

.rangee { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.rangee > * { min-width: 0; }
.colonne { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.extensible { flex: 1 1 320px; }

/* ---------- Tuiles de mesure ---------- */

.tuiles { display: flex; gap: 12px; flex-wrap: wrap; }
.tuile {
    flex: 1 1 180px;
    padding: 16px 17px;
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    display: flex; flex-direction: column; gap: 9px;
}
.tuile .etiquette {
    font-size: 11.5px; color: var(--texte-3);
    letter-spacing: 0.05em; text-transform: uppercase;
}
.tuile .valeur { display: flex; align-items: baseline; gap: 6px; }
.tuile .valeur .nombre { font-size: 28px; font-weight: 500; line-height: 1; }
.tuile .valeur .unite { font-size: 13px; color: var(--texte-2); }
.tuile .note { font-size: 11.5px; color: var(--texte-3); }

/* ---------- Badges ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--trait-2);
    font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.sans-point::before { display: none; }
.badge.vert { color: var(--vert); }
.badge.ambre { color: var(--ambre); }
.badge.rouge { color: var(--rouge); }
.badge.bleu { color: var(--bleu); }
.badge.violet { color: var(--violet); }
.badge.turquoise { color: var(--turquoise); }
.badge.gris { color: var(--texte-2); }

.point { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
.point.vert { background: var(--vert); }
.point.ambre { background: var(--ambre); }
.point.rouge { background: var(--rouge); }
.point.gris { background: var(--texte-3); }

/* ---------- Tableaux ---------- */

table.grille { width: 100%; border-collapse: collapse; }
table.grille th {
    text-align: left; padding: 0 10px 9px;
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--texte-3);
    white-space: nowrap;
}
table.grille td {
    padding: 10px; font-size: 12.5px;
    border-top: 1px solid var(--trait);
    vertical-align: middle;
}
table.grille tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
table.grille .droite { text-align: right; }
table.grille .vide { color: var(--texte-3); text-align: center; padding: 28px 10px; }

/* ---------- Formulaires ---------- */

label.champ { display: flex; flex-direction: column; gap: 5px; }
label.champ > span {
    font-size: 10.5px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--texte-3);
}

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
    width: 100%; min-height: 38px; padding: 8px 11px;
    background: var(--surface-2); color: var(--texte);
    border: 1px solid var(--trait-2); border-radius: var(--rayon-petit);
    font-family: inherit; font-size: 12.5px;
}
textarea { resize: vertical; min-height: 68px; }
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--turquoise); outline-offset: -1px; border-color: var(--turquoise);
}

.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px; min-height: 44px;
    background: var(--surface-2); color: var(--texte);
    border: 1px solid var(--trait-2); border-radius: var(--rayon-petit);
    font-family: inherit; font-size: 12.5px; font-weight: 500;
    cursor: pointer; text-decoration: none;
}
.bouton:hover { background: #1D3346; color: var(--texte); text-decoration: none; }
.bouton.principal { background: var(--turquoise); color: #06121A; border-color: var(--turquoise); font-weight: 600; }
.bouton.principal:hover { background: #55E3D4; color: #06121A; }
.bouton.danger { color: var(--rouge); border-color: #4A2430; }
.bouton.petit { min-height: 34px; padding: 7px 12px; font-size: 12px; }

.filtres { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filtres > * { flex: 0 1 auto; }
.filtres .large { flex: 1 1 220px; }

/* ---------- Barres de proportion ---------- */

.barres { display: flex; flex-direction: column; gap: 12px; }
.barres .ligne > .tete { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.barres .ligne > .tete .lib { color: var(--texte-2); }
.barres .ligne > .tete .val { font-family: var(--mono); }
.barres .piste { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.barres .piste > span { display: block; height: 100%; border-radius: 999px; }

/* ---------- Messages ---------- */

.avis {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 15px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--trait);
    font-size: 13px;
}
.avis.attention { border-color: #4A3418; }
.avis.alerte { border-color: #4A2430; }
.avis.succes { border-color: #1E4A3A; }
.avis .texte { flex-grow: 1; }
.avis .detail { font-size: 11.5px; color: var(--texte-2); margin-top: 2px; }

pre.charge {
    margin: 0; padding: 12px;
    background: var(--fond); border: 1px solid var(--trait);
    border-radius: var(--rayon-petit);
    font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
    color: var(--texte-2); white-space: pre-wrap; word-break: break-word;
    max-height: 320px; overflow: auto;
}

.paires { display: flex; flex-direction: column; gap: 11px; font-size: 12.5px; }
.paires > div { display: flex; justify-content: space-between; gap: 12px; }
.paires .cle { color: var(--texte-2); }
.paires .val { font-family: var(--mono); text-align: right; }

.legende { font-size: 11.5px; color: var(--texte-2); display: flex; gap: 14px; align-items: center; }
.aide { font-size: 11px; color: var(--texte-3); margin: 12px 0 0; }

/* ---------- Pagination ---------- */

.pages { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 12px; }
.pages .courante { color: var(--texte-3); }

/* ---------- Carte Leaflet ---------- */

.carte-geo { height: 380px; border-radius: var(--rayon-petit); overflow: hidden; background: #0A1622; }
.leaflet-container { background: #0A1622; }
.leaflet-control-attribution { background: rgba(8, 16, 24, 0.8) !important; color: var(--texte-3) !important; }
.leaflet-control-attribution a { color: var(--texte-2) !important; }

/* ---------- Authentification ---------- */

.page-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.page-auth .boite { width: 100%; max-width: 420px; }
.page-auth .marque { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.validation-summary-errors, .field-validation-error, .text-danger {
    color: var(--rouge); font-size: 12px;
}
.page-auth form > div { margin-bottom: 14px; }

@media (max-width: 900px) {
    .coque { flex-direction: column; }
    .barre { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; gap: 10px; }
    .barre .groupe { flex-direction: row; flex-wrap: wrap; }
    .barre .groupe > .titre { display: none; }
    .identite { margin-top: 0; }
    .contenu { padding: 16px; }
}
