/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  padding: var(--page-pad);
  overflow-y: auto;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.show .modal { transform: scale(1); }

.modal h3 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.modal .modal-sub {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.modal-actions .btn { width: 100%; }

/* ── Toasts ── */
.toast-container {
  position: fixed;
  top: 72px;
  left: var(--page-pad);
  right: var(--page-pad);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  max-width: none;
  width: 100%;
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }

.toast-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* Confirm modal */
.confirm-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ── Config Editor Modal ── */
.config-editor-modal {
  max-width: 720px;
}

.config-editor-modal h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.config-editor-modal .config-domain {
  color: var(--accent);
  font-weight: 400;
  font-size: 0.9rem;
}

.config-textarea {
  width: 100%;
  min-height: 400px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  resize: vertical;
  tab-size: 4;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.config-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.config-error-box {
  display: none;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--red);
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-family: "SF Mono", "Fira Code", monospace;
  margin-top: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
}

.config-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 1rem;
}

.config-actions-left {
  display: flex;
  gap: 0.5rem;
}

.config-actions-right {
  display: flex;
  gap: 0.5rem;
}

/* ── Nginx Diagnostics ── */
.nginx-diag-modal {
  max-width: 820px;
}

#nginxDiagModal.modal-overlay {
  z-index: 320;
}

.nginx-diag-fixed {
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.25);
  border-radius: 6px;
  padding: 0.75rem 0.875rem;
  margin: 0.75rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.nginx-diag-fixed ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.nginx-diag-issues {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.nginx-diag-issue {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.875rem;
  background: rgba(255, 255, 255, 0.02);
}

.nginx-diag-issue-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.nginx-diag-issue-head code {
  font-size: 0.78rem;
}

.nginx-diag-issue-msg {
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.nginx-diag-issue-suggestion {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.nginx-diag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nginx-diag-badge-auto {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}

.nginx-diag-badge-manual {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
}

.nginx-diag-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.nginx-diag-hidden h4,
.nginx-diag-detail-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.nginx-diag-hidden-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nginx-diag-hidden-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
}

.nginx-diag-detail,
.nginx-diag-detail-mini {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.875rem;
  font-size: 0.75rem;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
}

.nginx-diag-detail-mini {
  margin-top: 0.55rem;
  max-height: 120px;
  font-size: 0.7rem;
}

/* ── Env Editor ── */
.env-editor-root.env-editor-expanded {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.env-editor-root.env-editor-expanded .env-editor-plain,
.env-editor-root.env-editor-expanded .env-editor-friendly {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.env-editor-root.env-editor-expanded .env-editor-list {
  flex: 1;
  min-height: 0;
}

.env-editor-list-wrap {
  position: relative;
  --env-editor-key-col: 280px;
}

.env-editor-list {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  background: var(--bg-input);
}

.env-editor-col-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--env-editor-key-col) + 5px);
  width: 8px;
  margin-left: -4px;
  cursor: col-resize;
  z-index: 3;
  border-radius: 4px;
  touch-action: none;
}

.env-editor-col-resizer:hover,
.env-editor-col-resizer.is-dragging {
  background: var(--accent);
  opacity: 0.35;
}

.env-editor-row {
  display: grid;
  grid-template-columns: var(--env-editor-key-col) minmax(0, 1fr) repeat(4, auto);
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.env-editor-key,
.env-editor-value {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.8125rem;
}

.env-editor-key {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.75rem;
}

.env-editor-row-btn {
  padding: 0.25rem 0.45rem;
  font-size: 0.6875rem;
  white-space: nowrap;
}

.env-editor-row-remove {
  min-width: 32px;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.env-edit-modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  position: relative;
}

.env-edit-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.env-edit-modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.env-edit-modal-close:focus-visible,
.env-editor-col-resizer:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.env-edit-modal-dialog.env-edit-modal-expanded {
  display: flex;
  flex-direction: column;
}

.env-edit-modal-dialog.env-edit-modal-expanded #editEnvEditorRoot {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.env-edit-modal-dialog.env-edit-modal-expanded .env-editor-root {
  flex: 1;
  min-height: 0;
}

.env-edit-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.app-dir-modal-dialog {
  max-width: 760px;
}

.app-dir-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
}

.app-dir-breadcrumb button {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
}

.app-dir-breadcrumb button:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.app-dir-content {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  max-height: 420px;
  overflow: auto;
}

.app-dir-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.app-dir-table th,
.app-dir-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.app-dir-table th {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  background: var(--bg-input);
}

.app-dir-row {
  cursor: pointer;
}

.app-dir-row:hover td {
  background: var(--bg-secondary);
}

.app-dir-name {
  color: var(--text-primary);
  font-family: "SF Mono", "Fira Code", monospace;
}

.app-dir-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* ── Apps panel: shared modal + cards (mobile-first) ── */
.sp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sp-modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  padding: 1rem;
  width: 100%;
  max-width: 100%;
  max-height: 96vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  position: relative;
}

.sp-modal-dialog--md { max-width: 560px; }

.sp-modal-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin-top: 1rem;
}

.sp-modal-actions .btn {
  width: 100%;
  min-height: var(--touch-min);
  justify-content: center;
}

.sp-select-full {
  width: 100%;
  max-width: 100%;
  min-height: var(--touch-min, 44px);
  padding: 0.55rem 0.75rem;
  background: var(--bg-input, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  box-sizing: border-box;
}

.form-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.domain-hint.domain-hint-error {
  color: var(--red);
}

.domain-hint.domain-hint-warn {
  color: #d29922;
}

.domain-hint.domain-hint-ok {
  color: #3fb950;
}

.nginx-diag-fix-guide {
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  background: rgba(210, 153, 34, 0.08);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.nginx-diag-fix-guide strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
}

.nginx-diag-fix-guide ol {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}

.nginx-diag-fix-guide li {
  margin-bottom: 0.25rem;
}

.nginx-diag-fix-guide code {
  font-size: 0.72rem;
}

.assoc-body-size-group {
  margin-top: 0.5rem;
}

.env-edit-modal-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-right: 1.75rem;
}

.env-edit-modal-header-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.env-edit-modal-header-main h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  word-break: break-word;
}

.env-edit-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font-size: 0.625rem;
  color: var(--green);
  font-weight: 600;
}

.env-edit-modal-meta {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.managed-app-card {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.managed-app-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.managed-app-identity {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.managed-app-name {
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.managed-app-path {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  word-break: break-all;
}

.managed-app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.managed-app-actions .btn {
  flex: 1 1 calc(50% - 0.25rem);
  min-height: var(--touch-min);
  font-size: 0.75rem;
  justify-content: center;
}

.managed-app-created {
  flex: 1 1 100%;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.managed-app-env-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.managed-app-env-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  max-width: 100%;
  word-break: break-all;
}

.managed-app-env-badge button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  font-size: 0.875rem;
  line-height: 1;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  margin: -0.5rem -0.35rem -0.5rem 0;
}

.env-editor-row-actions {
  display: contents;
}

.env-editor-row-btn {
  min-height: var(--touch-min);
}

.env-editor-add-btn {
  width: 100%;
  min-height: var(--touch-min);
}

.env-edit-modal-actions {
  flex-direction: column-reverse;
}

.env-edit-modal-actions .btn {
  width: 100%;
  min-height: var(--touch-min);
  justify-content: center;
}

.env-edit-modal-dialog {
  border-radius: 12px 12px 0 0;
  padding: 1rem;
  width: 100%;
  max-width: 100%;
  max-height: 96vh;
  overflow-y: auto;
}

.env-edit-modal-dialog.env-edit-modal-expanded {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
}

.app-dir-modal-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.app-dir-modal-header .btn {
  width: 100%;
  min-height: var(--touch-min);
}

.app-dir-content {
  max-height: 55vh;
}

.app-dir-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .sp-modal-overlay {
    align-items: center;
    padding: 1rem;
  }

  .sp-modal-dialog {
    border-radius: 12px;
    padding: 1.5rem;
    width: 95%;
    max-height: 92vh;
  }

  .sp-modal-dialog--md {
    max-width: 560px;
  }

  .app-dir-modal-dialog {
    max-width: 760px;
  }

  .sp-modal-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .sp-modal-actions .btn {
    width: auto;
    min-height: auto;
  }

  .env-edit-modal-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .env-edit-modal-header-main h3 {
    font-size: 1.125rem;
  }

  .env-edit-modal-badge {
    font-size: 0.6875rem;
  }

  .managed-app-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .managed-app-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .managed-app-actions .btn {
    flex: 0 0 auto;
    min-height: auto;
  }

  .managed-app-created {
    flex: 0 0 auto;
  }

  .env-editor-row {
    grid-template-columns: var(--env-editor-key-col) minmax(0, 1fr) repeat(4, auto);
  }

  .env-editor-row-actions {
    display: contents;
  }

  .env-editor-row-btn {
    min-height: auto;
  }

  .env-editor-add-btn {
    width: auto;
    min-height: auto;
  }

  .env-edit-modal-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .env-edit-modal-actions .btn {
    width: auto;
    min-height: auto;
  }

  .env-edit-modal-dialog {
    border-radius: 12px;
    padding: 2rem;
    width: 95%;
    max-width: 640px;
  }

  .env-edit-modal-dialog.env-edit-modal-expanded {
    width: 98vw;
    height: 96vh;
    max-height: 96vh;
    border-radius: 12px;
  }

  .app-dir-modal-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .app-dir-modal-header .btn {
    width: auto;
    min-height: auto;
  }

  .app-dir-content {
    max-height: 420px;
  }
}

@media (max-width: 639px) {
  .card-header .toolbar {
    width: 100%;
  }

  .card-header .toolbar .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-height: var(--touch-min);
  }

  .env-editor-list-wrap {
    --env-editor-key-col: 100%;
  }

  .env-editor-col-resizer {
    display: none;
  }

  .env-editor-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
  }

  .env-editor-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .env-editor-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .env-editor-row-actions .env-editor-row-btn {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .env-edit-modal-badge span:last-child {
    display: none;
  }

  .app-dir-table th:nth-child(3),
  .app-dir-table th:nth-child(4),
  .app-dir-table td:nth-child(3),
  .app-dir-table td:nth-child(4) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .env-editor-col-resizer,
  .env-edit-modal-close,
  .managed-app-env-badge {
    transition: none;
  }
}

/* ── Progress / Log Modal ── */
.progress-modal {
  max-width: 620px;
}

.progress-modal h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.progress-modal .progress-domain {
  color: var(--accent);
  font-weight: 400;
  font-size: 0.9rem;
}

.progress-log {
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  background: var(--bg-primary);
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.75rem;
  line-height: 1.7;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 0.5rem;
}

.progress-log .log-error {
  color: var(--red);
}

.progress-log .log-warning {
  color: #ffa500;
}

.progress-log .log-step {
  color: var(--accent);
  font-weight: 700;
}

.progress-log .log-success {
  color: var(--green);
  font-weight: 700;
}

.progress-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-status {
  display: flex;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}

.progress-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ── Settings Steps ── */
.settings-step {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.settings-step-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.375rem;
}

.settings-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.settings-step-num.done {
  background: var(--green);
}

.settings-step-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.settings-step-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}

.settings-step-status.configured {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}

.settings-step-status.pending {
  background: rgba(139, 148, 158, 0.15);
  color: var(--text-secondary);
}

.settings-step-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
}

.settings-step.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Refresh Bar ── */
.refresh-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}

.refresh-bar-ts {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ── Resources Tab ── */
.res-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.res-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.res-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.res-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.res-card-sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.res-charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.res-chart-card {
  min-height: 340px;
}

.res-chart-body {
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pie-svg, .bar-svg {
  width: 100%;
  max-height: 280px;
}

.res-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.res-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ── Container Labels ── */
.label-selector {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 100%;
}

.label-btn {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.15s;
}

.label-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.label-btn.active-api {
  background: rgba(0, 180, 216, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

.label-btn.active-nestjs {
  background: rgba(63, 185, 80, 0.2);
  border-color: var(--green);
  color: var(--green);
}

.label-btn.active-back {
  background: rgba(139, 148, 158, 0.2);
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.label-btn.active-nextjs {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
  color: #fff;
}

.label-btn.active-frontend {
  background: rgba(255, 165, 0, 0.2);
  border-color: #ffa500;
  color: #ffa500;
}

.label-btn.active-gd-app {
  background: rgba(138, 43, 226, 0.2);
  border-color: #8a2be2;
  color: #8a2be2;
}

.label-btn.active-minio {
  background: rgba(239, 83, 80, 0.2);
  border-color: #ef5350;
  color: #ef5350;
}

.label-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.label-badge-api {
  background: rgba(0, 180, 216, 0.15);
  color: var(--accent);
}

.label-badge-nestjs {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}

.label-badge-back {
  background: rgba(139, 148, 158, 0.15);
  color: var(--text-secondary);
}

.label-badge-nextjs {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.label-badge-frontend {
  background: rgba(255, 165, 0, 0.1);
  color: #ffa500;
}

.label-badge-gd-app {
  background: rgba(138, 43, 226, 0.1);
  color: #8a2be2;
}

.label-badge-minio {
  background: rgba(239, 83, 80, 0.1);
  color: #ef5350;
}

.container-sites-panel {
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid var(--border);
}
.container-sites-panel h4 { margin: 0 0 8px; font-size: 0.85rem; }
.container-site-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.container-site-row a { color: var(--accent); text-decoration: none; }
.container-site-row a:hover { text-decoration: underline; }
.container-expand-btn { min-width: 2rem; padding: 0.1rem 0.35rem; }
.port-resolve-banner { font-size: 0.75rem; color: #d29922; margin-bottom: 8px; line-height: 1.4; }

/* ── Background process center ─────────────────────────────────────────────── */
.jobs-indicator-wrap { position: relative; display: inline-flex; }

.jobs-indicator-btn { display: inline-flex; align-items: center; gap: 0.4rem; }

.jobs-indicator-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); flex: 0 0 auto;
}
.jobs-indicator-btn.has-running .jobs-indicator-dot {
  background: var(--accent);
  animation: jobs-pulse 1.4s ease-in-out infinite;
}
@keyframes jobs-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.jobs-indicator-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.1rem; height: 1.1rem; padding: 0 0.3rem;
  font-size: 0.7rem; font-weight: 600; line-height: 1;
  color: #fff; background: var(--accent); border-radius: 999px;
}

.jobs-panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: 360px; max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 200;
  overflow: hidden;
}
.jobs-panel.open { display: block; }

.jobs-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0.9rem;
  font-weight: 600; font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.jobs-panel-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 0.2rem;
}
.jobs-panel-close:hover { color: var(--text-primary); }

.jobs-panel-list { max-height: 60vh; overflow-y: auto; }

.jobs-panel-note {
  padding: 0.55rem 0.9rem;
  font-size: 0.7rem; line-height: 1.4;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.jobs-empty { padding: 1rem 0.9rem; color: var(--text-muted); font-size: 0.8rem; }

.jobs-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.jobs-item:last-child { border-bottom: none; }
.jobs-item-main { display: flex; align-items: flex-start; gap: 0.55rem; min-width: 0; }
.jobs-item-icon { flex: 0 0 auto; font-size: 0.75rem; margin-top: 0.15rem; }
.jobs-item.job-running .jobs-item-icon { color: var(--accent); }
.jobs-item.job-done .jobs-item-icon { color: var(--green, #2ea043); }
.jobs-item.job-failed .jobs-item-icon { color: var(--red, #f85149); }
.jobs-item-text { min-width: 0; }
.jobs-item-title { font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs-item-sub { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs-item-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }
.jobs-item-actions { display: flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; }
.jobs-bg-hint { font-size: 0.65rem; color: var(--text-muted); font-style: italic; }

.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.72rem; min-height: auto; }

