/*
 * Exem supervision : le thème de l'admin, sombre (néon) par défaut, clair au choix. Chargé après les feuilles de
 * Django et des pages (admin/base_site.html) : il redéfinit leurs variables, puis restyle l'en-tête, le menu, les
 * listes, les formulaires et le tableau de bord (admin/index.html).
 *
 * Les couleurs sont toutes des variables --x-* : un jeu sombre (:root) et un jeu clair (html[data-theme="light"]),
 * posé par le bouton de l'en-tête (admin/exem/theme.js) et gardé dans le navigateur.
 *
 * Couleurs des graphiques : la palette catégorielle de référence, version sombre et version claire, vérifiées sur
 * --x-carte (lisibilité, daltonisme, contraste ; en clair, la légende et le tableau des chiffres compensent le jaune et
 * le vert, pâles sur blanc). Les couleurs d'état (ok, attention, urgent) ne servent qu'aux états, avec icône et libellé.
 */

/* ---- Thème sombre (par défaut) ---- */

:root,
html[data-theme="dark"] {
    color-scheme: dark;

    --x-fond: #070b14;
    --x-surface: #0c1220;
    --x-carte: #101827;
    --x-carte-2: #16213a;
    --x-champ: #0a1120;
    --x-ligne: rgba(125, 165, 230, 0.12);
    --x-ligne-forte: rgba(125, 165, 230, 0.24);
    --x-texte: #e6edf7;
    --x-texte-2: #aab7cb;
    --x-discret: #7d8aa0;
    --x-fort: #ffffff;
    --x-accent: #22d3ee;
    --x-accent-vif: #67e8f9;
    --x-sur-accent: #031018;
    --x-accent-doux: rgba(34, 211, 238, 0.08);
    --x-accent-moyen: rgba(34, 211, 238, 0.16);
    --x-accent-bord: rgba(34, 211, 238, 0.45);
    --x-accent-anneau: rgba(34, 211, 238, 0.18);
    --x-survol: rgba(34, 211, 238, 0.035);
    --x-survol-menu: rgba(34, 211, 238, 0.06);
    --x-zebre: rgba(255, 255, 255, 0.015);
    --x-magenta: #e879f9;
    --x-lueur: 0 0 0 1px rgba(34, 211, 238, 0.45), 0 0 18px rgba(34, 211, 238, 0.22);
    --x-ombre: 0 12px 30px rgba(0, 0, 0, 0.25);
    --x-ombre-forte: 0 30px 80px rgba(0, 0, 0, 0.6);
    --x-entete: rgba(12, 18, 32, 0.92);
    --x-menu: rgba(12, 18, 32, 0.78);
    --x-halo-1: rgba(34, 211, 238, 0.07);
    --x-halo-2: rgba(232, 121, 249, 0.05);
    --x-quadrillage: rgba(125, 165, 230, 0.03);
    --x-logo-lueur: drop-shadow(0 0 6px rgba(34, 211, 238, 0.6));
    --x-voile: rgba(3, 6, 12, 0.72);
    --x-defilement: #26344f;
    --x-selection: rgba(34, 211, 238, 0.3);
    --x-erreur: #ff8a8a;
    --x-erreur-texte: #ffc2c2;
    --x-erreur-fond: rgba(208, 59, 59, 0.16);
    --x-erreur-bord: rgba(208, 59, 59, 0.5);
    --x-suppr-texte: #ff9b9b;
    --x-int-texte: #67e8f9;
    --x-int-bord: rgba(34, 211, 238, 0.45);
    --x-int-fond: rgba(34, 211, 238, 0.08);
    --x-prod-texte: #f5c2ff;
    --x-prod-bord: rgba(232, 121, 249, 0.6);
    --x-prod-fond: rgba(232, 121, 249, 0.12);
    --x-prod-lueur: 0 0 14px rgba(232, 121, 249, 0.3);
    --x-selectionne: #1b2a44;
    --x-outils: #18253d;
    --x-outils-survol: #22355a;
    --x-fermer: #2a3650;
    --x-fermer-survol: #3a4868;
    --x-grille: #1d2940;
    --x-base: #2c3b59;
    --x-zone-survol: rgba(125, 165, 230, 0.07);

    --serie-1: #3987e5;
    --serie-2: #d95926;
    --serie-3: #199e70;
    --serie-4: #c98500;
}

/* ---- Thème clair ---- */

html[data-theme="light"] {
    color-scheme: light;

    --x-fond: #f3f5f9;
    --x-surface: #ffffff;
    --x-carte: #ffffff;
    --x-carte-2: #eef2f7;
    --x-champ: #ffffff;
    --x-ligne: rgba(15, 23, 42, 0.09);
    --x-ligne-forte: rgba(15, 23, 42, 0.18);
    --x-texte: #0f172a;
    --x-texte-2: #475569;
    --x-discret: #64748b;
    --x-fort: #0f172a;
    --x-accent: #0e7490;
    --x-accent-vif: #0891b2;
    --x-sur-accent: #ffffff;
    --x-accent-doux: rgba(14, 116, 144, 0.07);
    --x-accent-moyen: rgba(14, 116, 144, 0.13);
    --x-accent-bord: rgba(14, 116, 144, 0.4);
    --x-accent-anneau: rgba(14, 116, 144, 0.18);
    --x-survol: rgba(14, 116, 144, 0.04);
    --x-survol-menu: rgba(14, 116, 144, 0.06);
    --x-zebre: rgba(15, 23, 42, 0.02);
    --x-magenta: #c026d3;
    --x-lueur: 0 0 0 1px rgba(14, 116, 144, 0.35), 0 4px 14px rgba(14, 116, 144, 0.12);
    --x-ombre: 0 6px 20px rgba(15, 23, 42, 0.06);
    --x-ombre-forte: 0 24px 60px rgba(15, 23, 42, 0.25);
    --x-entete: rgba(255, 255, 255, 0.9);
    --x-menu: rgba(255, 255, 255, 0.85);
    --x-halo-1: rgba(34, 211, 238, 0.1);
    --x-halo-2: rgba(232, 121, 249, 0.07);
    --x-quadrillage: rgba(15, 23, 42, 0.035);
    --x-logo-lueur: none;
    --x-voile: rgba(15, 23, 42, 0.45);
    --x-defilement: #c4ccd8;
    --x-selection: rgba(14, 116, 144, 0.2);
    --x-erreur: #ba2121;
    --x-erreur-texte: #9b1c1c;
    --x-erreur-fond: rgba(208, 59, 59, 0.08);
    --x-erreur-bord: rgba(208, 59, 59, 0.4);
    --x-suppr-texte: #b42c3c;
    --x-int-texte: #0e7490;
    --x-int-bord: rgba(14, 116, 144, 0.4);
    --x-int-fond: rgba(14, 116, 144, 0.07);
    --x-prod-texte: #86198f;
    --x-prod-bord: rgba(162, 28, 175, 0.45);
    --x-prod-fond: rgba(162, 28, 175, 0.08);
    --x-prod-lueur: none;
    --x-selectionne: #e0f2fe;
    --x-outils: #e6f4f8;
    --x-outils-survol: #d4edf4;
    --x-fermer: #cbd5e1;
    --x-fermer-survol: #94a3b8;
    --x-grille: #e6eaf0;
    --x-base: #c8d0dc;
    --x-zone-survol: rgba(15, 23, 42, 0.05);

    --serie-1: #2a78d6;
    --serie-2: #eb6834;
    --serie-3: #1baf7a;
    --serie-4: #eda100;
}

/* ---- Les variables de l'admin de Django, tirées du thème ---- */

:root,
html[data-theme="light"],
html[data-theme="dark"] {
    --x-titre: "Chakra Petch", system-ui, -apple-system, "Segoe UI", sans-serif;
    --etat-ok: #0ca30c;
    --etat-attention: #fab219;
    --etat-urgent: #d03b3b;

    --primary: var(--x-surface);
    --secondary: var(--x-surface);
    --accent: var(--x-accent);
    --primary-fg: var(--x-texte);
    --body-fg: var(--x-texte);
    --body-bg: var(--x-fond);
    --body-quiet-color: var(--x-discret);
    --body-medium-color: var(--x-texte-2);
    --body-loud-color: var(--x-fort);
    --header-color: var(--x-texte-2);
    --header-branding-color: var(--x-texte);
    --header-bg: var(--x-surface);
    --header-link-color: var(--x-texte-2);
    --breadcrumbs-fg: var(--x-discret);
    --breadcrumbs-link-fg: var(--x-texte-2);
    --breadcrumbs-bg: transparent;
    --link-fg: var(--x-accent);
    --link-hover-color: var(--x-accent-vif);
    --link-selected-fg: var(--x-accent-vif);
    --hairline-color: var(--x-ligne);
    --border-color: var(--x-ligne-forte);
    --error-fg: var(--x-erreur);
    --message-success-bg: rgba(12, 163, 12, 0.14);
    --message-warning-bg: rgba(250, 178, 25, 0.14);
    --message-error-bg: rgba(208, 59, 59, 0.18);
    --darkened-bg: var(--x-carte);
    --selected-bg: var(--x-selectionne);
    --selected-row: var(--x-accent-doux);
    --button-fg: var(--x-sur-accent);
    --button-bg: var(--x-accent);
    --button-hover-bg: var(--x-accent-vif);
    --default-button-bg: var(--x-accent);
    --default-button-hover-bg: var(--x-accent-vif);
    --close-button-bg: var(--x-fermer);
    --close-button-hover-bg: var(--x-fermer-survol);
    --delete-button-bg: #b42c3c;
    --delete-button-hover-bg: #d03b3b;
    --object-tools-fg: var(--x-texte);
    --object-tools-bg: var(--x-outils);
    --object-tools-hover-bg: var(--x-outils-survol);
    --font-family-primary: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-monospace: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

/* ---- Base ---- */

body {
    background-color: var(--x-fond);
    background-image:
        radial-gradient(1100px 520px at 0% -8%, var(--x-halo-1), transparent 60%),
        radial-gradient(900px 480px at 100% 0%, var(--x-halo-2), transparent 55%),
        linear-gradient(var(--x-quadrillage) 1px, transparent 1px),
        linear-gradient(90deg, var(--x-quadrillage) 1px, transparent 1px);
    background-size: auto, auto, 32px 32px, 32px 32px;
    background-attachment: fixed;
    color: var(--x-texte);
}

* {
    scrollbar-color: var(--x-defilement) transparent;
    scrollbar-width: thin;
}

::selection {
    background: var(--x-selection);
}

a:link,
a:visited {
    transition: color 0.15s;
}

#content h1,
.entete-page h1 {
    font-family: var(--x-titre);
    font-weight: 600;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    color: var(--x-texte);
    margin: 0 0 18px;
}

#content h2 {
    color: var(--x-texte-2);
}

code,
pre,
kbd {
    color: var(--x-accent-vif);
    background: var(--x-champ);
}

/* ---- En-tête ---- */

#header {
    position: relative;
    min-height: 56px;
    padding: 10px 28px;
    background: var(--x-entete);
    border-bottom: 1px solid var(--x-ligne);
    backdrop-filter: blur(8px);
}

#header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--x-accent) 25%, var(--x-magenta) 75%, transparent);
    opacity: 0.55;
}

#branding {
    display: flex;
    align-items: center;
    gap: 14px;
}

.marque {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.marque:link,
.marque:visited,
.marque:hover {
    color: var(--x-texte);
}

.marque-logo {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: var(--x-accent);
    stroke-width: 1.6;
    stroke-linejoin: round;
    filter: var(--x-logo-lueur);
}

.marque-nom {
    font-family: var(--x-titre);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.marque-sous {
    font-family: var(--x-titre);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: var(--x-discret);
}

.environnement {
    font-family: var(--x-titre);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    padding: 3px 9px;
    border: 1px solid;
    border-radius: 999px;
}

.environnement-int {
    color: var(--x-int-texte);
    border-color: var(--x-int-bord);
    background: var(--x-int-fond);
}

.environnement-prod {
    color: var(--x-prod-texte);
    border-color: var(--x-prod-bord);
    background: var(--x-prod-fond);
    box-shadow: var(--x-prod-lueur);
}

#user-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 6px;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--x-discret);
}

#user-tools strong {
    color: var(--x-texte);
    font-weight: 600;
}

#user-tools a,
#logout-form button {
    color: var(--x-texte-2);
    border-bottom: 0;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
}

#user-tools a:hover,
#user-tools a:focus,
#logout-form button:hover,
#logout-form button:focus {
    color: var(--x-accent-vif);
    text-decoration: none;
}

/* bascule du thème (admin/color_theme_toggle.html, admin/exem/theme.js) */

.bascule-theme {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--x-ligne-forte);
    border-radius: 999px;
    color: var(--x-texte-2);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.bascule-theme:hover,
.bascule-theme:focus {
    border-color: var(--x-accent);
    color: var(--x-accent-vif);
}

.bascule-theme svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bascule-vers-sombre,
html[data-theme="light"] .bascule-vers-clair {
    display: none;
}

html[data-theme="light"] .bascule-vers-sombre {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bascule-vers-clair {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---- Fil d'Ariane ---- */

div.breadcrumbs {
    padding: 14px 28px 0;
    background: transparent;
    border: 0;
    font-size: 0.78rem;
    color: var(--x-discret);
}

div.breadcrumbs a:link,
div.breadcrumbs a:visited {
    color: var(--x-texte-2);
}

div.breadcrumbs a:hover {
    color: var(--x-accent-vif);
}

/* ---- Menu de gauche ---- */

#nav-sidebar {
    box-sizing: border-box;
    padding: 14px 12px 24px;
    background: var(--x-menu);
    border-right: 1px solid var(--x-ligne);
}

.toggle-nav-sidebar {
    background: transparent;
    border-right: 1px solid var(--x-ligne);
    color: var(--x-discret);
}

.toggle-nav-sidebar:hover,
.toggle-nav-sidebar:focus {
    background: var(--x-survol-menu);
    color: var(--x-accent);
}

#nav-filter {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 12px;
    padding: 8px 10px;
    background: var(--x-champ);
    border: 1px solid var(--x-ligne-forte);
    border-radius: 8px;
    color: var(--x-texte);
}

#nav-filter.no-results {
    background: var(--x-erreur-fond);
}

.menu-icone {
    flex: none;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-accueil {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 9px 10px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}

#nav-sidebar .module.menu-rubrique {
    margin: 0 0 14px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

#nav-sidebar .menu-rubrique caption {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: transparent;
    border: 0;
    font-family: var(--x-titre);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: left;
    color: var(--x-discret);
}

#nav-sidebar .menu-rubrique tr,
#nav-sidebar .menu-rubrique th {
    background: transparent;
    border: 0;
    padding: 0;
}

#nav-sidebar .menu-rubrique th a {
    display: block;
    padding: 6px 10px 6px 34px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 400;
    text-decoration: none;
}

.menu-accueil:link,
.menu-accueil:visited,
#nav-sidebar .menu-rubrique th a:link,
#nav-sidebar .menu-rubrique th a:visited {
    color: var(--x-texte-2);
}

.menu-accueil:hover,
#nav-sidebar .menu-rubrique th a:hover {
    background: var(--x-survol-menu);
    color: var(--x-texte);
}

#nav-sidebar .current-model,
#nav-sidebar .menu-rubrique tr.current-model {
    background: transparent;
}

.menu-accueil.actif:link,
.menu-accueil.actif:visited,
#nav-sidebar .current-model th a:link,
#nav-sidebar .current-model th a:visited {
    background: linear-gradient(90deg, var(--x-accent-moyen), var(--x-accent-doux));
    box-shadow: inset 2px 0 0 var(--x-accent);
    color: var(--x-fort);
}

/* ---- Contenu ---- */

#content {
    padding: 18px 28px 40px;
}

.module,
#changelist-filter,
.submit-row,
#content-related {
    background: var(--x-carte);
    border: 1px solid var(--x-ligne);
    border-radius: 12px;
}

.module {
    box-shadow: var(--x-ombre);
}

.module h2,
.module caption,
.inline-group h2,
fieldset .fieldset-heading,
#content-related h2 {
    padding: 10px 14px;
    background: transparent;
    border-bottom: 1px solid var(--x-ligne);
    font-family: var(--x-titre);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--x-texte-2);
}

fieldset.collapse summary,
fieldset details > summary {
    color: var(--x-texte-2);
}

/* tableaux et listes */

thead th,
tfoot td,
#changelist table thead th {
    background: var(--x-surface);
    border-bottom: 1px solid var(--x-ligne-forte);
    color: var(--x-discret);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

thead th a:link,
thead th a:visited {
    color: var(--x-texte-2);
}

td,
th {
    border-bottom-color: var(--x-ligne);
}

tbody tr:nth-child(odd),
.row-form-errors {
    background: transparent;
}

tbody tr:nth-child(even),
tr:nth-child(even) .errorlist {
    background: var(--x-zebre);
}

tbody tr:hover > td,
tbody tr:hover > th {
    background: var(--x-survol);
}

#result_list tbody th {
    white-space: nowrap;
}

#result_list tbody tr.selected td,
#result_list tbody tr.selected th {
    background: var(--selected-row);
}

#changelist .actions {
    padding: 10px 14px;
    background: var(--x-carte);
    border: 1px solid var(--x-ligne);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    color: var(--x-texte-2);
}

#changelist .results {
    background: var(--x-carte);
    border: 1px solid var(--x-ligne);
    border-radius: 0 0 12px 12px;
}

#changelist #toolbar {
    padding: 0 0 12px;
    background: transparent;
    border: 0;
    color: var(--x-discret);
}

#changelist-filter {
    padding-bottom: 6px;
}

#changelist-filter h2 {
    padding: 10px 14px;
    background: transparent;
    border-bottom: 1px solid var(--x-ligne);
    border-radius: 12px 12px 0 0;
    font-family: var(--x-titre);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--x-texte-2);
}

#changelist-filter h3,
#changelist-filter summary {
    color: var(--x-texte-2);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#changelist-filter li a:link,
#changelist-filter li a:visited {
    color: var(--x-texte-2);
}

#changelist-filter li a:hover {
    color: var(--x-accent-vif);
}

#changelist-filter li.selected {
    border-left-color: var(--x-accent);
}

#changelist-filter li.selected a:link,
#changelist-filter li.selected a:visited {
    color: var(--x-accent-vif);
}

.paginator {
    background: transparent;
    border-top: 1px solid var(--x-ligne);
    color: var(--x-discret);
}

.paginator .this-page {
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--x-accent);
    color: var(--x-sur-accent);
}

/* formulaires */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select,
.vTextField {
    padding: 6px 9px;
    background-color: var(--x-champ);
    border: 1px solid var(--x-ligne-forte);
    border-radius: 8px;
    color: var(--x-texte);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--x-accent);
    box-shadow: 0 0 0 3px var(--x-accent-anneau);
    outline: none;
}

.form-row {
    border-bottom-color: var(--x-ligne);
}

form label,
.aligned label {
    color: var(--x-texte-2);
}

form .required label,
label.required {
    color: var(--x-texte);
    font-weight: 600;
}

.help,
p.help,
div.help,
form p.help {
    color: var(--x-discret);
}

.errornote {
    background: var(--x-erreur-fond);
    border: 1px solid var(--x-erreur-bord);
    border-radius: 10px;
    color: var(--x-erreur-texte);
}

ul.errorlist li {
    background: var(--x-erreur-fond);
    border-radius: 6px;
    color: var(--x-erreur-texte);
}

/* boutons */

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--x-accent-bord);
    border-radius: 8px;
    color: var(--x-accent);
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}

.button:hover,
.button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus,
input[type="button"]:hover,
input[type="button"]:focus,
a.button:hover {
    background: var(--x-accent-doux);
    box-shadow: var(--x-lueur);
    color: var(--x-accent-vif);
}

.button.default,
input[type="submit"].default,
.submit-row input.default,
.login .submit-row input {
    background: var(--x-accent);
    border-color: var(--x-accent);
    color: var(--x-sur-accent);
}

.button.default:hover,
input[type="submit"].default:hover,
.submit-row input.default:hover,
.login .submit-row input:hover {
    background: var(--x-accent-vif);
    color: var(--x-sur-accent);
}

.submit-row {
    padding: 12px 14px;
}

.submit-row a.deletelink:link,
.submit-row a.deletelink:visited {
    background: transparent;
    border: 1px solid var(--x-erreur-bord);
    border-radius: 8px;
    color: var(--x-suppr-texte);
}

.submit-row a.deletelink:hover {
    background: var(--x-erreur-fond);
    color: var(--x-erreur-texte);
}

.object-tools a:link,
.object-tools a:visited {
    background: var(--x-accent-doux);
    border: 1px solid var(--x-accent-bord);
    border-radius: 999px;
    color: var(--x-accent);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.object-tools a:hover,
.object-tools a:focus {
    background: var(--x-accent-moyen);
    box-shadow: var(--x-lueur);
}

/* messages */

ul.messagelist li {
    border: 1px solid var(--x-ligne-forte);
    border-radius: 10px;
    color: var(--x-texte);
}

ul.messagelist li.success {
    border-color: rgba(12, 163, 12, 0.5);
}

ul.messagelist li.warning {
    border-color: rgba(250, 178, 25, 0.5);
}

ul.messagelist li.error {
    border-color: var(--x-erreur-bord);
}

/* liaisons, sélecteurs, calendriers */

.inline-related h3,
.inline-group .tabular tr.has_original td {
    background: var(--x-carte-2);
    color: var(--x-texte-2);
}

.selector-available h2,
.selector-chosen h2,
.selector-available-title,
.selector-chosen-title {
    background: var(--x-carte-2);
    color: var(--x-texte-2);
}

.selector .selector-filter {
    background: var(--x-surface);
    border-color: var(--x-ligne);
    color: var(--x-texte-2);
}

.calendarbox,
.clockbox {
    background: var(--x-carte);
    border: 1px solid var(--x-ligne-forte);
    border-radius: 12px;
    box-shadow: var(--x-ombre-forte);
}

.calendar caption,
.calendarbox h2 {
    background: var(--x-surface);
    color: var(--x-texte);
}

/* page de connexion */

body.login {
    background-color: var(--x-fond);
    background-image:
        radial-gradient(900px 480px at 50% -10%, var(--x-halo-1), transparent 60%),
        linear-gradient(var(--x-quadrillage) 1px, transparent 1px),
        linear-gradient(90deg, var(--x-quadrillage) 1px, transparent 1px);
    background-size: auto, 32px 32px, 32px 32px;
}

.login #container {
    background: var(--x-carte);
    border: 1px solid var(--x-ligne-forte);
    border-radius: 16px;
    box-shadow: var(--x-lueur), var(--x-ombre-forte);
}

.login #header {
    background: transparent;
}

.login #branding {
    justify-content: center;
    width: 100%;
}

.login .submit-row {
    background: transparent;
    border: 0;
}

/* ---- Tableau de bord ---- */

.tableau-de-bord #content {
    max-width: 1480px;
}

.entete-page {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    margin-bottom: 18px;
}

.entete-page h1 {
    margin-bottom: 2px;
}

.entete-page-meta {
    margin: 0;
    color: var(--x-discret);
    font-size: 0.8rem;
}

.recherche {
    display: flex;
    gap: 8px;
    flex: 0 1 460px;
}

.recherche input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 12px;
}

.grille {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 20px;
}

@media (max-width: 1100px) {
    .grille {
        grid-template-columns: minmax(0, 1fr);
    }
}

.carte {
    padding: 18px 20px;
    background: var(--x-carte);
    border: 1px solid var(--x-ligne);
    border-radius: 14px;
    box-shadow: var(--x-ombre);
}

#content .bloc-titre {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    margin: 0 0 14px;
    padding: 0;
    background: none;
    border: 0;
    font-family: var(--x-titre);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--x-texte-2);
}

.compte {
    font-family: var(--font-family-primary);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--x-discret);
}

.discret {
    color: var(--x-discret);
}

.insecable {
    white-space: nowrap;
}

.fort,
a.fort:link,
a.fort:visited {
    font-weight: 600;
    white-space: nowrap;
}

.sous-ligne {
    display: block;
    color: var(--x-discret);
    font-size: 0.75rem;
}

.code {
    font-family: var(--font-family-monospace);
    font-size: 0.8rem;
}

.vide {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    color: var(--x-texte-2);
}

.vide svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--etat-ok);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pied-carte {
    margin: 12px 0 0;
    font-size: 0.8rem;
}

table.liste {
    width: 100%;
}

table.liste th,
table.liste td {
    padding: 8px 10px;
    vertical-align: top;
}

.actions-ligne {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    white-space: nowrap;
}

.actions-ligne .button {
    padding: 4px 12px;
    font-size: 0.78rem;
}

/* graphiques */

ul.legende {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin: 0 0 8px;
    padding: 0;
}

ul.legende li {
    padding: 0;
    list-style: none;
    font-size: 0.8rem;
    color: var(--x-texte-2);
}

.pastille {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 7px;
    border-radius: 3px;
    vertical-align: -1px;
}

.pastille.serie-1 {
    background: var(--serie-1);
}

.pastille.serie-2 {
    background: var(--serie-2);
}

.pastille.serie-3 {
    background: var(--serie-3);
}

.pastille.serie-4 {
    background: var(--serie-4);
}

.graphe {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.graphe .grille {
    stroke: var(--x-grille);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.graphe .base {
    stroke: var(--x-base);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.graphe .axe {
    fill: var(--x-discret);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.graphe .zone {
    fill: transparent;
}

.graphe .creneau:hover .zone {
    fill: var(--x-zone-survol);
}

.graphe .part {
    transition: filter 0.12s;
}

.graphe .creneau:hover .part {
    filter: brightness(1.3);
}

.graphe .serie-1 {
    fill: var(--serie-1);
}

.graphe .serie-2 {
    fill: var(--serie-2);
}

.graphe .serie-3 {
    fill: var(--serie-3);
}

.graphe .serie-4 {
    fill: var(--serie-4);
}

.graphe .trait {
    fill: none;
    stroke: var(--serie-1);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.graphe .point {
    fill: var(--serie-1);
    stroke: var(--x-carte);
    stroke-width: 2;
}

.graphe .repere {
    fill: var(--x-texte);
    font-size: 11px;
    font-weight: 600;
}

.barres {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.barres li {
    display: grid;
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 0;
    list-style: none;
}

.barres-nom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
}

.barres-piste {
    height: 12px;
}

.barres-barre {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
    background: var(--serie-1);
}

.barres-valeur {
    font-size: 0.82rem;
    white-space: nowrap;
}

.chiffres {
    margin-top: 8px;
}

.chiffres summary {
    color: var(--x-texte-2);
    font-size: 0.8rem;
    cursor: pointer;
}

.chiffres table {
    width: 100%;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

.chiffres td {
    text-align: right;
}

/* fenêtre de la courbe d'un capteur (tableau de bord) */

dialog.fenetre {
    width: min(1240px, 94vw);
    height: min(860px, 90vh);
    padding: 0;
    background: var(--x-carte);
    border: 1px solid var(--x-accent-bord);
    border-radius: 16px;
    box-shadow: var(--x-lueur), var(--x-ombre-forte);
    color: var(--x-texte);
    overflow: hidden;
}

dialog.fenetre[open] {
    display: flex;
    flex-direction: column;
}

dialog.fenetre::backdrop {
    background: var(--x-voile);
    backdrop-filter: blur(3px);
}

.fenetre-entete {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px 10px 20px;
    border-bottom: 1px solid var(--x-ligne);
}

#content .fenetre-entete h2 {
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    font-family: var(--x-titre);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--x-texte);
}

.fenetre-onglet {
    font-size: 0.8rem;
}

.fenetre-fermer {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--x-ligne-forte);
    border-radius: 8px;
    color: var(--x-texte-2);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.fenetre-fermer:hover,
.fenetre-fermer:focus {
    border-color: var(--x-accent);
    color: var(--x-accent-vif);
}

.fenetre-cadre {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: var(--x-fond);
}

/* ---- Réception des données (Surveillance, et sa tuile au tableau de bord) ---- */

.reception #content {
    max-width: 1480px;
}

.pile {
    display: grid;
    gap: 20px;
}

td.lien-ligne {
    text-align: right;
    white-space: nowrap;
}

.periodes {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--x-carte);
    border: 1px solid var(--x-ligne);
    border-radius: 10px;
}

.periodes a:link,
.periodes a:visited {
    padding: 6px 14px;
    border-radius: 7px;
    color: var(--x-texte-2);
    font-size: 0.82rem;
}

.periodes a:hover {
    background: var(--x-survol-menu);
    color: var(--x-texte);
}

.periodes a[aria-current="page"] {
    background: var(--x-accent-moyen);
    box-shadow: inset 0 0 0 1px var(--x-accent-bord);
    color: var(--x-fort);
}

.chaines {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 900px) {
    .chaines {
        grid-template-columns: minmax(0, 1fr);
    }
}

.chaine-taux {
    margin: 0;
    font-family: var(--x-titre);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--x-fort);
    font-variant-numeric: tabular-nums;
}

.chaine-detail {
    margin: 0;
    color: var(--x-texte-2);
    font-size: 0.82rem;
}

.jauge,
.barres-taux .barres-piste {
    background: var(--x-grille);
    border-radius: 0 4px 4px 0;
}

/* des taux : la piste fait 100 % et garde la même longueur d'une ligne à l'autre */
.barres-taux li {
    grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) 10rem;
}

.barres-taux .barres-valeur {
    text-align: right;
}

.barres-barre.serie-2 {
    background: var(--serie-2);
}

.barres-barre.serie-3 {
    background: var(--serie-3);
}

.jauge {
    display: block;
    height: 8px;
    margin: 10px 0 12px;
}

.jauge-remplie {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
}

.jauge-remplie.serie-1 {
    background: var(--serie-1);
}

.jauge-remplie.serie-2 {
    background: var(--serie-2);
}

.jauge-remplie.serie-3 {
    background: var(--serie-3);
}

.graphe path.ligne {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.graphe path.ligne.serie-1 {
    stroke: var(--serie-1);
}

.graphe path.ligne.serie-2 {
    stroke: var(--serie-2);
}

.graphe path.ligne.serie-3 {
    stroke: var(--serie-3);
}

.graphe .fin {
    stroke: var(--x-carte);
    stroke-width: 2;
}

.graphe .ligne,
.graphe .fin,
.graphe .etiquette {
    pointer-events: none;
}

.graphe .etiquette {
    fill: var(--x-texte-2);
    font-size: 11px;
    font-weight: 600;
}

.notes-reception {
    color: var(--x-discret);
    font-size: 0.8rem;
}

.notes-reception p {
    margin: 0 0 8px;
}

.notes-reception summary {
    color: var(--x-texte-2);
    cursor: pointer;
}

.notes-reception ul {
    margin: 6px 0 10px;
}

.barre-vue {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
}

.barre-vue p {
    margin: 0;
}

.clients {
    display: grid;
}

details.client {
    border-top: 1px solid var(--x-ligne);
}

details.client summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(80px, 260px) 9rem;
    align-items: center;
    gap: 16px;
    padding: 10px 6px;
    cursor: pointer;
    list-style: none;
}

details.client summary::-webkit-details-marker {
    display: none;
}

details.client summary:hover {
    background: var(--x-survol);
}

details.client .jauge {
    margin: 0;
}

.client-taux {
    text-align: right;
    white-space: nowrap;
}

details.client table {
    margin: 0 0 14px;
}
