:root {
    color-scheme: light;
    --fond-page: #eef3f0;
    --fond-panneau: #ffffff;
    --fond-soft: #f7faf8;
    --texte: #121c18;
    --texte-discret: #53645d;
    --bordure: #d5dfda;
    --bordure-forte: #c4d1cb;
    --accent: #147a58;
    --accent-fonce: #0d6045;
    --accent-pale: #e2f3ec;
    --danger: #b34a4a;
    --danger-pale: #fae9e9;
    --info: #315f8f;
    --ombre: 0 12px 32px rgba(22, 39, 31, 0.08);
    --ombre-legere: 0 4px 14px rgba(22, 39, 31, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--fond-page);
}

body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    color: var(--texte);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

noscript {
    display: block;
    max-width: 40rem;
    margin: 2rem auto;
    padding: 1rem;
    color: var(--danger);
    background: var(--danger-pale);
    border: 1px solid #efb7b7;
    border-radius: 8px;
}

.application {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 36px;
}

.application-login,
.application-auth {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px 0;
}

/* Barre de navigation pleine largeur (hors conteneur centré .application). */
.entete {
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(22, 39, 31, 0.14);
}

.titre-app {
    cursor: pointer;
    border-radius: 6px;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    line-height: 1.1;
    white-space: nowrap;
    color: #ffffff;
}

.titre-app:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 3px;
}

/* Onglets principaux : alignés sur le bord gauche du contenu (.application) en dessous. */
.onglets {
    position: absolute;
    top: 50%;
    left: max(11rem, calc((100vw - 1120px) / 2));
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
}

.onglets button {
    min-height: 34px;
    padding: 7px 13px;
    color: #ffffff;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.onglets button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.onglets button.actif {
    color: var(--accent);
    background: #ffffff;
}

.onglets button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 2px;
}

.actions-entete {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.entete .session-utilisateur {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    white-space: nowrap;
}

.session-boutons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Boutons icônes de la barre (fixe, engrenage, hamburger, déconnexion). */
.bouton-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
}

.bouton-icone:hover,
.bouton-icone.actif {
    background: rgba(255, 255, 255, 0.26);
}

.bouton-icone:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 2px;
}

.icone {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Le hamburger n'apparaît qu'en vue mobile. */
.menu-mobile-bouton {
    display: none;
}

/* Dropdown Configuration (roue crantée, admin). */
.config-conteneur {
    position: relative;
    display: flex;
    align-items: center;
}

.config-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 12rem;
    padding: 5px;
    background: var(--fond-panneau);
    border: 1px solid var(--bordure);
    border-radius: 8px;
    box-shadow: var(--ombre);
}

.config-dropdown button {
    width: 100%;
    padding: 9px 12px;
    color: var(--texte);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.config-dropdown button:hover {
    background: var(--fond-soft);
}

.config-dropdown button.actif {
    color: #ffffff;
    background: var(--accent);
}

/* Menu mobile déroulant (sous la barre). */
.menu-mobile {
    display: none;
}

/* Barre auto-masquée : cachée en haut, réapparaît au survol (desktop avec souris). */
.barre-zone-reveal {
    display: none;
}

.barre-fixe-toggle {
    display: none;
}

@media (min-width: 821px) and (hover: hover) and (pointer: fine) {
    .barre-fixe-toggle {
        display: inline-flex;
    }

    .barre-zone-reveal {
        position: fixed;
        z-index: 999;
        top: 0;
        right: 0;
        left: 0;
        display: block;
        height: 46px;
    }

    .entete.entete-auto-masquee {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        transform: translateY(-100%);
        transition: transform 0.2s ease 0.65s;
        box-shadow: var(--ombre);
    }

    .barre-zone-reveal:hover + .entete.entete-auto-masquee,
    .entete.entete-auto-masquee:hover,
    .entete.entete-auto-masquee:focus-within {
        transform: translateY(0);
        transition-delay: 0s;
    }
}

.actions-vue {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 12px;
}

.surtitre,
.libelle {
    margin: 0 0 4px;
    color: var(--texte-discret);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(2.35rem, 4vw, 3.35rem);
    line-height: 0.98;
}

h2 {
    font-size: 1.35rem;
    line-height: 1.15;
}

h3 {
    font-size: 1.05rem;
    line-height: 1.2;
}

.grille-principale {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
    gap: 18px;
}

.panneau {
    min-width: 0;
    padding: 22px;
    background: var(--fond-panneau);
    border: 1px solid var(--bordure);
    border-radius: 8px;
    box-shadow: var(--ombre);
}

.panneau-etat {
    grid-row: span 2;
}

.ligne-titre {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.badges-etat {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 10px;
    color: var(--texte-discret);
    background: #f0f5f2;
    border: 1px solid var(--bordure);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge.actif {
    color: var(--accent-fonce);
    background: var(--accent-pale);
    border-color: #a9dcca;
}

.badge-clim.actif {
    color: #214f87;
    background: #e5f0fb;
    border-color: #b9d4f1;
}

.badge-wb-hs {
    color: #9b1c1c;
    background: #fde2e1;
    border-color: #f5b5b2;
}

/* Indicateur combiné borne : maison + prise (présence voiture) + point (santé wallbox). */
.lien-wallbox {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 4px;
    cursor: default;
}

.lien-wallbox-icones {
    color: var(--accent);
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Voiture hors périmètre : maison + prise grisées. Ce n'est pas une alerte (pas de rouge). */
.lien-wallbox.voiture-absente .lien-wallbox-icones {
    color: var(--texte-discret);
    opacity: 0.4;
}

.lien-wallbox-point {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #16a34a; /* vert = wallbox en ligne */
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}

.lien-wallbox.wallbox-hors-ligne .lien-wallbox-point {
    background: #dc2626; /* rouge = wallbox injoignable */
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.icone-badge {
    line-height: 1;
}

.batterie {
    margin: 16px 0 24px;
}

.batterie strong {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
    line-height: 1;
    color: #ffffff;
    text-shadow:
        0 1px 2px rgba(13, 45, 34, 0.55),
        0 0 3px rgba(13, 45, 34, 0.4);
    white-space: nowrap;
}

.batterie strong span {
    font-size: 0.42em;
}

/* Valeur superposée, centrée dans la jauge. */
.batterie-valeur {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
}

/* Bouton d'actualisation superposé, calé à droite. */
.bouton-actualiser-batterie {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--texte-discret);
    background: #ffffff;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: var(--ombre-legere);
}

.bouton-actualiser-batterie:hover:not(:disabled) {
    color: var(--accent-fonce);
    border-color: var(--bordure-forte);
}

.bouton-actualiser-batterie:focus-visible {
    outline: 3px solid rgba(44, 95, 158, 0.28);
    outline-offset: 2px;
}

.bouton-actualiser-batterie:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.batterie-jauge {
    position: relative;
    height: 86px;
    overflow: hidden;
    background: #e6eeea;
    border: 1px solid var(--bordure-forte);
    border-radius: 8px;
}

.batterie-remplissage {
    position: relative;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(90deg, var(--accent), #4aa478);
    transition: width 180ms ease-out;
}

/* Effet « flux » : bandes diagonales qui défilent pendant la charge. */
.batterie-remplissage.en-charge::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        115deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0) 14px,
        rgba(255, 255, 255, 0.3) 14px,
        rgba(255, 255, 255, 0.3) 28px
    );
    background-size: 56px 100%;
    animation: batterie-flux 0.9s linear infinite;
}

@keyframes batterie-flux {
    to {
        background-position: 56px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .batterie-remplissage.en-charge::after {
        animation: none;
    }
}

.metriques {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.metriques div {
    min-width: 0;
    padding: 14px;
    background: var(--fond-soft);
    border: 1px solid var(--bordure);
    border-radius: 8px;
}

.metriques dt {
    margin-bottom: 6px;
    color: var(--texte-discret);
    font-size: 0.82rem;
    font-weight: 700;
}

.metriques dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.1rem;
    font-weight: 750;
}

.autonomie-max {
    font-weight: 400;
    color: var(--texte-discret);
}

.metriques-verticales {
    grid-template-columns: 1fr;
}

.pied-panneau {
    margin-top: 18px;
    color: var(--texte-discret);
    font-size: 0.9rem;
}

.groupe-commandes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    color: var(--texte);
    text-decoration: none;
    background: #eef4f1;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.1;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.bouton:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--ombre-legere);
}

.bouton:focus-visible {
    outline: 3px solid rgba(44, 95, 158, 0.28);
    outline-offset: 2px;
}

.bouton:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.bouton-principal {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.bouton-principal:hover:not(:disabled) {
    background: var(--accent-fonce);
}

.bouton-secondaire {
    background: #ffffff;
    border-color: var(--bordure);
}

.bouton-secondaire:hover:not(:disabled) {
    border-color: var(--bordure-forte);
}

.bouton-danger {
    color: #ffffff;
    background: var(--danger);
}

.bouton-progression-charge {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: var(--accent);
    border-color: var(--danger);
    isolation: isolate;
}

.bouton-progression-charge:disabled {
    opacity: 1;
}

.bouton-progression-charge::before {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    width: var(--progression-charge, 0%);
    content: "";
    background: var(--danger);
    transition: width 250ms linear;
}

.bouton-progression-charge span {
    position: relative;
    z-index: 1;
}

.bouton-compact {
    width: 42px;
    padding: 0;
}

.bouton-table {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.86rem;
    font-weight: 750;
}

.pleine-largeur {
    width: 100%;
}

.bloc-seuil-charge {
    margin-bottom: 16px;
}

.bloc-clim {
    padding-top: 16px;
    border-top: 1px solid var(--bordure);
}

.clim-message {
    margin: 12px 0 0;
    font-size: 0.9rem;
}

/* Message d'etape de la sequence de demarrage, sous le bouton de charge. */
.message-etape-charge {
    margin: 10px 0 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    color: var(--accent-fonce);
    background: var(--accent-pale);
    border: 1px solid #a9dcca;
}

/* Variante barre de progression : la bulle se remplit sur la duree du delai de l'etape. */
.message-etape-charge.avec-barre {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.message-etape-charge.avec-barre::before {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    width: var(--progression-etape, 0%);
    content: "";
    background: #a9dcca;
    transition: width 950ms linear;
}

.message-etape-charge span {
    position: relative;
    z-index: 1;
}

/* Bouton pre-conditionnement en cours : barre de progression sur ~10 min (cf. bouton de charge). */
.bouton-progression-clim {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent-fonce);
}

.bouton-progression-clim:disabled {
    opacity: 1;
}

.bouton-progression-clim::before {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    width: var(--progression-clim, 0%);
    content: "";
    background: var(--accent-fonce);
    transition: width 250ms linear;
}

.bouton-progression-clim span {
    position: relative;
    z-index: 1;
}

.bloc-seuil-charge label,
.bloc-clim label {
    display: block;
    margin-bottom: 10px;
    color: var(--texte-discret);
    font-size: 0.9rem;
    font-weight: 800;
}

.controle-reglage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.controle-reglage input {
    width: 100%;
    accent-color: var(--accent);
}

.controle-reglage output {
    font-weight: 850;
    text-align: right;
}

.case-limite-charge {
    display: inline-flex !important;
    align-items: center;
    gap: 9px;
    margin: -2px 0 0 !important;
    color: var(--texte-discret);
    font-size: 0.9rem;
    font-weight: 800;
}

.case-limite-charge input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.alerte {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    color: #7d2020;
    background: var(--danger-pale);
    border: 1px solid #efb7b7;
    border-radius: 8px;
}

.alerte span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.vue-parametres {
    width: min(960px, 100%);
    margin-inline: auto;
}

.login-panneau {
    width: min(420px, 100%);
}

.login-panneau h1 {
    margin-bottom: 18px;
}

.login-panneau h2 {
    margin-bottom: 18px;
}

.login-panneau label {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
    color: var(--texte-discret);
    font-size: 0.9rem;
    font-weight: 800;
}

.login-panneau input {
    width: 100%;
    height: 44px;
    padding: 9px 12px;
    color: var(--texte);
    background: #ffffff;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-weight: 650;
}

.formulaire-parametres {
    box-shadow: var(--ombre);
}

.interrupteur {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    min-height: 72px;
    padding: 14px 16px;
    background: var(--fond-soft);
    border: 1px solid var(--bordure);
    border-radius: 8px;
    cursor: pointer;
}

.interrupteur input {
    width: 44px;
    height: 24px;
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.interrupteur span {
    display: grid;
    gap: 3px;
}

.interrupteur small {
    color: var(--texte-discret);
    line-height: 1.35;
}

.grille-formulaire {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    align-items: start;
    gap: 16px;
}

.grille-formulaire label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--texte-discret);
    font-size: 0.9rem;
    font-weight: 800;
}

.grille-formulaire input,
.grille-formulaire select {
    width: 100%;
    height: 44px;
    padding: 9px 12px;
    color: var(--texte);
    background: #ffffff;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-weight: 650;
}

.grille-formulaire input:focus,
.grille-formulaire select:focus,
.login-panneau input:focus,
.formulaire-mot-de-passe input:focus {
    outline: 3px solid rgba(44, 95, 158, 0.18);
    border-color: var(--info);
}

.actions-formulaire {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.actions-formulaire .bouton {
    min-width: 132px;
}

.bloc-redemarrage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--bordure);
}

.bloc-redemarrage p:last-child {
    margin: 6px 0 0;
    color: var(--texte-discret);
    line-height: 1.4;
}

.bloc-redemarrage .bouton {
    flex: 0 0 auto;
}

.message-succes,
.message-erreur,
.message-info {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 750;
}

.message-succes {
    color: var(--accent-fonce);
    background: var(--accent-pale);
    border: 1px solid #a9dcca;
}

.message-erreur {
    color: #7d2020;
    background: var(--danger-pale);
    border: 1px solid #efb7b7;
}

.message-info {
    color: #214f87;
    background: #e5f0fb;
    border: 1px solid #b9d4f1;
}

.changement-mdp {
    width: min(520px, 100%);
    margin: 0;
}

.changement-mdp h1 {
    margin-bottom: 6px;
}

.bloc-auth {
    margin: 24px 0 16px;
    padding-top: 18px;
    border-top: 1px solid var(--bordure);
}

.bloc-auth h2 {
    margin-bottom: 10px;
}

.bloc-auth p:last-child {
    margin: 0;
    color: var(--texte-discret);
    line-height: 1.45;
}

.formulaire-mot-de-passe {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 0 12px;
}

.formulaire-mot-de-passe label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--texte-discret);
    font-size: 0.9rem;
    font-weight: 800;
}

.formulaire-mot-de-passe input {
    width: 100%;
    height: 44px;
    padding: 9px 12px;
    color: var(--texte);
    background: #ffffff;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-weight: 650;
}

.case-simple {
    display: flex !important;
    grid-column: 1 / -1;
    align-items: center;
    gap: 10px !important;
}

.case-simple input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--accent);
}

.page-utilisateurs {
    width: min(1100px, 100%);
}

.page-vehicules {
    width: min(1120px, 100%);
}

.barre-page {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.grille-vehicules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.carte-vehicule {
    display: grid;
    grid-template-rows: 170px 1fr auto;
    gap: 16px;
}

.carte-vehicule.actif {
    border-color: #88cdb6;
    box-shadow: 0 12px 32px rgba(20, 122, 88, 0.14);
}

.carte-vehicule img {
    width: 100%;
    height: 170px;
    object-fit: contain;
    background: var(--fond-soft);
    border: 1px solid var(--bordure);
    border-radius: 8px;
}

.contenu-vehicule {
    min-width: 0;
}

.metriques-vehicule {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ── Wallbox modale ─────────────────────────────────────────────────── */

/* Badge statut wallbox */
.badge-wb {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.statut-wb-off {
    background: var(--fond-soft);
    color: var(--texte-secondaire);
}

.statut-wb-attente {
    background: #fff3cd;
    color: #7a5c00;
}

.statut-wb-ok {
    background: #d1fae5;
    color: #065f46;
}

.statut-wb-hs {
    background: #fde2e1;
    color: #9b1c1c;
}

.wb-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--texte-secondaire);
}

.wb-input-mono {
    font-family: monospace;
    font-size: 0.8rem;
}

.wb-lien {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.78rem;
    color: var(--couleur-principale, #147a58);
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wb-lien:hover {
    opacity: 0.75;
}

.wb-lien:disabled {
    opacity: 0.4;
    cursor: default;
}

.wb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.wb-actions-droite {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Toggle pilotage */
.wb-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--fond-soft);
    border-radius: 8px;
    flex-wrap: wrap;
}

.wb-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

/* Notes et feedback */
.wb-note {
    font-size: 0.78rem;
    color: var(--texte-secondaire);
    margin: 0;
    line-height: 1.4;
}

.wb-note-info {
    padding: 8px 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    color: #7a5c00;
}

.wb-feedback {
    margin: 0;
    font-size: 0.82rem;
}

.metriques-vehicule dd {
    font-size: 0.98rem;
}

.panneau-vide {
    color: var(--texte-discret);
    font-weight: 750;
}

.page-evenements {
    width: min(1120px, 100%);
}

.page-appels-renault {
    width: min(1120px, 100%);
}

.selection-vehicule-technique {
    display: grid;
    gap: 6px;
    min-width: min(320px, 100%);
    color: var(--texte-discret);
    font-size: 0.9rem;
    font-weight: 800;
}

.selection-vehicule-technique select {
    width: 100%;
    height: 42px;
    padding: 8px 11px;
    color: var(--texte);
    background: #ffffff;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-weight: 700;
}

.liste-appels-renault {
    display: grid;
    gap: 20px;
}

.groupe-appels-renault {
    display: grid;
    gap: 12px;
}

.groupe-appels-renault h3 {
    color: var(--texte-discret);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.appel-renault {
    display: grid;
    gap: 14px;
}

.appel-renault.commande {
    border-color: #e2b5b5;
}

.ligne-appel-renault {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;
}

.titre-appel-renault {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.titre-appel-renault h4 {
    margin: 0;
    font-size: 1.02rem;
}

.description-appel-renault,
.retour-appel-renault {
    margin: 0 0 8px;
    color: var(--texte-discret);
    line-height: 1.45;
}

.note-support-renault {
    margin: 8px 0 0;
    color: var(--texte-discret);
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.4;
}

.chemin-appel-renault {
    display: block;
    width: fit-content;
    max-width: 100%;
    padding: 7px 9px;
    overflow-wrap: anywhere;
    color: #234437;
    background: var(--fond-soft);
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.champs-appel-renault {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.champs-appel-renault label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--texte-discret);
    font-size: 0.88rem;
    font-weight: 800;
}

.champs-appel-renault input,
.champs-appel-renault textarea {
    width: 100%;
    padding: 9px 11px;
    color: var(--texte);
    background: #ffffff;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-weight: 650;
}

.champs-appel-renault textarea,
.reponse-renault {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.champs-appel-renault textarea {
    min-height: 118px;
    resize: vertical;
}

.champs-appel-renault small {
    color: var(--texte-discret);
    font-weight: 650;
    line-height: 1.35;
}

.reponse-renault {
    max-height: 520px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    color: #0d2a1f;
    background: #f3f7f5;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-size: 0.84rem;
    line-height: 1.45;
}

.badge-danger {
    color: #7d2020;
    background: var(--danger-pale);
    border-color: #efb7b7;
}

.badge-support.support-oui {
    color: var(--accent-fonce);
    background: var(--accent-pale);
    border-color: #a9dcca;
}

.badge-support.support-non {
    color: #7d2020;
    background: var(--danger-pale);
    border-color: #efb7b7;
}

.badge-support.support-partiel {
    color: #6d5815;
    background: #fff6cf;
    border-color: #eadb9c;
}

.badge-support.support-accepte_non_confirme {
    color: #7a4a12;
    background: #fff1df;
    border-color: #efc28d;
}

.badge-support.support-a_verifier {
    color: #244a72;
    background: #eaf2fb;
    border-color: #c5d9ee;
}

.table-responsive {
    overflow-x: auto;
}

.table-users {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
}

.table-charges {
    min-width: 860px;
}

.vue-gestion-charges,
.panneau-gestion-charges {
    width: min(1120px, 100%);
}

.explication-charges {
    margin: 0 0 18px;
    padding: 13px 15px;
    color: #244a72;
    background: #eaf2fb;
    border: 1px solid #c5d9ee;
    border-radius: 8px;
    line-height: 1.45;
}

.explication-charges p {
    margin: 0;
}

.barre-gestion-charges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.selection-mode-charge {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    background: #e4ece8;
    border: 1px solid var(--bordure);
    border-radius: 8px;
}

.selection-mode-charge button {
    min-height: 38px;
    padding: 8px 13px;
    color: var(--texte-discret);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 850;
}

.selection-mode-charge button.actif {
    color: #ffffff;
    background: var(--accent);
}

.actions-gestion-charges {
    display: flex;
    gap: 10px;
}

.table-programmes-charge {
    min-width: 1040px;
}

.ligne-programme-voiture td {
    background: #f6fbff;
}

.ligne-programme-app td {
    background: #fffdf5;
}

.ligne-desactivee td {
    color: #7c8983;
    background: #f1f5f3;
}

.jours-programme {
    display: inline-flex;
    gap: 5px;
}

.jours-programme span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    color: #95a19c;
    background: #edf2ef;
    border: 1px solid var(--bordure);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 850;
}

.jours-programme span.actif {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.badge-source {
    min-height: 26px;
    border-color: #eadb9c;
    background: #fff6cf;
    color: #6d5815;
}

.badge-source.voiture {
    color: #244a72;
    background: #eaf2fb;
    border-color: #c5d9ee;
}

.switch-compact {
    display: inline-flex;
    width: 42px;
    height: 24px;
    cursor: pointer;
}

.switch-compact input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-compact span {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    background: #cbd7d1;
    border-radius: 999px;
    transition: background-color 120ms ease;
}

.switch-compact span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(18, 28, 24, 0.22);
    transition: transform 120ms ease;
}

.switch-compact input:checked + span {
    background: var(--accent);
}

.switch-compact input:checked + span::after {
    transform: translateX(18px);
}

.switch-compact input:disabled + span {
    opacity: 0.45;
    cursor: not-allowed;
}

.erreur-programme {
    color: #7d2020;
    font-weight: 850;
}

.texte-discret,
.aide-action {
    color: var(--texte-discret);
}

.bouton-icone-table {
    width: 34px;
    padding: 0;
    font-size: 1.05rem;
}

.pied-gestion-charges {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 18px;
}

.aide-action {
    margin: 0;
    font-weight: 750;
}

.modale-programme-charge {
    width: min(680px, 100%);
}

.ligne-titre-compacte {
    margin-bottom: 10px;
}

.bloc-jours-edition {
    margin-top: 18px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--fond-soft);
    border: 1px solid var(--bordure);
    border-radius: 8px;
}

.selecteur-duree-clim {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.selecteur-duree-clim button {
    flex: 1 1 0;
    min-width: 52px;
    padding: 7px 4px;
    color: var(--texte-discret);
    background: #ffffff;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.selecteur-duree-clim button.actif {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.selecteur-duree-clim button:disabled {
    cursor: default;
    opacity: 0.6;
}

.interrupteur-tous {
    margin: 0;
    color: var(--texte-discret);
    font-weight: 850;
}

.choix-jours {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choix-jours button {
    width: 42px;
    height: 42px;
    color: var(--texte-discret);
    background: #ffffff;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
}

.choix-jours button.actif {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.table-evenements {
    min-width: 1180px;
    table-layout: fixed;
}

.table-evenements th:nth-child(1),
.table-evenements td:nth-child(1) {
    width: 112px;
}

.table-evenements th:nth-child(2),
.table-evenements td:nth-child(2) {
    width: 100px;
}

.table-evenements th:nth-child(3),
.table-evenements td:nth-child(3) {
    width: 78px;
}

.table-evenements th:nth-child(4),
.table-evenements td:nth-child(4) {
    width: 360px;
}

.table-evenements th:nth-child(5),
.table-evenements td:nth-child(5) {
    width: 74px;
}

.table-evenements th:nth-child(6),
.table-evenements td:nth-child(6) {
    width: 86px;
}

.table-evenements th:nth-child(7),
.table-evenements td:nth-child(7) {
    width: 370px;
}

.table-evenements td:nth-child(3),
.table-evenements td:nth-child(5),
.table-evenements td:nth-child(6) {
    white-space: nowrap;
}

.table-evenements td:nth-child(7) {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.cellule-chemin {
    max-width: 360px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.84rem !important;
}

.table-users th,
.table-users td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--bordure);
    text-align: left;
    vertical-align: middle;
}

.table-users th {
    color: var(--texte-discret);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-users td {
    font-size: 0.94rem;
    background: #ffffff;
}

.table-users tbody tr:hover td {
    background: #f8fbf9;
}

.table-vehicules-admin {
    min-width: 1040px;
}

.table-users td .sous-info {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--texte-discret);
}

.actions-cellule {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge-role {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 0.76rem;
}

.statut-session {
    color: var(--texte-discret);
    font-weight: 800;
}

.statut-session.actif {
    color: var(--accent-fonce);
}

.actions-table {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.table-vide {
    padding: 24px !important;
    color: var(--texte-discret);
    text-align: center !important;
}

.modale-fond {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(18, 28, 24, 0.48);
    backdrop-filter: blur(2px);
}

.modale-utilisateur {
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
}

.modale-utilisateur small {
    color: var(--texte-discret);
    font-weight: 650;
}

@media (max-width: 820px) {
    .application {
        width: min(100% - 24px, 640px);
        padding: 20px 0;
    }

    .grille-principale,
    .batterie,
    .metriques,
    .grille-formulaire {
        grid-template-columns: 1fr;
    }

    /* Barre : grille 4 colonnes × 2 rangées (façon lyracore, adaptée à zoeconnect). */
    .entete {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        align-items: center;
        column-gap: 0.5rem;
        row-gap: 0.6rem;
        padding: 12px 16px;
    }

    .titre-app {
        grid-column: 1;
        grid-row: 1;
    }

    /* Les onglets desktop laissent place au menu hamburger. */
    .onglets {
        display: none;
    }

    .actions-entete {
        display: contents;
    }

    .barre-fixe-toggle {
        display: none;
    }

    .entete .session-utilisateur {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .config-conteneur {
        grid-column: 4;
        grid-row: 2;
        justify-self: end;
    }

    .session-boutons {
        display: contents;
    }

    .menu-mobile-bouton {
        display: inline-flex;
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .logout-bouton {
        grid-column: 4;
        grid-row: 1;
        justify-self: end;
    }

    .menu-mobile {
        display: grid;
        gap: 0.45rem;
        padding: 0.75rem 16px;
        background: var(--accent-fonce);
    }

    .menu-mobile button {
        width: 100%;
        padding: 11px 14px;
        color: #ffffff;
        text-align: left;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 8px;
        cursor: pointer;
        font-weight: 700;
    }

    .menu-mobile button.actif {
        color: var(--accent);
        background: #ffffff;
    }

    .actions-vue {
        justify-content: stretch;
    }

    .barre-gestion-charges,
    .barre-page,
    .bloc-redemarrage,
    .pied-gestion-charges {
        display: grid;
        justify-content: stretch;
    }

    .selection-mode-charge,
    .actions-gestion-charges {
        display: grid;
    }

    .panneau-etat {
        grid-row: auto;
    }
}

@media (max-width: 460px) {
    .groupe-commandes,
    .actions-formulaire,
    .formulaire-mot-de-passe {
        grid-template-columns: 1fr;
    }

    .actions-formulaire,
    .actions-table {
        display: grid;
    }

    .table-responsive {
        overflow: visible;
    }

    .table-users {
        min-width: 0;
    }

    .table-users thead {
        display: none;
    }

    .table-users,
    .table-users tbody,
    .table-users tr,
    .table-users td {
        display: block;
        width: 100%;
    }

    .table-users tr {
        margin-bottom: 12px;
        padding: 12px;
        background: #f7faf8;
        border: 1px solid var(--bordure);
        border-radius: 8px;
    }

    .table-users td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 0;
        text-align: right;
    }

    .table-evenements {
        min-width: 0;
        table-layout: auto;
    }

    .table-evenements th,
    .table-evenements td {
        width: 100%;
    }

    .table-evenements td:nth-child(3),
    .table-evenements td:nth-child(5),
    .table-evenements td:nth-child(6) {
        white-space: normal;
    }

    .cellule-chemin {
        max-width: 100%;
        overflow: visible;
        overflow-wrap: anywhere;
        text-overflow: clip;
        white-space: normal;
    }

    .table-users td::before {
        content: attr(data-label);
        color: var(--texte-discret);
        font-weight: 800;
        text-align: left;
    }

    .actions-table {
        justify-content: stretch;
    }

    .actions-table::before {
        display: none;
    }

    .panneau {
        padding: 16px;
    }

    .ligne-titre {
        display: grid;
    }

    .badge {
        width: fit-content;
    }

    .badges-etat {
        justify-content: flex-start;
    }
}
