/* Sustain Exec — interface web. Complète sustain-exec.css (kit, importé tel quel).
   Aucune couleur en dur : uniquement les variables --se-*. Thème clair uniquement. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("/static/fonts/inter-tight-latin-300-normal.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("/static/fonts/inter-tight-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--se-bg); color: var(--se-text); font-family: var(--se-font-body); line-height: 1.5;
}
/* Tailles et graisses des titres : celles du kit (h1 48 px réservé à la connexion, h2 32 px, h3 22 px). */
h1, h2, h3, h4 { color: var(--se-text); margin: 0 0 .6rem; }
h2 { margin-bottom: .4rem; }
h3 { margin-top: 2rem; }
h4 { font-family: var(--se-font-display); font-weight: 700; font-size: 16px; line-height: 1.2; margin-top: 1.25rem; }
a { color: var(--se-link); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, pre:focus-visible {
  outline: 3px solid var(--se-focus); outline-offset: 2px;
}
code, pre { font-family: ui-monospace, Consolas, monospace; }
/* Conteneur 1200 px, gouttière 24 px ; sur mobile, gouttière 16 px et marges 20 px. */
.container { width: 100%; max-width: var(--se-container); margin: 0 auto; padding: 0 24px; }
.main { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: .5rem; top: -4rem; background: var(--se-blanc); color: var(--se-nuit); padding: .75rem 1rem; z-index: 20; }
.skip-link:focus { top: .5rem; }
.nowrap { white-space: nowrap; }
.lead { font-size: 1.05rem; max-width: 60ch; }
.hint { color: var(--se-text-muted); font-size: .875rem; margin: .3rem 0 0; }

/* --- En-tête horizontal Nuit ------------------------------------------------------------------ */
.app-header { background: var(--se-nuit); color: var(--se-blanc); }
.app-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; min-height: 4rem; }
.app-header__brand { display: inline-flex; align-items: center; min-height: 44px; }
.app-header__nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; flex: 1; }
.app-header a { color: var(--se-blanc); text-decoration: none; }
.app-header__nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; border-bottom: 3px solid transparent; font-weight: 500; }
.app-header__nav a:hover { border-bottom-color: var(--se-brume); }
.app-header__nav a[aria-current="page"] { border-bottom-color: var(--se-blanc); font-weight: 700; }
.app-header a:focus-visible, .app-header button:focus-visible, .app-header summary:focus-visible { outline-color: var(--se-blanc); }
.app-header__tools { display: flex; align-items: center; gap: 1rem; margin-left: auto; flex-wrap: wrap; }
.app-header__org { color: var(--se-brume); font-size: .9rem; }
.lang-switch { display: inline-flex; align-items: center; gap: .15rem; margin: 0; }
.lang-switch button {
  background: none; border: 0; color: var(--se-brume); font: inherit; min-width: 44px; min-height: 44px; cursor: pointer;
}
.lang-switch button[aria-current="true"] { color: var(--se-blanc); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; border: solid currentColor; border-width: 0 2px 2px 0; padding: 3px; transform: rotate(45deg); margin-top: -3px; }
.menu__panel {
  position: absolute; right: 0; top: 100%; z-index: 10; min-width: 12rem; background: var(--se-blanc); color: var(--se-text);
  border: var(--se-hairline); box-shadow: var(--se-shadow); display: flex; flex-direction: column;
}
.menu__panel a, .menu__panel button {
  display: flex; align-items: center; min-height: 44px; padding: 0 1rem; color: var(--se-text); background: none; border: 0;
  font: inherit; text-align: left; width: 100%; cursor: pointer; text-decoration: none;
}
.menu__panel a:hover, .menu__panel button:hover { background: var(--se-bg-subtle); }
.menu__panel form { margin: 0; }
.app-footer { background: var(--se-nuit); color: var(--se-brume); font-size: .85rem; padding: 1rem 0; margin-top: auto; }
.app-footer a { color: var(--se-blanc); }

/* --- Page, séparateurs ------------------------------------------------------------------------ */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head--small { align-items: center; margin-top: 2rem; }
.page-head--small h3 { margin: 0; }
.notice {
  border-left: 4px solid var(--se-sapin); background: var(--se-bg-subtle); padding: .75rem 1rem; margin: 0 0 1.5rem;
}
.empty { border: var(--se-hairline); background: var(--se-bg-subtle); padding: 2.5rem 1.5rem; text-align: center; }
.empty h3 { margin-top: 0; }

/* --- Boutons (≥ 44 px, rayon 2 px) ------------------------------------------------------------ */
.se-btn { min-height: 44px; border-radius: var(--se-radius); display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; text-decoration: none; }
.se-btn[disabled] { opacity: .55; cursor: not-allowed; }
.se-input { min-height: 44px; border-radius: var(--se-radius); width: 100%; }
.se-input--short, .field--short .se-input { max-width: 8rem; }

/* --- Formulaires ------------------------------------------------------------------------------ */
.form { display: block; margin: 0; max-width: 60rem; }
.form--narrow { max-width: 32rem; }
.form--inline { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.field { margin: 0 0 1rem; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: .3rem; padding: 0; }
.field-error { color: var(--se-text); border-left: 4px solid var(--se-nuit); background: var(--se-bg-subtle); padding: .5rem .75rem; margin: .4rem 0; font-weight: 600; }
.field-error .icon { vertical-align: -2px; }
.form-section { border-top: var(--se-hairline); padding-top: .5rem; margin-bottom: 1.5rem; }
.form-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px; }
.col-4 { grid-column: span 4; } .col-6 { grid-column: span 6; }
.choice { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 400; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--se-sapin); flex: none; }
.choices-inline { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.advanced { border: var(--se-hairline); padding: 0 1rem; margin: 1rem 0; }
.advanced > summary, .group > summary, .log > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.row-form { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: 0; }
.row-form--wrap { align-items: flex-end; }
.row-form .field { margin: 0; }
.row-form__count { color: var(--se-text-muted); }
.user-card { border-bottom: var(--se-hairline); padding: 1rem 0; display: grid; gap: .75rem; }
.temp-password { font-size: 1.2rem; background: var(--se-blanc); border: var(--se-hairline); padding: .4rem .7rem; user-select: all; }
.subnav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin-bottom: 1.5rem; border-bottom: var(--se-hairline); }
.subnav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--se-text); border-bottom: 3px solid transparent; }
.subnav a[aria-current="page"] { border-bottom-color: var(--se-nuit); font-weight: 700; }

/* --- Connexion, mot de passe, erreurs ------------------------------------------------------------ */
.auth { max-width: 32rem; }

/* --- Tableaux --------------------------------------------------------------------------------- */
/* position: relative : les libellés masqués (position absolue) des en-têtes restent dans la zone défilante. */
.table-scroll { position: relative; overflow-x: auto; max-width: 100%; margin: .75rem 0 1rem; }
.se-table { width: 100%; border-collapse: collapse; }
.se-table th, .se-table td { padding: .6rem .75rem; text-align: left; vertical-align: top; border-bottom: var(--se-hairline); }
.se-table thead th { border-bottom: var(--se-rule); white-space: nowrap; }
.se-table tbody th { font-weight: 600; }
.cell-name { overflow-wrap: anywhere; }

/* --- Statuts : texte + filet + icône ------------------------------------------------------------ */
.status { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .5rem; border-left: 4px solid var(--se-ardoise); font-weight: 600; white-space: nowrap; }
.status--running { border-left-color: var(--se-signal); color: var(--se-signal); }
.status--ok { border-left-color: var(--se-sapin); color: var(--se-sapin); }
.status--failed { border-left-color: var(--se-nuit); color: var(--se-nuit); }
.status--muted { border-left-color: var(--se-ardoise); color: var(--se-ardoise); }
.icon { flex: none; }

/* --- Niveaux de risque (échelle inversée : plus le score est haut, plus le risque est élevé) ----- */
.risk-chip { display: inline-block; padding: .15rem .55rem; border-radius: var(--se-radius); color: var(--se-nuit); font-weight: 600; white-space: nowrap; }
.se-risk--low { background: var(--se-score-haut); }
.se-risk--mid { background: var(--se-score-moyen); }
.se-risk--high { background: var(--se-score-bas); }

/* --- Détail d'une analyse ----------------------------------------------------------------------- */
.meta { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin: 0 0 1.5rem; }
.meta div { min-width: 8rem; }
.meta dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--se-text-muted); }
.meta dd { margin: .15rem 0 0; font-weight: 600; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 1rem 0; }
.kpi-item { border: var(--se-hairline); background: var(--se-bg-subtle); padding: 1rem; }
.kpi-item--highlight { border-top: 4px solid var(--se-or); }
.kpi-item .se-kpi { overflow-wrap: anywhere; }
.banner-demo { border: 3px solid var(--se-ardoise); background: var(--se-bg-subtle); padding: .75rem 1rem; margin: 0 0 1.5rem; display: flex; flex-direction: column; gap: .25rem; }
.banner-demo__kicker { margin: 0; }
.action-block { border-top: var(--se-hairline); margin-top: 1.5rem; }
.action-note { border: var(--se-hairline); border-left: 4px solid var(--se-sapin); background: var(--se-bg-subtle); padding: 1rem 1.25rem; margin-top: 2rem; }
.action-note h3 { margin-top: 0; }
.group { border: var(--se-hairline); padding: 0 1rem; margin: 1rem 0; }
.map-frame { width: 100%; height: 28rem; border: var(--se-hairline); background: var(--se-bg-subtle); }
.log { margin-top: 2rem; }
pre { background: var(--se-bg-subtle); border: var(--se-hairline); padding: .75rem 1rem; overflow: auto; max-height: 22rem; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: .5rem 0 1rem; }

/* --- Suivi ------------------------------------------------------------------------------------- */
.steps { list-style: none; margin: 1rem 0 1.5rem; padding: 0; }
.step { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: var(--se-hairline); color: var(--se-text-muted); min-height: 44px; }
.step__mark { width: 1.5rem; height: 1.5rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--se-brume); border-radius: var(--se-radius); }
.step--done { color: var(--se-text); }
.step--done .step__mark { border-color: var(--se-sapin); color: var(--se-sapin); }
.step--active { color: var(--se-text); font-weight: 700; }
.step--active .step__mark { border-color: var(--se-signal); color: var(--se-signal); }
.progress-note { display: flex; align-items: center; gap: 1rem; border-left: 4px solid var(--se-signal); background: var(--se-bg-subtle); padding: .75rem 1rem; margin: 1rem 0; }
.progress-note h3, .progress-note p { margin: 0; }
.spinner { width: 1rem; height: 1rem; border: 2px solid var(--se-brume); border-top-color: currentColor; border-radius: var(--se-radius); display: inline-block; animation: se-spin 1s linear infinite; flex: none; }
@keyframes se-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--se-brume); } }

/* --- Mobile ------------------------------------------------------------------------------------ */
@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .grid { grid-template-columns: 1fr; gap: 0 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .table--wide { min-width: 40rem; }
  .col-4, .col-6 { grid-column: auto; }
  .app-header__tools { margin-left: 0; width: 100%; justify-content: space-between; }
  .app-header__nav { width: 100%; order: 3; }
  .menu__panel { right: auto; left: 0; }
  h1, h2 { overflow-wrap: anywhere; }
  .map-frame { height: 20rem; }
  .form-actions .se-btn { width: 100%; }
}
