/* ── P2J — Pannello Deploy (applicazioni distribuite) ───────────────────────
   Stesso linguaggio visivo del pannello Anteprima (P2I): pannello laterale,
   chip scuro, bordi sottili, hover sobrio — §4j/§4k. Non è un IDE: mostra
   l'applicazione DISTRIBUITA, con versione, macchina e stato reale. */

.amd-lock { overflow: hidden; }

.amd-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(1, 4, 9, 0.62);
  backdrop-filter: blur(2px);
}
.amd-overlay.is-open { display: flex; }

.amd-panel {
  width: min(1180px, 88vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
  animation: amd-in 160ms ease-out;
}
@keyframes amd-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.amd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.amd-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.amd-id-text { min-width: 0; }

.amd-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #8a93a6;
  box-shadow: 0 0 0 3px rgba(138, 147, 166, 0.16);
}
.amd-dot-ready { background: #3fb950; box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.16); }
.amd-dot-preparing, .amd-dot-building, .amd-dot-starting { background: #d29922; box-shadow: 0 0 0 3px rgba(210, 153, 34, 0.16); }
.amd-dot-failed { background: #f85149; box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.16); }
.amd-dot-stopped { background: #8a93a6; }

.amd-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amd-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amd-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.amd-actions .cu-filter-btn:disabled { opacity: 0.45; cursor: default; }
.amd-danger { color: #ff9a94; border-color: rgba(248, 81, 73, 0.4); }

.amd-body { position: relative; flex: 1 1 auto; min-height: 0; background: #0b0f16; }
.amd-frame { width: 100%; height: 100%; border: 0; background: #ffffff; }
.amd-frame:not([src]) { display: none; }

.amd-layer {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--bg-primary);
  overflow: auto;
}
.amd-layer.is-visible { display: flex; }

.amd-note {
  width: min(760px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.amd-note-bad { border-color: rgba(248, 81, 73, 0.35); }
.amd-note-title { font-size: 14px; font-weight: 600; }
.amd-note-sub { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.amd-note-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.amd-rows { display: flex; flex-direction: column; gap: 6px; }
.amd-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #121826;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.amd-row:hover { background: rgba(88, 166, 255, 0.08); border-color: rgba(88, 166, 255, 0.32); }
.amd-row-name { font-size: 13px; font-weight: 600; }
.amd-row-meta { font-size: 11.5px; color: var(--text-secondary); }

.amd-log {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  background: #0b0f16;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
}

.amd-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.amd-primary { background: rgba(88, 166, 255, 0.16); border-color: rgba(88, 166, 255, 0.5); color: #cfe6ff; }

.amd-spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(138, 147, 166, 0.3);
  border-top-color: #58a6ff;
  animation: amd-spin 700ms linear infinite;
}
@keyframes amd-spin { to { transform: rotate(360deg); } }

.amd-foot {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 11px;
}
