/* =========================
   RESET & BASE
   ========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  color: #333;
  background-color: #fafafa;
}

.hidden {
  display: none !important;
}


/* =========================
   LINKS & CONTAINER
   ========================= */

a {
  color: #0056b3;
  text-decoration: none;
  transition: 0.3s ease;
}

a:hover {
  color: #003d80;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* =========================
   HEADER (GLOBAL)
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #0e0e0e;
  border-bottom: 1px solid #1f1f1f;
  padding: 18px 0;
}

.site-header.scrolled {
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Branding */

.brand {
  font-family: 'Orbitron', 'Inter', sans-serif;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-nat {
  color: #e53935;
  font-weight: 700;
  font-size: 1.6rem;
}

.brand-commerce {
  color: #ffffff;
  font-weight: 600;
  font-size: 1.6rem;
}

.brand-sub {
  margin-left: 10px;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #b0b0b0;
}
.brand-sep {
  color: #e53935; /* mesma cor do .brand-nat */
}

/* Header actions */

.header-link {
  color: #ffffff;
  font-size: 0.95rem;
  padding: 8px 14px;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  transition: all 0.25s ease;
}

.header-link:hover {
  background: #e53935;
  border-color: #e53935;
}

/* =========================
   HERO (INDEX)
   ========================= */

.hero {
  padding: 60px 0;
  text-align: center;
  background-color: #e9f2fc;
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 15px;
}

.hero p {
  font-size: 1.1rem;
  color: #555;
}

/* =========================
   BUTTONS
   ========================= */

.btn-primary {
  padding: 12px 25px;
  background-color: #e53935;
  color: #fff;
  border-radius: 4px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #c62828;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid #d0d7de;
  color: #24292f;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
}

.full {
  width: 100%;
}

/* =========================
   MODALS & AUTH
   ========================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#appModal {
  z-index: 2000;
}

#verificationModal {
  z-index: 1500;
}

#feedbackModal {
  z-index: 2500;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
}

.password-strength {
  font-size: 0.85rem;
  font-weight: 600;
  margin: -2px 0 6px;
}

.password-strength.weak {
  color: #c62828;
}

.password-strength.ok {
  color: #f57c00;
}

.password-strength.good {
  color: #2e7d32;
}

.password-feedback {
  font-size: 0.8rem;
  color: #6b7280;
  margin: -2px 0 8px;
}

.modal-content textarea {
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
}

.error {
  display: block;
  margin: -4px 0 8px;
  font-size: 0.8rem;
  color: #c62828;
}

.profile-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  font-size: 0.88rem;
  color: #444;
}

.profile-check-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.close {
  float: right;
  font-size: 22px;
  cursor: pointer;
}

/* =========================
   APP MODAL
   ========================= */

.app-modal h3 {
  margin-bottom: 8px;
  color: #111;
}

.app-modal p {
  margin-bottom: 18px;
  color: #555;
}

.app-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.app-modal.info h3 {
  color: #1565c0;
}

.app-modal.success h3 {
  color: #2e7d32;
}

.app-modal.error h3 {
  color: #c62828;
}

/* =========================
   WHATSAPP SETUP MODALS
   ========================= */

.token-box {
  background: #f6f8fa;
  border: 1px solid #e5e7eb;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 6px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: #555;
}

.icon-btn:hover {
  border-color: #bfc6cf;
}

.phone-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.phone-row select,
.phone-row input {
  padding: 10px;
  height: 42px;
  line-height: 42px;
}

.qr-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  min-height: 240px;
}

.qr-wrapper img {
  width: 240px;
  height: 240px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.field-with-counter {
  position: relative;
  margin-bottom: 10px;
}

.field-with-counter input {
  padding-right: 58px;
}

.char-counter {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 0.78rem;
  color: #8a8f98;
  pointer-events: none;
}

.wa-success {
  animation: waPulse 0.6s ease-in-out;
}

@keyframes waPulse {
  0% { transform: scale(0.98); }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* =========================
   UPGRADE MODAL
   ========================= */

.upgrade-modal {
  max-width: 760px;
}

.upgrade-modal p {
  margin-bottom: 16px;
  color: #555;
}

.plans-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.plans-carousel .plan-card {
  min-width: 0;
}

/* Auth */

.auth-actions,
.oauth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  font-size: 13px;
  color: #6e7781;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #d0d7de;
}

.divider span {
  padding: 0 10px;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  border-radius: 6px;
  border: 1px solid #d0d7de;
  background: #fff;
  cursor: pointer;
}

.btn-oauth.apple {
  background: #000;
  color: #fff;
  border-color: #000;
}

.btn-oauth.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================
   DASHBOARD HEADER
   ========================= */

.dashboard-body {
  background: #fafafa;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.welcome-text {
  color: #d0d0d0;
  font-size: 0.9rem;
}

.welcome-text strong {
  color: #ffffff;
}

.btn-logout {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-logout:hover {
  background: #e53935;
  border-color: #e53935;
}

/* =========================
   DASHBOARD CONTENT
   ========================= */

.dashboard-main {
  min-height: calc(100vh - 120px);
}

.api-tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 25px 0;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.api-tab {
  padding: 10px 22px;
  border-radius: 20px;
  border: 1px solid #d0d0d0;
  background: #fff;
  cursor: pointer;
}

.api-tab.active {
  background: #e53935;
  color: #fff;
  border-color: #e53935;
}

.api-tab.disabled {
  opacity: .5;
  cursor: not-allowed;
}

.dashboard-content {
  padding-top: 40px;
}
.dashboard-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.menu-toggle {
  width: 38px;
  height: 34px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  background: #fff;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.side-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
  z-index: 10;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #333;
}
.side-menu-item {
  border: 1px solid #e0e0e0;
  background: #fafafa;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.side-menu-item:hover {
  background: #f0f0f0;
  border-color: #cfcfcf;
}

/* =========================
   LOADING OVERLAY
   ========================= */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
.loading-box {
  background: #fff;
  border-radius: 14px;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px dotted #e53935;
  animation: spin 2s linear infinite;
}
.loading-text {
  font-size: 0.95rem;
  color: #333;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.api-description {
  color: #555;
  margin-bottom: 30px;
}

/* =========================
   PLANS (CARDS)
   ========================= */

.dashboard-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.dashboard-plans .plan-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  padding: 22px;
  border-radius: 14px;
  border-left: 6px solid #e53935;
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
}

.plan-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.plan-desc {
  font-size: 0.95rem;
  color: #666;
}

.plan-meta {
  font-size: 0.85rem;
  color: #444;
}

.plan-price {
  margin-top: auto;
}

.plan-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #e53935;
}

.plan-period {
  font-size: 0.8rem;
  color: #777;
}

.plan-flex {
  font-size: 1.1rem;
  font-weight: 600;
}

.plan-flex-note {
  font-size: 0.75rem;
  color: #888;
}

.plan-action button {
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid #e53935;
  background: transparent;
  color: #e53935;
  cursor: pointer;
}

.plan-action button:hover {
  background: #e53935;
  color: #fff;
}

/* =========================
   INSTANCES (CARDS)
   ========================= */

.dashboard-instances {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 30px;
}
.instance-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 260px;
  gap: 14px;
  background: #fff;
  padding: 22px;
  border-radius: 14px;
  border-left: 6px solid #2196f3; /* azul = serviço ativo */
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
}
.instance-card.active {
  border-left-color: #2e7d32;
}
.instance-card.pending_payment {
  border-left-color: #ef6c00;
}
.instance-card.pending_setup {
  border-left-color: #1565c0;
}
.instance-card.suspended {
  border-left-color: #c62828;
}
.instance-card.inactive {
  border-left-color: #9e9e9e;
  color: #9e9e9e;
}
.instance-card.inactive .instance-card-title,
.instance-card.inactive .instance-meta,
.instance-card.inactive .instance-phone,
.instance-card.inactive .instance-status {
  color: #9e9e9e;
}
.instance-header {
  display: flex;
  align-items: center;
  position: relative;
}
.instance-collapse-btn {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #666;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.instance-card.inactive.collapsed {
  flex: 0 0 44px;
  padding: 10px;
  gap: 6px;
}
.instance-card.inactive.collapsed .instance-meta,
.instance-card.inactive.collapsed .instance-phone,
.instance-card.inactive.collapsed .instance-status,
.instance-card.inactive.collapsed .badge,
.instance-card.inactive.collapsed .instance-action {
  display: none;
}
.instance-card.inactive.collapsed .instance-card-title {
  display: none;
}
.instance-menu {
  margin-left: auto;
  position: relative;
}
.instance-menu-toggle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #d0d0d0;
  background: #fff;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}
.instance-menu-toggle span {
  width: 3px;
  height: 3px;
  background: #666;
  border-radius: 50%;
  display: block;
}
.instance-menu-panel {
  position: absolute;
  top: 30px;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  min-width: 170px;
  z-index: 5;
}
.instance-menu-item {
  border: none;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}
.instance-menu-item:hover {
  background: #f5f5f5;
}
.instance-title {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.instance-meta {
  text-align: center;
  font-size: 0.92rem;
  color: #555;
}

.instance-phone {
  text-align: center;
  font-size: 0.85rem;
  color: #777;
}
.instance-phone.with-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.instance-wait-icon {
  color: #1565c0;
  font-size: 1rem;
  line-height: 1;
  cursor: help;
}
.instance-status {
  align-self: center;
  text-align: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Estados */
.instance-dot-emoji {
  font-size: 22px;
  margin-right: 12px;
  line-height: 1;
}

.instance-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 10px;
}
.instance-dot.active {
  background: #00c853; /* 🟢 */
}

.instance-dot.pending_payment {
  background: #ef6c00; /* 🟡 */
}

.instance-dot.pending_setup {
  background: #1565c0; /* 🔵 */
}

.instance-dot.suspended {
  background: #c62828; /* 🔴 */
}
.instance-dot.inactive {
  background: #9e9e9e; /* cinza */
}
.instance-status.active {
  background: #e3f9ec;
  color: #00c853;
}

.instance-status.pending_payment {
  background: #fff3e0;
  color: #ef6c00;
}

.instance-status.pending_setup {
  background: #e3f2fd;
  color: #1565c0;
}

.instance-status.suspended {
  background: #ffebee;
  color: #c62828;
}
.instance-status.inactive {
  background: #f3f3f3;
  color: #757575;
}
.instance-action button {
  margin-top: auto;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid #2196f3;
  background: transparent;
  color: #2196f3;
  cursor: pointer;
}

.instance-action button:hover {
  background: #2196f3;
  color: #fff;
}

.instance-action button.pending_payment {
  border-color: #ef6c00;
  color: #ef6c00;
}
.instance-action button.pending_payment:hover {
  background: #ef6c00;
  color: #fff;
}

.instance-action button.pending_setup {
  border-color: #1565c0;
  color: #1565c0;
}
.instance-action button.pending_setup:hover {
  background: #1565c0;
  color: #fff;
}

.instance-action button.active {
  border-color: #00c853;
  color: #00c853;
}
.instance-action button.active:hover {
  background: #00c853;
  color: #fff;
}

.instance-action button.suspended {
  border-color: #c62828;
  color: #c62828;
}
.instance-action button.suspended:hover {
  background: #c62828;
  color: #fff;
}

.instance-action button.inactive {
  border-color: #9e9e9e;
  color: #9e9e9e;
}
.instance-action button.inactive:hover {
  background: #9e9e9e;
  color: #fff;
}
/* nova instancia */
.instance-card.add-instance {
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 2px dashed #bbb;
  color: #777;
  cursor: pointer;
}

.instance-card.add-instance:hover {
  border-color: #2196f3;
  color: #2196f3;
}

.add-icon {
  font-size: 48px;
  line-height: 1;
}


/* =========================
   FOOTER
   ========================= */

footer,
.dashboard-footer {
  background-color: #222;
  color: #fff;
  padding: 20px 0;
  text-align: center;
  font-size: 0.9rem;
}
/* =========================
   FIX MODAL OAUTH
   ========================= */

/* Garante que o modal fique centralizado corretamente */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Conteúdo do modal */
.modal-content {
  display: block;
}

/* OAuth actions */
.oauth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Botões OAuth */
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 10px;
  padding: 11px 14px;

  border-radius: 6px;
  border: 1px solid #d0d7de;
  background: #fff;

  font-weight: 500;
  font-size: 14px;
  line-height: 1;

  cursor: pointer;
  transition: background 0.2s ease;
}

/* Ícones (Google img e Apple svg) */
.btn-oauth img,
.btn-oauth svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

/* Google */
.btn-oauth.google {
  color: #24292f;
}

.btn-oauth.google:hover {
  background: #f6f8fa;
}

/* Apple */
.btn-oauth.apple {
  background: #000;
  color: #fff;
  border-color: #000;
}

.btn-oauth.apple:hover {
  background: #111;
}

/* Desabilitado */
.btn-oauth.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================
   API CAROUSEL (INDEX)
   ========================= */

.api-carousel {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.carousel-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.6s ease;
}

.carousel-slide {
  min-width: 100%;
  padding: 20px;
}

.carousel-slide h1 {
  margin-bottom: 10px;
  color: #e53935;
}

.carousel-slide h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: #e53935;
}

.carousel-slide p {
  font-size: 1rem;
  color: #555;
  max-width: 700px;
}

.carousel-sub {
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 18px;
  max-width: 720px;
}

.carousel-features {
  list-style: none;
  padding-left: 0;
  margin-bottom: 20px;
}

.carousel-features li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: #555;
  font-size: 0.95rem;
}

.carousel-features li::before {
  content: "●";
  position: absolute;
  left: 0;
  color: #e53935;
  font-size: 0.8rem;
  top: 2px;
}

/* Dots */

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
}

.carousel-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-dots .dot.active {
  background: #e53935;
}

/* Botão do carousel */

.carousel-btn {
  margin-top: 18px;
}

/* ===================
    Interruptor
   =================== */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}

.switch-label {
  font-size: 14px;
  color: #333;
}

.switch {
  position: relative;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background-color: #ccc;
  border-radius: 22px;
  cursor: pointer;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background-color: #0056b3;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* ========================
    INSTANCIAS DAS APIS
   ======================== */
.instances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* CARD BASE */
.instance-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

/* TÍTULO */
.instance-card-title {
  flex: 1;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
}


/* STATUS */
.instance-status {
  margin: 10px 0;
  align-self: center;
  text-align: center;
}

.badge {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 20px;
}

.badge.success {
  background: #e6f4ea;
  color: #137333;
}

.badge.warning {
  background: #fff4e5;
  color: #b26a00;
}

.badge.info {
  background: #e8f0fe;
  color: #1a73e8;
}

.badge.inactive {
  background: #f3f3f3;
  color: #757575;
}

/* ADD CARD */
.add-instance {
  border: 2px dashed #bbb;
  cursor: pointer;
  color: #666;
  justify-content: center;
}

.add-instance:hover {
  border-color: #0056b3;
  color: #0056b3;
}

.add-icon {
  font-size: 36px;
  line-height: 1;
}

.mp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-modal {
  background: #fff;
  width: 420px;
  max-width: 95vw;
  height: 650px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.mp-modal iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.mp-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 10;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

/* =========================
   WA HELP MODAL
   ========================= */
.wa-help-modal {
  width: min(1100px, 70vw);
  height: 70vh;
  max-width: 96vw;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* =========================
   PAYMENTS MODAL
   ========================= */
.payments-modal {
  width: min(1100px, 70vw);
  height: 70vh;
  max-width: 96vw;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.payments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.payments-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #444;
  cursor: pointer;
  padding: 0 2px;
}

.payments-subtitle {
  color: #555;
  margin: 0 0 14px;
}

.payments-grid {
  overflow: auto;
  padding-right: 6px;
  display: grid;
  gap: 16px;
}

.payments-panel {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fafafa;
}

.payments-panel h4 {
  margin: 0 0 10px;
  color: #111;
}

.payments-history {
  background: #fff;
}

.payments-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.payments-history-header select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

.payment-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.payment-status {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.payment-status.active {
  color: #2e7d32;
}

.payment-status.suspended {
  color: #c62828;
}

.payment-list {
  display: grid;
  gap: 10px;
}

.payment-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.payment-item .payment-meta {
  color: #555;
  font-size: 0.88rem;
}

.payment-item .payment-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: #6b7280;
}

.payment-item button {
  padding: 8px 14px;
}

.billing-summary {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.billing-summary .billing-info {
  display: grid;
  gap: 4px;
}

.billing-summary .billing-title {
  font-weight: 600;
  color: #111;
}

.billing-summary .billing-subtitle {
  color: #555;
  font-size: 0.9rem;
}

.billing-summary .billing-status {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.billing-summary .billing-status.active {
  color: #2e7d32;
}

.billing-summary .billing-status.suspended {
  color: #c62828;
}

.billing-summary .billing-status.pending_payment {
  color: #f57c00;
}

.billing-summary .billing-info .btn-primary {
  margin-top: 10px;
}

.billing-summary .billing-status {
  margin-top: 8px;
  text-align: center;
  width: 100%;
}

.wa-help-subtitle {
  color: #555;
  margin: 2px 0 10px;
}

.wa-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.wa-help-header h3 {
  margin: 0;
}

.wa-help-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #444;
  cursor: pointer;
  padding: 0 2px;
}

.wa-help-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.wa-help-inputs input {
  margin-bottom: 0;
}

.wa-help-examples {
  overflow: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-help-example {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
}

.wa-help-example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.wa-help-example-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #222;
}

.wa-help-code {
  margin: 0;
  background: #0e1116;
  color: #d1d5db;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.wa-help-copy-btn svg {
  fill: #444;
}

@media (max-width: 900px) {
  .wa-help-modal {
    width: 95vw;
    height: 88vh;
    padding: 18px;
  }

  .wa-help-inputs {
    grid-template-columns: 1fr;
  }
}
