:root {
  --bg-body: #0d0f17;
  --bg-sidebar: #131622;
  --bg-card: #171b29;
  --bg-card-hover: #1c2132;
  --bg-input: #0e111a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.2);
  --yellow: #f59e0b;
  --red: #ef4444;
  --border: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(59, 130, 246, 0.6);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --font: "Plus Jakarta Sans", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* ── Hosteg Layout (Sidebar + Main) ─────────────────────────────── */
.hosteg-layout {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  height: 100vh;
  max-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.sidebar-header {
  flex-shrink: 0;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}
.brand strong {
  color: #60a5fa;
}
.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.sidebar-section-title {
  flex-shrink: 0;
  padding: 1.25rem 1.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.75rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.menu-item {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
}
.menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}
.menu-item.active {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border-left: 3px solid #3b82f6;
}
.menu-label {
  flex: 1;
}
.menu-badge {
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.menu-badge.green {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green);
}
.menu-pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.menu-pill.green {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green);
}
.menu-pill.yellow {
  background: rgba(245, 158, 11, 0.2);
  color: var(--yellow);
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1.25rem 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg-sidebar);
}
.server-status-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.server-ip-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: monospace;
  font-size: 0.8rem;
  color: #60a5fa;
}
.server-ip-box:hover code {
  text-decoration: underline;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.user-name {
  flex: 1;
  color: var(--text-main);
  font-weight: 600;
}
.btn-logout {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
}
.btn-logout:hover {
  color: var(--red);
}

/* Main Viewport */
.main-viewport {
  flex: 1;
  height: 100vh;
  max-height: 100vh;
  padding: 2rem 2.5rem 4rem;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Scrollbars customizados */
.main-viewport::-webkit-scrollbar,
.sidebar-menu::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 8px;
}
.main-viewport::-webkit-scrollbar-track,
.sidebar-menu::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: rgba(13, 15, 23, 0.4);
}
.main-viewport::-webkit-scrollbar-thumb,
.sidebar-menu::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}
.main-viewport::-webkit-scrollbar-thumb:hover,
.sidebar-menu::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Notice Banner */
.notice-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.notice-icon {
  font-size: 1.75rem;
}
.notice-body {
  flex: 1;
  min-width: 260px;
}
.notice-body h4 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
.notice-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Page Title Row */
.page-title-row {
  margin-bottom: 1.5rem;
}
.page-title-row h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 750px;
  line-height: 1.5;
}

/* Filter Bar (Igual Hosteg) */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.search-input-box {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 1rem;
  font-size: 0.95rem;
  pointer-events: none;
}
.search-input-box input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.search-input-box input:focus {
  border-color: var(--border-focus);
}

.category-select-box select {
  padding: 0.8rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 0.92rem;
  outline: none;
  cursor: pointer;
}

/* Apps Grid (Cards estilo Hosteg) */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.hosteg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.hosteg-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.hosteg-card.installed {
  border-color: rgba(16, 185, 129, 0.35);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.app-avatar {
  font-size: 1.85rem;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 8px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.hosteg-card:hover .app-avatar {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(255, 255, 255, 0.07);
  transform: scale(1.05);
}
.app-avatar .app-icon-img,
.app-avatar img,
.app-avatar svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.app-identity {
  flex: 1;
}
.app-identity h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.app-tag-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}
.ram-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border-radius: 999px;
  white-space: nowrap;
}

.app-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.app-meta-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  margin-bottom: 1.25rem;
}
.meta-label {
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 0.35rem;
}
.meta-val {
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.instance-status-tag {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 0.2rem;
}

.btn-group-hosteg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* Botões Estilo Hosteg */
.btn-hosteg-primary {
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-hosteg-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-hosteg-primary.full {
  width: 100%;
}

.btn-hosteg-outline {
  background: transparent;
  color: var(--text-main);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background 0.12s ease;
}
.btn-hosteg-outline:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-hosteg-sm {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-hosteg-sm:hover {
  filter: brightness(1.15);
}

/* ── Tabela de Instâncias ────────────────────────────────────────── */
.instances-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hosteg-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}
.hosteg-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.hosteg-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.hosteg-table tr:last-child td {
  border-bottom: 0;
}
.domain-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}
.domain-link:hover {
  text-decoration: underline;
}
.inst-num-chip {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
}
.inst-avatar-mini {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
}
.inst-avatar-mini .app-icon-img,
.inst-avatar-mini img,
.inst-avatar-mini svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.chip-svg-inline {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: -2px;
  margin-right: 5px;
  display: inline-block;
}
.menu-svg-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.85;
  vertical-align: middle;
  transition: opacity var(--transition-fast);
}
.menu-item.active .menu-svg-icon {
  opacity: 1;
}
.btn-table-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.4rem;
}
.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.06);
}
.btn-table-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
}
.btn-table-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

/* ── Base Tab & Cloudflare Tab ───────────────────────────────────── */
.base-overview-card, .cf-settings-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 800px;
}
.base-status-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.base-status-banner.ready {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.base-status-banner.ready .base-status-icon {
  color: var(--green);
  font-size: 1.75rem;
}
.base-status-banner.pending {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.base-status-banner.pending .base-status-icon {
  color: var(--yellow);
  font-size: 1.75rem;
}
.base-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.detail-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.detail-item .label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.cf-status-strip {
  margin-bottom: 1.5rem;
}
.cf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.cf-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ── Modais ─────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalIn 0.18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.modal-head h3 .app-icon-img,
.modal-head h3 img,
.modal-head h3 svg {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
}
.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal-intro {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.dns-guideline-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}
.guideline-row {
  display: flex;
  gap: 0.75rem;
  font-family: monospace;
  font-size: 0.82rem;
  color: #93c5fd;
  flex-wrap: wrap;
}

.instruction-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.cf-auto-box {
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}
.cf-auto-box label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.cf-auto-box input {
  width: auto;
}

.creds-terminal {
  background: #090a10;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  max-height: 280px;
  overflow: auto;
}
.creds-terminal pre {
  font-family: monospace;
  font-size: 0.85rem;
  color: #7dd3fc;
  white-space: pre-wrap;
  word-break: break-all;
}

.form-group {
  margin-bottom: 1.15rem;
  text-align: left;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
}
.form-group input:focus {
  border-color: var(--border-focus);
}
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

/* ── Auth Wrapper ────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
}
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.auth-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.auth-header h1 strong {
  color: #60a5fa;
}
.auth-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.auth-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Status Dot & Utilities ─────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.empty-state p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Toasts ──────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 420px;
}
.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  background: #181b24;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.toast-item.ok {
  border-color: rgba(16, 185, 129, 0.5);
  background: #0f231d;
}
.toast-item.err {
  border-color: rgba(239, 68, 68, 0.5);
  background: #251214;
}

/* ── Live Progress Stepper Modal ────────────────────────────────── */
.progress-modal {
  max-width: 540px;
  width: 100%;
  padding: 2.2rem;
}
.progress-head {
  text-align: center;
  margin-bottom: 1.5rem;
}
.progress-pulsing-icon {
  font-size: 2.2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.85rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.progress-pulsing-icon.pulsing {
  animation: pulseGlow 1.8s infinite;
}
.progress-pulsing-icon.done {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}
.progress-pulsing-icon.error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}
@keyframes pulseGlow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(59, 130, 246, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
.progress-head h3 {
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
}
.progress-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.progress-bar-track {
  background: rgba(255, 255, 255, 0.08);
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.5s ease;
  border-radius: 999px;
}
.progress-bar-fill.done {
  background: linear-gradient(90deg, #10b981, #34d399);
}
.progress-pct-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1.4rem;
}

.progress-stepper {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}
.stepper-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  opacity: 0.35;
  transition: all 0.3s;
}
.stepper-item.active {
  opacity: 1;
}
.stepper-item.done {
  opacity: 0.9;
}
.stepper-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}
.stepper-item.active .stepper-dot {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}
.stepper-item.done .stepper-dot {
  background: #10b981;
  color: #fff;
}
.spin-dot {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.stepper-content {
  flex: 1;
}
.stepper-title {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
}
.stepper-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.progress-success-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.2rem;
}
.progress-success-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.success-row {
  font-size: 0.86rem;
  color: #6ee7b7;
  font-weight: 500;
}

.result-url-card {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.result-url-card span {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.result-url-card a {
  font-size: 1rem;
  font-weight: 700;
  color: #60a5fa;
  text-decoration: none;
}
.result-url-card a:hover {
  text-decoration: underline;
}

.result-creds-box {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}
.creds-box-head {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.result-creds-box pre {
  font-family: monospace;
  font-size: 0.8rem;
  color: #a5f3fc;
  margin: 0;
  white-space: pre-wrap;
}

.progress-live-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.progress-error-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.2rem;
}
.err-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  font-size: 0.86rem;
  color: #fca5a5;
  line-height: 1.4;
}

/* ── Form inputs & selects ───────────────────────────────────────── */
.form-group select, .form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}
.form-group select option {
  background: #111827;
  color: #f3f4f6;
  padding: 8px 12px;
}
.form-group select:focus, .form-select:focus {
  border-color: var(--border-focus);
}

/* ── PostgreSQL Selector & Dependency Notice ────────────────────── */
.db-select-card {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}
.db-select-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.db-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.db-status-pill.online {
  font-size: 0.72rem;
  font-weight: 600;
  color: #34d399;
}
.db-select-card h4 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.25rem;
}
.db-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.9rem;
}

.db-notice-card {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}
.db-notice-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.db-warn-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.db-notice-head h4 {
  font-size: 1rem;
  color: #fbbf24;
  margin-bottom: 0.2rem;
}
.db-notice-head p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* ── Custom In-App Dialog Modal (No browser confirm/alert) ──────── */
.modal-dialog {
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 2.2rem 2rem;
}
.dialog-icon-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.2rem;
}
.dialog-icon-badge.danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.dialog-icon-badge.warn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #fff;
}
.dialog-message {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.8rem;
}
.dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.dialog-actions button {
  flex: 1;
  padding: 0.75rem 1rem;
}
.btn-hosteg-danger {
  background: #dc2626;
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-hosteg-danger:hover {
  background: #b91c1c;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.4);
}

/* ── Painel Técnico & Portainer (Acesso Direto sem SFTP) ────────── */
.portainer-tech-card {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
}
.portainer-tech-header {
  margin-bottom: 1.5rem;
}
.portainer-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.tech-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.portainer-tag-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.portainer-tech-header h3 {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
  color: #fff;
}
.portainer-tech-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 800px;
}
.portainer-creds-container {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}
.portainer-cred-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cred-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 170px;
}
.cred-value-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.cred-value-row code {
  font-family: monospace;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  color: #a5f3fc;
}
.portainer-url-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: #60a5fa;
  text-decoration: none;
}
.portainer-url-link:hover {
  text-decoration: underline;
}
.btn-copy-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-copy-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.portainer-footer-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* SetupOrion Discreet Credits & Badges */
.sidebar-orion-credit {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.sidebar-orion-credit strong {
  color: #93c5fd;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.orion-credits-card {
  margin-top: 1.5rem;
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
}
.orion-credits-head {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.orion-credits-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.orion-credits-head h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}
.orion-credits-head p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.tags-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}
.app-tag-pill.orion-tag,
.app-tag-pill.official-tag,
.app-tag-pill {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.28);
}
.orion-mini-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
}
.modal-orion-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-left: 0.6rem;
}
.app-avatar-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  width: 26px;
  height: 26px;
}
.app-avatar-mini img,
.app-avatar-mini svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.inst-avatar-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
}
.inst-avatar-mini img,
.inst-avatar-mini svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 900px) {
  html, body, #app {
    height: auto;
    max-height: none;
    overflow: auto;
  }
  .hosteg-layout {
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
    width: 100%;
  }
  .sidebar {
    width: 100%;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .main-viewport {
    padding: 1.5rem;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .apps-grid { grid-template-columns: 1fr; }
  .base-details-grid { grid-template-columns: 1fr; }
  .portainer-cred-box { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}

/* ── MCP & AI Agent Studio Styles ───────────────────────────────── */
.mcp-overview-card,
.mcp-config-card,
.mcp-test-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.mcp-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.mcp-status-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: mcp-pulse 2s infinite;
  margin-top: 4px;
  flex-shrink: 0;
}

@keyframes mcp-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.mcp-title-badge {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #34d399;
}

.mcp-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}
.mcp-pill.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.mcp-pill.blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.mcp-pill.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.mcp-status-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.mcp-key-section {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.mcp-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mcp-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.mcp-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.mcp-input-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.mcp-input-code {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  outline: none;
}
.mcp-input-code:focus {
  border-color: var(--border-focus);
}

.btn-toggle-eye,
.btn-copy-mini,
.btn-regen-mini {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
}
.btn-toggle-eye {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}
.btn-toggle-eye:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-copy-mini {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
.btn-copy-mini:hover {
  background: rgba(59, 130, 246, 0.22);
}
.btn-regen-mini {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}
.btn-regen-mini:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.mcp-config-header h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.mcp-config-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.mcp-tab-pills {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.mcp-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mcp-tab-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
}
.mcp-tab-pill.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.mcp-snippet-container {
  background: #090c14;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.snippet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.snippet-lang {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.btn-copy-code {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-copy-code:hover {
  background: rgba(59, 130, 246, 0.28);
}

.mcp-pre {
  margin: 0;
  padding: 1.15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #93c5fd;
  overflow-x: auto;
  white-space: pre;
}

.mcp-tab-instructions {
  padding: 0.9rem 1.15rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.mcp-test-result-box {
  margin-top: 1rem;
  background: #090c14;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.test-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.9rem;
  background: rgba(16, 185, 129, 0.08);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 0.8rem;
  font-weight: 600;
  color: #34d399;
}
.btn-clear-test {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.78rem;
}
.btn-clear-test:hover { color: var(--text-main); }
.mcp-test-pre {
  margin: 0;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #a7f3d0;
  max-height: 280px;
  overflow: auto;
}

.mcp-tools-section {
  margin-top: 2rem;
}

.mcp-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.mcp-tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.mcp-tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
}

.mcp-tool-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}
.tool-icon {
  font-size: 1.25rem;
}
.tool-name {
  font-size: 0.88rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #60a5fa;
  font-weight: 700;
}
.tool-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* ── DevOps & System Monitor Styles ────────────────────────────── */
.devops-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 0 3.5rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.devops-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.devops-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.devops-title-group h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.devops-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.devops-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-devops-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-devops-toggle.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.btn-devops-refresh {
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-devops-refresh:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-devops-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.devops-alert-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 0.88rem;
}

/* 4 Core DevOps Metric Cards */
.devops-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 1200px) {
  .devops-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .devops-grid { grid-template-columns: 1fr; }
}

.devops-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.devops-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6);
}

.devops-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}
.devops-card-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.devops-card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.devops-card-tag.ok {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.devops-card-tag.warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.devops-card-tag.crit {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.devops-big-metric {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.devops-big-metric .value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  font-family: "Space Grotesk", var(--font);
  color: #ffffff;
}
.devops-big-metric .sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* HTOP Styled Progress Bars */
.devops-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.1rem;
}
.devops-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}
.devops-bar-fill.cpu {
  background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 70%, #8b5cf6 100%);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.devops-bar-fill.cpu.high {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}
.devops-bar-fill.disk {
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

/* Segmented HTOP RAM Bar */
.devops-segmented-bar {
  display: flex;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.seg-used {
  background: #8b5cf6;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
  transition: width 0.35s ease;
}
.seg-cached {
  background: #3b82f6;
  transition: width 0.35s ease;
}

.devops-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.85rem;
  margin-top: auto;
}
.devops-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.devops-detail-row strong {
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Process & Container Table Card */
.devops-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.5);
}

.devops-table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.devops-table-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.devops-count-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.devops-search-box {
  width: min(380px, 100%);
  position: relative;
}
.devops-search-input {
  width: 100%;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  outline: none;
}
.devops-search-input:focus {
  border-color: var(--border-focus);
}

/* Cyber HTOP Table */
.devops-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.devops-table-wrap::-webkit-scrollbar {
  height: 6px;
}
.devops-table-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.devops-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.devops-htop-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.devops-htop-table th {
  padding: 0.9rem 1.25rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.devops-htop-table td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  color: var(--text-muted);
}
.devops-htop-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.stack-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}
.stack-tag.traefik {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.35);
  color: #67e8f9;
}
.stack-tag.portainer {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}
.stack-tag.postgres {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.c-name-col {
  display: flex;
  flex-direction: column;
}
.c-clean-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.88rem;
}
.c-raw-name {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.c-metric-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 140px;
}
.c-metric-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-main);
}
.c-mini-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.c-mini-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.c-mini-fill.cpu { background: #38bdf8; }
.c-mini-fill.cpu.high { background: #ef4444; }
.c-mini-fill.mem { background: #a855f7; }
.c-mini-fill.mem.high { background: #f59e0b; }

.c-image-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

/* Sidebar Mini Telemetry Widget */
.sidebar-mini-devops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.sidebar-mini-devops:hover {
  background: rgba(255, 255, 255, 0.03);
}
.mini-devops-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.3rem 0.2rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}
.mini-devops-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mini-devops-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── DevOps Historical Trends & Analytics Card ─────────────────── */
.devops-history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.devops-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.devops-history-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.devops-history-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.devops-history-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.devops-btn-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.devops-btn-pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.devops-btn-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.devops-btn-pill.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.devops-history-legend {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.cpu { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.5); }
.legend-dot.mem { background: #a855f7; box-shadow: 0 0 8px rgba(168, 85, 247, 0.5); }
.legend-dot.disk { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }

.devops-history-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1.15rem 1.5rem 0.5rem;
}

@media (max-width: 900px) {
  .devops-history-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.history-stat-badge {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.history-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.history-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: "Space Grotesk", var(--font);
  color: #fff;
}

.devops-history-svg-wrap {
  width: 100%;
  padding: 1rem 1.5rem 1.5rem;
  box-sizing: border-box;
}

.devops-history-svg {
  width: 100%;
  height: 240px;
  display: block;
}

.chart-point {
  cursor: pointer;
  transition: r 0.15s ease;
}

.chart-point:hover {
  r: 7;
}

/* ── Custom Panel Domain & SSL Styles ──────────────────────────── */
.panel-domain-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.5);
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-domain-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-domain-badge.active {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.panel-domain-badge.unconfigured {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.panel-domain-active-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-domain-url-link {
  font-size: 1.15rem;
  font-weight: 800;
  color: #34d399;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.panel-domain-url-link:hover {
  text-decoration: underline;
}

.panel-domain-form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.panel-domain-input {
  flex: 1;
  min-width: 260px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #fff;
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.panel-domain-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.panel-domain-help {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}



