/* © 2026 Duncan Cordier — voir LICENCE.txt
   VPS Control Center — style imposé par la maquette de Duncan (violet néon, cartes vitrées) : data-style-libre. */
:root {
  --fond: #f3f1fb; --fond2: #e9e5f8; --carte: rgba(255,255,255,.78); --carte-plein: #ffffff;
  --bord: rgba(109,40,217,.22); --bord-fort: rgba(109,40,217,.55);
  --texte: #17142b; --doux: #5d5878; --tres-doux: #8a85a6;
  --violet: #6d28d9; --violet-clair: #8b5cf6; --violet-lueur: rgba(139,92,246,.35);
  --cyan: #0891b2; --vert: #15803d; --vert-fond: rgba(21,128,61,.12); --orange: #b45309; --rouge: #c81e3a; --rouge-fond: rgba(200,30,58,.1);
  --grille: rgba(23,20,43,.08); --ombre: 0 10px 30px rgba(76,29,149,.10);
  --rayon: 14px; --t-xs: 12px; --t-s: 14px; --t-l: 18px; --t-xl: 22px; --t-xxl: 28px;
  --degrade-a: #6d28d9; --degrade-b: #8b5cf6; --sur-violet: #ffffff; --console-fond: #05050f; --console-texte: #d9d6ff; --console-err: #fb7185; --voile: rgba(5,5,20,.6); --police: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #07071a; --fond2: #0d0c26; --carte: rgba(18,16,48,.72); --carte-plein: #121030;
    --bord: rgba(139,92,246,.28); --bord-fort: rgba(167,139,250,.75);
    --texte: #f2efff; --doux: #b9b3dc; --tres-doux: #8580ad;
    --violet: #8b5cf6; --violet-clair: #a78bfa; --violet-lueur: rgba(139,92,246,.55);
    --cyan: #22d3ee; --vert: #34d399; --vert-fond: rgba(52,211,153,.14); --orange: #fbbf24; --rouge: #fb7185; --rouge-fond: rgba(251,113,133,.14);
    --grille: rgba(255,255,255,.07); --ombre: 0 12px 40px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #07071a; --fond2: #0d0c26; --carte: rgba(18,16,48,.72); --carte-plein: #121030;
  --bord: rgba(139,92,246,.28); --bord-fort: rgba(167,139,250,.75);
  --texte: #f2efff; --doux: #b9b3dc; --tres-doux: #8580ad;
  --violet: #8b5cf6; --violet-clair: #a78bfa; --violet-lueur: rgba(139,92,246,.55);
  --cyan: #22d3ee; --vert: #34d399; --vert-fond: rgba(52,211,153,.14); --orange: #fbbf24; --rouge: #fb7185; --rouge-fond: rgba(251,113,133,.14);
  --grille: rgba(255,255,255,.07); --ombre: 0 12px 40px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100dvh; }
body {
  font: 15px/1.45 var(--police); color: var(--texte); background: var(--fond);
  background-image: radial-gradient(1200px 600px at 75% -10%, var(--violet-lueur), transparent 60%), radial-gradient(800px 500px at -10% 110%, rgba(34,211,238,.10), transparent 60%);
  background-attachment: fixed; font-variant-numeric: tabular-nums;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--violet-clair); }
.cache { display: none !important; }
/* Les dégradés d'un SVG en display:none ne s'affichent pas : le bloc de définitions est seulement réduit à rien. */
.definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.muet { color: var(--doux); }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; overflow-wrap: anywhere; }

/* ── Structure ── */
.appli { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.barre-laterale {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 14px; background: linear-gradient(180deg, var(--fond2), var(--fond)); border-right: 1px solid var(--bord);
}
.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 22px; border-bottom: 1px solid var(--bord); margin-bottom: 12px; }
.logo svg { width: 82px; height: 60px; filter: drop-shadow(0 0 14px var(--violet-lueur)); }
.logo strong { font-size: var(--t-l); letter-spacing: .04em; }
.logo span { font-size: var(--t-xs); letter-spacing: .32em; color: var(--doux); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 16px; border-radius: 10px;
  color: var(--doux); text-decoration: none; border: 1px solid transparent; transition: background .15s, color .15s;
}
.nav a svg { width: 22px; height: 22px; flex: none; }
.nav a:hover { color: var(--texte); background: var(--carte); }
.nav a[aria-current="page"] {
  color: var(--sur-violet); background: linear-gradient(90deg, var(--violet), color-mix(in srgb, var(--violet) 55%, transparent));
  border-color: var(--bord-fort); box-shadow: 0 0 22px var(--violet-lueur);
}
.nav .pastille { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--rouge); color: var(--sur-violet); font-size: var(--t-xs); text-align: center; }
.pied-lateral { margin-top: auto; font-size: var(--t-xs); color: var(--tres-doux); padding: 14px 8px 0; border-top: 1px solid var(--bord); }
.pied-lateral b { color: var(--doux); font-weight: 600; }

.principal { min-width: 0; padding: 18px 26px 40px; display: flex; flex-direction: column; gap: 22px; }
.haut { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.recherche { flex: 1 1 320px; max-width: 580px; position: relative; }
.recherche input {
  width: 100%; min-height: 48px; padding: 0 92px 0 46px; border-radius: 12px; border: 1px solid var(--bord);
  background: var(--carte); backdrop-filter: blur(12px);
}
.recherche svg { position: absolute; z-index: 1; left: 15px; top: 13px; width: 20px; height: 20px; color: var(--doux); pointer-events: none; }
.recherche kbd { position: absolute; z-index: 1; right: 12px; top: 12px; padding: 2px 8px; border: 1px solid var(--bord); border-radius: 6px; font-size: var(--t-xs); color: var(--doux); }
.resultats { position: absolute; z-index: 20; left: 0; right: 0; top: 54px; background: var(--carte-plein); border: 1px solid var(--bord-fort); border-radius: 12px; box-shadow: var(--ombre); overflow: hidden; }
.resultats button { display: block; width: 100%; min-height: 44px; padding: 8px 16px; text-align: left; border: 0; background: none; cursor: pointer; }
.resultats button:hover, .resultats button:focus { background: var(--violet-lueur); outline: none; }
.resultats small { color: var(--doux); margin-left: 8px; }
.etat-global { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.voyant { width: 12px; height: 12px; border-radius: 50%; background: var(--vert); box-shadow: 0 0 12px var(--vert); flex: none; }
.voyant.alerte { background: var(--rouge); box-shadow: 0 0 12px var(--rouge); }
.voyant.attente { background: var(--orange); box-shadow: 0 0 12px var(--orange); }
.etat-global strong { display: block; color: var(--vert); }
.etat-global.alerte strong { color: var(--rouge); }
.etat-global small { color: var(--doux); }
.profil { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--bord); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--sur-violet); background: linear-gradient(135deg, var(--violet), var(--cyan)); box-shadow: 0 0 16px var(--violet-lueur); }
.profil small { display: block; color: var(--doux); }

/* ── Cartes ── */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 20px; box-shadow: var(--ombre); backdrop-filter: blur(14px); min-width: 0; }
.carte h2 { margin: 0 0 14px; font-size: var(--t-l); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.carte h2 .droite { margin-left: auto; }
.grille-haut { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
.grille-milieu { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; }
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 10px; padding: 22px; border-color: var(--bord-fort); }
.hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 520px; height: 420px; border-radius: 50%; background: radial-gradient(circle at 40% 60%, rgba(34,211,238,.25), rgba(139,92,246,.15) 45%, transparent 70%); pointer-events: none; }
.hero svg.baies { width: 100%; height: auto; max-height: 230px; filter: drop-shadow(0 0 18px var(--violet-lueur)); }
.hero h1 { margin: 6px 0 2px; font-size: var(--t-xxl); }
.hero p { margin: 0 0 18px; color: var(--doux); font-size: var(--t-l); }
.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; position: relative; z-index: 1; }
.tuile { background: var(--carte-plein); border: 1px solid var(--bord); border-radius: 12px; padding: 14px; min-width: 0; }
.tuile .icone { width: 34px; height: 34px; color: var(--violet-clair); }
.tuile .valeur { font-size: var(--t-xxl); font-weight: 700; margin-top: 8px; line-height: 1.1; }
.tuile .libelle { color: var(--doux); font-size: var(--t-s); }
.tuile .tendance { font-size: var(--t-xs); color: var(--vert); float: right; margin-top: 4px; }
.jauge { height: 7px; border-radius: 9px; background: var(--grille); margin-top: 10px; overflow: hidden; }
.jauge i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--violet), var(--violet-clair)); box-shadow: 0 0 10px var(--violet-lueur); }
.jauge.vert i { background: linear-gradient(90deg, var(--vert), var(--cyan)); }
.jauge.haute i { background: linear-gradient(90deg, var(--orange), var(--rouge)); }
.mini { width: 100%; height: 34px; margin-top: 6px; }

.actions-rapides { display: flex; flex-direction: column; gap: 12px; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--bord); background: var(--carte-plein); cursor: pointer; text-decoration: none; color: var(--texte);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.bouton:hover { border-color: var(--bord-fort); box-shadow: 0 0 18px var(--violet-lueur); }
.bouton:active { transform: translateY(1px); }
.bouton:disabled { opacity: .5; cursor: not-allowed; }
.bouton svg { width: 20px; height: 20px; flex: none; }
.bouton.principal-btn { color: var(--sur-violet); border-color: var(--bord-fort); background: linear-gradient(90deg, var(--degrade-a), var(--degrade-b)); box-shadow: 0 0 22px var(--violet-lueur); font-weight: 600; }
.bouton.danger { color: var(--rouge); border-color: color-mix(in srgb, var(--rouge) 50%, transparent); }
.bouton.danger.plein { color: var(--sur-violet); background: var(--rouge); }
.bouton.petit { min-height: 44px; padding: 0 12px; }
.actions-rapides .bouton { justify-content: flex-start; }

.periodes { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.periodes button { min-height: 44px; min-width: 52px; border-radius: 10px; border: 1px solid var(--bord); background: var(--carte-plein); cursor: pointer; }
.periodes button[aria-pressed="true"] { border-color: var(--bord-fort); background: var(--violet); color: var(--sur-violet); box-shadow: 0 0 14px var(--violet-lueur); }
.perf { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; }
.graphe { position: relative; min-height: 220px; }
.graphe svg { width: 100%; height: 220px; display: block; overflow: visible; }
.graphe .axe { font-size: var(--t-xs); fill: var(--tres-doux); }
.graphe .ligne-grille { stroke: var(--grille); stroke-width: 1; }
.serie-cpu { stroke: var(--cyan); } .serie-mem { stroke: var(--violet-clair); } .serie-disque { stroke: var(--vert); }
.graphe path.serie { fill: none; stroke-width: 2.4; filter: drop-shadow(0 0 6px currentColor); vector-effect: non-scaling-stroke; }
.legendes { display: flex; flex-direction: column; gap: 10px; }
.legende { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--carte-plein); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; }
.legende svg { width: 28px; height: 28px; }
.legende b { display: block; font-size: var(--t-l); }
.vide { color: var(--doux); padding: 30px 10px; text-align: center; }

.anneau { display: grid; place-items: center; padding: 4px 0 10px; }
.anneau svg { width: 160px; height: 160px; }
.anneau .centre { font-size: var(--t-xxl); font-weight: 700; fill: var(--texte); }
.anneau .sous { font-size: var(--t-xs); fill: var(--doux); }
.compteurs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: var(--t-s); }
.compteurs span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--c, var(--vert)); box-shadow: 0 0 8px var(--c, var(--vert)); }

.activite { list-style: none; margin: 0; padding: 0; }
.activite li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grille); }
.activite li:last-child { border-bottom: 0; }
.activite svg { width: 22px; height: 22px; }
.activite b { display: block; overflow-wrap: anywhere; }
.activite small { color: var(--doux); overflow-wrap: anywhere; }
.activite time { color: var(--doux); font-size: var(--t-s); white-space: nowrap; }

/* ── Tableaux ── */
.defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; font-weight: 600; font-size: var(--t-s); color: var(--doux); padding: 8px 10px; border-bottom: 1px solid var(--bord); }
td { padding: 12px 10px; border-bottom: 1px solid var(--grille); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .nom b { display: block; } td .nom small { color: var(--doux); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: var(--t-s); white-space: nowrap; background: var(--vert-fond); color: var(--vert); border: 1px solid color-mix(in srgb, var(--vert) 40%, transparent); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.ko { background: var(--rouge-fond); color: var(--rouge); border-color: color-mix(in srgb, var(--rouge) 40%, transparent); }
.badge.att { background: rgba(251,191,36,.12); color: var(--orange); border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.badge.neutre { background: var(--grille); color: var(--doux); border-color: var(--bord); }
.barre-val { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.barre-val .jauge { flex: 1; margin: 0; max-width: 90px; }
.outils { display: flex; gap: 8px; flex-wrap: wrap; }
.outils .bouton { min-width: 44px; padding: 0 12px; }

.vue { display: flex; flex-direction: column; gap: 22px; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 22px; }
.alerte-bandeau { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 12px; background: var(--rouge-fond); border: 1px solid color-mix(in srgb, var(--rouge) 45%, transparent); }
.alerte-bandeau.att { background: rgba(251,191,36,.10); border-color: color-mix(in srgb, var(--orange) 45%, transparent); }
.alerte-bandeau ul { margin: 0; padding-left: 18px; }
dl.infos { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
dl.infos dt { color: var(--doux); } dl.infos dd { margin: 0; overflow-wrap: anywhere; }

/* Console */
.console-sortie { background: var(--console-fond); color: var(--console-texte); border: 1px solid var(--bord); border-radius: 12px; padding: 14px; min-height: 280px; max-height: 60dvh; overflow: auto; font: var(--t-s)/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.console-sortie .cmd { color: var(--violet-clair); } .console-sortie .err { color: var(--console-err); }
.console-saisie { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.console-saisie input { flex: 1 1 260px; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--bord); background: var(--carte-plein); font-family: ui-monospace, Consolas, monospace; }

/* Journal d'un service */
pre.journal { margin: 0; max-height: 55dvh; overflow: auto; font: var(--t-xs)/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fond2); border-radius: 10px; padding: 12px; }

/* ── Fenêtres ── */
dialog { border: 1px solid var(--bord-fort); border-radius: 16px; background: var(--carte-plein); color: var(--texte); padding: 22px; width: min(560px, calc(100vw - 24px)); box-shadow: 0 0 60px var(--violet-lueur); }
dialog.large { width: min(980px, calc(100vw - 24px)); }
dialog::backdrop { background: var(--voile); backdrop-filter: blur(3px); }
dialog h3 { margin: 0 0 12px; font-size: var(--t-l); }
dialog .pied { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.message-dialogue { margin-top: 12px; }

/* ── Écrans d'accès ── */
.acces { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.acces .carte { width: min(430px, 100%); padding: 28px; }
.acces .logo { border: 0; padding-bottom: 8px; }
.acces h1 { font-size: var(--t-xl); margin: 6px 0; text-align: center; }
.acces p { color: var(--doux); text-align: center; margin: 0 0 18px; }
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.champ input { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--bord); background: var(--carte-plein); }
.champ input:focus, .console-saisie input:focus, .recherche input:focus { outline: 2px solid var(--violet-clair); outline-offset: 1px; }
.acces .bouton { width: 100%; }
.acces .signature { text-align: center; font-size: var(--t-xs); color: var(--tres-doux); margin-top: 18px; }

/* Messages (toujours visibles, au premier plan) */
.toasts { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--carte-plein); border: 1px solid var(--bord-fort); box-shadow: var(--ombre); }
.toast.ko { border-color: var(--rouge); } .toast.ok { border-color: var(--vert); }
.erreur-form { color: var(--rouge); min-height: 1.4em; margin: 6px 0 0; text-align: center; }

.theme-choix { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.theme-choix button { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--bord); background: var(--carte-plein); cursor: pointer; }
.theme-choix button[aria-pressed="true"] { border-color: var(--bord-fort); background: var(--violet); color: var(--sur-violet); }
.bouton-menu { display: none; }

/* ── Tailles d'écran ── */
@media (max-width: 1280px) {
  .grille-milieu { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grille-milieu > :first-child { grid-column: 1 / -1; }
  .hero { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .grille-haut { grid-template-columns: minmax(0, 1fr); }
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .appli { grid-template-columns: minmax(0, 1fr); }
  .barre-laterale { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-105%); transition: transform .2s; }
  .barre-laterale.ouverte { transform: none; box-shadow: var(--ombre); }
  .bouton-menu { display: inline-flex; }
  .principal { padding: 14px 14px 40px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero svg.baies { display: none; }
  .grille-milieu { grid-template-columns: minmax(0, 1fr); }
  .perf { grid-template-columns: minmax(0, 1fr); }
  .legendes { flex-direction: row; flex-wrap: wrap; } .legende { flex: 1 1 150px; }
  .etat-global { margin-left: 0; }
  .profil { border-left: 0; padding-left: 0; }
}
@media (max-width: 480px) {
  .tuiles { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: var(--t-xl); }
  .profil .nom-profil { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
