/* ===== Page Netsight — supervision des équipements clients ===== */
.page_netsight {
  padding: 16px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.ns-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ns-header h1 {
  font-size: 20pt;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ns-header h1 .fa { color: var(--main-bg-color); }

.ns-config-badge {
  background: #fff3cd;
  color: #8a6d3b;
  border: 1px solid #ffe69c;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 9.5pt;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Toolbar / sélection tiers */
.ns-toolbar {
  margin-bottom: 18px;
}
.ns-tier-select { max-width: 480px; }
.ns-tier-select label {
  display: block;
  font-size: 9pt;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

/* Layout 2 colonnes */
.ns-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.ns-col { min-width: 0; }

/* Cartes */
.ns-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  padding: 16px;
}
.ns-card-title {
  font-size: 13pt;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ns-card-title .fa { color: var(--main-bg-color); }
.ns-card-subtitle {
  font-size: 10pt;
  font-weight: 600;
  color: #555;
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ns-count {
  background: var(--main-bg-color);
  color: #fff;
  border-radius: 20px;
  padding: 0 8px;
  font-size: 8.5pt;
  line-height: 18px;
}

/* Client */
.ns-client-name { font-size: 12pt; font-weight: 600; }
.ns-client-line { font-size: 9.5pt; color: #444; margin-top: 2px; }

/* Contrats */
.ns-contract {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.ns-contract-ref { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ns-lines { margin: 6px 0 0; padding-left: 18px; font-size: 9pt; color: #555; }
.ns-lines li { margin: 2px 0; }

.ns-badge {
  font-size: 8pt;
  padding: 1px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.ns-badge-ok { background: #e3f6e8; color: #1d7a3a; }

/* Actions */
.ns-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.ns-btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 10pt;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: filter .15s, background .15s;
}
.ns-btn:disabled { opacity: .55; cursor: not-allowed; }
.ns-btn-primary { background: var(--main-bg-color); color: #fff; }
.ns-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.ns-btn-ghost { background: #f0f0f0; color: #333; border: 1px solid #ddd; }
.ns-btn-ghost:hover:not(:disabled) { background: #e4e4e4; }
.ns-btn-sm { padding: 5px 10px; font-size: 9pt; margin-left: auto; }

/* Payload / réponse brute */
.ns-payload {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  font-size: 8.5pt;
  line-height: 1.45;
  max-height: 420px;
  overflow: auto;
  white-space: pre;
}

/* Résumé KPI équipements */
.ns-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.ns-kpi {
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  color: #fff;
}
.ns-kpi-val { font-size: 16pt; font-weight: 700; line-height: 1; }
.ns-kpi-lbl { font-size: 8pt; text-transform: uppercase; opacity: .9; margin-top: 3px; }
.ns-kpi-ok   { background: #2ecc71; }
.ns-kpi-warn { background: #f39c12; }
.ns-kpi-crit { background: #e74c3c; }
.ns-kpi-off  { background: #95a5a6; }

/* Équipements */
.ns-equip {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.ns-equip-head { display: flex; align-items: center; gap: 8px; }
.ns-equip-name { font-weight: 600; }
.ns-equip-type {
  font-size: 8pt;
  background: #f0f0f0;
  border-radius: 12px;
  padding: 1px 8px;
  color: #555;
}
.ns-equip-msg { font-size: 9pt; color: #555; margin-top: 4px; }
.ns-equip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 8.5pt;
  color: #777;
}
.ns-metric { background: #f7f7f9; border-radius: 6px; padding: 1px 7px; }

.ns-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.ns-status-ok      { background: #2ecc71; }
.ns-status-warn    { background: #f39c12; }
.ns-status-crit    { background: #e74c3c; }
.ns-status-off     { background: #95a5a6; }
.ns-status-unknown { background: #ccc; }

/* Vides / placeholder */
.ns-empty {
  color: #888;
  font-size: 9.5pt;
  padding: 8px 0;
  font-style: italic;
}
.ns-placeholder {
  text-align: center;
  color: #999;
  padding: 60px 20px;
  font-size: 11pt;
}
.ns-placeholder .fa { display: block; font-size: 22pt; margin-bottom: 10px; color: #ccc; }

/* Toolbar : sélecteur + bouton synchro groupée alignés */
.ns-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.ns-bulk-open { white-space: nowrap; }

/* Description de ligne de contrat */
.ns-line-main { display: block; }
.ns-line-desc {
  display: block;
  font-size: 8pt;
  color: #888;
  font-style: italic;
  white-space: pre-wrap;
  margin: 1px 0 4px;
}

/* ===== Modale synchro groupée ===== */
.ns-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}
.ns-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}
.ns-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}
.ns-modal-title { font-size: 13pt; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ns-modal-title .fa { color: var(--main-bg-color); }
.ns-modal-close {
  border: none;
  background: transparent;
  font-size: 14pt;
  cursor: pointer;
  color: #888;
}
.ns-modal-close:hover { color: #333; }
.ns-modal-sub { padding: 10px 16px 0; font-size: 9pt; color: #666; }
.ns-modal-warn {
  margin: 10px 16px 0;
  background: #fff3cd;
  color: #8a6d3b;
  border: 1px solid #ffe69c;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 8.5pt;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ns-modal-warn code { background: rgba(0,0,0,0.06); padding: 0 4px; border-radius: 3px; }

.ns-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}
.ns-bulk-all { display: flex; align-items: center; gap: 6px; font-size: 9.5pt; font-weight: 600; cursor: pointer; }
.ns-bulk-count { font-size: 8.5pt; color: #777; }

.ns-bulk-loading { padding: 24px 16px; text-align: center; color: #888; }

.ns-bulk-list {
  overflow: auto;
  padding: 0 16px;
  flex: 1;
}
.ns-bulk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
  font-size: 9.5pt;
}
.ns-bulk-item input { flex: 0 0 auto; }
.ns-bulk-name { flex: 1; min-width: 0; }
.ns-bulk-nb {
  font-size: 7.5pt;
  background: #f0f0f0;
  border-radius: 12px;
  padding: 1px 7px;
  color: #666;
  margin-left: 6px;
}
.ns-bulk-status { flex: 0 0 auto; width: 18px; text-align: center; }
.ns-bulk-ok { color: #2ecc71; }
.ns-bulk-error { color: #e74c3c; }
.ns-bulk-running { color: var(--main-bg-color); }

.ns-bulk-progress {
  padding: 10px 16px;
  font-size: 8.5pt;
  color: #555;
}
.ns-bulk-bar {
  height: 8px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 5px;
}
.ns-bulk-bar-fill {
  height: 100%;
  background: var(--main-bg-color);
  transition: width .2s;
}

.ns-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 992px) {
  .ns-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .ns-summary { grid-template-columns: repeat(2, 1fr); }
  .ns-btn-sm { margin-left: 0; }
  .ns-bulk-open { width: 100%; justify-content: center; }
}
