.surv-tab { padding: 0; height: 100%; display: flex; flex-direction: column; }

.surv-toolbar {
  display: flex; gap: .7rem; align-items: center;
  padding: .55rem .9rem;
  background: rgba(24, 24, 27, .22);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex-wrap: wrap;
  backdrop-filter: blur(24px) saturate(180%);
}
.surv-toolbar label { font-size: .82rem; color: #d4d4d8; display: flex; align-items: center; gap: .3rem; }
.surv-toolbar select, .surv-toolbar input, .surv-toolbar button:not(.icon-btn) {
  background: rgba(39, 39, 42, .45); color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px; padding: .22rem .55rem; font-size: .82rem;
}
.surv-toolbar input[type="search"] { min-width: 200px; font-family: inherit; }
.surv-toolbar .surv-stats {
  margin-left: auto;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: .8rem; font-weight: 600;
  display: flex; gap: .4rem;
}
.surv-toolbar .surv-stats .stat { padding: .1rem .45rem; border-radius: 3px; border: 1px solid; }
.surv-toolbar .surv-stats .stat.ok   { color: var(--v4); border-color: var(--v4); background: rgba(var(--v4-rgb), .1); }
.surv-toolbar .surv-stats .stat.warn { color: #fb923c;   border-color: #fb923c;   background: rgba(251, 146, 60, .1); }
.surv-toolbar .surv-stats .stat.crit { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb), .12); }

/* ===== Layout : sidebar (catégories) + main (liste) ===== */
.surv-layout {
  display: grid; grid-template-columns: 260px 1fr;
  flex: 1; min-height: 0;
  transition: grid-template-columns .2s;
}
.surv-layout.sidebar-hidden { grid-template-columns: 0 1fr; }
.surv-layout.sidebar-hidden #surv-sidebar { visibility: hidden; border-right: none; }

#surv-sidebar {
  background: rgba(20, 20, 23, .25);
  border-right: 1px solid rgba(255, 255, 255, .1);
  overflow-y: auto;
  min-height: 0;
}
#surv-tree { list-style: none; margin: 0; padding: .4rem 0; }
#surv-tree .tree-cat {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .85rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  color: #d4d4d8;
}
#surv-tree .tree-cat:hover { background: rgba(var(--p-base-rgb), .07); }
#surv-tree .tree-cat.active {
  background: rgba(var(--p-glow-rgb), .12);
  box-shadow: inset 2px 0 0 var(--p-base);
  border-left-color: transparent;
}
#surv-tree .tree-cat.active .tc-label { color: var(--p-base); font-weight: 600; }
#surv-tree .tc-icon {
  flex-shrink: 0; opacity: .75;
  width: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--p-base);
}
#surv-tree .tree-cat:hover .tc-icon { opacity: .95; }
#surv-tree .tree-cat.active .tc-icon { opacity: 1; }
#surv-tree .tc-label { color: #e4e4e7; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#surv-tree .tc-badges { display: flex; gap: .22rem; align-items: center; flex-shrink: 0; }
#surv-tree .tc-b {
  font-size: .6rem; font-weight: 700;
  padding: .05rem .32rem; border-radius: 3px; border: 1px solid;
  font-family: 'Menlo','Consolas',monospace;
  letter-spacing: 0;
}
#surv-tree .tc-b.crit { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb),.12); }
#surv-tree .tc-b.warn { color: #fb923c; border-color: #fb923c; background: rgba(251,146,60,.12); }
#surv-tree .tc-count {
  color: #64748b; font-size: .7rem; font-weight: 400;
  font-family: 'Menlo','Consolas',monospace;
  letter-spacing: 0;
}

#surv-main { display: flex; flex-direction: column; background: transparent; position: relative; overflow: hidden; min-height: 0; }
#surv-main .sidebar-handle {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 12px; height: 64px;
  background: rgba(39, 39, 42, .55);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: none; border-radius: 0 4px 4px 0;
  cursor: pointer; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: background .15s, color .15s;
}
#surv-main .sidebar-handle:hover { background: rgba(var(--p-base-rgb), .18); color: var(--p-base); }

.surv-list { flex: 1; overflow-y: auto; padding: .85rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.surv-empty { color: #64748b; font-style: italic; text-align: center; padding: 2rem 0; }

/* ===== Groupes collapsables ===== */
.surv-group { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .6rem; }
.surv-group-header {
  display: flex; align-items: baseline; gap: .5rem;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(var(--p-base-rgb), .18);
  cursor: pointer;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--p-light);
  padding: .1rem .2rem .3rem;
  text-align: left;
  font-family: inherit;
  transition: background .12s;
}
.surv-group-header:hover { background: rgba(var(--p-base-rgb), .06); }
.surv-group-header .g-chevron {
  display: inline-block; width: 12px;
  color: var(--p-base); font-size: .72rem;
  transition: transform .15s; line-height: 1;
}
.surv-group.collapsed .g-chevron { transform: rotate(-90deg); }
.surv-group-header .g-name { font-weight: 600; color: var(--p-base); }
.surv-group-header .g-badges {
  display: flex; gap: 0;
  margin-left: auto;
  font-family: 'Menlo','Consolas',monospace;
  font-weight: 700; font-size: .78rem;
}
.surv-group-header .g-badges .g-crit { color: var(--v2); }
.surv-group-header .g-badges .g-warn { color: #fb923c; }
.surv-group-header .g-badges .g-ok   { color: var(--v4); opacity: .7; }
.surv-group-header .g-badges .g-sep  { color: #475569; font-weight: 400; }
.surv-group-header .g-count {
  color: #64748b; font-size: .68rem; font-weight: 400;
  padding-left: .4rem; border-left: 1px solid rgba(255, 255, 255, .08); margin-left: .2rem;
}
.surv-group-items { display: flex; flex-direction: column; gap: .6rem; }
.surv-group.collapsed .surv-group-items { display: none; }

/* ===== Card — chrome .card-pri (ref design Vincent 2026-04-29) =====
   Actif + état → couleur statut (ok/warn/crit), critical clignotant.
   Inactif (disabled) → couleur principale --p-base éteinte.
   LED .s-bullet supprimée — la couleur de carte + clignotement la remplacent. */
.surv-card {
  --card-rgb: var(--p-base-rgb);
  display: flex; flex-direction: column;
  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%);
  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;
}
/* Couleur card = CRITICITÉ du monitor (statique, propre au monitor)
   ref Vincent 2026-04-29 : low gris, medium jaune, high orange, critical rouge */
.surv-card.crit-low      { --card-rgb: 100, 116, 139; }
.surv-card.crit-medium   { --card-rgb: 234, 179, 8; }
.surv-card.crit-high     { --card-rgb: var(--c-state-alert-rgb); }
.surv-card.crit-critical { --card-rgb: var(--c-state-critical-rgb); }
/* Clignotement si DÉCLENCHÉE (état actuel = warn ou crit, indépendamment de la criticité) */
.surv-card.state-warn,
.surv-card.state-crit    { animation: state-critical-blink 1s steps(2, start) infinite; }
.surv-card.state-error   { opacity: .75; }
.surv-card.disabled      { opacity: .5; }   /* éteint, garde la couleur de criticité */
.surv-card.paused        { opacity: .6; border-style: dashed; }

/* LED supprimée — la couleur de carte + clignotement la remplacent (ref Vincent 2026-04-29) */
.surv-card .s-bullet { display: none; }
.surv-card .s-row { grid-template-columns: 32px auto auto auto 1fr auto auto; }

.s-row {
  display: grid;
  grid-template-columns: 32px 12px auto auto auto 1fr auto auto;
  align-items: center;
  gap: .55rem;
  padding: .4rem .7rem;
  cursor: pointer;
}
.s-bullet { width: 10px; height: 10px; border-radius: 50%; }
.s-bullet.ok   { background: var(--v4); box-shadow: 0 0 5px var(--v4); }
.s-bullet.warn { background: #fb923c; box-shadow: 0 0 5px #fb923c; }
.s-bullet.crit { background: var(--v2); box-shadow: 0 0 6px var(--v2); animation: surv-pulse 1.5s ease-in-out infinite; }
.s-bullet.error { background: #64748b; }
@keyframes surv-pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }

.s-title { color: #e4e4e7; font-weight: 500; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.s-ref { color: #64748b; font-family: 'Menlo','Consolas',monospace; font-size: .7rem; font-weight: 600; margin-right: .45rem; letter-spacing: .02em; }
.s-title .s-cat { color: var(--p-light); font-size: .7rem; font-family: 'Menlo','Consolas',monospace; margin-right: .4rem; padding: 0 .3rem; border-radius: 3px; background: rgba(var(--p-base-rgb),.08); border: 1px solid rgba(var(--p-base-rgb),.2); }

.s-crit {
  font-size: .65rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
  padding: .1rem .4rem; border-radius: 3px; border: 1px solid; font-family: 'Menlo','Consolas',monospace;
  line-height: 1.3;
  min-width: 72px;
  text-align: center;
  box-sizing: border-box;
  display: inline-block;
}
.s-crit.critical { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb), .12); }
.s-crit.high     { color: #fb923c;   border-color: #fb923c;   background: rgba(251,146,60,.12); }
.s-crit.medium   { color: var(--p-light); border-color: var(--p-light); background: rgba(var(--p-base-rgb), .1); }
.s-crit.low      { color: #94a3b8;   border-color: #64748b;   background: rgba(100,116,139,.1); }

.s-freq { color: #64748b; font-family: 'Menlo','Consolas',monospace; font-size: .72rem; }
/* Valeur + sparkline — couleur = état actuel du statut (ref Vincent 2026-04-29).
   currentColor est porté par .s-spark via CSS, le SVG path utilise stroke="currentColor". */
.s-val  { color: var(--c-state-notif); font-family: 'Menlo','Consolas',monospace; font-size: .78rem; font-weight: 600; min-width: 4rem; text-align: right; }
.s-spark { width: 80px; height: 22px; flex-shrink: 0; color: var(--c-state-notif); }

.surv-card.state-ok    .s-val,
.surv-card.state-ok    .s-spark { color: var(--c-state-notif); }     /* vert ok */
.surv-card.state-warn  .s-val,
.surv-card.state-warn  .s-spark { color: var(--c-state-alert); }     /* orange warn */
.surv-card.state-crit  .s-val,
.surv-card.state-crit  .s-spark { color: var(--c-state-critical); }  /* rouge triggé */
.surv-card.state-error .s-val,
.surv-card.state-error .s-spark { color: var(--c-state-alarm); opacity: .65; }

/* ===== Expand ===== */
.s-expand {
  display: none;
  padding: .6rem .9rem .9rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  gap: .7rem; flex-direction: column;
  font-size: .84rem;
}
.surv-card.expanded .s-expand { display: flex; }

.s-sec h4 { margin: 0 0 .25rem; font-size: .7rem; color: var(--p-light); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.s-sec p  { margin: 0; color: #d4d4d8; line-height: 1.5; }
.s-desc { color: #d4d4d8; line-height: 1.5; white-space: pre-wrap; }
.s-advice {
  color: #fed7aa; font-size: .82rem; line-height: 1.5;
  padding: .4rem .6rem; background: rgba(251, 146, 60, .08);
  border-left: 2px solid #fb923c; border-radius: 0 4px 4px 0;
}

.s-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .3rem .8rem; font-size: .76rem; font-family: 'Menlo','Consolas',monospace;
}
.s-meta-grid .k { color: #64748b; }
.s-meta-grid .v { color: #d4d4d8; }
.s-meta-grid .v.mono { color: var(--p-light); }

.s-probe {
  padding: .4rem .6rem; background: rgba(0, 0, 0, .25);
  border-left: 2px solid rgba(255, 255, 255, .08); border-radius: 0 4px 4px 0;
  font-family: 'Menlo','Consolas',monospace; font-size: .76rem; color: #cbd5e1;
  white-space: pre-wrap; word-break: break-word;
}

.s-alerts { display: flex; flex-direction: column; gap: .25rem; }
.s-alert {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: .5rem; padding: .3rem .55rem;
  background: rgba(239, 68, 68, .06); border-left: 2px solid var(--v2);
  border-radius: 0 4px 4px 0;
  font-size: .76rem; font-family: 'Menlo','Consolas',monospace;
}
.s-alert.cleared { opacity: .55; background: rgba(148, 163, 184, .06); border-left-color: #64748b; }
.s-alert .a-level { color: var(--v2); font-weight: 700; text-transform: uppercase; font-size: .68rem; }
.s-alert.cleared .a-level { color: #64748b; }
.s-alert .a-msg { color: #e4e4e7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-alert .a-ts  { color: #64748b; }

/* ===== Action rules ===== */
.s-rules { display: flex; flex-direction: column; gap: .3rem; }
.s-rule {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto auto;
  gap: .45rem;
  align-items: center;
  padding: .3rem .55rem;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 5px;
  font-family: 'Menlo','Consolas',monospace;
  font-size: .74rem;
}
.s-rule.r-off { opacity: .5; }
.s-rule .r-trigger {
  padding: .1rem .4rem; border-radius: 3px; border: 1px solid; font-size: .65rem;
  text-transform: uppercase; font-weight: 600; letter-spacing: .04em;
  line-height: 1.3;
  min-width: 72px; text-align: center; box-sizing: border-box;
  font-family: 'Menlo','Consolas',monospace;
}
.s-rule .r-type {
  padding: .1rem .4rem; border-radius: 3px; border: 1px solid rgba(var(--p-base-rgb),.3);
  font-size: .65rem; font-weight: 600; letter-spacing: .04em;
  color: var(--p-light); line-height: 1.3;
  min-width: 56px; text-align: center; box-sizing: border-box;
  font-family: 'Menlo','Consolas',monospace;
}
.s-rule .r-lvl-crit     { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb), .12); }
.s-rule .r-lvl-warn     { color: #fb923c;   border-color: #fb923c;   background: rgba(251,146,60,.12); }
.s-rule .r-lvl-recovery { color: var(--v4); border-color: var(--v4); background: rgba(var(--v4-rgb), .1); }
.s-rule .r-summary { color: #cbd5e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-rule .r-summary .r-ssh { color: #94a3b8; font-style: italic; margin-left: .3rem; }
.s-rule .r-fired { color: var(--p-deep); font-size: .65rem; }
.s-rule .r-toggle { display: inline-flex; align-items: center; gap: .3rem; color: #94a3b8; font-size: .66rem; }
.s-rule .r-tog-lbl { font-family: 'Menlo','Consolas',monospace; text-transform: uppercase; letter-spacing: .04em; }
.s-rule .r-del {
  background: transparent; color: #fca5a5; border: 1px solid rgba(239, 68, 68, .3);
  border-radius: 3px; padding: 0 .35rem; font-size: .72rem; cursor: pointer; line-height: 1.4;
}
.s-rule .r-del:hover:not(:disabled) { background: rgba(239, 68, 68, .15); }
.s-rule .r-del:disabled { opacity: .35; cursor: not-allowed; }

.s-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .4rem; border-top: 1px dashed rgba(255, 255, 255, .06); }
.s-actions .t-btn {
  background: rgba(39, 39, 42, .5); color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px;
  padding: .3rem .65rem; font-size: .78rem; cursor: pointer;
}
.s-actions .t-btn:hover:not(:disabled) { background: rgba(63, 63, 70, .65); border-color: rgba(var(--p-base-rgb), .3); }
.s-actions .t-btn.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;
}
.s-actions .t-btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, .3); }
.s-actions .t-btn.danger:hover:not(:disabled) { background: rgba(239, 68, 68, .15); }
.s-actions .t-btn:disabled { opacity: .4; cursor: not-allowed; }

.s-err-inline { color: var(--v2); font-size: .75rem; margin-top: .3rem; }

/* ===== Modal wide ===== */
.surv-modal .modal { max-width: 640px !important; width: 92vw !important; }

/* A3a : ZERO override mobile sur cet onglet (Vincent demande à reprendre plus tard avec DevTools) */

/* ============================================================================
   Modale 'Destinations' (notification_destinations CRUD)
   ============================================================================ */
.surv-dest-modal-overlay { position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; }
.surv-dest-modal { width: 92vw; max-width: 920px; max-height: 86vh; overflow: auto;
  background: rgba(15,15,19,.95); border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  padding: 1.2rem 1.4rem; color: #e4e4e7; backdrop-filter: blur(16px) saturate(180%);
  position: relative; }
.surv-dest-modal h3 { color: var(--p-base); margin: 0 0 .5rem; font-size: 1.05rem; }
.surv-dest-modal .modal-close { position: absolute; top: .6rem; right: .8rem;
  background: transparent; border: 0; color: #94a3b8; font-size: 1.4rem; cursor: pointer; }
.surv-dest-modal .modal-close:hover { color: #fff; }
.surv-dest-help { font-size: .76rem; color: #94a3b8; margin: 0 0 .8rem; line-height: 1.4; }
.surv-dest-actions { margin-bottom: .6rem; }
.surv-dest-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.surv-dest-table th { text-align: left; padding: .35rem .5rem; color: #94a3b8;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.surv-dest-table td { padding: .4rem .5rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.surv-dest-table td.center { text-align: center; }
.surv-dest-table tr:hover { background: rgba(255,255,255,.02); }
.surv-dest-kind { display: inline-block; font-size: .68rem; font-weight: 600;
  padding: .12rem .45rem; border-radius: 4px; font-family: 'Menlo','Consolas',monospace; }

.surv-dest-edit-overlay { position: fixed; inset: 0; z-index: 9100;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; }
.surv-dest-edit { width: 92vw; max-width: 560px; max-height: 86vh; overflow: auto;
  background: rgba(15,15,19,.97); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  padding: 1.2rem 1.4rem; color: #e4e4e7; position: relative; }
.surv-dest-edit h3 { color: var(--p-base); margin: 0 0 .8rem; font-size: 1.05rem; }
.surv-dest-form { display: flex; flex-direction: column; gap: .6rem; }
.surv-dest-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .76rem; color: #cbd5e1; }
.surv-dest-form label.row { flex-direction: row; align-items: center; gap: .5rem; }
.surv-dest-form input[type=text], .surv-dest-form input:not([type]),
.surv-dest-form select, .surv-dest-form textarea {
  background: rgba(20,20,23,.65); color: #e4e4e7;
  border: 1px solid rgba(255,255,255,.1); border-radius: 4px;
  padding: .35rem .5rem; font-size: .8rem;
  font-family: 'Menlo','Consolas',monospace;
}
.surv-dest-form textarea { resize: vertical; min-height: 60px; }
.surv-dest-form .actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }

/* ============================================================================
   STANDARD TOOLBAR — uniforme reference Biometrie sante (Vincent 2026-05-10)
   Zone figee (min-height 3.15rem) + controls cohérents (bg .45, radius 6, h 28).
   ============================================================================ */
.surv-toolbar {
  min-height: 3.15rem !important;
  box-sizing: border-box !important;
}
.surv-toolbar input[type="search"],
.surv-toolbar input[type="text"],
.surv-toolbar input[type="date"],
.surv-toolbar input[type="number"],
.surv-toolbar select,
.surv-toolbar button.t-btn {
  background: rgba(39, 39, 42, .45);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: .22rem .55rem;
  font-size: .82rem;
  font-family: 'Menlo','Consolas',monospace;
  height: 28px;
  box-sizing: border-box;
  line-height: 1.2;
}
.surv-toolbar button.t-btn:hover:not(:disabled) {
  background: rgba(var(--p-base-rgb), .18);
  color: var(--p-base);
  border-color: rgba(var(--p-base-rgb), .35);
}
.surv-toolbar label {
  font-size: .82rem;
  color: #d4d4d8;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  line-height: 1.2;
}

/* ============================================================================
   Bouton Destinations — couleur principale (--p-base) + alignement icone/texte
   Vincent 2026-05-10 : respecte design portail (couleur principale + flex align)
   ============================================================================ */
/* #surv-destinations override retire — utilise .icon-btn standard pur (portal.css) */
