/* AGENT-CARD 2026-05-27 · screen3 compact + busy-tile animation */
.nh-ac {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.nh-ac:hover { border-color: #3b82f6; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(59,130,246,0.08); }

/* Stato → bordo + bg ambient */
.nh-ac-idle      { border-left: 4px solid #94a3b8; }
.nh-ac-busy      { border-left: 4px solid #10b981; background: linear-gradient(180deg, rgba(16,185,129,0.08), transparent 60%); }
.nh-ac-busy::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(16,185,129,0.10), transparent 50%);
  pointer-events: none;
}
.nh-ac-paused    { border-left: 4px solid #f59e0b; background: linear-gradient(180deg, rgba(245,158,11,0.06), transparent 60%); }
.nh-ac-disabled  { border-left: 4px solid #64748b; opacity: 0.65; background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(100,116,139,0.06) 8px, rgba(100,116,139,0.06) 16px); }

.nh-ac-head { display: flex; align-items: center; gap: 12px; }
.nh-ac-icon {
  width: 48px; height: 48px; border-radius: 10px;
  background: radial-gradient(circle, rgba(34,211,238,0.16), rgba(168,85,247,0.12));
  border: 1px solid rgba(34,211,238,0.25);
  display: grid; place-items: center; font-size: 22px;
  flex-shrink: 0;
}
.nh-ac-title { flex: 1; min-width: 0; }
.nh-ac-name {
  font-size: 14px; font-weight: 700; color: var(--text-1, #1e293b);
  line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nh-ac-meta {
  font-family: ui-monospace, monospace; font-size: 10.5px;
  color: var(--text-3, #64748b); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nh-ac-state-box { flex-shrink: 0; }
.nh-ac-state {
  display: inline-block; padding: 3px 9px; border-radius: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.6px;
}
.nh-ac-st-idle     { background: rgba(148,163,184,0.18); color: #475569; }
.nh-ac-st-busy     { background: rgba(16,185,129,0.18); color: #065f46; animation: nh-ac-pulse-bg 2s ease-in-out infinite; }
.nh-ac-st-paused   { background: rgba(245,158,11,0.18); color: #92400e; }
.nh-ac-st-disabled { background: rgba(100,116,139,0.15); color: #475569; }
@keyframes nh-ac-pulse-bg { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5);} 50%{box-shadow:0 0 0 6px rgba(16,185,129,0);} }

/* TOOLS / CAPS rows */
.nh-ac-row { display: flex; align-items: center; gap: 10px; font-size: 10.5px; padding-top: 2px; }
.nh-ac-row-k { width: 50px; color: var(--text-3, #64748b); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600; font-size: 9px; flex-shrink: 0; }
.nh-ac-row-v { flex: 1; color: var(--text-2, #475569); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.nh-ac-risks { display: inline-flex; gap: 4px; margin-left: 6px; }
.nh-ac-risk { padding: 1px 6px; border-radius: 3px; font-size: 9px; font-weight: 700; letter-spacing: 0.3px; }
.nh-ac-risk.r-low      { background: rgba(34,197,94,0.16); color: #15803d; }
.nh-ac-risk.r-medium   { background: rgba(245,158,11,0.16); color: #b45309; }
.nh-ac-risk.r-high     { background: rgba(249,115,22,0.16); color: #c2410c; }
.nh-ac-risk.r-critical { background: rgba(239,68,68,0.18); color: #b91c1c; }
.nh-ac-cap-chip {
  padding: 1px 7px; background: rgba(59,130,246,0.08); color: #1e40af;
  border: 1px solid rgba(59,130,246,0.18); border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 9px; font-weight: 600;
}
.nh-ac-cap-more { font-size: 9px; color: var(--text-3, #64748b); margin-left: 4px; font-weight: 600; }
.muted { opacity: 0.5; }

/* KPI grid */
.nh-ac-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px; background: rgba(15,23,42,0.04); border-radius: 6px; }
.nh-ac-kpi { text-align: center; }
.nh-ac-kpi .k { font-size: 8.5px; color: var(--text-3, #64748b); text-transform: uppercase; letter-spacing: 0.5px; }
.nh-ac-kpi .v { font-size: 14px; font-weight: 800; color: var(--text-1, #0f172a); margin-top: 2px; }
.nh-ac-kpi .v.ok { color: #10b981; }
.nh-ac-kpi .v.warn { color: #f59e0b; }

/* Health bar */
.nh-ac-health { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.nh-ac-health-lbl { color: var(--text-3, #64748b); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; font-size: 9px; min-width: 90px; }
.nh-ac-health-bar { flex: 1; height: 5px; background: rgba(15,23,42,0.08); border-radius: 3px; overflow: hidden; }
.nh-ac-health-bar > div { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.nh-ac-health-bar .ok   { background: linear-gradient(90deg, #10b981, #22c55e); }
.nh-ac-health-bar .warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.nh-ac-health-bar .err  { background: linear-gradient(90deg, #ef4444, #f87171); }
.nh-ac-health-bar .muted { background: rgba(148,163,184,0.3); }
.nh-ac-health-val { font-family: ui-monospace, monospace; font-weight: 700; font-size: 11px; min-width: 38px; text-align: right; }
.nh-ac-health-val.ok { color: #10b981; }
.nh-ac-health-val.warn { color: #f59e0b; }
.nh-ac-health-val.err { color: #ef4444; }
.nh-ac-health-val.muted { color: #94a3b8; }

/* Busy live block + animated pipeline */
.nh-ac-busy-slot:empty { display: none; }
.nh-ac-busy {
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(34,211,238,0.05));
  border: 1px solid rgba(16,185,129,0.28);
  border-radius: 7px;
}
.nh-ac-busy-line { display: flex; align-items: center; gap: 8px; font-size: 10.5px; margin-bottom: 6px; }
.nh-ac-busy-arrow { color: #10b981; font-size: 12px; animation: nh-ac-arrow-blink 1.3s ease-in-out infinite; }
@keyframes nh-ac-arrow-blink { 50% { opacity: 0.3; } }
.nh-ac-busy-tk { font-family: ui-monospace, monospace; color: #1d4ed8; font-weight: 700; }
.nh-ac-busy-tk.muted { color: var(--text-3, #94a3b8); }
.nh-ac-busy-step { color: var(--text-3, #64748b); font-family: ui-monospace, monospace; }
.nh-ac-busy-stage { color: #065f46; font-weight: 600; margin-left: auto; padding: 1px 7px; background: rgba(16,185,129,0.16); border-radius: 3px; font-size: 9.5px; letter-spacing: 0.3px; }

/* Mini state machine pipeline · 7 stage dots */
.nh-ac-pipeline { display: flex; gap: 3px; align-items: center; }
.nh-ac-stage {
  flex: 1; height: 5px; border-radius: 3px;
  background: rgba(148,163,184,0.35);
  transition: background 0.3s;
  position: relative;
}
.nh-ac-stage.done {
  background: linear-gradient(90deg, #10b981, #22c55e);
}
.nh-ac-stage.active {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  animation: nh-ac-stage-glow 1.2s ease-in-out infinite;
}
@keyframes nh-ac-stage-glow {
  0%,100% { box-shadow: 0 0 0 rgba(245,158,11,0.5); transform: scaleY(1); }
  50%     { box-shadow: 0 0 8px rgba(245,158,11,0.7); transform: scaleY(1.6); }
}
.nh-ac-stage.pending { background: rgba(148,163,184,0.25); }

/* Actions footer */
.nh-ac-actions { display: flex; gap: 6px; padding-top: 2px; align-items: center; }
.nh-ac-btn {
  padding: 6px 10px; border-radius: 6px; font-size: 10.5px;
  border: 1px solid var(--border, #e2e8f0); background: rgba(15,23,42,0.03);
  color: var(--text-1, #1e293b); cursor: pointer; font-weight: 600;
  transition: all 0.15s;
}
.nh-ac-btn:hover { background: rgba(59,130,246,0.10); border-color: #3b82f6; color: #1e40af; }
.nh-ac-btn.ok { background: rgba(16,185,129,0.10); border-color: rgba(16,185,129,0.4); color: #047857; }
.nh-ac-btn.ok:hover { background: #10b981; color: white; }

/* Skeleton loader */
@keyframes nh-ac-skel { 0%,100% { opacity: 0.4; } 50% { opacity: 0.6; } }
.nh-ac.skeleton { pointer-events: none; }

/* Dark theme override (se la pagina ha tema dark) */
.theme-dark .nh-ac, [data-theme="dark"] .nh-ac { background: rgba(20,28,48,0.6); }
.theme-dark .nh-ac-name, [data-theme="dark"] .nh-ac-name { color: #e2eaf5; }
.theme-dark .nh-ac-kpi .v, [data-theme="dark"] .nh-ac-kpi .v { color: #e2eaf5; }
.theme-dark .nh-ac-kpis, [data-theme="dark"] .nh-ac-kpis { background: rgba(0,0,0,0.25); }
