.bot-connection-hero {
  align-items: center;
}

.bot-preview-notice {
  margin-bottom: 0;
}

.bot-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.bot-overview-card {
  display: grid;
  gap: 8px;
  min-height: 146px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.bot-overview-card > span,
.bot-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bot-overview-card strong {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #111827;
  font-size: 17px;
}

.bot-overview-card small {
  color: var(--muted);
  line-height: 1.45;
}

.bot-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.12);
}

.bot-status-dot.online { background: #22c55e; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12); }
.bot-status-dot.unstable { background: #f59e0b; box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.12); }
.bot-status-dot.waiting { background: #0ea5e9; box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.12); }
.bot-status-dot.critical { background: #ef4444; box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12); }
.bot-status-dot.offline { background: #64748b; box-shadow: 0 0 0 5px rgba(100, 116, 139, 0.12); }

.connection-status.unstable {
  color: #92400e;
  background: #fff7ed;
  border-color: #fed7aa;
}

.connection-status.critical {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.bot-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.bot-alert > div:first-child {
  display: grid;
  gap: 5px;
}

.bot-alert strong {
  color: #111827;
}

.bot-alert p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.bot-alert-warning { background: #fffaf0; border-color: #fde3a7; }
.bot-alert-info { justify-content: flex-start; background: #f0f9ff; border-color: #bae6fd; }
.bot-alert-critical { background: #fff5f5; border-color: #fecaca; }
.bot-alert-neutral { background: #f8fafc; }

.bot-alert-actions {
  display: flex !important;
  grid-auto-flow: column;
  gap: 10px !important;
}

.bot-loading-ring {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 3px solid #bae6fd;
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: bot-spin 0.8s linear infinite;
}

@keyframes bot-spin {
  to { transform: rotate(360deg); }
}

.bot-connection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.bot-connection-main,
.bot-actions-card,
.bot-events-card,
.bot-support-card {
  padding: 22px;
}

.bot-section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.bot-section-header.compact {
  margin-bottom: 14px;
}

.bot-section-header h3,
.bot-method-copy h3,
.bot-actions-card h3,
.bot-support-card h3 {
  margin: 5px 0 6px;
  color: #111827;
}

.bot-section-header p,
.bot-method-copy p,
.bot-support-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.bot-method-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: #f3f4f6;
}

.bot-method-tabs button {
  border: 0;
  border-radius: 9px;
  padding: 9px 13px;
  background: transparent;
  color: #6b7280;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.bot-method-tabs button.active {
  color: #111827;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.bot-method-content {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.bot-method-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.bot-method-copy {
  display: grid;
  align-content: start;
  gap: 12px;
}

.bot-method-copy ol {
  margin: 0;
  padding-left: 20px;
  color: #374151;
  line-height: 1.8;
}

.bot-attempt-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #374151;
  font-size: 13px;
}

.bot-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.bot-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #0ea5e9);
  transition: width 0.3s linear;
}

.bot-qr-shell,
.bot-code-shell {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 330px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fafafa, #fff);
  text-align: center;
}

.bot-qr-grid {
  display: grid;
  grid-template-columns: repeat(25, 7px);
  grid-template-rows: repeat(25, 7px);
  gap: 1px;
  padding: 14px;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

.bot-qr-grid span {
  width: 7px;
  height: 7px;
  background: transparent;
}

.bot-qr-grid span.is-dark {
  background: #111827;
}

.bot-qr-shell small,
.bot-code-shell small {
  max-width: 28ch;
  color: var(--muted);
  line-height: 1.45;
}

.bot-empty-method {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 330px;
  padding: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  background: #fafafa;
  text-align: center;
}

.bot-empty-method p {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.bot-method-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #6d28d9;
  background: #f3e8ff;
  font-size: 24px;
}

.bot-phone-field {
  display: grid;
  gap: 7px;
  margin-top: 2px;
}

.bot-phone-field span {
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.bot-phone-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.bot-phone-field input:focus {
  outline: 3px solid rgba(14, 165, 233, 0.12);
  border-color: #0ea5e9;
}

.bot-code-shell strong {
  color: #111827;
  font-size: 30px;
  letter-spacing: 0.12em;
}

.bot-code-shell.has-code {
  background: linear-gradient(180deg, #f5f3ff, #fff);
  border-color: #ddd6fe;
}

.bot-connection-side {
  display: grid;
  gap: 18px;
}

.bot-actions-card {
  display: grid;
  gap: 10px;
}

.bot-action-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.bot-action-row:hover {
  transform: translateY(-1px);
  border-color: #c4b5fd;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.bot-action-row.danger:hover {
  border-color: #fca5a5;
}

.bot-action-row > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.bot-action-row small {
  color: var(--muted);
  line-height: 1.35;
}

.bot-action-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #6d28d9;
  background: #f5f3ff;
  font-size: 19px;
}

.bot-action-row.danger .bot-action-icon {
  color: #dc2626;
  background: #fef2f2;
}

.bot-events-card ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bot-events-card li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.bot-events-card li:first-child {
  border-top: 0;
}

.bot-events-card li > i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #94a3b8;
}

.bot-events-card li > i.success { background: #22c55e; }

.bot-events-card li > div {
  display: grid;
  gap: 2px;
}

.bot-events-card li span,
.bot-events-card li small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.bot-support-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, #fff, #faf8ff);
}

.bot-support-card.requested {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4, #fff);
}

.bot-support-card > div {
  max-width: 760px;
}

.bot-scenario-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 15px;
  color: var(--muted);
  font-size: 12px;
}

.bot-scenario-preview > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.bot-scenario-preview button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bot-scenario-preview button.active {
  color: #fff;
  border-color: #6d28d9;
  background: #6d28d9;
}

.bot-modal[hidden] {
  display: none;
}

.bot-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
}

.bot-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.bot-modal > section {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 13px;
  width: min(440px, 100%);
  padding: 26px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
  text-align: center;
}

.bot-modal > section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.bot-modal > section > div {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
}

.bot-modal-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 15px;
  color: #b91c1c;
  background: #fef2f2;
  font-size: 22px;
  font-weight: 900;
}

.button.danger {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

@media (max-width: 1180px) {
  .bot-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bot-connection-layout {
    grid-template-columns: 1fr;
  }

  .bot-connection-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .bot-overview-grid,
  .bot-connection-side,
  .bot-method-layout {
    grid-template-columns: 1fr;
  }

  .bot-section-header,
  .bot-support-card,
  .bot-alert,
  .bot-scenario-preview {
    align-items: stretch;
    flex-direction: column;
  }

  .bot-method-tabs {
    width: 100%;
  }

  .bot-method-tabs button {
    flex: 1;
  }

  .bot-qr-grid {
    grid-template-columns: repeat(25, 6px);
    grid-template-rows: repeat(25, 6px);
  }

  .bot-qr-grid span {
    width: 6px;
    height: 6px;
  }

  .bot-alert-actions,
  .bot-modal > section > div {
    flex-direction: column;
  }
}

/* Integração real: preserva a moldura original e troca apenas o conteúdo demonstrativo pelo QR do WPPConnect. */
.bot-qr-image {
  display: block;
  width: min(100%, 270px);
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  margin: 0 auto 14px;
}
.bot-action-row:disabled,
.bot-method-copy .button:disabled,
.bot-method-tabs button:disabled { opacity: .5; cursor: not-allowed; }
.bot-real-notice span { white-space: nowrap; }
