/* Palette définie séparément dans /css/palette.css (chargé avant celui-ci dans index.html) */

/* ===== États (communs à toutes les VMs) ===== */
:root {
  --c-state-notif:    #4ade80;
  --c-state-alert:    #fb923c;
  --c-state-alarm:    #ef4444;
  --c-state-critical: #ef4444;
  /* Variantes RGB triplet pour rgba() dynamiques (cards .card-pri.is-*) */
  --c-state-notif-rgb:    74, 222, 128;
  --c-state-alert-rgb:    251, 146, 60;
  --c-state-alarm-rgb:    239, 68, 68;
  --c-state-critical-rgb: 239, 68, 68;
}

/* Inputs jaune principal — custom (accent-color souvent ignoré sous Windows/Chrome).
   !important sur dimensions critiques pour blinder contre les sélecteurs génériques
   type `.xxx-toolbar input { padding/border-radius/width }` qui déformaient les checkboxes. */
input[type="checkbox"], input[type="radio"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 14px !important;
  height: 14px !important;
  padding: 0 !important;
  margin: 0 .15rem 0 0;
  border: 1.5px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .25);
  cursor: pointer;
  position: relative;
  vertical-align: -2px;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
  accent-color: var(--p-base);
}
input[type="checkbox"] { border-radius: 3px !important; }
input[type="radio"]    { border-radius: 50% !important; }

/* ===== Icônes SVG (cf js/icons.js) — héritent de la couleur via currentColor ===== */
.ico { display: inline-block; vertical-align: -2px; flex-shrink: 0; line-height: 0; }
.ico svg { display: block; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }

/* ===== Composant toggle-switch (couleur principale jaune --p-base) ===== */
/* Usage : <button class="switch on|off"><span class="sw-track"><span class="sw-knob"></span></span></button>
   Tailles : par défaut 32×18 ; variante compacte avec classe .sm (24×14) */
.switch {
  -webkit-appearance: none; appearance: none;
  background: transparent; border: none; padding: 0;
  cursor: pointer;
  display: inline-flex; align-items: center;
  width: 32px; height: 18px;
  outline: none;
  flex-shrink: 0;
}
.switch.sm { width: 24px; height: 14px; }
.switch .sw-track {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 999px;
  background: rgba(24, 24, 27, .65);
  border: 1px solid rgba(100, 116, 139, .45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.switch .sw-knob {
  position: absolute;
  top: 50%; left: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #64748b;
  transform: translateY(-50%);
  transition: left .18s cubic-bezier(.4, 0, .2, 1), background .18s, box-shadow .18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.switch.sm .sw-knob { width: 9px; height: 9px; left: 2px; }
.switch.on .sw-track {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .35), rgba(var(--p-glow-rgb), .22));
  border-color: var(--p-base);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 6px rgba(var(--p-glow-rgb), .35);
}
.switch.on .sw-knob {
  left: 17px;
  background: var(--p-base);
  box-shadow: 0 0 6px rgba(var(--p-glow-rgb), .7), 0 1px 2px rgba(0, 0, 0, .4);
}
.switch.sm.on .sw-knob { left: 12px; }
.switch:hover:not(:disabled) .sw-track { border-color: rgba(var(--p-base-rgb), .7); }
.switch:hover:not(:disabled).on .sw-track { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 10px rgba(var(--p-glow-rgb), .55); }
.switch:focus-visible .sw-track { box-shadow: 0 0 0 2px rgba(var(--p-base-rgb), .4); }
.switch:active:not(:disabled) .sw-knob { width: 14px; }
.switch:disabled { opacity: .4; cursor: not-allowed; }

/* Variante dry (orange) pour marquer un mode simulation — mêmes dimensions */
.switch.dry.on .sw-track {
  background: linear-gradient(135deg, rgba(251, 146, 60, .35), rgba(251, 146, 60, .22));
  border-color: #fb923c;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 6px rgba(251, 146, 60, .35);
}
.switch.dry.on .sw-knob { background: #fb923c; box-shadow: 0 0 6px rgba(251, 146, 60, .7), 0 1px 2px rgba(0, 0, 0, .4); }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--p-base); }
/* Checkbox/radio checked : même style que les onglets actifs (gradient + glow) */
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .9), rgba(var(--p-glow-rgb), .85));
  border-color: rgba(var(--p-soft-rgb), .85);
  box-shadow:
    0 0 8px rgba(var(--p-glow-rgb), .55),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid var(--p-text-on);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--p-text-on);
}

/* Classes utilitaires d'état (à appliquer aux éléments de notification/alerte) */
.state-notif    { color: var(--c-state-notif); }
.state-alert    { color: var(--c-state-alert); }
.state-alarm    { color: var(--c-state-alarm); }
.state-critical { color: var(--c-state-critical); animation: state-critical-blink 1s steps(2, start) infinite; }
@keyframes state-critical-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .25; }
}
@keyframes card-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

/* ============================================================
   .card-pri — chrome unifié des cards individuelles (ref .dash-synthesis)
   Spec design Vincent 2026-04-29 — appliqué cross-onglet via classes is-*

   Custom prop `--card-rgb` portée par .card-pri ou ses variantes
   (is-ok, is-alert, is-alarm, is-critical, is-running, vlan-1..6, p0..p3).
   Default = couleur principale --p-base (rgb triplet).
   ============================================================ */
.card-pri {
  --card-rgb: var(--p-base-rgb);
  padding: .75rem .9rem;
  border-radius: 8px;
  border-top:    1px solid rgba(var(--card-rgb), .4);
  border-right:  1px solid rgba(var(--card-rgb), .4);
  border-bottom: 1px solid rgba(var(--card-rgb), .4);
  border-left:   2px solid rgba(var(--card-rgb), .9);
  background:
    radial-gradient(circle at top right, rgba(var(--card-rgb), .14), transparent 60%),
    linear-gradient(135deg, rgba(var(--card-rgb), .1) 0%, rgba(var(--card-rgb), .03) 50%, rgba(24, 24, 27, .55) 100%);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  /* Triple shadow : tranche de verre lumineuse gauche + highlight haut (verre poli) + ombre extérieure */
  box-shadow:
    inset 8px 0 14px -8px rgba(var(--card-rgb), .55),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 4px 18px rgba(0, 0, 0, .28);
  transition: opacity .2s, border-color .2s, box-shadow .2s;
}
.card-pri:hover {
  border-top-color:    rgba(var(--card-rgb), .65);
  border-right-color:  rgba(var(--card-rgb), .65);
  border-bottom-color: rgba(var(--card-rgb), .65);
  border-left-color:   rgba(var(--card-rgb), 1);
  box-shadow:
    inset 8px 0 16px -8px rgba(var(--card-rgb), .7),
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 0 24px rgba(var(--card-rgb), .25),       /* glow extérieur au hover */
    0 4px 18px rgba(0, 0, 0, .3);
}

/* États génériques */
.card-pri.is-inactive,
.card-pri.is-disabled       { opacity: .5; }
.card-pri.is-ok             { --card-rgb: var(--c-state-notif-rgb); }
.card-pri.is-alert          { --card-rgb: var(--c-state-alert-rgb); }
.card-pri.is-alarm          { --card-rgb: var(--c-state-alarm-rgb); }
.card-pri.is-critical       { --card-rgb: var(--c-state-critical-rgb); animation: state-critical-blink 1s steps(2, start) infinite; }
.card-pri.is-running        { --card-rgb: var(--c-state-notif-rgb); animation: card-pulse 1.6s ease-in-out infinite; }

/* VLAN (topologie) — la couleur VLAN domine, accent border-left renforcé 3px */
.card-pri.vlan-1 { --card-rgb: var(--v1-rgb); }
.card-pri.vlan-2 { --card-rgb: var(--v2-rgb); }
.card-pri.vlan-3 { --card-rgb: var(--v3-rgb); }
.card-pri.vlan-4 { --card-rgb: var(--v4-rgb); }
.card-pri.vlan-5 { --card-rgb: var(--v5-rgb); }
.card-pri.vlan-6 { --card-rgb: var(--v6-rgb); }

/* Priorités (Todo, Principes) */
.card-pri.p-p0 { --card-rgb: var(--c-state-alarm-rgb); }     /* P0 inviolable = rouge */
.card-pri.p-p1 { --card-rgb: var(--c-state-alert-rgb); }     /* P1 critique = orange */
.card-pri.p-p2 { --card-rgb: var(--p-base-rgb); }            /* P2 important = couleur principale */
.card-pri.p-p3 { --card-rgb: var(--v3-rgb); }                /* P3 nice-to-have = cyan/turquoise */

/* Importance changement (Changelog semver) */
.card-pri.semver-major { --card-rgb: var(--c-state-alarm-rgb); }  /* breaking change */
.card-pri.semver-minor { --card-rgb: var(--p-base-rgb); }         /* feature */
.card-pri.semver-patch { --card-rgb: var(--c-state-notif-rgb); }  /* fix */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }

/* ===== Background "glass canvas" : fond riche + blobs flous animés à brouiller ===== */
body {
  font-family: system-ui, sans-serif;
  color: #e4e4e7;
  display: flex;
  flex-direction: column;
  position: relative;
  background:
    radial-gradient(ellipse 60vw 50vh at 15% 15%, rgba(var(--p-glow-rgb), .25), transparent 55%),
    radial-gradient(ellipse 55vw 45vh at 88% 75%, rgba(var(--p-base-rgb), .18), transparent 55%),
    radial-gradient(ellipse 50vw 40vh at 65% 25%, rgba(var(--p-bright-rgb), .12), transparent 60%),
    radial-gradient(ellipse 70vw 60vh at 25% 90%, rgba(var(--p-shadow-rgb), .15), transparent 60%),
    radial-gradient(ellipse 40vw 35vh at 50% 50%, rgba(255, 255, 255, .04), transparent 65%),
    #131316;
}
body::before {
  content: '';
  position: fixed;
  inset: -10vh -10vw;
  z-index: -1;
  background:
    radial-gradient(circle 280px at 22% 30%, rgba(var(--p-base-rgb), .14), transparent 70%),
    radial-gradient(circle 220px at 78% 70%, rgba(var(--p-glow-rgb), .12), transparent 70%);
  filter: blur(40px);
  animation: blobs-drift 28s ease-in-out infinite alternate;
}
@keyframes blobs-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3vw, -2vh) scale(1.05); }
  100% { transform: translate(-2vw, 3vh) scale(.97); }
}

/* ===== Header glass — bord lumineux + relief ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: .8rem 1.5rem;
  background: rgba(24, 24, 27, .3);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  flex: 0 0 auto;
  gap: 1rem;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 4px 24px rgba(0, 0, 0, .25);
}
.header-left { display: flex; flex-direction: column; gap: .15rem; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: .25rem; }
header h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--p-base);
  text-shadow:
    0 0 1px var(--p-base),
    0 0 8px rgba(var(--p-base-rgb), .35),
    0 1px 2px rgba(0,0,0,.5);
  line-height: 1;
}
.header-sub { display: flex; align-items: baseline; gap: .65rem; font-family: 'Menlo', 'Consolas', monospace; }
.header-sub .vm-name { color: #d4d4d8; font-weight: 500; letter-spacing: .04em; font-size: 1.44rem; }
.header-sub #vm-version { color: var(--p-light); font-size: .72rem; }
#vm-last-cron { color: var(--p-light); font-family: 'Menlo', 'Consolas', monospace; font-size: .72rem; line-height: 1.3; }

/* ===== Combobox mode d'interaction (sans cadre, petit, haut-droite) ===== */
#auth-mode {
  background: transparent;
  color: var(--p-light);
  border: none;
  outline: none;
  padding: 0;
  font-size: .7rem;
  font-family: 'Menlo', 'Consolas', monospace;
  cursor: pointer;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  text-align: right;
  text-align-last: right;
}
#auth-mode option { background: #18181b; color: var(--p-light); text-align: left; }
#auth-mode:hover { color: var(--p-base); }
#auth-mode.authed { color: var(--p-base); font-weight: 600; }

/* ===== Modal password ===== */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 1000;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
.modal-backdrop:not([hidden]) { display: flex; }
.modal {
  background: rgba(24, 24, 27, .85);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  max-width: 380px;
  width: 90%;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.modal h2 { margin: 0 0 .5rem; font-size: 1.1rem; color: var(--p-base); font-weight: 600; }
.modal p { margin: 0 0 1rem; font-size: .85rem; color: #d4d4d8; }
.modal input[type="password"] {
  width: 100%;
  background: rgba(0, 0, 0, .35);
  color: var(--p-pale);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: .55rem .75rem;
  font-size: .92rem;
  font-family: inherit;
  margin-bottom: .85rem;
}
.modal input[type="password"]:focus { outline: none; border-color: var(--p-base); box-shadow: 0 0 0 3px rgba(var(--p-base-rgb), .15); }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.modal-actions button {
  background: rgba(39, 39, 42, .55);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: .45rem 1rem;
  font-size: .88rem;
  cursor: pointer;
}
.modal-actions button:hover { background: rgba(63, 63, 70, .7); }
.modal-actions button[type="submit"] {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .85), rgba(var(--p-glow-rgb), .75));
  color: var(--p-text-on);
  border-color: rgba(var(--p-soft-rgb), .8);
  font-weight: 600;
  box-shadow: 0 0 14px rgba(var(--p-glow-rgb), .4), inset 0 1px 0 rgba(255,255,255,.3);
}
.auth-err { margin-top: .6rem; color: var(--c-state-alarm); font-size: .8rem; }

/* ===== Nav glass — pills ===== */
nav#tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: .3rem;
  padding: .6rem .8rem;
  background: rgba(24, 24, 27, .22);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex: 0 0 auto;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  width: 100%;
  box-sizing: border-box;
}
nav#tabs a {
  padding: .5rem .5rem;
  flex: 1 1 0;
  min-width: 0;
  max-width: 140px;
  text-align: center;
  border-radius: 999px;
  color: #d4d4d8;
  text-decoration: none;
  font-size: .84rem;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
nav#tabs a:hover { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .18); }
nav#tabs a.active {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .85), rgba(var(--p-glow-rgb), .75));
  color: var(--p-text-on);
  border-color: rgba(var(--p-soft-rgb), .8);
  box-shadow:
    0 0 18px rgba(var(--p-glow-rgb), .5),
    inset 0 1px 0 rgba(255, 255, 255, .35);
}


main#content { flex: 1; min-height: 0; overflow: hidden; position: relative; display: flex; flex-direction: column; }
main > [data-tab] { display: none; flex: 1; min-height: 0; overflow: auto; padding: 1.25rem; }
main > [data-tab].active { display: flex; flex-direction: column; }
main > #tab-chat-slot, main > #tab-todo-slot, main > #tab-docs-slot, main > #tab-logs-slot, main > #tab-changelog-slot, main > #tab-dashboard-slot, main > #tab-topologie-slot, main > #tab-surveillance-slot, main > #tab-tasks-slot, main > #tab-actions-slot, main > #tab-nodes-slot, main > #tab-reports-slot, main > #tab-principles-slot, main > #tab-access-slot, main > #tab-sante-slot, main > #tab-sport-slot { padding: 0; overflow: hidden; }
main > #tab-chat-slot section, main > #tab-todo-slot section, main > #tab-docs-slot section, main > #tab-logs-slot section, main > #tab-changelog-slot section, main > #tab-dashboard-slot section, main > #tab-topologie-slot section, main > #tab-surveillance-slot section, main > #tab-tasks-slot section, main > #tab-actions-slot section, main > #tab-nodes-slot section, main > #tab-reports-slot section, main > #tab-principles-slot section, main > #tab-access-slot section, main > #tab-sante-slot section, main > #tab-sport-slot section { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Placeholder "EN CONSTRUCTION" — centré, glass, dashed */
main > section.placeholder-tab.active { justify-content: center; align-items: center; }
.placeholder-box {
  padding: 2.2rem 3.4rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .06), rgba(255, 255, 255, .02));
  border: 1px dashed rgba(var(--p-base-rgb), .3);
  border-radius: 16px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.placeholder-box h2 {
  margin: 0;
  color: var(--p-base);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-shadow: 0 0 14px rgba(var(--p-glow-rgb), .35);
}
.placeholder-box p {
  margin: .6rem 0 0;
  color: #a1a1aa;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-family: 'Menlo', 'Consolas', monospace;
}

/* Scrollbars globaux discrets */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; transition: background .2s; }
*:hover::-webkit-scrollbar-thumb { background: #1e293b; }
*::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ===== Deep-link flash (highlight ciblé après nav depuis dashboard) ===== */
@keyframes dl-flash {
  0%   { box-shadow: 0 0 0 2px rgba(var(--p-base-rgb), 0); }
  20%  { box-shadow: 0 0 0 3px rgba(var(--p-base-rgb), .8), 0 0 18px rgba(var(--p-glow-rgb), .55); }
  100% { box-shadow: 0 0 0 0 rgba(var(--p-base-rgb), 0); }
}
.todo-flash, .task-flash, .nf-flash {
  animation: dl-flash 1.6s ease-out;
}

/* ============================================================================
   STANDARDS GLOBAUX FORMULAIRES (.std-*)
   Pattern unifié issue de Reports/Principles : modal max 920px scrollable, onglets internes,
   grid 2-col, blocks "checks" et bloc "Claude assist" pour pré-remplissage par IA.
   À utiliser pour tous les nouveaux formulaires + migration progressive des existants.
   ============================================================================ */

.std-modal .modal {
  max-width: 920px !important; width: 94vw !important;
  max-height: 90vh !important;
  display: flex; flex-direction: column;
  padding: 1.2rem 1.3rem !important;
}
.std-modal h2 { margin-bottom: .8rem; }

.std-tabs {
  display: flex; gap: .25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  margin-bottom: 1rem; flex-shrink: 0;
  flex-wrap: wrap;
}
.std-tab {
  background: transparent; color: #94a3b8;
  border: none; border-bottom: 2px solid transparent;
  padding: .45rem .85rem; cursor: pointer;
  font-size: .82rem; font-weight: 500;
  transition: color .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: .35rem;
}
.std-tab:hover { color: #e4e4e7; }
.std-tab.active { color: var(--p-base); border-bottom-color: var(--p-base); }

/* Le form interne scroll, headers/footer fixes */
.std-form { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.std-pane { display: none; padding-right: .4rem; }
.std-pane.active { display: block; }

.std-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem .85rem;
  margin-bottom: .5rem;
}
.std-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .78rem; color: #d4d4d8; }
.std-grid label > span { color: #94a3b8; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.std-grid .std-full { grid-column: 1 / -1; }
.std-grid input[type="text"],
.std-grid input[type="number"],
.std-grid input[type="time"],
.std-grid input[type="date"],
.std-grid input[type="url"],
.std-grid input[type="password"],
.std-grid select,
.std-grid textarea {
  background: rgba(39, 39, 42, .5);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 5px;
  padding: .35rem .55rem;
  font-size: .82rem;
  font-family: inherit;
  box-sizing: border-box;
}
.std-grid textarea { resize: vertical; min-height: 38px; line-height: 1.45; }
.std-grid input:focus, .std-grid select:focus, .std-grid textarea:focus {
  outline: none; border-color: var(--p-base);
  box-shadow: 0 0 0 2px rgba(var(--p-base-rgb), .18);
}

/* Checkbox row */
.std-check { flex-direction: row !important; align-items: center; gap: .45rem; padding: .35rem 0; }
.std-check > span { color: #d4d4d8 !important; font-size: .82rem !important; text-transform: none !important; letter-spacing: normal !important; }

/* Grille de checkboxes 3 cols (channels, etc.) */
.std-checks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-top: .25rem; }
.std-check-mini { flex-direction: row !important; align-items: center; gap: .35rem; padding: .15rem .25rem; }
.std-check-mini > span { color: #d4d4d8 !important; font-size: .74rem !important; text-transform: none !important; letter-spacing: normal !important; }

/* ===== Bloc Claude assist (pré-remplissage IA) ===== */
.std-claude-help {
  margin-top: 1rem; padding: .65rem .85rem;
  background: rgba(var(--p-base-rgb), .04);
  border: 1px dashed rgba(var(--p-base-rgb), .25);
  border-radius: 6px;
}
.std-claude-help h3 {
  margin: 0 0 .35rem; color: var(--p-light); font-size: .78rem;
  display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 600;
}
.std-claude-help textarea {
  width: 100%; box-sizing: border-box; min-height: 50px;
  background: rgba(0, 0, 0, .3); color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 4px;
  padding: .35rem .55rem; font-size: .82rem; font-family: inherit;
  margin-bottom: .35rem;
}
.std-claude-help .std-claude-actions {
  display: flex; gap: .4rem; flex-wrap: wrap; align-items: center;
}
.std-claude-help button {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .6), rgba(var(--p-glow-rgb), .5));
  color: var(--p-text-on); border: 1px solid rgba(var(--p-soft-rgb), .6);
  border-radius: 4px; padding: .25rem .65rem; font-size: .76rem; cursor: pointer; font-weight: 600;
  display: inline-flex; align-items: center; gap: .3rem;
}
.std-claude-help button:hover:not(:disabled) { box-shadow: 0 0 10px rgba(var(--p-glow-rgb), .35); }
.std-claude-help button:disabled { opacity: .5; cursor: not-allowed; }
.std-claude-help .std-claude-status {
  font-size: .74rem; color: #94a3b8; align-self: center;
}

/* ===== Footer modal (boutons d'action standardisés) ===== */
.std-modal-actions {
  display: flex; gap: .5rem; align-items: center; justify-content: flex-end;
  padding-top: .8rem; margin-top: .6rem; flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.std-modal-actions button {
  background: rgba(39, 39, 42, .6); color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 5px;
  padding: .4rem .85rem; font-size: .82rem; cursor: pointer;
}
.std-modal-actions button.primary {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .85), rgba(var(--p-glow-rgb), .75));
  color: var(--p-text-on); border-color: rgba(var(--p-soft-rgb), .8); font-weight: 600;
}
.std-modal-actions button.danger {
  color: var(--v2); border-color: rgba(var(--v2-rgb), .4);
}
.std-modal-actions .std-spacer { margin-right: auto; }

/* ===== Erreur formulaire ===== */
.std-err {
  color: #fecaca; font-size: .8rem;
  padding: .4rem .6rem;
  background: rgba(239, 68, 68, .1);
  border-left: 2px solid var(--v2);
  border-radius: 0 4px 4px 0;
  margin-top: .5rem; flex-shrink: 0;
}

/* ============================================================================
   Variante volet de navigation (.std-side) — sidebar verticale gauche
   À utiliser quand 4+ onglets ou besoin de scaling. Onglets en MAJUSCULES sans accents.
   ============================================================================ */
.std-modal.std-side .modal {
  max-width: 1100px !important; width: 96vw !important;
  padding: 0 !important;
}
.std-modal.std-side h2 {
  margin: 0; padding: .9rem 1.2rem .7rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}
.std-modal.std-side .std-body {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}
.std-modal.std-side .std-side-nav {
  flex: 0 0 210px;
  border-right: 1px solid rgba(255, 255, 255, .08);
  padding: .55rem .35rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: .1rem;
  background: rgba(0, 0, 0, .12);
}
.std-modal.std-side .std-side-nav .std-tab {
  width: 100%; justify-content: flex-start;
  border-bottom: none !important;
  border-left: 2px solid transparent;
  padding: .55rem .8rem;
  text-transform: uppercase; letter-spacing: .05em;
  font-size: .74rem; font-weight: 600;
  border-radius: 0 4px 4px 0;
}
.std-modal.std-side .std-side-nav .std-tab:hover {
  background: rgba(255, 255, 255, .035);
}
.std-modal.std-side .std-side-nav .std-tab.active {
  background: rgba(var(--p-base-rgb), .1);
  border-left-color: var(--p-base);
  color: var(--p-base);
}
.std-modal.std-side .std-form {
  padding: .8rem 1.2rem 0; flex: 1;
}
.std-modal.std-side .std-pane { padding: .2rem 0 .6rem; }
.std-modal.std-side .std-modal-actions {
  padding: .75rem 1.2rem; margin-top: 0;
}

/* Onglet ACTIONS — liste de règles dans la modal d'édition */
.std-rules-pane-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .6rem; padding-bottom: .35rem;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.std-rules-pane-header .std-rules-count {
  font-size: .78rem; color: #94a3b8;
}
.std-rules-pane-header .std-rule-add-btn {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .85), rgba(var(--p-glow-rgb), .75));
  color: var(--p-text-on); border: 1px solid rgba(var(--p-soft-rgb), .8);
  border-radius: 4px; padding: .3rem .7rem;
  font-size: .76rem; font-weight: 600; cursor: pointer;
}
.std-rules-pane-header .std-rule-add-btn:hover:not(:disabled) {
  box-shadow: 0 0 10px rgba(var(--p-glow-rgb), .35);
}
.std-rules-pane-header .std-rule-add-btn:disabled { opacity: .5; cursor: not-allowed; }
.std-rules-pane-list { display: flex; flex-direction: column; gap: .35rem; }
.std-rules-pane-empty {
  padding: 1.5rem .5rem; text-align: center; color: #71717a;
  font-size: .78rem; border: 1px dashed rgba(255, 255, 255, .08);
  border-radius: 5px;
}

/* ===================================================================
   RESPONSIVE MOBILE (A3a) — strictement scope @media (max-width: 768px)
   AUCUN impact sur PC ≥ 769px. Ajouts en fin de fichier pour cascade max.
   =================================================================== */

/* Burger + drawer cachés par défaut sur PC */
#mobile-burger { display: none; }
#mobile-drawer, #mobile-drawer-backdrop { display: none; }

/* GARANTIE ABSOLUE : drawer caché tant que [hidden] HTML attribute présent (toutes viewports) */
#mobile-drawer[hidden],
#mobile-drawer-backdrop[hidden] {
  display: none !important;
  visibility: hidden !important;
}

@media (max-width: 768px) {
  /* === Étape 1 : scroll vertical natif === */
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh; min-height: 100dvh;
  }
  main#content {
    overflow: visible !important;
    min-height: auto !important;
    height: auto !important;
  }
  main > [id^="tab-"][id$="-slot"] {
    overflow: visible !important;
    padding: 0 !important;
  }

  /* === Étape 2 : header compact + burger + nav#tabs cachée === */
  header {
    padding: .35rem .6rem !important;
    gap: .4rem !important;
  }
  header .header-left h1 { font-size: .9rem !important; }
  header .header-left .header-sub { font-size: .65rem !important; }
  header .header-right { gap: .35rem !important; }
  header .header-right .header-mode-sel { font-size: .7rem; padding: .2rem .35rem; }
  header #vm-last-cron { display: none; }

  #mobile-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 6px;
    color: #d4d4d8;
    cursor: pointer;
    flex-shrink: 0;
  }
  #mobile-burger:active { background: rgba(255, 255, 255, .08); }

  /* Nav onglets horizontale cachée — remplacée par le drawer */
  nav#tabs { display: none !important; }

  /* Drawer slide-in : caché de base ([hidden] → display:none), montré quand JS retire hidden */
  #mobile-drawer:not([hidden]) {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    width: 86%; max-width: 320px;
    height: 100vh; height: 100dvh;
    background: #14141c;
    border-right: 1px solid rgba(255, 255, 255, .08);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease-out;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  #mobile-drawer.open { transform: translateX(0); }

  #mobile-drawer .md-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  #mobile-drawer .md-brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--p-base, #fde047);
    letter-spacing: .02em;
  }
  #mobile-drawer-close {
    width: 36px; height: 36px;
    background: transparent;
    border: none;
    color: #a1a1aa;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  #mobile-drawer-close:active { background: rgba(255, 255, 255, .1); }

  #mobile-drawer-tabs {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0;
  }
  #mobile-drawer-tabs .md-tab {
    display: flex; align-items: center; gap: 14px;
    width: 100%;
    padding: 13px 18px;
    color: #d4d4d8;
    text-decoration: none;
    text-align: left;
    font-size: .95rem;
    border-left: 3px solid transparent;
    transition: background .12s;
  }
  #mobile-drawer-tabs .md-tab:active { background: rgba(255, 255, 255, .06); }
  #mobile-drawer-tabs .md-tab.active {
    color: var(--p-base, #fde047);
    background: rgba(253, 224, 71, .06);
    border-left-color: var(--p-base, #fde047);
    font-weight: 600;
  }
  #mobile-drawer-tabs .md-tab-icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    opacity: .8;
  }
  #mobile-drawer-tabs .md-tab.active .md-tab-icon { opacity: 1; }
  #mobile-drawer-tabs .md-tab-label { flex: 1; }

  /* === Handles de sidebar internes (chat, nodes, surveillance, access, docs) ===
     Design mobile : fixed au centre du viewport, discret style PC mais tap target élargi.
     z-index 250 pour passer DEVANT les sidebars internes (z-index 200) — on veut que la
     handle reste tap-able même quand la sidebar est ouverte (pour la refermer).
     S'applique à TOUS les onglets ayant une .sidebar-handle. */
  .sidebar-handle {
    position: fixed !important;
    top: 50% !important;
    left: 0 !important;
    transform: translateY(-50%) !important;
    width: 18px !important;
    height: 72px !important;
    font-size: 1rem !important;
    background: rgba(39, 39, 42, .85) !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-left: none !important;
    color: var(--p-light) !important;
    border-radius: 0 6px 6px 0 !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, .35) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 250 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 1 !important;
    padding: 0 !important;
  }
  .sidebar-handle:active {
    background: rgba(var(--p-base-rgb), .25) !important;
    color: var(--p-base) !important;
    border-color: rgba(var(--p-base-rgb), .5) !important;
  }

  #mobile-drawer-backdrop:not([hidden]) {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 150;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
  }
  #mobile-drawer-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================================================================
 * .icon-action-btn — STANDARD GLOBAL Vincent 2026-05-01
 * Bouton icône SIMPLE (icône seule, sans texte) : pas de bordure, pas de fond.
 * Hover/active : SEULE l'icône s'illumine (filter: drop-shadow sur le SVG),
 * AUCUN background n'apparaît (pas de "rectangle qui s'allume").
 * NE PAS utiliser pour les boutons icône+texte (formulaires, modales actions
 * primaires) — ceux-ci gardent fond + bordure + padding texte.
 * ============================================================================ */
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  background: transparent !important;
  border: none;
  color: var(--p-base);
  cursor: pointer;
  /* Default : opacité 45% (icône discrète au repos) — Vincent 2026-05-10 */
  opacity: .45;
  filter: none;
  transition: color .18s, opacity .18s, filter .18s, transform .18s;
}
/* SVG enfant : transition pour stroke-width (effet bold au hover) */
.icon-action-btn svg { transition: stroke-width .18s; }

/* Hover : zoom (1.15) + bold (stroke-width 2.6 vs 2 default Lucide) + glow */
.icon-action-btn:hover:not(:disabled) {
  opacity: 1;
  color: var(--p-glow);
  transform: scale(1.15);
}
.icon-action-btn:hover:not(:disabled) svg { stroke-width: 2.6; }

/* Active (clic) : compression scale .92 (depuis 1.15) + glow max */
.icon-action-btn:active:not(:disabled) {
  opacity: 1;
  transform: scale(.92);
  transition: transform .05s, color .05s, opacity .05s;
}
.icon-action-btn:active:not(:disabled) svg { stroke-width: 2.8; }

.icon-action-btn:disabled { opacity: .25; cursor: not-allowed; }

/* Variantes warning (ORANGE — archive) et danger (ROUGE — supprimer) */
.icon-action-btn.warn  { color: #fb923c; }                /* orange */
.icon-action-btn.warn:hover:not(:disabled) {
  opacity: 1;
  color: #fdba74;                                          /* orange clair au hover */
  filter: drop-shadow(0 0 6px rgba(251, 146, 60, .9))
          drop-shadow(0 0 14px rgba(251, 146, 60, .5));
}
.icon-action-btn.warn:active:not(:disabled) {
  opacity: 1;
  transform: scale(.88);
  filter: drop-shadow(0 0 10px rgba(251, 146, 60, 1))
          drop-shadow(0 0 22px rgba(251, 146, 60, .8));
}
.icon-action-btn.danger { color: #ef4444; }               /* rouge saturé */
.icon-action-btn.danger:hover:not(:disabled) {
  opacity: 1;
  color: #f87171;                                          /* rouge clair au hover */
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, .9))
          drop-shadow(0 0 14px rgba(239, 68, 68, .5));
}
.icon-action-btn.danger:active:not(:disabled) {
  opacity: 1;
  transform: scale(.88);
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 1))
          drop-shadow(0 0 22px rgba(239, 68, 68, .8));
}

/* Tailles compactes (28x28 pour tables denses, 24x24 pour très compact) */
.icon-action-btn.sm { width: 28px; height: 28px; }
.icon-action-btn.xs { width: 24px; height: 24px; }
.icon-action-btn.xs svg { width: 12px; height: 12px; }


/* ============================================================================
   KPI Score Card — Standard global (cf principle DB #73 + dashboard claude-systeme)
   Importé pour utilisation transversale (toutes vues, toutes VMs).
   Structure :
     <div class="kpi-card kpi-score-card lvl-{ok|warn|crit} score-{ok|warn|crit}">
       <div class="kpi-head">
         <span class="kpi-icon">[icon]</span>
         <span class="kpi-title">TITLE UPPERCASE</span>
         <div class="kpi-score score-X"><span class="ks-value">N</span><span class="ks-unit">%|unit</span></div>
       </div>
       <div class="kpi-foot">[footer text]</div>
       <div class="kpi-badges">[5 badges crit/alarm/warn/ok/info]</div>  // optionnel
     </div>
   ============================================================================ */
.kpi-card {
  display: flex; flex-direction: column; gap: .35rem;
  padding: .6rem .7rem .55rem;
  background: linear-gradient(135deg, rgba(39, 39, 42, .35), rgba(24, 24, 27, .55));
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: 3px solid #475569;
  border-radius: 8px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  text-align: left;
  font-family: inherit; color: inherit;
  min-width: 0;
  transition: transform .12s, border-color .15s, background .15s;
}
.kpi-card[role="button"], .kpi-card[data-target] { cursor: pointer; }
.kpi-card.lvl-ok   { border-left-color: #4ade80; }
.kpi-card.lvl-warn {
  border-left-color: #fb923c;
  background: linear-gradient(135deg, rgba(251, 146, 60, .08), rgba(24, 24, 27, .55));
}
.kpi-card.lvl-crit {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, .12), rgba(24, 24, 27, .55));
}

.kpi-card .kpi-head {
  display: flex; align-items: center; gap: .4rem;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  padding-bottom: .3rem;
}
.kpi-card .kpi-head .kpi-score { margin-left: auto; }
.kpi-card .kpi-icon { font-size: 1.4rem; flex-shrink: 0; color: var(--p-base); display: inline-flex; align-items: center; }
.kpi-card .kpi-title {
  font-size: 1.05rem; font-weight: 600;
  color: #e4e4e7; letter-spacing: .06em; text-transform: uppercase;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'Menlo', 'Consolas', monospace;
}

.kpi-score {
  display: flex; align-items: baseline; gap: .05rem;
  font-family: 'Menlo','Consolas',monospace;
  line-height: 1; flex-shrink: 0;
}
.kpi-score .ks-value { font-size: 1.85rem; font-weight: 700; color: inherit; }
.kpi-score .ks-unit  { font-size: 1rem; font-weight: 600; color: inherit; opacity: .75; }
.kpi-score.score-ok   { color: #4ade80; }
.kpi-score.score-warn { color: #fb923c; }
.kpi-score.score-crit { color: #ef4444; }

/* Carte teintée selon score (scoring badge à droite) — bordure 4 côtés cohérente, gradient glass épais */
.kpi-card.kpi-score-card {
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
}
.kpi-score-card.score-ok {
  border-top: 1px solid rgba(74, 222, 128, .4);
  border-right: 1px solid rgba(74, 222, 128, .4);
  border-bottom: 1px solid rgba(74, 222, 128, .4);
  border-left: 2px solid rgba(74, 222, 128, .85);
  background:
    radial-gradient(circle at top right, rgba(74, 222, 128, .14), transparent 60%),
    linear-gradient(135deg, rgba(74, 222, 128, .1) 0%, rgba(74, 222, 128, .03) 50%, rgba(24, 24, 27, .5) 100%);
  box-shadow:
    inset 8px 0 14px -8px rgba(74, 222, 128, .55),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 4px 18px rgba(0, 0, 0, .28);
}
.kpi-score-card.score-warn {
  border-top: 1px solid rgba(251, 146, 60, .45);
  border-right: 1px solid rgba(251, 146, 60, .45);
  border-bottom: 1px solid rgba(251, 146, 60, .45);
  border-left: 2px solid rgba(251, 146, 60, .9);
  background:
    radial-gradient(circle at top right, rgba(251, 146, 60, .16), transparent 60%),
    linear-gradient(135deg, rgba(251, 146, 60, .12) 0%, rgba(251, 146, 60, .04) 50%, rgba(24, 24, 27, .5) 100%);
  box-shadow:
    inset 8px 0 14px -8px rgba(251, 146, 60, .6),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 4px 18px rgba(0, 0, 0, .28);
}
.kpi-score-card.score-crit {
  border-top: 1px solid rgba(239, 68, 68, .5);
  border-right: 1px solid rgba(239, 68, 68, .5);
  border-bottom: 1px solid rgba(239, 68, 68, .5);
  border-left: 2px solid rgba(239, 68, 68, .95);
  background:
    radial-gradient(circle at top right, rgba(239, 68, 68, .2), transparent 60%),
    linear-gradient(135deg, rgba(239, 68, 68, .15) 0%, rgba(239, 68, 68, .05) 50%, rgba(24, 24, 27, .5) 100%);
  box-shadow:
    inset 8px 0 14px -8px rgba(239, 68, 68, .65),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 4px 18px rgba(0, 0, 0, .28);
}

.kpi-card .kpi-foot {
  font-size: .68rem; color: #94a3b8;
  font-family: 'Menlo', 'Consolas', monospace;
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: .15rem .5rem;
  padding-top: .15rem;
}

/* HAUTEUR FIXE alignée standard KPI dashboard (cf principle #79).
   Toutes les .kpi-score-card occupent la même hauteur dans une grille pour cohérence visuelle. */
.kpi-card.kpi-score-card { min-height: 7.5rem; }

/* Responsive mobile : score reste lisible mais compact */
@media (max-width: 680px) {
  .kpi-card { padding: .5rem .6rem; }
  .kpi-card .kpi-title { font-size: .92rem; letter-spacing: .03em; }
  .kpi-score .ks-value { font-size: 1.5rem; }
  .kpi-score .ks-unit  { font-size: .85rem; }
  .kpi-card.kpi-score-card { min-height: 7rem; }
}

.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================================
   TOOLBAR CONTROLS STANDARD v2 — Vincent 2026-05-10
   Reference : Biometrie sante (.sante-toolbar) + arbitrages Vincent design.
   Cible tous les *-toolbar du portail.
   ============================================================================ */

/* C2 : input search au design portail + min-width 200 unifie */
[class$="-toolbar"] input[type="search"] {
  min-width: 200px !important;
  background: rgba(39, 39, 42, .45) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
  border-radius: 6px !important;
  padding: .22rem .55rem !important;
  font-size: .82rem !important;
  font-family: 'Menlo','Consolas',monospace !important;
  height: 28px !important;
  box-sizing: border-box !important;
}
[class$="-toolbar"] input[type="search"]:focus {
  outline: none !important;
  border-color: rgba(var(--p-base-rgb), .55) !important;
  box-shadow: 0 0 0 2px rgba(var(--p-base-rgb), .15) !important;
}

/* C4 : icon-btn pur — pas de bordure/fond meme au hover, opacity 0.45 -> 1
   Pattern Vincent 2026-05-10 (cf principle #74) : icon-only = juste l icone qui s allume */
.icon-btn {
  background: transparent !important;
  border: none !important;
  color: var(--p-base) !important;
  padding: 0 .35rem !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 28px !important;
  min-width: 28px !important;
  opacity: .45 !important;
  transition: opacity .18s, color .18s, transform .18s, filter .18s !important;
  font-size: .9rem !important;
  line-height: 1 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.icon-btn:hover:not(:disabled),
.icon-btn.active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  color: var(--p-glow, var(--p-base)) !important;
  filter: none !important;
}
.icon-btn:active:not(:disabled) {
  transform: scale(.92);
  filter: none !important;
}
.icon-btn:disabled { opacity: .25 !important; cursor: not-allowed !important; }
.icon-btn svg { display: block; }
/* icon-btn.danger : color rouge fixe au lieu de --p-base */
.icon-btn.danger { color: #f87171 !important; }
.icon-btn.danger:hover:not(:disabled) {
  color: #fca5a5 !important;
  filter: drop-shadow(0 0 6px rgba(248, 113, 113, .65))
          drop-shadow(0 0 12px rgba(248, 113, 113, .35)) !important;
}

/* C5 : t-btn couleur principale + effet allume au hover/active */
[class$="-toolbar"] button.t-btn:not(.primary):not(.danger) {
  background: rgba(39, 39, 42, .45) !important;
  color: var(--p-base) !important;
  border: 1px solid rgba(var(--p-base-rgb), .35) !important;
  border-radius: 6px !important;
  padding: .22rem .55rem !important;
  font-size: .82rem !important;
  font-family: 'Menlo','Consolas',monospace !important;
  height: 28px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: .35rem !important;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s !important;
}
[class$="-toolbar"] button.t-btn:not(.primary):not(.danger):hover:not(:disabled),
[class$="-toolbar"] button.t-btn:not(.primary):not(.danger).active {
  background: rgba(var(--p-base-rgb), .22) !important;
  color: var(--p-bright, var(--p-base)) !important;
  border-color: rgba(var(--p-base-rgb), .55) !important;
  box-shadow: 0 0 10px rgba(var(--p-base-rgb), .4) !important;
}

/* C6 : t-btn.primary — variant fort (CTA) */
[class$="-toolbar"] button.t-btn.primary {
  background: rgba(var(--p-base-rgb), .25) !important;
  color: var(--p-bright, #fff) !important;
  border: 1px solid rgba(var(--p-base-rgb), .65) !important;
  border-radius: 6px !important;
  padding: .22rem .65rem !important;
  font-size: .82rem !important;
  font-family: 'Menlo','Consolas',monospace !important;
  font-weight: 600 !important;
  height: 28px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: .35rem !important;
  box-shadow: 0 0 8px rgba(var(--p-base-rgb), .3), inset 0 1px 0 rgba(255,255,255,.1) !important;
  transition: background .15s, box-shadow .15s !important;
}
[class$="-toolbar"] button.t-btn.primary:hover:not(:disabled) {
  background: rgba(var(--p-base-rgb), .4) !important;
  box-shadow: 0 0 14px rgba(var(--p-base-rgb), .55), inset 0 1px 0 rgba(255,255,255,.15) !important;
}

/* C7 : t-btn.danger uniforme rouge fixe */
[class$="-toolbar"] button.t-btn.danger {
  background: rgba(239, 68, 68, .12) !important;
  color: #fecaca !important;
  border: 1px solid rgba(239, 68, 68, .4) !important;
  border-radius: 6px !important;
  padding: .22rem .55rem !important;
  font-size: .82rem !important;
  font-family: 'Menlo','Consolas',monospace !important;
  height: 28px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: .35rem !important;
  transition: background .15s, border-color .15s !important;
}
[class$="-toolbar"] button.t-btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, .22) !important;
  border-color: rgba(239, 68, 68, .65) !important;
  color: #fee2e2 !important;
}

/* C9 : labels couleur principale (--p-base) allume */
[class$="-toolbar"] label {
  color: var(--p-base) !important;
  font-size: .82rem !important;
  font-family: 'Menlo','Consolas',monospace !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: .35rem !important;
  line-height: 1.2 !important;
}

/* C10 : checkbox stylise (no border/bg sur label conteneur, checkbox custom) */
[class$="-toolbar"] label:has(input[type="checkbox"]) {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
[class$="-toolbar"] input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 14px !important;
  height: 14px !important;
  border: 1px solid rgba(var(--p-base-rgb), .55) !important;
  border-radius: 3px !important;
  background: rgba(39, 39, 42, .55) !important;
  cursor: pointer !important;
  position: relative !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  transition: background .15s, border-color .15s !important;
}
[class$="-toolbar"] input[type="checkbox"]:hover {
  border-color: var(--p-base) !important;
}
[class$="-toolbar"] input[type="checkbox"]:checked {
  background: var(--p-base) !important;
  border-color: var(--p-base) !important;
}
[class$="-toolbar"] input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 0px;
  width: 4px; height: 9px;
  border: solid #14141c;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* C11.c : counters simples harmonises */
[class$="-toolbar"] .docs-count,
[class$="-toolbar"] .cl-count,
[class$="-toolbar"] .todo-count,
[class$="-toolbar"] .logs-count,
[class$="-toolbar"] .dash-generated {
  color: var(--p-light, #94a3b8) !important;
  font-size: .72rem !important;
  font-family: 'Menlo','Consolas',monospace !important;
  font-weight: 500 !important;
}

/* C12 : letter-spacing .12em uniforme (style dashboard) */
.sante-toolbar .sante-title,
.sport-toolbar .sport-title,
.dash-toolbar .dash-title {
  letter-spacing: .12em !important;
}

/* Force absolue : icon-btn jamais de fond/bordure/outline dans aucun etat
   (override eventuel user-agent stylesheet ou autre cascade) */
button.icon-btn,
button.icon-btn:hover,
button.icon-btn:focus,
button.icon-btn:focus-visible,
button.icon-btn:active,
button.icon-btn:visited,
button.icon-btn.active {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Force absolue famille icon-only — Vincent 2026-05-10
   Couvre toutes les classes icon-only custom (en plus de .icon-btn et .icon-action-btn).
   Pattern strict : opacity .45 -> 1, transparent partout, juste color qui s allume.
   Conformite principle DB "Boutons icône-only — design pur". */
.bsc-pin, .bsc-pin:hover, .bsc-pin:focus, .bsc-pin:active, .bsc-pin.pinned,
.bsc-edit, .bsc-edit:hover, .bsc-edit:focus, .bsc-edit:active,
.dc-pin, .dc-pin:hover, .dc-pin:focus, .dc-pin:active, .dc-pin.pinned,
.s-del, .s-del:hover, .s-del:focus, .s-del:active,
.s-edit, .s-edit:hover, .s-edit:focus, .s-edit:active {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}
