:root {
  --wa-dark: #075E54;
  --wa-teal: #128C7E;
  --wa-green: #25D366;
  --wa-green-ink: #0b7a43;
  --wa-chat: #DCF8C6;
  --wa-blue: #34B7F1;
  --ink: #0f1f1b;
  --muted: #5a6b66;
  --line: #e4ebe8;
  --bg: #f4f7f6;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(7, 94, 84, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--wa-teal); }

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--wa-dark); color: #fff;
}
.topbar .brand { font-weight: 700; letter-spacing: .3px; color: #fff; text-decoration: none; display: flex; gap: 8px; align-items: center; }
.topbar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--wa-green); box-shadow: 0 0 0 4px rgba(37,211,102,.25); }
.topbar nav a { color: #d7efe9; text-decoration: none; margin-left: 16px; font-size: 14px; }
.topbar nav a:hover { color: #fff; }

/* Buttons */
.btn {
  display: inline-block; border: none; cursor: pointer; font: inherit; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--wa-green); color: #063; color: #04371f; }
.btn-primary:hover { background: #1fc65c; }
.btn-light { background: #fff; color: var(--wa-dark); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
.btn-block { display: block; width: 100%; }
.btn-google { background:#fff; color:#3c4043; border:1px solid #dadce0; display:flex; gap:10px; align-items:center; justify-content:center; }

/* Hero / landing */
.hero {
  background: linear-gradient(135deg, var(--wa-dark) 0%, var(--wa-teal) 50%, var(--wa-green) 100%);
  color: #fff; padding: 72px 16px;
}
.hero h1 { font-size: clamp(28px, 5vw, 46px); margin: 0 0 14px; line-height: 1.1; }
.hero p { font-size: 18px; max-width: 620px; opacity: .95; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }

.features { padding: 48px 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Login split with WhatsApp-green gradient */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.auth .pane-visual {
  background: linear-gradient(135deg, var(--wa-dark) 0%, var(--wa-teal) 45%, var(--wa-green) 100%);
  color: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center;
}
.auth .pane-visual h1 { font-size: 40px; margin: 0 0 12px; }
.auth .pane-visual p { font-size: 17px; opacity: .95; max-width: 420px; }
.auth .pane-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth .formbox { width: 100%; max-width: 360px; }
.auth .formbox h2 { margin: 0 0 6px; }
.auth .formbox .sub { color: var(--muted); margin: 0 0 24px; }

label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=url] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; background: #fbfdfc;
}
input:focus { outline: none; border-color: var(--wa-green); box-shadow: 0 0 0 3px rgba(37,211,102,.18); }

.divider { display:flex; align-items:center; gap:12px; color:var(--muted); margin:18px 0; font-size:13px; }
.divider::before, .divider::after { content:""; height:1px; background:var(--line); flex:1; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.flash.error { background: #fde8e8; color: #9b1c1c; }
.flash.info { background: var(--wa-chat); color: #1b5e20; }

/* App */
.page { padding: 28px 16px 60px; } /* mantém a margem lateral do .container (telemóvel) */
.page h1 { margin: 0 0 4px; }
.page .muted { color: var(--muted); margin-top: 0; }
.list { display: grid; gap: 14px; margin-top: 18px; }
.nexa-row {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:18px 20px; box-shadow:var(--shadow); text-decoration:none; color:inherit;
}
.nexa-row:hover { border-color: var(--wa-green); }
.badge { font-size:12px; font-weight:700; padding:4px 10px; border-radius:999px; }
.badge.ok { background:var(--wa-chat); color:#1b5e20; }
.badge.warn { background:#fff3cd; color:#8a6d00; }
.badge.off { background:#eceff1; color:#546e7a; }

.qr-box { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:20px; text-align:center; box-shadow:var(--shadow); }
.qr-box img { width:260px; height:260px; image-rendering: pixelated; }

table { width:100%; border-collapse: collapse; background:#fff; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
th, td { text-align:left; padding:12px 16px; border-bottom:1px solid var(--line); font-size:14px; }
th { background:#f0f5f3; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.4px; }

.footer { color: var(--muted); font-size: 13px; text-align:center; padding: 30px 16px; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .pane-visual { min-height: 220px; padding: 36px 28px; }
}

/* Assistant form */
.assistant-form .card { margin-bottom: 18px; }
.assistant-form h3 { margin-top: 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
select { width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: #fbfdfc; }
select:focus { outline: none; border-color: var(--wa-green); box-shadow: 0 0 0 3px rgba(37,211,102,.18); }
textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: #fbfdfc; resize: vertical; }
textarea:focus { outline: none; border-color: var(--wa-green); box-shadow: 0 0 0 3px rgba(37,211,102,.18); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1.5px solid var(--line);
        border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; background: #fff; }
.chip input { accent-color: var(--wa-green); width: 18px; height: 18px; margin: 0; flex: none; }
.chip:has(input:checked) { border-color: var(--wa-green); background: var(--wa-chat); color: #075E54; font-weight: 600; }
.chip:has(input[type=checkbox]:not(:checked)) { color: var(--muted, #6b7b76); }
.instructions { background: #0f1f1b; color: #dcf8c6; padding: 18px 20px; border-radius: var(--radius);
                white-space: pre-wrap; font-size: 13px; line-height: 1.5; overflow-x: auto; }

/* Presets */
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.preset-card { display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
               border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fbfdfc; }
.preset-card:hover { border-color: var(--wa-green); }
.preset-card .muted { font-size: 13px; margin: 4px 0 0; }
.preset-card .btn { align-self: flex-start; }

/* Preset ativo (destacado a verde) */
.preset-card.active { border-color: var(--wa-green); background: var(--wa-chat); box-shadow: 0 0 0 3px rgba(37,211,102,.18); }
.preset-card .badge { margin-left: 6px; }

/* Listas compactas e editores */
.mini-list { list-style: none; padding: 0; margin: 6px 0 12px; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-list li:last-child { border-bottom: none; }
.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table th { background: transparent; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.schedule-table td { border-bottom: 1px solid var(--line); padding: 10px 6px; vertical-align: middle; }
.schedule-table input[type=time] { width: 110px; padding: 8px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; }
.service-row { display: grid; grid-template-columns: 1fr 110px 120px auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.service-row input:not([type=checkbox]) { padding: 10px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; width: 100%; }
.service-head { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
@media (max-width: 560px) { .service-row { grid-template-columns: 1fr 1fr; } .service-head { display: none; } }

/* Preset meta e ações */
.preset-meta { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.preset-actions { display: flex; align-items: center; gap: 12px; }
.btn-link { background: none; border: none; color: var(--wa-teal); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* Botão de aviso (ex.: arquivar) */
.btn-warn { background: #fff3cd; color: #8a6d00; border: 1.5px solid #f0d473; }
.btn-warn:hover { background: #ffe9a8; }

/* Detalhes do preset (disclosure, mantém o cartão limpo) */
.preset-details { margin-top: 6px; }
.preset-details > summary { cursor: pointer; color: var(--wa-teal); font-size: 13px; font-weight: 600; list-style: none; }
.preset-details > summary::-webkit-details-marker { display: none; }
.preset-details > summary::before { content: "▸ "; }
.preset-details[open] > summary::before { content: "▾ "; }
.preset-details .preset-meta:first-of-type { margin-top: 6px; }

/* Marcações */
.booking-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.booking-info { display: flex; flex-direction: column; gap: 2px; }
.booking-actions { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.reschedule > summary { list-style: none; }
.reschedule > summary::-webkit-details-marker { display: none; }
.reschedule form { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.reschedule input[type=datetime-local] { padding: 9px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; }

/* Resgate de código promocional */
.redeem-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.redeem-form input { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; min-width: 220px; }

/* ---- Dashboard da NeXa (responsivo) ---- */
.page .card { margin-bottom: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* WhatsApp em destaque */
.wa-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wa-status { display: flex; align-items: center; gap: 12px; }
.wa-status .wa-dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }
.wa-label { font-size: 18px; font-weight: 700; }
.wa-ligado    .wa-dot { background: var(--wa-green); box-shadow: 0 0 0 4px rgba(37,211,102,.25); }
.wa-ligado    .wa-label { color: var(--wa-green-ink); }
.wa-desligado .wa-dot { background: #b0bec5; }
.wa-atencao   .wa-dot { background: #f1b100; box-shadow: 0 0 0 4px rgba(241,177,0,.22); }
.wa-atencao   .wa-label { color: #8a6d00; }
.wa-ligar     .wa-dot { background: var(--wa-blue); box-shadow: 0 0 0 4px rgba(52,183,241,.22); }
.wa-actions { min-width: 180px; }

.sub-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sub-actions form { flex: 1 1 160px; }

@media (max-width: 560px) {
  .wa-card { flex-direction: column; align-items: stretch; }
  .wa-actions { min-width: 0; width: 100%; }
  .btn { padding: 13px 20px; }          /* alvos de toque maiores */
  .sub-actions form { flex-basis: 100%; }
  h1 { font-size: 26px; }
}

/* ---------- Textos legais ---------- */
.legal { max-width: 760px; line-height: 1.6; }
.legal h1 { margin-bottom: 4px; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.legal th, .legal td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.legal blockquote { margin: 0; padding: 8px 14px; border-left: 3px solid var(--wa-teal); background: var(--card); }
.footer a { color: inherit; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { margin-top: 3px; width: auto; }

/* ---------- Gestão da plataforma ---------- */
.admin .alarms { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.alarm { padding: 8px 12px; border-radius: 10px; font-size: 14px; border-left: 4px solid; }
.alarm-high { background: #fdecea; border-color: #c62828; }
.alarm-medium { background: #fff6e0; border-color: #e6a100; }
.alarm-low { background: var(--bg); border-color: var(--line); color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 700; margin: 2px 0; }
.kpi-of { font-size: 16px; color: var(--muted); font-weight: 400; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtable th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); }
.rtable td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 640px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .rtable td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .rtable td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  .rtable td:first-child { display: block; text-align: left; }
  .rtable td:first-child::before { content: none; }
}

/* Lista com janela fixa (≈ 6 linhas) e scroll quando há mais */
.scroll-list { max-height: 228px; overflow-y: auto; padding-right: 6px; overscroll-behavior: contain; }
.count-badge { display: inline-block; min-width: 22px; padding: 1px 8px; margin-left: 6px; border-radius: 999px;
  background: var(--line); color: var(--ink, inherit); font-size: 13px; font-weight: 600; vertical-align: middle; text-align: center; }

/* Acordeão (configuração do assistente): título + resumo do estado atual; abre ao clicar */
details.acc { padding: 0; }
details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px;
  padding: 18px 22px; flex-wrap: wrap; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.acc[open] > summary::after { transform: rotate(180deg); }
.acc-title { font-weight: 700; font-size: 17px; }
.acc-sum { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
details.acc[open] > summary .acc-sum { display: none; }
details.acc.dirty > summary .acc-title::after { content: " • por gravar"; color: var(--wa-green); font-size: 13px; font-weight: 600; }
.acc-body { padding: 0 22px 22px; }
.save-bar { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg, #fff) 35%); z-index: 5; }

/* Resultados da assistente na página da NeXa */
.insight { border-left: 4px solid var(--wa-green); }
.insight-main { font-size: 17px; line-height: 1.5; }
.insight-value { display: inline-block; margin-left: 6px; font-weight: 700; font-size: 20px; color: var(--wa-green); white-space: nowrap; }
.insight-sub { font-size: 13px; margin-top: 4px; }

/* Próxima ação: sugestões para aprovar */
.suggestion textarea { margin-top: 4px; }
.suggestion-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.suggestion-cta { display: block; text-decoration: none; color: inherit; border-left: 4px solid #f5b301; }
.suggestion-cta:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }

/* Versão no rodapé (suporte: saber que código está a correr) */
.footer .version { font-size: 10px; color: var(--wa-green); font-weight: 600; margin-left: 4px; letter-spacing: .02em; }

/* Mensagens automáticas */
.outbound-filters { gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
a.chip { text-decoration: none; color: inherit; font-size: 13px; }
a.chip.on { border-color: var(--wa-green); background: var(--wa-chat); font-weight: 600; }
.outbound-list.scroll-list { max-height: 480px; }
.outbound-origin { font-size: 12px; }
.outbound-when { text-align: right; white-space: nowrap; font-size: 13px; }
.text-warn { color: #8a6d00; font-weight: 600; }
.service-row .price-note { grid-column: 1 / -1; font-size: 14px; }

/* Landing: «Como funciona» */
.how { padding: 64px 0; }
.how-eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wa-green-ink); }
.how-title { margin: 0; max-width: 22ch; font-size: clamp(26px, 4.2vw, 40px); line-height: 1.12; letter-spacing: -.02em; }
.how-lead { margin: 14px 0 0; max-width: 60ch; font-size: 17px; color: var(--muted); }
.how-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: center; margin-top: 40px; }
.how-chat { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 18px; background: #e8efec; border: 1px solid var(--line); min-width: 0; }
.how-chat-tag { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.how-msg { max-width: 85%; padding: 9px 13px; border-radius: 12px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.how-msg-in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.how-msg-out { align-self: flex-end; background: var(--wa-chat); border-top-right-radius: 4px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; min-width: 0; }
.how-steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; align-items: start; }
.how-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--wa-green-ink); color: #fff; font-weight: 800; }
.how-steps h3 { margin: 6px 0 4px; font-size: 18px; }
.how-steps p { margin: 0; color: var(--muted); }
.how-subtitle { margin: 64px 0 18px; font-size: 24px; letter-spacing: -.01em; }
/* Cartão em destaque a toda a largura (1 + 6 cartões: a grelha de 3 fica sem órfãos) */
.how-feature { grid-column: 1 / -1; display: flex; gap: 18px; align-items: center; border: 1.5px solid var(--wa-green); background: #f3fcf5; }
.how-feature h3 { margin-top: 0; }
.how-feature p { margin-bottom: 0; }
.how-feature-icon { font-size: 40px; line-height: 1; flex-shrink: 0; }
@media (max-width: 560px) { .how-feature { align-items: flex-start; gap: 14px; } .how-feature-icon { font-size: 32px; } }
.how-trust { margin: 24px 0 0; font-size: 15px; color: var(--muted); }  /* largura dos cartões */
.how-cta { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; justify-content: space-between; }
.how-cta > div { flex: 1 1 280px; min-width: 0; }
.how-cta h2 { margin: 0 0 6px; font-size: 22px; }
@media (max-width: 760px) {
  .how { padding: 44px 0; }
  .how-split { grid-template-columns: minmax(0, 1fr); gap: 30px; margin-top: 30px; }
  .how-cta .btn { width: 100%; }
}

/* Landing: «Planos» */
.plans { padding: 8px 0 64px; }
.plan { margin-top: 32px; padding: 28px; }
.plan-head h3 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.plan-tagline { margin: 6px 0 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.plan-audience { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.plan-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; margin: 22px 0; }
.plan-price { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.plan-price.best { border-color: var(--wa-green); background: #f3fcf5; }
.plan-price-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.plan-amount { margin: 6px 0 4px; font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-amount span { font-size: 16px; font-weight: 500; color: var(--muted); }
.plan-price-note { margin: 0; font-size: 14px; color: var(--muted); }
.plan-features, .plan-terms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-features { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.plan-features li { position: relative; padding-left: 26px; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--wa-green-ink); }
.plan-terms { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.plan-terms strong { color: var(--ink); }
.plan-cta { margin-top: 22px; }
@media (max-width: 760px) {
  .plan { padding: 20px; }
  .plan-cta { width: 100%; }
}

/* Botões de subscrição com o preço, discreto */
.sub-actions .btn small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; opacity: .75; }
.sub-plan-name { margin: 14px 0 0; font-weight: 700; }

/* Subscrição por link (aviso de fim do teste) */
.subscribe { max-width: 760px; }
.subscribe-lead { max-width: 60ch; }
.subscribe .plan { margin-top: 20px; }
.subscribe .plan-head h2 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.subscribe .plan-price .btn { margin-top: 10px; }
.sub-plans-link { margin: 8px 0 0; font-size: 13px; text-align: center; }

/* Gestão: planos */
.admin-plans { margin-top: 14px; }
.plan-edit { border-top: 1px solid var(--line); padding: 10px 0; }
.plan-edit summary { cursor: pointer; padding: 4px 0; }
.plan-edit form { margin-top: 10px; }
.plan-edit label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.plan-edit input[type=text], .plan-edit textarea { display: block; width: 100%; margin-top: 4px; padding: 9px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); }
.plan-edit label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.plan-edit-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.plan-edit fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; }
.plan-edit legend { font-weight: 700; padding: 0 4px; }

/* Atendimentos e integrações (issue #3) */
.visit-list li { align-items: center; }
.visit-state { text-align: right; white-space: nowrap; font-size: 14px; }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.visit-form label:not(.chip) { display: block; margin: 14px 0 6px; font-weight: 600; }
.visit-form .chips { margin-bottom: 4px; }
.visit-form .btn-link { margin-left: 12px; }
.field-hint { font-size: 13px; margin: 6px 0 0; }
.visit-field.off { opacity: .6; }
.visit-field-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.visit-field-edit input[type=text] { flex: 1 1 200px; }
.new-key { border: 1.5px solid var(--wa-green); background: #f3fcf5; }
.key-value { display: block; padding: 10px 12px; background: #fff; border: 1px dashed var(--wa-green); border-radius: 8px; word-break: break-all; user-select: all; }
.key-form { margin-top: 12px; flex-wrap: nowrap; }
.key-form input { flex: 1; }
.api-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 14px; }
.api-table td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.api-table td:first-child { width: 48px; font-weight: 700; }
.api-table code { word-break: break-all; }
.api-example { background: #0f1f1b; color: #dcf8c6; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; overflow-x: auto; white-space: pre; }
@media (max-width: 560px) {
  .key-form { flex-wrap: wrap; }
  .key-form .btn { width: 100%; }
}
.mini-list li > .badge, .mini-list li > form { align-self: center; flex-shrink: 0; }

/* Teste grátis pedido no site (issue #20) */
.plans-trial { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.plans-trial p { margin: 0; font-size: 14px; }
@media (max-width: 560px) { .plans-trial { justify-content: stretch; } .plans-trial .btn { width: 100%; } .plans-trial p { width: 100%; text-align: center; } }
.trial-request { max-width: 640px; }
.trial-lead { max-width: 60ch; }
.trial-form label:not(.check) { display: block; margin: 14px 0 6px; font-weight: 600; }
.trial-form label.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: 14px; line-height: 1.45; }
.trial-form label.check input { margin-top: 3px; accent-color: var(--wa-green); flex-shrink: 0; }
.trial-form .btn-block { margin-top: 20px; }
.trial-names { margin-top: 2px; }
.trial-warning { margin: 12px 0 4px; padding: 12px 14px; border-radius: 10px; background: #fff3cd; border: 1.5px solid #f0d473; color: #5c4a00; font-size: 14px; line-height: 1.5; }
.trial-sent { border: 1.5px solid var(--wa-green); background: #f3fcf5; }
.trial-sent h2 { margin-top: 0; font-size: 20px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.qr-warning { max-width: 520px; margin: 0 auto 12px; text-align: left; }
#leads summary, #bloqueios summary { cursor: pointer; list-style: none; }
#leads summary::-webkit-details-marker, #bloqueios summary::-webkit-details-marker { display: none; }
#leads summary h3::before, #bloqueios summary h3::before { content: "▸ "; color: var(--muted); }
#leads details[open] summary h3::before, #bloqueios details[open] summary h3::before { content: "▾ "; }
.leads-tools { margin: 14px 0 6px; }
.leads-search input { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; font: inherit; font-size: 14px; min-width: 220px; }
.pager { margin-top: 12px; }
.block-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.block-form select { width: auto; }
.block-form input { flex: 1 1 180px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; }

/* Limite mensal de mensagens (issue #18) */
.month-usage { margin-top: 14px; font-size: 14px; }
.month-usage p { font-size: 13px; margin: 6px 0 0; }
.month-bar { height: 8px; border-radius: 999px; background: var(--line); margin-top: 6px; overflow: hidden; }
.month-bar span { display: block; height: 100%; border-radius: 999px; background: var(--wa-green); }
.month-warning .month-bar span { background: #e0a800; }
.month-tolerance .month-bar span, .month-blocked .month-bar span { background: #d9534f; }
.month-blocked strong { color: #9b1c1c; }
.plan-limit { margin: 6px 0 0; font-weight: 600; color: var(--wa-green-ink); }

/* Plano Custom (issue #17) */
.plan-contact { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.plan-contact-text { flex: 1 1 420px; }
.plan-contact h3 { margin: 0; font-size: 22px; }
.plan-contact .plan-features { margin-top: 14px; }
.plan-upsell { border: 1.5px solid var(--wa-green); background: #f3fcf5; }
.plan-override { margin-top: 6px; }
.plan-override select { width: auto; padding: 4px 8px; font-size: 12px; border-radius: 8px; }
.plan-contact .plan-cta { border: 1.5px solid var(--wa-green); margin-top: 0; }
.service-row .price-note { grid-column: 1 / -2; }
.service-remove { justify-self: end; font-size: 13px; color: #9b1c1c; }

/* Auditoria de marcações (issue #29) */
.audit-form label { display: block; margin-bottom: 10px; font-weight: 600; }
.audit-form input, .audit-form select { margin-top: 4px; }
.audit-booking { margin-top: 14px; }
.audit-ids { font-size: 12px; word-break: break-all; }
.audit-sub { margin: 16px 0 4px; font-size: 14px; }
.audit-changes .audit-when { text-align: right; font-size: 12px; white-space: nowrap; }
