/* ==========================================================================
   myLims Console (ADR-0034, DEC-082) : seul écart de style avec myLims, le rail orange, pour qu'on ne confonde
   jamais la console avec l'application d'un laboratoire. Tout le reste vient du kit (mêmes composants).
   Contraste AA vérifié : texte du rail sur son fond ≥ 4,5:1, texte fort ≥ 7:1 (DEC-080).
   Le thème « contraste élevé » garde son rail noir : l'accessibilité prime sur la couleur de l'application.
   ========================================================================== */
html[data-app="console"] {
  --nav-bg: #7c2d12;          /* orange 900 : #fff dessus 9,9:1 */
  --nav-text: #fde4cf;        /* sur #7c2d12 : 8,3:1 */
  --nav-text-strong: #ffffff;
  --nav-active: #9a3412;      /* orange 800 : #fff dessus 7,3:1 */
}
html[data-app="console"][data-theme="sombre"] {
  --nav-bg: #431407;          /* orange 950 */
  --nav-text: #fdba74;        /* sur #431407 : 9,6:1 */
  --nav-text-strong: #ffffff;
  --nav-active: #7c2d12;
}
html[data-app="console"][data-theme="contraste"] {
  --nav-bg: #000000;
  --nav-text: #ffffff;
  --nav-active: #0033a0;
}
/* Logo : pastille claire, lettre orange */
html[data-app="console"] .nb-rail .nb-logo { color: #9a3412; }

/* ==========================================================================
   Environnements en serveurs (EXPLOIT-CLIENT, CHG-029) : une carte par environnement, la production en orange
   (couleur de la console), les environnements bas chacun sa couleur ; instances de base dessous, reliées aux
   environnements qu'elles portent. Clic droit (ou bouton « Actions », Maj+F10) : menu des actions de l'environnement.
   ========================================================================== */
.cs-parc { display: grid; gap: 0 .75rem; align-items: stretch; }
.cs-srv { --c: #2563eb; position: relative; display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); box-shadow: 0 .5rem 1.5rem color-mix(in srgb, var(--c) 14%, transparent);
  overflow: hidden; cursor: context-menu; transition: transform .15s, box-shadow .15s; outline-offset: 2px; }
.cs-srv:hover, .cs-srv:focus-visible { transform: translateY(-2px); box-shadow: 0 .75rem 2rem color-mix(in srgb, var(--c) 26%, transparent); }
.cs-srv.prod { --c: #c2410c; }
.cs-srv.recette { --c: #0e7490; }
.cs-srv.preprod { --c: #7c3aed; }
.cs-srv.formation { --c: #15803d; }
.cs-srv.autre { --c: #475569; }
.cs-srv .tete { position: relative; display: grid; justify-items: center; gap: .375rem; padding: 1.125rem .75rem .875rem; color: #fff; text-align: center;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 60%, #000) 100%); }
.cs-srv .tete > svg { width: 3.25rem; height: 3.875rem; filter: drop-shadow(0 .375rem .5rem rgba(0,0,0,.3)); }
.cs-srv .tete .led { animation: cs-led 1.6s ease-in-out infinite; }
.cs-srv .tete .led.b { animation-delay: .5s; }
.cs-srv .tete .led.c { animation-delay: 1s; }
.cs-srv.arret .tete .led { animation: none; fill: #fca5a5; }
@keyframes cs-led { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .cs-srv .tete .led { animation: none; } .cs-srv { transition: none; } }
.cs-srv .tete .nom { min-width: 0; max-width: 100%; }
.cs-srv .tete b { display: block; font-size: var(--fs-lg); letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-srv .tete small { opacity: .92; font-size: var(--fs-xs); }
.cs-srv .tete .ver { position: absolute; top: .5rem; left: .5rem; padding: .125rem .5rem; border-radius: 62.4375rem; background: rgba(255,255,255,.22); font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.cs-srv .tete .act { position: absolute; top: .375rem; right: .375rem; border: 0; background: rgba(255,255,255,.16); color: inherit; border-radius: var(--radius); width: 1.75rem; height: 1.75rem; display: grid; place-items: center; cursor: pointer; }
.cs-srv .tete .act:hover { background: rgba(255,255,255,.32); }
.cs-srv dl { display: grid; gap: .0625rem; margin: 0; padding: .625rem .875rem; font-size: var(--fs-xs); }
.cs-srv dt { color: var(--text-muted); margin-top: .3125rem; }
.cs-srv dt:first-child { margin-top: 0; }
.cs-srv dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
.cs-srv .pied { margin-top: auto; display: flex; flex-wrap: wrap; gap: .375rem; padding: .5rem .875rem .75rem; border-top: 1px solid var(--border); }
.cs-ajout { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .375rem; min-height: 100%; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); background: none; font: inherit; font-size: var(--fs-sm); cursor: pointer; padding: 1rem; }
.cs-ajout:hover { border-color: var(--accent); color: var(--accent); }
/* Liaisons vers les instances de base : un trait sous chaque serveur, une barre au-dessus de chaque instance */
.cs-lien { height: 1.25rem; display: flex; justify-content: center; }
.cs-lien i { width: 2px; background: var(--border-strong); }
.cs-base { position: relative; display: flex; align-items: center; gap: .625rem; padding: .625rem .875rem; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.cs-base::before { content: ""; position: absolute; left: 10%; right: 10%; top: -2px; height: 3px; border-radius: 3px; background: var(--border-strong); }
.cs-base svg { flex: none; width: 1.75rem; height: 2rem; color: var(--text-muted); }
.cs-base b { font-family: var(--font-mono); font-size: var(--fs-sm); }
.cs-base small { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
.cs-legende { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .75rem 0 0; color: var(--text-muted); font-size: var(--fs-xs); }
.cs-legende .pastille { display: inline-block; width: .625rem; height: .625rem; border-radius: 50%; margin-right: .3125rem; vertical-align: -1px; }
/* Menu contextuel : celui du rail (.nb-menu), posé au pointeur */
.nb-menu.cs-menu { position: fixed; z-index: 60; width: 18rem; right: auto; bottom: auto; }
.cs-menu .titre { padding: .375rem .625rem .25rem; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.cs-menu hr { border: 0; border-top: 1px solid var(--border); margin: .25rem 0; }
.cs-menu button.danger { color: var(--err); }
.cs-menu button.danger .ico { color: var(--err); }
.cs-menu button:disabled { opacity: .45; cursor: not-allowed; }
.cs-menu button small { margin-left: auto; color: var(--text-muted); font-size: var(--fs-xs); }
/* Modules complémentaires (CHG-032) : souscrits hors niveau, chacun avec sa date */
.cs-modc .vc-grp small .badge { margin-left: .25rem; }
.cs-ajout b, .cs-ajout small { display: block; max-width: 100%; }
.cs-ajout small { color: var(--text-muted); font-size: var(--fs-xs); }
/* Versions et migrations d'un environnement (panneau Environnement) : date, version, nature */
.cs-mig { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.cs-mig li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .125rem .75rem; padding: .5rem 0; border-top: 1px solid var(--border); }
.cs-mig li:first-child { border-top: 0; padding-top: 0; }
.cs-mig time { color: var(--text-muted); white-space: nowrap; }
.cs-mig small { grid-column: 2; color: var(--text-muted); font-size: var(--fs-xs); }
/* Serveur choisi (son détail est dans le panneau Environnement, CHG-030) */
.cs-srv.choisi { outline: 3px solid var(--c); outline-offset: 2px; }
.cs-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3125rem .75rem; margin: 0; font-size: var(--fs-sm); }
.cs-kv dt { color: var(--text-muted); }
.cs-kv dd { margin: 0; overflow-wrap: anywhere; }
/* Lien d'un menu contextuel de serveur (ouvrir l'application), au rendu des boutons du menu */
.cs-menu a[role="menuitem"] { display: flex; align-items: center; gap: .5625rem; width: 100%; padding: .4375rem .625rem; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.cs-menu a[role="menuitem"]:hover { background: var(--surface-2); }
.cs-menu a[role="menuitem"] .ico { color: var(--text-muted); }
/* Code du laboratoire et icône du nouvel onglet, côte à côte dans la cellule (EXPLOIT-CLIENTS, DEC-084) */
.cl-ouvrir { display: inline-flex; align-items: center; gap: .375rem; }
.cl-ouvrir a + a { color: var(--text-muted); display: inline-flex; }
.cl-ouvrir a + a:hover { color: var(--accent); }
