:root {
  --bg: #0a0b14;
  --sidebar-bg: #0d0e1a;
  --panel: #13152280;
  --panel: #131522;
  --panel-2: #1a1d2e;
  --panel-3: #212438;
  --border: #262a3f;
  --text: #eef0f6;
  --muted: #8b90a8;
  --accent: #8b5cf6;
  --accent-strong: #7c3aed;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --radius: 10px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
}

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .02em;
}
.sidebar-logo .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 13px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: #d6c8ff; }
.nav-item.active svg { opacity: 1; }
.nav-item.disabled { opacity: .4; cursor: default; pointer-events: none; }
.sidebar-footer { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--border); }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.breadcrumb .crumb-link { color: var(--muted); cursor: pointer; }
.breadcrumb .crumb-link:hover { color: var(--text); }
.breadcrumb .crumb-current { color: var(--text); font-weight: 600; }
.breadcrumb .sep { opacity: .5; }

.main-content { padding: 28px; flex: 1; }
.container { max-width: 1100px; margin: 0 auto; }

/* ---------- Login (sem shell) ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { max-width: 380px; width: 100%; text-align: center; }
.login-box .brand-big {
  font-size: 20px; font-weight: 700; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2, .card h3 { margin-top: 0; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.info-box { background: var(--panel-3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }

/* ---------- Faturamento ---------- */
.billing-columns { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
@media (max-width: 920px) { .billing-columns { grid-template-columns: 1fr; } }
.billing-detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.billing-detail-row:last-of-type { border-bottom: none; }
.billing-detail-row .muted { flex-shrink: 0; }
.billing-usage-box { background: var(--panel-3); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.billing-usage-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.billing-usage-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.billing-usage-icon svg { width: 15px; height: 15px; }
.info-box label { margin: 0 0 4px; font-size: 11.5px; }
.info-box .value { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; word-break: break-all; display: flex; align-items: center; gap: 6px; }

.account-access-panel {
  margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel-3); display: flex;
  align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.account-access-panel.is-blocked { border-color: rgba(239, 68, 68, .35); }
.account-access-panel.is-active { border-color: rgba(34, 197, 94, .28); }
.account-access-title { font-size: 13px; font-weight: 700; }
.account-access-error { color: var(--danger); font-size: 12px; margin-top: 8px; }
.account-access-panel .btn svg { vertical-align: -3px; margin-right: 5px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }

.account-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color .15s;
}
.account-card:hover { border-color: var(--accent); }
.account-card h3 { margin: 0 0 6px; font-size: 15px; }
.account-card .badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px; font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--danger-soft); color: var(--danger); }
.badge.pending { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge-running { margin-left: 6px; }
.badge-running::before { display: none; }
.badge-spinner {
  width: 9px; height: 9px;
  border: 2px solid rgba(139, 92, 246, .35);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: delete-instance-spin .7s linear infinite;
}

/* ---------- Instância ---------- */
.instance-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.instance-header { display: flex; align-items: center; gap: 12px; }
.instance-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--panel-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.instance-icon svg { width: 18px; height: 18px; color: var(--muted); }
.instance-icon.connected { background: var(--success-soft); border-color: transparent; }
.instance-icon.connected svg { color: var(--success); }
.instance-title { font-weight: 600; font-size: 14px; }
.instance-sub { font-size: 12px; color: var(--muted); }

.instance-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.add-instance-card {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 30px 16px; cursor: pointer; color: var(--muted);
  min-height: 140px; transition: border-color .15s, color .15s;
}
.add-instance-card:hover { border-color: var(--accent); color: var(--text); }
.add-instance-card .plus {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center; font-size: 19px; line-height: 1;
}

.webhook-section { border-top: 1px solid var(--border); padding-top: 10px; }
.webhook-toggle { font-size: 12px; color: var(--accent); cursor: pointer; background: none; border: none; padding: 0; font-weight: 600; }
.webhook-entry { background: var(--panel-3); border-radius: 6px; padding: 8px 10px; font-size: 12px; margin-top: 8px; word-break: break-all; }

/* ---------- Botões ---------- */
.btn {
  border: none; border-radius: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity .12s, transform .05s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--panel-3); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; }
.btn-success { background: var(--success); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-icon { padding: 6px 9px; }

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

label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; font-weight: 500; }
input, textarea, select {
  width: 100%; background: var(--panel-3); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 10px 12px; font-size: 13.5px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"] { width: auto; }

.muted { color: var(--muted); }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 24px 0 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.back-link:hover { color: var(--text); }

.copy-icon { cursor: pointer; opacity: .6; }
.copy-icon:hover { opacity: 1; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,5,10,.72); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 18px; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 380px; width: 90%; text-align: center; position: relative; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.qr-content { margin: 16px 0; min-height: 220px; display: flex; align-items: center; justify-content: center; }
.qr-content img { width: 220px; height: 220px; background: white; border-radius: 8px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; z-index: 100; max-width: min(360px, calc(100vw - 32px)); box-shadow: 0 18px 50px rgba(0,0,0,.25); animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast.error { border-color: var(--danger); color: #fca5a5; }
.toast.success { border-color: var(--success); color: #86efac; }

/* ---------- Drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(5,5,10,.6); z-index: 60; display: flex; justify-content: flex-end; }
.drawer-overlay.hidden { display: none; }
.drawer {
  width: 420px; max-width: 92vw; height: 100%; background: var(--panel-2);
  border-left: 1px solid var(--border); padding: 24px; overflow-y: auto;
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.drawer-header h3 { margin: 0; }
.drawer-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.readonly-field { background: var(--panel-3); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 13px; color: var(--muted); }
.drawer-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---------- Confirm modal ---------- */
.confirm-modal .modal { max-width: 400px; }
.confirm-modal h3 { margin-bottom: 6px; }
.confirm-modal p { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.confirm-modal .row { justify-content: center; }

/* ---------- Webhook list ---------- */
.webhook-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.webhook-item { background: var(--panel-3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.webhook-item .url { font-size: 12px; word-break: break-all; margin-bottom: 6px; }
.webhook-item .badges { display: flex; gap: 5px; flex-wrap: wrap; }
.badge-event { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: #d6c8ff; font-weight: 600; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.checkbox-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); }
.checkbox-item input { width: auto; }

/* ---------- Tabela ---------- */
.search-row { display: flex; gap: 10px; margin: 20px 0 16px; }
.search-row input { flex: 1; }

.data-table { width: 100%; border-collapse: collapse; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--panel-3); }
.data-table .row-actions { display: flex; gap: 6px; }
.table-empty-state { min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; }
.table-empty-state strong { color: var(--text); font-size: 13px; }
.table-empty-state span { color: var(--muted); font-size: 12px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel-3);
  color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: color .12s, border-color .12s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.icon-btn svg { width: 15px; height: 15px; }

@media (max-width: 760px) {
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .row-between { align-items: flex-start; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}

/* ---------- Central de alertas e novidades ---------- */
.page-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:22px; }
.page-heading h2 { margin:4px 0 5px; }
.eyebrow { color:#8b5cf6; font-size:10px; font-weight:800; letter-spacing:.16em; }
.form-grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.metric-card {
  display:flex; flex-direction:column; gap:8px;
  padding:16px 18px; background:var(--panel-2); border:1px solid var(--border); border-radius:14px;
}
.metric-card span { font-size:11.5px; font-weight:650; color:#838aa1; text-transform:uppercase; letter-spacing:.03em; }
.metric-card strong { font-size:24px; font-weight:750; color:#f3f4f9; letter-spacing:-.03em; }
.alert-metrics { margin-bottom:18px; }
.alert-metrics .metric-card { min-height:110px; }
.metric-card.critical { border-color:rgba(239,68,68,.28); }
.metric-card.warning { border-color:rgba(245,158,11,.28); }
@media (max-width:920px) { .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { .metric-grid { grid-template-columns:1fr; } }
.alert-severity { display:inline-flex; align-items:center; border-radius:999px; padding:5px 9px; font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.alert-severity.critical { color:#fca5a5; background:rgba(239,68,68,.13); }
.alert-severity.warning { color:#fcd34d; background:rgba(245,158,11,.13); }
.alert-severity.info { color:#93c5fd; background:rgba(59,130,246,.13); }
.table-secondary { max-width:520px; margin-top:4px; font-size:11px; line-height:1.4; }
.updates-feed { display:grid; gap:14px; }
.update-card { padding:22px; border:1px solid var(--border); border-radius:15px; background:var(--panel-solid); box-shadow:var(--shadow-sm); }
.update-card-top { display:flex; justify-content:space-between; gap:16px; }
.update-card h3 { margin:10px 0 3px; font-size:18px; }
.update-card time { color:var(--muted); font-size:11px; }
.update-content { margin-top:18px; padding-top:17px; border-top:1px solid var(--border); color:var(--text-soft); font-size:13px; line-height:1.7; }
.update-attachments { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.attachment-chip { display:flex; align-items:center; gap:7px; border:1px solid var(--border); border-radius:9px; background:var(--panel-2); color:var(--text); padding:8px 10px; cursor:pointer; }
.attachment-chip svg { width:14px; height:14px; color:var(--primary); }
.attachment-chip small { color:var(--muted); }
.portal-updates { display:grid; gap:14px; }
.portal-update-card { padding:22px; border:1px solid var(--border); border-radius:15px; background:var(--panel-solid); }
.portal-update-date { color:var(--primary); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.portal-update-card h3 { margin:8px 0 12px; }
.portal-update-content { color:var(--text-soft); font-size:13px; line-height:1.7; }
.portal-update-files { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.portal-update-files a { padding:7px 10px; border:1px solid var(--border); border-radius:8px; color:var(--primary); font-size:11px; text-decoration:none; }

html.ghl-light .alert-severity.critical { color:#b91c1c; background:#fef2f2; }
html.ghl-light .alert-severity.warning { color:#92400e; background:#fffbeb; }
html.ghl-light .alert-severity.info { color:#1d4ed8; background:#eff6ff; }

@media (max-width:760px) {
  .page-heading { align-items:stretch; flex-direction:column; }
  .form-grid-2 { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 20px; }
.page-btn {
  min-width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--muted); cursor: pointer; font-size: 12.5px; display: flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.page-btn.active { background: var(--accent); color: white; border-color: transparent; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

.instance-card { position: relative; }
.instance-status-badge { position: absolute; top: 16px; right: 16px; }
.instance-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.instance-divider { border-top: 1px solid var(--border); margin: 2px 0; }
.instance-action-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.info-banner {
  background: var(--accent-soft);
  border: 1px solid rgba(139,92,246,0.35);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 10px 0 20px;
}
.info-banner a { color: #c4b5fd; text-decoration: underline; }
.info-banner .copy-btn { margin-left: auto; }

.switch { position: relative; display: inline-block; width: 34px; height: 19px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--panel-3); border: 1px solid var(--border);
  border-radius: 999px; transition: background .15s;
}
.switch-slider::before {
  content: ''; position: absolute; height: 13px; width: 13px; left: 2px; top: 2px;
  background: var(--muted); border-radius: 50%; transition: transform .15s, background .15s;
}
.switch input:checked + .switch-slider { background: var(--success-soft); border-color: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(15px); background: var(--success); }

.checkout-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(10,11,20,0.85); display: flex; align-items: center; justify-content: center; padding: 24px; }
.checkout-modal { background: #12141f; border: 1px solid #262a3f; border-radius: 18px; width: 100%; max-width: 900px; max-height: 92vh; overflow-y: auto; padding: 36px; }
.checkout-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.checkout-topbar .brand-mark { display: flex; align-items: center; gap: 10px; }
.checkout-topbar .brand-mark span { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: #b9bdd1; }
.checkout-close { background: transparent; border: 1px solid #262a3f; border-radius: 8px; width: 32px; height: 32px; color: #8b90a8; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; color: #6b7086; }
.steps .step { display: flex; align-items: center; gap: 6px; }
.steps .step.done { color: #8b90a8; }
.steps .dot { width: 6px; height: 6px; border-radius: 50%; background: #8b5cf6; display: inline-block; }
.steps .step-sep { color: #33374a; }
.checkout-title { font-size: 24px; font-weight: 600; margin: 4px 0 28px; color: #f4f5fa; }
.checkout-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.checkout-summary { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 14px; padding: 24px; height: fit-content; }
.checkout-summary h3 { font-size: 12px; color: #8b90a8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 20px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid #21243570; }
.summary-row-left { display: flex; align-items: center; gap: 10px; }
.row-icon { width: 28px; height: 28px; border-radius: 7px; background: #212438; display: flex; align-items: center; justify-content: center; color: #a78bfa; flex-shrink: 0; }
.row-icon svg { width: 15px; height: 15px; }
.summary-row label { font-size: 13px; color: #a7abbf; display: block; }
.summary-row .qty { font-size: 11.5px; color: #6b7086; min-height: 14px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid #33374a; background: #212438; color: #c4b5fd; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.stepper button:hover { background: #2a2e45; border-color: #8b5cf6; }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper .qty-value { font-size: 15px; font-weight: 600; color: #eef0f6; min-width: 16px; text-align: center; }
.summary-total { margin-top: 16px; padding-top: 16px; border-top: 1px solid #262a3f; display: flex; justify-content: space-between; align-items: baseline; }
.summary-total label { font-size: 12.5px; color: #8b90a8; }
.summary-total .value { font-size: 26px; font-weight: 700; color: #a78bfa; letter-spacing: -0.01em; }
.summary-total .cadence { font-size: 12px; color: #6b7086; }
.checkout-payment { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 14px; padding: 40px 32px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.payment-icon { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg,#262a3f,#1c1f30); border: 1px solid #33374a; display: flex; align-items: center; justify-content: center; color: #a78bfa; margin-bottom: 20px; }
.payment-icon svg { width: 22px; height: 22px; }
.checkout-payment h4 { font-size: 16px; font-weight: 600; color: #eef0f6; margin-bottom: 10px; }
.checkout-payment p { font-size: 13.5px; color: #8b90a8; line-height: 1.65; max-width: 340px; margin-bottom: 26px; }
.btn-pay { width: 100%; max-width: 320px; background: #7c3aed; color: #fff; border: none; border-radius: 10px; padding: 15px 20px; font-size: 14.5px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-pay:hover:not(:disabled) { background: #8b5cf6; }
.btn-pay:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-pay svg { width: 16px; height: 16px; }
.trust-row { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.trust-item { font-size: 11px; color: #6b7086; display: flex; align-items: center; gap: 5px; }
.trust-item svg { width: 13px; height: 13px; }
.trust-sep { width: 1px; height: 12px; background: #262a3f; }
.checkout-security { text-align: center; color: #565b70; font-size: 11.5px; margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.checkout-security svg { width: 12px; height: 12px; }
.skeleton-inline { display: inline-block; width: 60px; height: 11px; border-radius: 4px; background: linear-gradient(90deg, #212438 25%, #2a2e45 37%, #212438 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (max-width: 640px) { .checkout-layout { grid-template-columns: 1fr; } .checkout-modal { padding: 22px; } }
.checkout-warning { background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.35); color: #fbbf24; font-size: 12.5px; line-height: 1.5; padding: 12px 14px; border-radius: 10px; margin-bottom: 20px; }


.insights-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-top: 18px; }
.insight-card { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 16px; padding: 22px; }
.insight-head { margin-bottom: 18px; }
.insight-head label { font-size: 12px; color: #8b90a8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.insight-head .big { font-size: 26px; font-weight: 700; color: #eef0f6; margin-top: 4px; }
.insight-head .trend { font-size: 11.5px; display: flex; align-items: center; gap: 3px; margin-top: 6px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.chart .bar { flex: 1; background: linear-gradient(180deg, #8b5cf6, #6d3fc4); border-radius: 3px 3px 1px 1px; min-height: 4px; opacity: 0.85; }
.chart .bar.today { background: linear-gradient(180deg, #a78bfa, #8b5cf6); opacity: 1; }
.pipeline-list { display: flex; flex-direction: column; gap: 14px; }
.pipeline-item { display: flex; justify-content: space-between; align-items: center; }
.pipeline-item .left { display: flex; align-items: center; gap: 9px; }
.pipeline-dot { width: 9px; height: 9px; border-radius: 3px; }
.pipeline-name { font-size: 13px; color: #c7cad9; }
.pipeline-count { font-size: 13px; font-weight: 700; color: #eef0f6; }
@media (max-width: 640px) { .insights-grid { grid-template-columns: 1fr; } }


.portal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.portal-header .brand-mark { display: flex; align-items: center; gap: 12px; }
.portal-header .mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg,#8b5cf6,#7c3aed); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 15px; }
.brand-text .name { font-size: 15px; font-weight: 700; color: #f4f5fa; }
.brand-text .sub { font-size: 11.5px; color: #6b7086; }
.account-pill { display: flex; align-items: center; gap: 6px; background: #1a1d2e; border: 1px solid #262a3f; border-radius: 20px; padding: 6px 14px; font-size: 12.5px; color: #a7abbf; }
.account-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }

.tabs { display: flex; gap: 4px; background: #12141f; border: 1px solid #262a3f; border-radius: 12px; padding: 4px; margin-bottom: 24px; width: fit-content; }
.tab { padding: 9px 20px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: #8b90a8; cursor: pointer; }
.tab.active { background: #262a3f; color: #eef0f6; }
.tab:not(.active):hover { color: #b9bdd1; }

.status-card { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 16px; padding: 26px; margin-bottom: 18px; }
.status-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.3); color: #fbbf24; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 20px; }
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #fbbf24; }
.status-days { font-size: 12.5px; color: #8b90a8; margin-top: 8px; display: block; }
.btn-primary { background: #7c3aed; color: #fff; border: none; border-radius: 10px; padding: 11px 20px; font-size: 13.5px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.btn-primary:hover { background: #8b5cf6; }
.btn-primary svg { width: 14px; height: 14px; }

.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric-box { background: #12141f; border: 1px solid #21243570; border-radius: 12px; padding: 16px 18px; }
.metric-box .icon-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.metric-box .icon-row .row-icon { width: 24px; height: 24px; border-radius: 6px; background: #212438; display: flex; align-items: center; justify-content: center; color: #a78bfa; }
.metric-box .icon-row .row-icon svg { width: 13px; height: 13px; }
.metric-box label { font-size: 11.5px; color: #8b90a8; }
.metric-box .value { font-size: 19px; font-weight: 700; color: #eef0f6; margin-top: 2px; }
.metric-box .value .of { font-size: 13px; font-weight: 400; color: #6b7086; }
.progress-bar { height: 4px; border-radius: 2px; background: #262a3f; margin-top: 10px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: #8b5cf6; border-radius: 2px; }

.insights-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.insight-card { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 16px; padding: 22px; }
.insight-head { margin-bottom: 18px; }
.insight-head label { font-size: 12px; color: #8b90a8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.insight-head .big { font-size: 26px; font-weight: 700; color: #eef0f6; margin-top: 4px; }
.insight-head .trend { font-size: 11.5px; display: flex; align-items: center; gap: 3px; margin-top: 6px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.chart .bar { flex: 1; background: linear-gradient(180deg, #8b5cf6, #6d3fc4); border-radius: 3px 3px 1px 1px; min-height: 4px; opacity: 0.85; }
.chart .bar.today { background: linear-gradient(180deg, #a78bfa, #8b5cf6); opacity: 1; }
.pipeline-list { display: flex; flex-direction: column; gap: 14px; }
.pipeline-item { display: flex; justify-content: space-between; align-items: center; }
.pipeline-item .left { display: flex; align-items: center; gap: 9px; }
.pipeline-dot { width: 9px; height: 9px; border-radius: 3px; }
.pipeline-name { font-size: 13px; color: #c7cad9; }
.pipeline-count { font-size: 13px; font-weight: 700; color: #eef0f6; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar-count { font-size: 13px; color: #8b90a8; }
.toolbar-count b { color: #eef0f6; }
.btn-sm { background: #7c3aed; color: #fff; border: none; border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-sm:disabled { opacity: 0.5; cursor: not-allowed; }

.users-table { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 14px; overflow: hidden; }
.u-row { display: grid; grid-template-columns: 1.3fr 1.7fr 0.7fr minmax(150px, auto); align-items: center; padding: 15px 20px; border-bottom: 1px solid #21243570; gap: 10px; }
.u-row:last-child { border-bottom: none; }
.u-row.head { color: #6b7086; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; padding: 12px 20px; background: #16182633; }
.u-name-cell { display: flex; align-items: center; gap: 10px; }
.u-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#262a3f,#33374a); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: #c4b5fd; }
.u-name { font-size: 13.5px; font-weight: 600; color: #eef0f6; }
.u-email { font-size: 12.5px; color: #8b90a8; font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-role-badge { display: inline-block; background: #212438; border: 1px solid #33374a; border-radius: 6px; padding: 3px 9px; font-size: 11px; color: #a7abbf; }
.u-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.u-actions button { background: #212438; border: 1px solid #33374a; color: #c4b5fd; font-size: 11.5px; font-weight: 600; padding: 6px 9px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.u-actions button:hover { background: #2a2e45; border-color: #8b5cf6; }

.wa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.wa-card { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 14px; padding: 20px; position: relative; }
.wa-badge { position: absolute; top: 18px; right: 18px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.wa-badge.ok { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.wa-badge.warn { background: rgba(251,191,36,0.1); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.wa-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.wa-icon { width: 40px; height: 40px; border-radius: 10px; background: #212438; display: flex; align-items: center; justify-content: center; color: #8b90a8; }
.wa-icon.connected { color: #4ade80; background: rgba(34,197,94,0.08); }
.wa-icon svg { width: 19px; height: 19px; }
.wa-name { font-size: 14px; font-weight: 700; color: #eef0f6; }
.wa-phone { font-size: 12px; color: #8b90a8; font-family: ui-monospace, monospace; margin-top: 2px; }
.wa-actions { display: flex; gap: 8px; margin-top: 6px; }
.wa-actions button { flex: 1; border-radius: 8px; padding: 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid #33374a; }
.btn-connect { background: #16342a; border-color: rgba(34,197,94,0.35) !important; color: #4ade80; }
.btn-disconnect { background: #212438; color: #c4b5fd; }
.wa-add-card { border: 1.5px dashed #33374a; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; cursor: pointer; color: #6b7086; min-height: 140px; }
.wa-add-card:hover { border-color: #8b5cf6; color: #a78bfa; }
.wa-add-card .plus-circle { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid #33374a; display: flex; align-items: center; justify-content: center; }
.wa-add-card .plus-circle svg { width: 16px; height: 16px; }

.checkout-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(10,11,20,0.85); display: flex; align-items: center; justify-content: center; padding: 24px; }
.checkout-modal { background: #12141f; border: 1px solid #262a3f; border-radius: 18px; width: 100%; max-width: 900px; max-height: 92vh; overflow-y: auto; padding: 36px; }
.checkout-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.checkout-topbar .brand-mark { display: flex; align-items: center; gap: 10px; }
.checkout-topbar .brand-mark span { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: #b9bdd1; }
.checkout-close { background: transparent; border: 1px solid #262a3f; border-radius: 8px; width: 32px; height: 32px; color: #8b90a8; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; color: #6b7086; }
.steps .step { display: flex; align-items: center; gap: 6px; }
.steps .step.done { color: #8b90a8; }
.steps .dot { width: 6px; height: 6px; border-radius: 50%; background: #8b5cf6; display: inline-block; }
.steps .step-sep { color: #33374a; }
.checkout-title { font-size: 24px; font-weight: 600; margin: 4px 0 28px; color: #f4f5fa; }
.checkout-warning { background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.35); color: #fbbf24; font-size: 12.5px; line-height: 1.5; padding: 12px 14px; border-radius: 10px; margin-bottom: 20px; }
.checkout-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.checkout-summary { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 14px; padding: 24px; height: fit-content; }
.checkout-summary h3 { font-size: 12px; color: #8b90a8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 20px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid #21243570; }
.summary-row-left { display: flex; align-items: center; gap: 10px; }
.row-icon { width: 28px; height: 28px; border-radius: 7px; background: #212438; display: flex; align-items: center; justify-content: center; color: #a78bfa; flex-shrink: 0; }
.row-icon svg { width: 15px; height: 15px; }
.summary-row label { font-size: 13px; color: #a7abbf; display: block; }
.summary-row .qty { font-size: 11.5px; color: #6b7086; min-height: 14px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid #33374a; background: #212438; color: #c4b5fd; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.stepper button:hover { background: #2a2e45; border-color: #8b5cf6; }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper .qty-value { font-size: 15px; font-weight: 600; color: #eef0f6; min-width: 16px; text-align: center; }
.summary-total { margin-top: 16px; padding-top: 16px; border-top: 1px solid #262a3f; display: flex; justify-content: space-between; align-items: baseline; }
.summary-total label { font-size: 12.5px; color: #8b90a8; }
.summary-total .value { font-size: 26px; font-weight: 700; color: #a78bfa; letter-spacing: -0.01em; }
.summary-total .cadence { font-size: 12px; color: #6b7086; }
.checkout-payment { background: #1a1d2e; border: 1px solid #262a3f; border-radius: 14px; padding: 40px 32px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.payment-icon { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg,#262a3f,#1c1f30); border: 1px solid #33374a; display: flex; align-items: center; justify-content: center; color: #a78bfa; margin-bottom: 20px; }
.payment-icon svg { width: 22px; height: 22px; }
.checkout-payment h4 { font-size: 16px; font-weight: 600; color: #eef0f6; margin-bottom: 10px; }
.checkout-payment p { font-size: 13.5px; color: #8b90a8; line-height: 1.65; max-width: 340px; margin-bottom: 26px; }
.btn-pay { width: 100%; max-width: 320px; background: #7c3aed; color: #fff; border: none; border-radius: 10px; padding: 15px 20px; font-size: 14.5px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-pay:hover:not(:disabled) { background: #8b5cf6; }
.btn-pay:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-pay svg { width: 16px; height: 16px; }
.trust-row { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.trust-item { font-size: 11px; color: #6b7086; display: flex; align-items: center; gap: 5px; }
.trust-item svg { width: 13px; height: 13px; }
.trust-sep { width: 1px; height: 12px; background: #262a3f; }
.checkout-security { text-align: center; color: #565b70; font-size: 11.5px; margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.checkout-security svg { width: 12px; height: 12px; }
.skeleton-inline { display: inline-block; width: 60px; height: 11px; border-radius: 4px; background: linear-gradient(90deg, #212438 25%, #2a2e45 37%, #212438 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (max-width: 640px) { .checkout-layout { grid-template-columns: 1fr; } .checkout-modal { padding: 22px; } .insights-grid { grid-template-columns: 1fr; } .wa-grid { grid-template-columns: 1fr; } }

.wa-avatar { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }

@media (max-width: 640px) {
  .u-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }
  .u-row.head { display: none; }
  .u-actions { justify-content: flex-start; margin-top: 6px; }
}


/* ================================================================
   AUGUR CRM — Professional UI layer
   Cole este bloco NO FINAL do styles.css atual.
   Mantém os IDs/classes e toda a lógica JavaScript existente.
   ================================================================ */

:root {
  --bg: #080910;
  --sidebar-bg: #0c0d16;
  --panel: #11131e;
  --panel-2: #151827;
  --panel-3: #1b1f31;
  --panel-elevated: #1e2235;
  --panel-solid: #1e2235;
  --border: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #f4f5fb;
  --text-soft: #c4c7d6;
  --muted: #9298af;
  --muted-2: #686f88;
  --accent: #8b5cf6;
  --accent-strong: #7138e6;
  --accent-hover: #9d75fa;
  --primary: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.13);
  --success: #35d477;
  --success-soft: rgba(53, 212, 119, 0.12);
  --danger: #fb5b64;
  --danger-soft: rgba(251, 91, 100, 0.11);
  --warning: #f7b955;
  --warning-soft: rgba(247, 185, 85, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.22);
  --focus-ring: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

html { color-scheme: dark; }

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 72% -15%, rgba(124, 58, 237, 0.08), transparent 31rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, .nav-item:focus-visible, .add-instance-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Shell */
.app-shell { background: transparent; }

.sidebar {
  width: var(--sidebar-w);
  padding: 24px 14px 18px;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.035), transparent 24%),
    var(--sidebar-bg);
  border-right-color: var(--border);
}

.sidebar-logo {
  gap: 12px;
  min-height: 52px;
  padding: 2px 10px 26px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.sidebar-logo .mark,
.login-box .mark,
.portal-header .mark,
.checkout-topbar .mark {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #a075ff 0%, #7c3aed 65%, #6224cf 100%) !important;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.25);
}

.sidebar-logo .mark::after,
.portal-header .mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.22), transparent 45%);
  pointer-events: none;
}

/* AUGUR CRM — Contas GHL redesign
   Cole no FINAL de src/public/styles.css, depois do override anterior. */

.accounts-page { display: flex; flex-direction: column; gap: 24px; }

.accounts-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-eyebrow {
  margin-bottom: 7px;
  color: #9f83f7;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .13em;
}

.accounts-page-header h1 {
  margin: 0;
  color: #f7f7fb;
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.12;
  letter-spacing: -.04em;
}

.accounts-page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.accounts-header-actions { display: flex; align-items: center; gap: 10px; }
.accounts-header-actions .btn { min-height: 42px; }
.accounts-header-actions svg { width: 16px; height: 16px; }
.maintenance-btn { color: #858ba1; }

.accounts-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.summary-stat-card {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background:
    linear-gradient(145deg, rgba(27,30,47,.95), rgba(17,20,32,.95));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.summary-stat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
}

.summary-stat-icon svg { width: 20px; height: 20px; }
.summary-stat-icon.purple { color: #b79cff; background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.17); }
.summary-stat-icon.green { color: #45dd82; background: rgba(53,212,119,.10); border-color: rgba(53,212,119,.16); }
.summary-stat-icon.blue { color: #66b8ff; background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.16); }
.summary-stat-icon.orange { color: #f7b955; background: rgba(247,185,85,.10); border-color: rgba(247,185,85,.16); }

.summary-stat-card > div:last-child { min-width: 0; }
.summary-stat-label { display: block; color: #838aa1; font-size: 11.5px; font-weight: 650; }
.summary-stat-card strong { display: inline-block; margin-top: 2px; color: #f3f4f9; font-size: 26px; line-height: 1.1; letter-spacing: -.035em; }
.summary-stat-card small { display: block; margin-top: 4px; color: #686f87; font-size: 10.5px; }
.summary-stat-suffix { font-size: 14px; font-weight: 600; color: #c4c7d6; margin-left: 4px; }

/* Versão compacta, usada nas abas internas da conta (4 indicadores menores) */
.accounts-summary-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.accounts-summary-grid.compact .summary-stat-card { min-height: 76px; padding: 14px 16px; gap: 12px; border-radius: 12px; }
.accounts-summary-grid.compact .summary-stat-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; }
.accounts-summary-grid.compact .summary-stat-icon svg { width: 16px; height: 16px; }
.accounts-summary-grid.compact .summary-stat-card strong { font-size: 19px; }

/* ---------- Visão geral da conta ---------- */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.overview-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 18px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.overview-card-label { font-size: 11.5px; font-weight: 650; color: #838aa1; text-transform: uppercase; letter-spacing: .03em; }
.overview-card-number { font-size: 24px; font-weight: 750; color: #f3f4f9; letter-spacing: -.03em; }
.overview-card-note { font-size: 11.5px; margin: 0; }

.attention-card { border-color: rgba(239,68,68,.32); background: var(--danger-soft); }
.attention-title { color: #fca5a5 !important; }
.attention-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.attention-list li { margin-bottom: 6px; }
.attention-list li:last-child { margin-bottom: 0; }

.activity-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.activity-list li { margin-bottom: 8px; }
.activity-list li:last-child { margin-bottom: 0; }

@media (max-width: 920px) {
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounts-summary-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .overview-grid { grid-template-columns: 1fr; }
  .accounts-summary-grid.compact { grid-template-columns: 1fr; }
}

.accounts-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 10px;
  background: rgba(20,23,37,.7);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.accounts-search-wrap {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.accounts-search-icon { color: #747b94; font-size: 23px; line-height: 1; transform: rotate(-20deg); }

.accounts-search-wrap input {
  min-height: 38px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.accounts-search-wrap input:focus { background: transparent; border: 0; box-shadow: none; }
.accounts-search-wrap kbd {
  padding: 3px 7px;
  color: #6e758c;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 10.5px ui-monospace, monospace;
}

.accounts-result-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: #777e95;
  font-size: 11.5px;
  font-weight: 650;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(148,163,184,.09);
  border-radius: 999px;
}

.accounts-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.client-account-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(139,92,246,.07), transparent 12rem),
    linear-gradient(145deg, rgba(26,29,45,.98), rgba(17,20,32,.98));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.client-account-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.13), transparent);
}

.client-account-card:hover,
.client-account-card:focus-visible {
  outline: none;
  transform: translateY(-3px);
  border-color: rgba(139,92,246,.34);
  box-shadow: 0 18px 48px rgba(0,0,0,.25);
}

.client-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.client-identity { min-width: 0; display: flex; align-items: center; gap: 12px; }

.client-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #ddcffd;
  background: linear-gradient(145deg, rgba(139,92,246,.22), rgba(113,56,230,.12));
  border: 1px solid rgba(139,92,246,.24);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.client-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload { cursor: pointer; }
.avatar-upload:hover { border-color: rgba(139,92,246,.6); }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #a78bfa;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: #c4b5fd; }

.client-title-wrap { min-width: 0; }
.client-title-wrap h3 {
  max-width: 270px;
  margin: 0;
  overflow: hidden;
  color: #f3f4fa;
  font-size: 16px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-id { display: block; max-width: 220px; margin-top: 3px; overflow: hidden; color: #697087; font: 10.5px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Header + abas compartilhados da tela de conta ---------- */
.account-shell-header { margin-bottom: 20px; }
.account-header-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.client-avatar.big { width: 52px; height: 52px; flex: 0 0 52px; font-size: 16px; border-radius: 14px; }
.client-title-wrap h2 { margin: 0; font-size: 19px; font-weight: 730; color: #f3f4fa; }
.account-header-meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
#quickActionsBtn { display: inline-flex; align-items: center; gap: 6px; }
#quickActionsBtn svg { width: 12px; height: 12px; transform: rotate(90deg); }

.account-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.account-tab {
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
}
.account-tab:hover { color: var(--text); }
.account-tab.active { color: #d6c8ff; border-bottom-color: var(--accent); }

#accountTabBody { padding-top: 20px; }

.billing-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}
.billing-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.billing-pill.active { color: #42da7f; background: rgba(53,212,119,.09); border-color: rgba(53,212,119,.16); }
.billing-pill.trial { color: #b79cff; background: rgba(139,92,246,.10); border-color: rgba(139,92,246,.18); }
.billing-pill.warning { color: #f5bd60; background: rgba(247,185,85,.09); border-color: rgba(247,185,85,.16); }
.billing-pill.danger { color: #fb747c; background: rgba(251,91,100,.09); border-color: rgba(251,91,100,.16); }
.billing-pill.neutral { color: #858ca2; background: rgba(148,163,184,.06); border-color: rgba(148,163,184,.11); }

.client-location-block {
  margin-top: 18px;
  padding: 11px 12px;
  background: rgba(255,255,255,.022);
  border: 1px solid rgba(148,163,184,.08);
  border-radius: 10px;
}
.client-location-block span { display: block; margin-bottom: 3px; color: #686f87; font-size: 9.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.client-location-block strong { display: block; overflow: hidden; color: #b6bacb; font: 11.5px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }

.client-health-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.client-health-item { min-width: 0; display: flex; align-items: center; gap: 9px; }
.client-health-item small { display: block; color: #686f87; font-size: 9.5px; }
.client-health-item strong { display: block; margin-top: 1px; overflow: hidden; color: #c8cbd8; font-size: 11.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.health-dot { display: inline-block; width: 9px; height: 9px; margin: 0 7px; flex: 0 0 9px; border-radius: 50%; box-shadow: 0 0 0 5px rgba(148,163,184,.06); vertical-align: middle; }
.health-dot.online { background: #35d477; box-shadow: 0 0 0 5px rgba(53,212,119,.09); }
.health-dot.offline { background: #70778e; }
.health-dot.warning { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-soft); }
.mini-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; color: #9180c7; background: rgba(139,92,246,.07); border-radius: 8px; }
.mini-icon svg { width: 14px; height: 14px; }

.client-card-footer {
  min-height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid rgba(148,163,184,.09);
}
.client-card-footer > span { color: #626980; font-size: 10.5px; white-space: nowrap; }
.client-card-actions { display: flex; align-items: center; gap: 6px; }
.client-card-actions .icon-btn { width: 32px; height: 32px; border-radius: 8px; opacity: .66; }
.client-account-card:hover .client-card-actions .icon-btn { opacity: 1; }
.open-account-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px 6px 11px;
  color: #c7b7f5;
  background: rgba(139,92,246,.08);
  border: 1px solid rgba(139,92,246,.14);
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.open-account-btn:hover { color: #fff; background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.25); }
.open-account-btn svg { width: 13px; height: 13px; }

/* ---------- Filtros da toolbar (select compacto) ---------- */
.toolbar-filter {
  width: auto;
  min-width: 150px;
  padding: 8px 10px;
  font-size: 12.5px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

/* Container de rolagem horizontal pras tabelas operacionais - evita que a
   página inteira role de lado quando a tabela não cabe (telas estreitas). */
.table-scroll { width: 100%; overflow-x: auto; }

/* ---------- Tabela operacional (Contas GHL, WhatsApp, etc.) ---------- */
.accounts-table td, .accounts-table th { vertical-align: middle; }
.accounts-table-row { cursor: pointer; }
.accounts-table-row:hover { background: var(--panel-3); }
.accounts-table .client-identity { display: flex; align-items: center; gap: 10px; }
.accounts-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

/* ---------- Menu de 3 pontos (genérico) ---------- */
.kebab-menu {
  position: fixed;
  z-index: 200;
  min-width: 180px;
  padding: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}
.kebab-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.kebab-menu-item:hover { background: var(--panel-3); }
.kebab-menu-item.danger { color: #fb747c; }
.kebab-menu-item svg { width: 14px; height: 14px; flex-shrink: 0; }

.accounts-empty-state {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 20px;
  text-align: center;
  background: rgba(255,255,255,.012);
  border: 1px dashed rgba(148,163,184,.18);
  border-radius: 16px;
}
.empty-state-icon { width: 46px; height: 46px; display: grid; place-items: center; color: #af92fa; background: rgba(139,92,246,.10); border: 1px solid rgba(139,92,246,.18); border-radius: 13px; font-size: 18px; font-weight: 700; }
.accounts-empty-state h3 { margin: 14px 0 5px; }
.accounts-empty-state p { max-width: 400px; margin: 0 0 18px; color: var(--muted); font-size: 13px; }

.accounts-loading { display: flex; flex-direction: column; gap: 24px; }
.skeleton-block { background: linear-gradient(90deg, #151827 25%, #202438 38%, #151827 63%); background-size: 400% 100%; border-radius: 14px; animation: shimmer 1.4s ease infinite; }
.skeleton-title { width: 240px; height: 44px; }
.skeleton-stat { height: 112px; }

@media (max-width: 920px) {
  .accounts-summary-grid { grid-template-columns: 1fr; }
  .summary-stat-card { min-height: 92px; }
  .accounts-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .accounts-page { gap: 18px; }
  .accounts-page-header { align-items: stretch; flex-direction: column; }
  .accounts-page-header p { max-width: 300px; }
  .accounts-header-actions { width: 100%; }
  .accounts-header-actions .maintenance-btn { width: 42px; flex: 0 0 42px; padding: 0; justify-content: center; }
  .accounts-header-actions .maintenance-btn span { display: none; }
  .accounts-header-actions .btn-primary { flex: 1; justify-content: center; }
  .accounts-toolbar { align-items: stretch; flex-direction: column; gap: 4px; }
  .accounts-result-count { width: fit-content; margin-left: 8px; }
  .accounts-search-wrap kbd { display: none; }
  .client-account-card { padding: 17px; }
  .client-card-top { align-items: center; }
  .client-title-wrap h3 { max-width: 150px; }
  .billing-pill { padding: 4px 7px; }
  .client-health-row { grid-template-columns: 1fr; }
  .client-card-footer { align-items: stretch; flex-direction: column; }
  .client-card-actions { width: 100%; }
  .open-account-btn { flex: 1; justify-content: center; }
}
/* Correção de segurança para os ícones da nova tela */
.accounts-page svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex-shrink: 0;
}

.summary-stat-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-stat-icon svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}

/* Modal de edição do AUGUR */
.augur-input-overlay {
  padding: 20px;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.augur-input-modal {
  width: min(440px, 100%);
  max-width: 440px;
  padding: 26px;
  text-align: left;
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(139, 92, 246, 0.10),
      transparent 14rem
    ),
    #171a29;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
  animation: augurInputEnter 0.18s ease-out;
}

@keyframes augurInputEnter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

.input-modal-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: #b99cff;
  background: rgba(139, 92, 246, 0.11);
  border: 1px solid rgba(139, 92, 246, 0.20);
  border-radius: 11px;
}

.input-modal-icon svg {
  width: 18px;
  height: 18px;
}

.augur-input-modal h3 {
  margin: 0;
  color: #f5f5fa;
  font-size: 19px;
}

.input-modal-description {
  margin: 7px 0 20px;
  color: #8f95aa;
  font-size: 13px;
  line-height: 1.55;
}

.augur-input-modal form label {
  margin-top: 0;
  color: #a9aec0;
  font-size: 12px;
  font-weight: 650;
}

.augur-input-modal input {
  height: 44px;
  margin-top: 7px;
}

.input-modal-error {
  min-height: 18px;
  margin-top: 6px;
  color: #fb747c;
  font-size: 11.5px;
}

.input-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.11);
}

.input-modal-actions .btn {
  min-width: 100px;
  justify-content: center;
}

@media (max-width: 480px) {
  .augur-input-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .augur-input-modal {
    max-width: none;
    padding: 22px 18px 18px;
    border-radius: 18px;
  }

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

  .input-modal-actions .btn {
    width: 100%;
  }
}
/* ---------- Portal autenticado ---------- */
.portal-login-page { min-height: calc(100vh - 48px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.portal-login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.portal-login-brand .mark { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; font-weight: 800; background: linear-gradient(145deg,#a075ff,#7138e6); border-radius: 11px; box-shadow: 0 12px 30px rgba(124,58,237,.25); }
.portal-login-brand strong, .portal-login-brand span { display: block; }
.portal-login-brand strong { font-size: 15px; letter-spacing: .06em; }
.portal-login-brand span { margin-top: 1px; color: var(--muted); font-size: 11px; }
.portal-login-card { width: min(420px, 100%); padding: 30px; background: linear-gradient(145deg,#1a1d2e,#12141f); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 28px 80px rgba(0,0,0,.38); }
.portal-login-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #b99cff; background: var(--accent-soft); border: 1px solid rgba(139,92,246,.2); border-radius: 12px; }
.portal-login-card h1 { margin: 18px 0 6px; font-size: 24px; }
.portal-login-card > p { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.portal-login-card label { margin-top: 13px; }
.portal-login-error { min-height: 20px; margin: 8px 0 4px; color: #fb747c; font-size: 12px; }
.portal-login-submit { width: 100%; min-height: 44px; justify-content: center; margin-top: 4px; }
.portal-login-security { margin-top: 18px; color: #626980; font-size: 11px; }
.portal-logout-btn { padding: 7px 11px; color: #8d93a8; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 9px; font-size: 11.5px; cursor: pointer; }
.portal-logout-btn:hover { color: #fff; border-color: rgba(139,92,246,.3); }
.portal-readonly-note { margin-top: 14px; padding: 10px 13px; color: #a7abbf; background: rgba(139,92,246,.06); border: 1px solid rgba(139,92,246,.14); border-radius: 10px; font-size: 11.5px; }
.portal-readonly #hireBtn, .portal-readonly .wa-add-card, .portal-readonly [data-connect], .portal-readonly [data-disconnect], .portal-readonly #newUserBtn, .portal-readonly .u-actions { display: none !important; }
@media (max-width: 640px) { .portal-login-card { padding: 24px 19px; } .portal-header { flex-wrap: wrap; } .portal-logout-btn { margin-left: auto; } }


/* ================================================================
   AUGUR — Tema claro integrado ao GHL
   Ativado somente quando <html> possuir a classe .ghl-light
   ================================================================ */

html.ghl-light {
  color-scheme: light;

  --bg: #ffffff;
  --sidebar-bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --panel-3: #f8f7fa;
  --panel-elevated: #ffffff;

  --text: #20232d;
  --muted: #6b7280;
  --muted-2: #9297a5;

  --border: #e5e7eb;
  --border-strong: #d8dae0;

  --accent: #560089;
  --accent-hover: #6d00ad;
  --accent-soft: rgba(86, 0, 137, 0.08);
}

html.ghl-light,
html.ghl-light body {
  background: #ffffff !important;
  color: #20232d;
}

html.ghl-light body {
  min-height: 100vh;
}

/* Cabeçalho */

html.ghl-light .portal-header {
  padding-bottom: 20px;
  border-bottom: 1px solid #ececf0;
}

html.ghl-light .brand-text .name,
html.ghl-light .portal-login-brand strong {
  color: #20232d;
}

html.ghl-light .brand-text .sub,
html.ghl-light .portal-login-brand span {
  color: #737786;
}

html.ghl-light .portal-header .mark,
html.ghl-light .portal-login-brand .mark,
html.ghl-light .checkout-topbar .mark {
  background: linear-gradient(145deg, #6d00ad, #560089) !important;
  box-shadow: 0 8px 20px rgba(86, 0, 137, 0.18);
}

html.ghl-light .account-pill {
  color: #4b5060;
  background: #f7f5f9;
  border-color: rgba(86, 0, 137, 0.12);
}

html.ghl-light .portal-logout-btn {
  color: #636776;
  background: #ffffff;
  border-color: #e2e3e8;
}

html.ghl-light .portal-logout-btn:hover {
  color: #560089;
  background: rgba(86, 0, 137, 0.05);
  border-color: rgba(86, 0, 137, 0.25);
}

/* Abas */

html.ghl-light .tabs {
  background: #f7f7f9;
  border-color: #e3e4e8;
  box-shadow: none;
}

html.ghl-light .tab {
  color: #6c7080;
}

html.ghl-light .tab.active {
  color: #560089;
  background: #ffffff;
  box-shadow:
    0 1px 3px rgba(28, 20, 38, 0.08),
    inset 0 0 0 1px rgba(86, 0, 137, 0.10);
}

html.ghl-light .tab:not(.active):hover {
  color: #560089;
  background: rgba(86, 0, 137, 0.04);
}

/* Cards principais */

html.ghl-light .status-card,
html.ghl-light .metric-box,
html.ghl-light .insight-card,
html.ghl-light .users-table,
html.ghl-light .wa-card {
  color: #20232d;
  background: #ffffff;
  border-color: #e3e4e8;
  box-shadow: 0 4px 18px rgba(29, 23, 38, 0.045);
}

html.ghl-light .metric-box {
  background: #fafafa;
}

html.ghl-light .metric-box .value,
html.ghl-light .insight-head .big,
html.ghl-light .pipeline-count,
html.ghl-light .toolbar-count b,
html.ghl-light .u-name,
html.ghl-light .wa-name {
  color: #20232d;
}

html.ghl-light .metric-box label,
html.ghl-light .metric-box .value .of,
html.ghl-light .insight-head label,
html.ghl-light .pipeline-name,
html.ghl-light .toolbar-count,
html.ghl-light .wa-phone,
html.ghl-light .u-email,
html.ghl-light .status-days {
  color: #747887;
}

html.ghl-light .row-icon,
html.ghl-light .metric-box .icon-row .row-icon,
html.ghl-light .wa-icon {
  color: #560089;
  background: rgba(86, 0, 137, 0.08);
}

html.ghl-light .progress-bar {
  background: #e8e5eb;
}

html.ghl-light .progress-bar .fill,
html.ghl-light .chart .bar {
  background: linear-gradient(
    180deg,
    rgba(86, 0, 137, 0.5),
    #560089
  );
}

html.ghl-light .chart .bar.today {
  background: linear-gradient(180deg, #8734b9, #560089);
}

/* Status */

html.ghl-light .status-badge {
  color: #936200;
  background: #fff8e6;
  border-color: #f1d38a;
}

html.ghl-light .status-badge .dot {
  background: #d69a00;
}

/* Botões */

html.ghl-light .btn-primary,
html.ghl-light .btn-sm,
html.ghl-light .btn-pay {
  color: #ffffff;
  background: #560089;
  box-shadow: 0 7px 18px rgba(86, 0, 137, 0.16);
}

html.ghl-light .btn-primary:hover,
html.ghl-light .btn-sm:hover,
html.ghl-light .btn-pay:hover:not(:disabled) {
  background: #6d00ad;
}

/* Usuários */

html.ghl-light .u-row {
  border-bottom-color: #ececf0;
}

html.ghl-light .u-row.head {
  color: #777b88;
  background: #f8f8fa;
}

html.ghl-light .u-avatar {
  color: #560089;
  background: rgba(86, 0, 137, 0.09);
  border: 1px solid rgba(86, 0, 137, 0.10);
}

html.ghl-light .u-role-badge {
  color: #560089;
  background: rgba(86, 0, 137, 0.06);
  border-color: rgba(86, 0, 137, 0.15);
}

html.ghl-light .u-actions button {
  color: #560089;
  background: #ffffff;
  border-color: #dedfe5;
}

html.ghl-light .u-actions button:hover {
  background: rgba(86, 0, 137, 0.05);
  border-color: rgba(86, 0, 137, 0.35);
}

/* WhatsApp */

html.ghl-light .wa-icon.connected {
  color: #138a4a;
  background: #eaf8f0;
}

html.ghl-light .wa-badge.ok {
  color: #167544;
  background: #eaf8f0;
  border-color: #bee8d0;
}

html.ghl-light .wa-badge.warn {
  color: #936200;
  background: #fff8e6;
  border-color: #f1d38a;
}

html.ghl-light .wa-actions button,
html.ghl-light .btn-disconnect {
  color: #560089;
  background: #ffffff;
  border-color: #dedfe5;
}

html.ghl-light .btn-connect {
  color: #167544;
  background: #eaf8f0;
}

html.ghl-light .wa-add-card {
  color: #737786;
  background: #fbfbfc;
  border-color: #d9dbe1;
}

html.ghl-light .wa-add-card:hover {
  color: #560089;
  background: rgba(86, 0, 137, 0.025);
  border-color: rgba(86, 0, 137, 0.45);
}

html.ghl-light .wa-add-card .plus-circle {
  border-color: rgba(86, 0, 137, 0.25);
}

/* Inputs e formulários */

html.ghl-light input,
html.ghl-light select,
html.ghl-light textarea {
  color: #20232d;
  background: #ffffff;
  border-color: #dfe1e6;
}

html.ghl-light input::placeholder,
html.ghl-light textarea::placeholder {
  color: #a1a5af;
}

html.ghl-light input:focus,
html.ghl-light select:focus,
html.ghl-light textarea:focus {
  border-color: rgba(86, 0, 137, 0.5);
  box-shadow: 0 0 0 3px rgba(86, 0, 137, 0.08);
}

/* Drawers */

html.ghl-light .drawer-overlay {
  background: rgba(30, 24, 38, 0.28);
}

html.ghl-light .drawer {
  color: #20232d;
  background: #ffffff;
  border-left-color: #e1e2e7;
  box-shadow: -16px 0 45px rgba(30, 24, 38, 0.10);
}

html.ghl-light .drawer-header,
html.ghl-light .drawer-footer {
  border-color: #e8e8ec;
}

html.ghl-light .drawer-close {
  color: #6b7280;
}

html.ghl-light .checkbox-item {
  color: #30333c;
}

/* Checkout */

html.ghl-light .checkout-overlay {
  background: rgba(30, 24, 38, 0.32);
  backdrop-filter: blur(3px);
}

html.ghl-light .checkout-modal,
html.ghl-light .checkout-summary,
html.ghl-light .checkout-payment {
  color: #20232d;
  background: #ffffff;
  border-color: #e1e2e7;
}

html.ghl-light .checkout-modal {
  box-shadow: 0 26px 80px rgba(30, 24, 38, 0.18);
}

html.ghl-light .checkout-title,
html.ghl-light .checkout-payment h4,
html.ghl-light .stepper .qty-value {
  color: #20232d;
}

html.ghl-light .checkout-topbar .brand-mark span,
html.ghl-light .checkout-summary h3,
html.ghl-light .summary-row label,
html.ghl-light .checkout-payment p,
html.ghl-light .steps,
html.ghl-light .trust-item,
html.ghl-light .checkout-security {
  color: #737786;
}

html.ghl-light .checkout-close,
html.ghl-light .stepper button {
  color: #560089;
  background: #ffffff;
  border-color: #dcdee4;
}

html.ghl-light .summary-row,
html.ghl-light .summary-total {
  border-color: #e9e9ed;
}

html.ghl-light .summary-total .value {
  color: #560089;
}

html.ghl-light .payment-icon {
  color: #560089;
  background: rgba(86, 0, 137, 0.07);
  border-color: rgba(86, 0, 137, 0.15);
}

html.ghl-light .trust-sep {
  background: #dedfe5;
}

/* Login dentro do iframe */

html.ghl-light .portal-login-card {
  color: #20232d;
  background: #ffffff;
  border-color: #e1e2e7;
  box-shadow: 0 24px 70px rgba(30, 24, 38, 0.10);
}

html.ghl-light .portal-login-card h1 {
  color: #20232d;
}

html.ghl-light .portal-login-card > p,
html.ghl-light .portal-login-security {
  color: #737786;
}

/* Informações auxiliares */

html.ghl-light .info-banner {
  color: #560089;
  background: rgba(86, 0, 137, 0.05);
  border-color: rgba(86, 0, 137, 0.15);
}

html.ghl-light .info-banner a {
  color: #560089;
}

html.ghl-light .skeleton-inline {
  background: linear-gradient(
    90deg,
    #f0f0f3 25%,
    #e4e4e9 37%,
    #f0f0f3 63%
  );
  background-size: 400% 100%;
}

/* =========================================================
   EXCLUSÃO DE INSTÂNCIAS WHATSAPP
   ========================================================= */

.wa-actions .btn-delete-instance {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 96px;
  color: #ef4444;
  background: transparent;
  border-color: rgba(239, 68, 68, 0.3);
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease;
}

.wa-actions .btn-delete-instance:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-delete-instance svg,
.btn-delete-confirm svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.delete-instance-overlay {
  padding: 20px;
  z-index: 1000;
}

.delete-instance-modal {
  position: relative;
  width: min(100%, 460px);
  padding: 30px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  text-align: left;
}

.delete-instance-close {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.delete-instance-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.11);
  border: 1px solid rgba(239, 68, 68, 0.23);
  border-radius: 14px;
}

.delete-instance-icon svg {
  width: 23px;
  height: 23px;
}

.delete-instance-modal h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 22px;
}

.delete-instance-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.delete-instance-modal p strong {
  color: inherit;
}

.delete-instance-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.btn-delete-cancel,
.btn-delete-confirm {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.btn-delete-cancel {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-delete-cancel:hover {
  background: var(--panel-3);
}

.btn-delete-confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  background: #dc2626;
  border: 1px solid #dc2626;
}

.btn-delete-confirm:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-delete-confirm:disabled {
  opacity: 0.7;
  cursor: wait;
}

.delete-instance-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: delete-instance-spin 0.7s linear infinite;
}

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

/* Aparência integrada ao GHL em modo claro */

html.ghl-light .wa-actions .btn-delete-instance {
  color: #dc2626;
  background: #ffffff;
  border-color: rgba(220, 38, 38, 0.25);
}

html.ghl-light .wa-actions .btn-delete-instance:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.42);
}

html.ghl-light .delete-instance-modal {
  color: #20232d;
  background: #ffffff;
  border-color: #e1e2e7;
  box-shadow: 0 24px 70px rgba(30, 24, 38, 0.16);
}

html.ghl-light .delete-instance-modal h3 {
  color: #20232d;
}

html.ghl-light .delete-instance-modal p {
  color: #737786;
}

html.ghl-light .btn-delete-cancel {
  color: #3f3f46;
  background: #ffffff;
  border-color: #dedee5;
}

html.ghl-light .btn-delete-cancel:hover {
  background: #f7f7f8;
}

@media (max-width: 520px) {
  .wa-actions {
    flex-wrap: wrap;
  }

  .wa-actions .btn-delete-instance {
    flex: 1 1 100%;
  }

  .delete-instance-modal {
    padding: 26px 22px 22px;
  }

  .delete-instance-actions {
    flex-direction: column-reverse;
  }

  .btn-delete-cancel,
  .btn-delete-confirm {
    width: 100%;
  }
}

/* ---------- Gestão de grupos WhatsApp ---------- */

.groups-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.groups-subtitle {
  font-size: 12px;
  margin-top: 4px;
}

.groups-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.group-check {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.group-card {
  background: #1a1d2e;
  border: 1px solid #262a3f;
  border-radius: 12px;
  padding: 16px;
}

.group-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.group-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.group-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  font-weight: 700;
}

.group-main {
  min-width: 0;
  flex: 1;
}

.group-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-instance {
  font-size: 12px;
  margin-top: 3px;
}

.group-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  color: #8b90a8;
  font-size: 11.5px;
}

.group-id {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #131522;
  color: #aeb3c7;
  word-break: break-all;
}

.group-switches {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.group-switches label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.group-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #262a3f;
  padding-top: 12px;
}

.groups-empty {
  grid-column: 1 / -1;
  padding: 35px;
  text-align: center;
  border: 1px dashed #363a51;
  border-radius: 12px;
  color: #8b90a8;
}

.participant-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.participant-row {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #212438;
  padding: 10px;
  border-radius: 9px;
}

.participant-row .muted {
  font-size: 12px;
  margin-top: 3px;
}

.participant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 700;
}

/* Tema claro do GHL */

html.ghl-light .group-card {
  background: #ffffff;
  border-color: #dedee5;
}

html.ghl-light .group-name {
  color: #20232d;
}

html.ghl-light .group-id {
  background: #f6f6f8;
  color: #626777;
}

html.ghl-light .group-actions {
  border-color: #dedee5;
}

html.ghl-light .groups-empty {
  border-color: #dedee5;
  color: #737786;
}

html.ghl-light .participant-row {
  background: #f6f6f8;
}

/* Responsividade */

@media (max-width: 760px) {
  .groups-grid {
    grid-template-columns: 1fr;
  }

  .groups-filters {
    grid-template-columns: 1fr;
  }

  .groups-toolbar {
    flex-direction: column;
  }
}
