:root {
  --fond: #0b1022;
  --verre: rgba(255, 255, 255, 0.075);
  --verre-fort: rgba(255, 255, 255, 0.12);
  --verre-hover: rgba(255, 255, 255, 0.14);
  --bord: rgba(255, 255, 255, 0.12);
  --bord-fort: rgba(255, 255, 255, 0.22);
  --texte: #f3f5ff;
  --texte-2: rgba(235, 239, 255, 0.72);
  --texte-3: rgba(235, 239, 255, 0.5);
  --accent: #7c9bff;
  --accent-2: #a77bff;
  --ok: #3ddc97;
  --attention: #ffb347;
  --panne: #ff5f6d;
  --pause: #8b93b5;
  --rayon: 22px;
  --rayon-s: 14px;
  --ombre: 0 18px 50px rgba(3, 6, 20, 0.45);
  --flou: blur(26px) saturate(150%);
  --police: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--police);
  color: var(--texte);
  background: var(--fond);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.discret { color: var(--texte-3); }
.second { color: var(--texte-2); }
[hidden] { display: none !important; }

/* ---------- fond façon fond d'écran ---------- */
.fond { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(1200px 800px at 15% 10%, #24306b 0%, transparent 60%),
              radial-gradient(900px 700px at 90% 20%, #4a2a74 0%, transparent 60%),
              radial-gradient(1000px 900px at 60% 100%, #0f4a62 0%, transparent 60%),
              linear-gradient(160deg, #0c1230, #0a0f20 60%, #0c1a2c); }
.fond i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; animation: flotte 40s ease-in-out infinite alternate; }
.fond i:nth-child(1) { width: 520px; height: 520px; left: -120px; top: 30%; background: #3c5cff; }
.fond i:nth-child(2) { width: 460px; height: 460px; right: -100px; top: -80px; background: #9b4dff; animation-duration: 52s; }
.fond i:nth-child(3) { width: 600px; height: 600px; right: 20%; bottom: -260px; background: #0ea5b7; animation-duration: 60s; opacity: 0.35; }
@keyframes flotte { to { transform: translate3d(80px, -60px, 0) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .fond i { animation: none; } }

.verre {
  background: var(--verre);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  backdrop-filter: var(--flou);
  -webkit-backdrop-filter: var(--flou);
  box-shadow: var(--ombre);
}

/* ---------- barre du haut ---------- */
.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(10, 14, 32, 0.75), rgba(10, 14, 32, 0.35));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.logo img { width: 30px; height: 30px; }
.logo span { font-size: 17px; }
.logo small { font-weight: 500; color: var(--texte-3); margin-left: 2px; }
nav.onglets { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); margin: 0 auto; }
nav.onglets a { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--texte-2); font-weight: 500; font-size: 14px; transition: background 0.15s, color 0.15s; }
nav.onglets a:hover { color: var(--texte); background: rgba(255, 255, 255, 0.06); }
nav.onglets a.actif { background: rgba(255, 255, 255, 0.16); color: var(--texte); }
nav.onglets svg { width: 17px; height: 17px; }
.barre .droite { display: flex; align-items: center; gap: 8px; }
.rond { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); cursor: pointer; position: relative; transition: background 0.15s; }
.rond:hover { background: rgba(255, 255, 255, 0.14); }
.rond svg { width: 18px; height: 18px; }
.rond .pastille { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--panne); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

main { max-width: 1480px; margin: 0 auto; padding: 24px max(20px, env(safe-area-inset-right)) 60px max(20px, env(safe-area-inset-left)); }

/* ---------- accueil ---------- */
.accueil { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.colonne { display: flex; flex-direction: column; gap: 18px; }
.widget { padding: 18px 20px; }
.widget h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-3); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.horloge .heure { font-size: 54px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.horloge .date { margin-top: 6px; color: var(--texte-2); text-transform: capitalize; }
.horloge .salut { margin-top: 12px; font-size: 14px; color: var(--texte-3); }

.etat-general { display: flex; gap: 12px; align-items: center; }
.etat-general .icone-etat { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.etat-general .icone-etat svg { width: 22px; height: 22px; }
.etat-general.ok .icone-etat { background: rgba(61, 220, 151, 0.16); color: var(--ok); }
.etat-general.ko .icone-etat { background: rgba(255, 95, 109, 0.16); color: var(--panne); }
.etat-general.att .icone-etat { background: rgba(255, 179, 71, 0.16); color: var(--attention); }
.etat-general b { display: block; font-size: 16px; }
.problemes { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.problemes li { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--texte-2); padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); cursor: pointer; }
.problemes li:hover { background: rgba(255, 255, 255, 0.09); }

.machine { cursor: pointer; transition: transform 0.2s cubic-bezier(.2,.8,.2,1), background 0.2s; }
.machine:hover { background: var(--verre-hover); }
.machine:active { transform: scale(0.99); }
.machine .tete { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.machine .tete b { font-size: 16px; }
.machine .tete .sous { font-size: 12.5px; color: var(--texte-3); }
.machine .tete .fleche { margin-left: auto; color: var(--texte-3); }
.jauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jauge { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.jauge .anneau { position: relative; width: 74px; height: 74px; }
.jauge .anneau svg { width: 74px; height: 74px; transform: rotate(-90deg); }
.jauge .anneau circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.jauge .anneau .piste { stroke: rgba(255, 255, 255, 0.09); }
.jauge .anneau .valeur { transition: stroke-dashoffset 0.8s cubic-bezier(.2,.8,.2,1), stroke 0.4s; }
.jauge .anneau span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.jauge small { font-size: 12px; color: var(--texte-3); text-align: center; line-height: 1.25; }
.infos-machine { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; color: var(--texte-2); }
.infos-machine div { display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.infos-machine svg { width: 15px; height: 15px; color: var(--texte-3); flex: none; }
.hors-ligne { padding: 14px; border-radius: 12px; background: rgba(255, 95, 109, 0.12); color: #ffc2c8; font-size: 14px; }

.section-titre { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.section-titre h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.section-titre .compte { color: var(--texte-3); font-weight: 500; }
.section-titre .espace { flex: 1; }
.puces { display: flex; gap: 6px; flex-wrap: wrap; }
.puce { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--bord); background: rgba(255, 255, 255, 0.05); cursor: pointer; font-size: 13.5px; color: var(--texte-2); transition: background 0.15s, color 0.15s; }
.puce:hover { background: rgba(255, 255, 255, 0.1); color: var(--texte); }
.puce.actif { background: rgba(255, 255, 255, 0.18); color: var(--texte); border-color: var(--bord-fort); }
.recherche { position: relative; }
.recherche input { width: 200px; padding: 8px 12px 8px 34px; border-radius: 999px; border: 1px solid var(--bord); background: rgba(255, 255, 255, 0.06); outline: none; transition: border-color 0.15s, background 0.15s; }
.recherche input:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.1); }
.recherche svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--texte-3); }

.applis { padding: 22px; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.tuile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px 14px; border-radius: 18px; cursor: pointer; text-decoration: none; transition: background 0.18s, transform 0.18s cubic-bezier(.2,.8,.2,1); border: 1px solid transparent; background: none; }
.tuile:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.08); }
.tuile:active { transform: scale(0.96); }
.tuile .ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 32px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25); position: relative; overflow: hidden; }
.tuile .ico img { width: 44px; height: 44px; object-fit: contain; }
.tuile .ico.image { background: rgba(255, 255, 255, 0.92); }
.tuile .ico .lettre { font-weight: 700; font-size: 26px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.tuile .nom { font-size: 13.5px; font-weight: 500; text-align: center; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tuile .point { position: absolute; top: 12px; right: calc(50% - 40px); width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #1a2040; }
.tuile .plus { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; opacity: 0; color: var(--texte-2); background: rgba(255, 255, 255, 0.1); border: none; cursor: pointer; transition: opacity 0.15s; }
.tuile:hover .plus, .tuile:focus-within .plus { opacity: 1; }
.tuile .plus svg { width: 16px; height: 16px; }
.tuile.masque { opacity: 0.45; }
@media (hover: none) { .tuile .plus { opacity: 0.8; } }
.machine-groupe { margin: 18px 0 8px; font-size: 13px; color: var(--texte-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 10px; }
.machine-groupe::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.08); }
.machine-groupe:first-child { margin-top: 0; }

.point.ok, .dot.ok { background: var(--ok); }
.point.attention, .dot.attention { background: var(--attention); }
.point.panne, .dot.panne { background: var(--panne); }
.point.arret, .dot.arret { background: var(--panne); }
.point.inconnu, .point.attente, .dot.inconnu, .dot.attente { background: var(--pause); }
.point.pause, .dot.pause { background: var(--pause); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot.ok { box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15); }
.dot.panne, .dot.arret { box-shadow: 0 0 0 4px rgba(255, 95, 109, 0.18); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 95, 109, 0.05); } }

.evenements { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.evenements li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 13.5px; }
.evenements li:last-child { border-bottom: none; }
.evenements li .dot { transform: translateY(-1px); }
.evenements li time { color: var(--texte-3); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.evenements li .detail { grid-column: 2 / 4; color: var(--texte-3); font-size: 12.5px; white-space: pre-line; margin-top: -4px; }
.vide { padding: 22px; text-align: center; color: var(--texte-3); font-size: 14px; }

/* ---------- surveillance ---------- */
.sondes { padding: 8px; }
.sonde { display: grid; grid-template-columns: auto minmax(160px, 1.2fr) minmax(200px, 2fr) 92px 86px; gap: 16px; align-items: center; padding: 14px 16px; border-radius: 16px; cursor: pointer; transition: background 0.15s; }
.sonde:hover { background: rgba(255, 255, 255, 0.06); }
.sonde + .sonde { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.sonde .titre b { display: block; font-weight: 600; }
.sonde .titre > span { font-size: 12.5px; color: var(--texte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pilule { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pilule.ok { background: rgba(61, 220, 151, 0.16); color: var(--ok); }
.pilule.panne { background: rgba(255, 95, 109, 0.18); color: var(--panne); }
.pilule.attention { background: rgba(255, 179, 71, 0.16); color: var(--attention); }
.pilule.pause, .pilule.attente { background: rgba(139, 147, 181, 0.18); color: var(--pause); }
.battements { display: flex; gap: 3px; align-items: center; height: 30px; justify-content: flex-end; }
.battements i { flex: 1; max-width: 8px; min-width: 3px; height: 26px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); transition: transform 0.15s; }
.battements i.ok { background: var(--ok); }
.battements i.ko { background: var(--panne); }
.battements i:hover { transform: scaleY(1.15); }
.sonde .chiffre { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.sonde .chiffre small { display: block; color: var(--texte-3); font-size: 11.5px; }
.badge-cert { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: var(--texte-2); margin-left: 6px; white-space: nowrap; }
.badge-cert.att { background: rgba(255, 179, 71, 0.18); color: var(--attention); }

/* ---------- boutons et formulaires ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(255, 255, 255, 0.08); cursor: pointer; font-weight: 550; font-size: 14px; text-decoration: none; transition: background 0.15s, transform 0.1s, border-color 0.15s; white-space: nowrap; }
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn.principal { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(124, 155, 255, 0.35); }
.btn.principal:hover { filter: brightness(1.08); }
.btn.danger { color: #ffb4bb; border-color: rgba(255, 95, 109, 0.35); background: rgba(255, 95, 109, 0.1); }
.btn.danger:hover { background: rgba(255, 95, 109, 0.2); }
.btn.petit { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.lien { background: none; border-color: transparent; color: var(--texte-2); }
.btn.lien:hover { color: var(--texte); background: rgba(255, 255, 255, 0.06); }
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.champ label { font-size: 13px; color: var(--texte-2); font-weight: 500; }
.champ .aide { font-size: 12.5px; color: var(--texte-3); }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(8, 12, 30, 0.45); outline: none; transition: border-color 0.15s, box-shadow 0.15s; font-size: 16px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 155, 255, 0.2); }
select option { background: #151b38; }
.ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ligne3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); cursor: pointer; }
.interrupteur:last-of-type { border-bottom: none; }
.interrupteur .texte b { display: block; font-weight: 550; font-size: 14.5px; }
.interrupteur .texte span { font-size: 12.5px; color: var(--texte-3); }
.interrupteur input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: rgba(255, 255, 255, 0.16); position: relative; cursor: pointer; flex: none; transition: background 0.2s; margin: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.22s cubic-bezier(.2,.8,.2,1); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.interrupteur input:checked { background: var(--ok); }
.interrupteur input:checked::after { transform: translateX(18px); }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.message-erreur { padding: 10px 12px; border-radius: 10px; background: rgba(255, 95, 109, 0.14); color: #ffc2c8; font-size: 14px; margin-bottom: 14px; }

/* ---------- connexion ---------- */
.ecran-connexion { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.carte-connexion { width: 100%; max-width: 400px; padding: 34px 30px 28px; }
.carte-connexion .logo { justify-content: center; margin-bottom: 6px; }
.carte-connexion .logo img { width: 48px; height: 48px; }
.carte-connexion h1 { text-align: center; font-size: 22px; margin: 14px 0 4px; letter-spacing: -0.02em; }
.carte-connexion p.intro { text-align: center; color: var(--texte-2); margin: 0 0 22px; font-size: 14px; }
.carte-connexion .btn.principal { width: 100%; padding: 12px; margin-top: 6px; }
.code-2fa { text-align: center; letter-spacing: 0.4em; font-size: 26px !important; font-family: var(--mono); padding: 12px !important; }
.qr { background: #fff; border-radius: 16px; padding: 12px; width: 212px; height: 212px; margin: 0 auto 14px; display: grid; place-items: center; }
.qr img, .qr svg { width: 188px; height: 188px; image-rendering: pixelated; }
.secret { text-align: center; font-family: var(--mono); font-size: 13px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); word-break: break-all; margin-bottom: 16px; user-select: all; }
.etapes-2fa { margin: 0 0 18px; padding-left: 20px; color: var(--texte-2); font-size: 14px; }
.etapes-2fa li { margin-bottom: 4px; }

/* ---------- fenêtres (modales et tiroir) ---------- */
#couche { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.voile { position: fixed; inset: 0; background: rgba(4, 7, 20, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); pointer-events: auto; animation: apparait 0.2s ease-out; display: flex; align-items: center; justify-content: center; padding: 20px; }
.voile.ferme { animation: disparait 0.16s ease-in forwards; }
.fenetre { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; padding: 24px; background: rgba(22, 28, 58, 0.82); animation: monte 0.28s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; }
.fenetre.large { max-width: 860px; }
.voile.ferme .fenetre { animation: descend 0.16s ease-in forwards; }
.fenetre .entete { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.fenetre .entete h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.fenetre .entete .sous { color: var(--texte-3); font-size: 13.5px; word-break: break-all; }
.fenetre .entete .rond { margin-left: auto; flex: none; }
@keyframes apparait { from { opacity: 0; } }
@keyframes disparait { to { opacity: 0; } }
@keyframes monte { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes descend { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06); }
.stat small { display: block; font-size: 12px; color: var(--texte-3); margin-bottom: 2px; }
.stat b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bloc { margin-bottom: 20px; }
.bloc h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-3); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.bloc h4 .espace { flex: 1; }

.conteneurs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.conteneurs th { text-align: left; font-weight: 500; color: var(--texte-3); font-size: 12px; padding: 6px 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.conteneurs td { padding: 9px 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; }
.conteneurs td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.conteneurs th.num { text-align: right; }
.conteneurs .nomc { display: flex; align-items: center; gap: 9px; font-weight: 550; }
.conteneurs .img { font-size: 12px; color: var(--texte-3); word-break: break-all; }
.table-defile { overflow-x: auto; margin: 0 -4px; }

/* ---------- graphiques ---------- */
.graph { position: relative; height: 170px; }
.graph svg { width: 100%; height: 100%; overflow: visible; }
.graph .axe { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.graph text { fill: var(--texte-3); font-size: 11px; font-family: var(--police); }
.graph .bulle { position: absolute; pointer-events: none; padding: 7px 10px; border-radius: 10px; background: rgba(12, 16, 38, 0.92); border: 1px solid var(--bord); font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: var(--ombre); font-variant-numeric: tabular-nums; z-index: 2; }
.graph .curseur { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.graphs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.carte-graph { padding: 16px 18px 12px; }
.carte-graph h4 { margin: 0 0 4px; display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; }
.carte-graph h4 span { font-size: 13px; color: var(--texte-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.legende { display: flex; gap: 14px; font-size: 12px; color: var(--texte-3); }
.legende i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* ---------- page machine ---------- */
.entete-page { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.entete-page h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.entete-page .sous { color: var(--texte-3); font-size: 14px; }
.entete-page .espace { flex: 1; }
.resume-machine { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.resume-machine .stat { background: var(--verre); backdrop-filter: var(--flou); -webkit-backdrop-filter: var(--flou); border-color: var(--bord); }

/* ---------- réglages ---------- */
.reglages { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }
.reglages .widget h3 { font-size: 15px; text-transform: none; letter-spacing: -0.01em; color: var(--texte); margin-bottom: 4px; }
.reglages .widget > p.second { margin: 0 0 14px; font-size: 13.5px; }
.liste-applis { display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.ligne-appli { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; cursor: pointer; }
.ligne-appli:hover { background: rgba(255, 255, 255, 0.06); }
.ligne-appli .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; flex: none; overflow: hidden; }
.ligne-appli .ico img { width: 26px; height: 26px; }
.ligne-appli .ico.image { background: rgba(255,255,255,0.92); }
.ligne-appli .ico .lettre { font-size: 16px; font-weight: 700; }
.ligne-appli .t { flex: 1; min-width: 0; }
.ligne-appli .t b { display: block; font-weight: 550; font-size: 14px; }
.ligne-appli .t span { display: block; font-size: 12.5px; color: var(--texte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etiquette { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: var(--texte-2); white-space: nowrap; }

/* ---------- notifications ---------- */
#toasts { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 440px; }
.toast { padding: 11px 16px; border-radius: 14px; background: rgba(20, 26, 54, 0.95); border: 1px solid var(--bord); box-shadow: var(--ombre); font-size: 14px; animation: monte 0.25s cubic-bezier(.2,.8,.2,1); pointer-events: auto; display: flex; gap: 10px; align-items: center; }
.toast.erreur { border-color: rgba(255, 95, 109, 0.5); }
.toast.ok .dot { background: var(--ok); }
.toast.erreur .dot { background: var(--panne); }
.toast.sort { animation: descend 0.2s ease-in forwards; }

.chargement { display: grid; place-items: center; min-height: 50vh; color: var(--texte-3); }
.roue { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--accent); border-radius: 50%; animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- petits écrans ---------- */
@media (max-width: 1100px) {
  .accueil { grid-template-columns: 1fr; }
  .colonne { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .graphs { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .barre { gap: 10px; padding: 10px 16px; }
  .logo span, .logo small { display: none; }
  nav.onglets { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 30; background: rgba(18, 24, 52, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--ombre); padding: 5px; }
  nav.onglets a { flex-direction: column; gap: 2px; padding: 7px 14px; font-size: 11px; }
  nav.onglets a svg { width: 20px; height: 20px; }
  .barre .droite { margin-left: auto; }
  main { padding: 16px 16px 110px; }
  .colonne { grid-template-columns: 1fr; }
  .horloge .heure { font-size: 44px; }
  .applis { padding: 16px 10px; }
  .grille { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 4px; }
  .tuile { padding: 12px 4px 10px; }
  .tuile .ico { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; }
  .tuile .ico img { width: 38px; height: 38px; }
  .tuile .point { right: calc(50% - 35px); top: 8px; }
  .recherche input { width: 100%; }
  .recherche { flex: 1 1 100%; }
  .sonde { grid-template-columns: auto 1fr auto; gap: 6px 12px; padding: 12px; }
  .sonde .battements { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .sonde .chiffre.ms { display: none; }
  .reglages { grid-template-columns: 1fr; }
  .ligne, .ligne3 { grid-template-columns: 1fr; gap: 0; }
  .voile { padding: 0; align-items: flex-end; }
  .fenetre { max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .conteneurs .img, .conteneurs th.cache, .conteneurs td.cache { display: none; }
}

/* ---------- graphiques (zone) ---------- */
.graph .zone { position: absolute; left: 42px; right: 6px; top: 8px; bottom: 22px; cursor: crosshair; }
.graph .zone svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.graph .ey { position: absolute; left: 0; width: 36px; text-align: right; font-size: 11px; color: var(--texte-3); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.graph .ex { position: absolute; bottom: 0; font-size: 11px; color: var(--texte-3); transform: translateX(-50%); white-space: nowrap; }
.graph .ligne-v { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.35); pointer-events: none; }
.graph .vide-graph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--texte-3); font-size: 13px; }

/* ---------- phase 2 : actions, journaux, tâches ---------- */
.dot.action, .point.action { background: var(--accent); }
.boutons-ic { display: flex; gap: 4px; justify-content: flex-end; }
.ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; border: 1px solid transparent; background: rgba(255, 255, 255, 0.06); color: var(--texte-2); cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.1s; flex: none; }
.ic:hover { background: rgba(255, 255, 255, 0.14); color: var(--texte); }
.ic:active { transform: scale(0.94); }
.ic:disabled { opacity: 0.3; cursor: default; transform: none; }
.ic.rouge:hover { background: rgba(255, 95, 109, 0.2); color: #ffb4bb; }
.ic.vert:hover { background: rgba(61, 220, 151, 0.18); color: var(--ok); }
.ic svg { width: 15px; height: 15px; }
.ic.tourne svg { animation: tourne 0.8s linear infinite; }
.journal { background: rgba(4, 6, 16, 0.7); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 12px 14px; height: min(60vh, 560px); overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; overscroll-behavior: contain; }
.journal .l { display: block; }
.journal .l time { color: rgba(160, 170, 210, 0.55); margin-right: 10px; user-select: none; }
.journal .l.err { color: #ffb0b8; }
.journal mark { background: rgba(255, 210, 90, 0.35); color: inherit; border-radius: 3px; }
.barre-journal { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.barre-journal input[type=search] { flex: 1; min-width: 160px; padding: 8px 12px; font-size: 14px; }
.barre-journal select { width: auto; padding: 8px 10px; font-size: 14px; }
.barre-journal label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--texte-2); cursor: pointer; white-space: nowrap; }
.sortie-tache { height: min(55vh, 480px); }
.services { display: flex; flex-direction: column; max-height: 560px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.service { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 6px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.service:first-child { border-top: none; }
.service .t b { font-weight: 550; font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service .t span { font-size: 12.5px; color: var(--texte-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.systeme-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.paquets { max-height: 260px; overflow: auto; font-size: 13px; margin-top: 8px; }
.paquets div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.paquets div span:last-child { color: var(--texte-3); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
details > summary { cursor: pointer; color: var(--texte-2); font-size: 14px; list-style: none; display: flex; align-items: center; gap: 6px; }
details > summary::-webkit-details-marker { display: none; }
details > summary svg { width: 14px; height: 14px; transition: transform 0.2s; }
details[open] > summary svg { transform: rotate(90deg); }
.encours { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(124, 155, 255, 0.12); margin-bottom: 14px; font-size: 14px; }
.encours .roue { width: 18px; height: 18px; border-width: 2px; flex: none; }
.encours .espace { flex: 1; }
.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
@media (max-width: 1100px) { .deux-col { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .service { grid-template-columns: auto minmax(0, 1fr) auto; }
  .service .etiquette { display: none; }
  .conteneurs td.actions-c { padding-left: 0; }
}
