/* Painel do usuario MCP — linha visual do LBC Fiscal Engine (appbar + drawer azul,
   superficie clara, cards arredondados). Tokens e medidas espelham o admin do
   Fiscal Engine para manter a familia visual entre os produtos LBC. */

:root {
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --primary-light: #e3f2fd;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #6b7684;
  --border: #e4e8ef;
  --danger: #c62828;
  --success: #2e7d32;
  --radius: 14px;
  --drawer-w: 260px;
  --bar-h: 60px;
  --shadow-login: 0 12px 32px rgba(13, 71, 161, .18);
  --shadow-1: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.06);
  --shadow-2: 0 6px 20px rgba(16,24,40,.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Roboto", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
}

/* ---------------- Login ----------------
   Look and feel da LANDING (gasmonitor.ai): navy profundo com glow, card
   translucido e acento teal. Estas classes sao EXCLUSIVAS da tela de login;
   o shell administrativo do painel segue no tema claro. */
.painel-login {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 82% 8%, rgba(37, 99, 235, .28), transparent 62%),
    radial-gradient(720px 460px at 8% 92%, rgba(45, 212, 191, .14), transparent 60%),
    linear-gradient(160deg, #050d1f 0%, #081831 55%, #0a1f40 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 410px;
  background: rgba(10, 25, 47, .72);
  border: 1px solid rgba(148, 183, 255, .16);
  border-radius: 16px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(2, 8, 20, .55);
  padding: 34px 32px 26px;
  animation: rise .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-card .brand { text-align: center; margin-bottom: 20px; }
.login-card .brand img { display: block; width: 64px; height: auto; margin: 0 auto 14px; }
.login-card .brand h1 { font-size: 22px; margin: 0; letter-spacing: .2px; color: #eaf2ff; }
.login-card .brand h1 .ai { color: #2dd4bf; }
.login-card .brand p { margin: 5px 0 0; color: #93a7c4; font-size: 13px; }
.login-badge {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  padding: 5px 12px; border-radius: 999px; font-size: 11.5px; color: #7fe7d9;
  border: 1px solid rgba(45, 212, 191, .35); background: rgba(45, 212, 191, .08);
}
.login-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #2dd4bf; }
.alert {
  border-radius: 10px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 18px;
  display: flex; gap: 8px; align-items: flex-start; line-height: 1.35;
}
.alert.error { background: rgba(198, 40, 40, .16); color: #ff9d94;
  border: 1px solid rgba(255, 138, 128, .25); }
.alert.info { background: rgba(37, 99, 235, .14); color: #9cc0ff;
  border: 1px solid rgba(37, 99, 235, .3); }
.painel-login label { display: block; font-size: 12.5px; color: #93a7c4; margin: 0 0 6px 2px; font-weight: 600; }
.field { position: relative; margin-bottom: 18px; }
/* type=text incluso: o botao do olho troca password -> text para revelar a
   senha, e sem ele o campo revelado perderia toda a formatacao */
.field input[type=email], .field input[type=password], .field input[type=text] {
  width: 100%; padding: 13px 14px; font-size: 15px; color: #eaf2ff;
  border: 1.5px solid rgba(148, 183, 255, .2); border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s; background: rgba(255, 255, 255, .05);
}
.field input::placeholder { color: #5b6f8e; }
.field input:focus { border-color: #2dd4bf; box-shadow: 0 0 0 3px rgba(45, 212, 191, .16);
  background: rgba(255, 255, 255, .07); }
/* autofill do Chrome pintaria o campo de branco no tema escuro */
.field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0d2240 inset; -webkit-text-fill-color: #eaf2ff;
  caret-color: #eaf2ff; transition: background-color 99999s ease-in-out 0s;
}
.input-wrap { position: relative; }
.input-wrap .reveal {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; background: transparent; cursor: pointer;
  color: #7e93b5; display: grid; place-items: center; border-radius: 8px; padding: 0;
}
.input-wrap .reveal:hover { background: rgba(255, 255, 255, .08); color: #eaf2ff; }
.input-wrap .reveal svg { width: 20px; height: 20px; display: block; }
.btn-primary {
  width: 100%; border: none; cursor: pointer; border-radius: 10px;
  padding: 13px 16px; font-size: 15px; font-weight: 700; color: #06263f;
  background: #2dd4bf; transition: background .15s, transform .05s;
  box-shadow: 0 8px 24px rgba(45, 212, 191, .25);
}
.btn-primary:hover { background: #5eead4; }
.btn-primary:active { transform: translateY(1px); }

/* Login processando: botao desligado + spinner (evita a sensacao de sistema travado) */
.btn-primary:disabled { opacity: 0.82; cursor: wait; transform: none; }
.btn-primary:disabled:hover { background: #2dd4bf; }
.btn-spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px;
  vertical-align: -2px; border-radius: 50%; border: 2px solid rgba(6, 38, 63, .35);
  border-top-color: #06263f; animation: spin 0.9s linear infinite; }
/* Acesso incluido para quem ja e cliente Gas Monitor (explicacao pedida pelo usuario) */
.login-card .foot-access {
  margin-top: 20px; padding: 12px 14px; border-radius: 10px; font-size: 12.5px;
  line-height: 1.55; color: #b9c9e2; text-align: left;
  border: 1px solid rgba(148, 183, 255, .16); background: rgba(37, 99, 235, .1);
}
.login-card .foot-access b { color: #eaf2ff; }
/* Visitante sem credencial: convite para conhecer o produto (landing) */
.login-card .foot-prospect {
  margin-top: 10px; padding: 12px 14px; border-radius: 10px; font-size: 12.5px;
  line-height: 1.55; color: #93a7c4; text-align: left;
  border: 1px solid rgba(148, 183, 255, .12); background: rgba(255, 255, 255, .03);
}
.login-card .foot-prospect b { color: #eaf2ff; }
.login-card .foot-prospect a { color: #2dd4bf; font-weight: 600; text-decoration: none; }
.login-card .foot-prospect a:hover { text-decoration: underline; }
.login-card .foot { text-align: center; margin-top: 14px; font-size: 11.5px; color: #5b6f8e; }

/* ---------------- Shell do painel ---------------- */
.painel-app { min-height: 100vh; background: var(--bg); }
.appbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--bar-h);
  background: var(--primary); color: #fff; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  box-shadow: var(--shadow-2);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: transparent; color: #fff; font-size: 20px; display: grid; place-items: center;
  transition: background .15s; text-decoration: none;
}
.icon-btn:hover { background: rgba(255,255,255,.15); }
.icon-btn svg { width: 20px; height: 20px; }
.appbar .title { font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.appbar .spacer { flex: 1; }
.appbar .user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.appbar .avatar {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.appbar .uname { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-pill { display: inline-flex; align-items: center; margin-left: 2px; padding: 2px 9px;
  border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; line-height: 1.6; background: #607d8b; color: #fff; white-space: nowrap; }
.plan-pill.plan-essential { background: #e3f2fd; color: #0d47a1; }
.plan-pill.plan-advanced  { background: #fb8c00; color: #fff; }
.plan-pill.plan-premium   { background: #2e7d32; color: #fff; }

.drawer {
  position: fixed; top: var(--bar-h); bottom: 0; left: 0; width: var(--drawer-w);
  background: var(--surface); border-right: 1px solid var(--border);
  z-index: 25; overflow-y: auto; transition: transform .25s cubic-bezier(.2,.8,.2,1);
  padding: 14px 12px; display: flex; flex-direction: column;
}
.drawer.closed { transform: translateX(calc(-1 * var(--drawer-w))); }
/* Nome do produto dentro do menu: so aparece no modo APP (mobile), quando some
   da appbar — la ele quebrava em 3 linhas por falta de largura. */
.drawer-brand { display: none; font-size: 16px; font-weight: 700; color: var(--primary);
  padding: 2px 10px 12px; border-bottom: 1px solid var(--border); margin: 0 0 4px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: #9aa5b1; font-weight: 700; margin: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 14.5px; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s; margin-bottom: 2px;
  border: none; background: transparent; width: 100%; text-align: left; font-family: inherit;
}
.nav-item .ni { width: 22px; height: 20px; display: grid; place-items: center; }
.nav-item .ni svg { width: 20px; height: 20px; display: block; }
.nav-item:hover { background: #f0f3f8; }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.drawer .drawer-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.nav-item.logoff { color: var(--danger); }
.nav-item.logoff:hover { background: #fdecea; }

.content { padding: calc(var(--bar-h) + 24px) 24px 40px; margin-left: var(--drawer-w);
  transition: margin-left .25s cubic-bezier(.2,.8,.2,1); }
.content.full { margin-left: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.placeholder-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 48px 24px; box-shadow: var(--shadow-1); text-align: center; color: var(--muted);
}
.placeholder-card .big { font-size: 40px; margin-bottom: 12px; }
.placeholder-card h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; }
.placeholder-card p { margin: 0; font-size: 13.5px; }

.secao { display: none; }
.secao.active { display: block; }

@media (max-width: 860px) {
  .content { margin-left: 0; }
  .drawer { transform: translateX(calc(-1 * var(--drawer-w))); box-shadow: var(--shadow-2); }
  .drawer.open-mobile { transform: none; }
  /* Modo APP: nome do produto migra da appbar (viraria 3 linhas) para o menu */
  .appbar .title { display: none; }
  .drawer-brand { display: block; }
  .appbar .uname { max-width: 110px; }
}

/* ---------------- Secao Consumo (estilo "Usage") ---------------- */
.usage-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 24px; box-shadow: var(--shadow-1); margin-bottom: 16px; }
.usage-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.usage-title { font-size: 15px; font-weight: 700; }
.usage-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.usage-numbers { font-size: 15px; color: var(--muted); }
.usage-numbers b { font-size: 26px; color: var(--text); font-weight: 800; letter-spacing: -.5px; }
.usage-bar { height: 10px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.usage-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.usage-fill.warn { background: #fb8c00; }
.usage-fill.danger { background: var(--danger); }
.usage-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px;
  color: var(--muted); font-size: 12.5px; }
.usage-tiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.usage-tile { background: #f8fafd; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.usage-tile .ut-value { font-size: 20px; font-weight: 800; }
.usage-tile .ut-label { color: var(--muted); font-size: 12px; margin-top: 4px; }
.usage-tile .ut-hint { color: #aeb6c2; }
.usage-explain { background: #e8f0fe; color: #174ea6; border-radius: 12px; padding: 14px 16px;
  font-size: 13px; line-height: 1.5; margin-bottom: 20px; }
.usage-explain p { margin: 0; }
.usage-explain p + p { margin-top: 10px; }

.consumo-detalhe { background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 24px; box-shadow: var(--shadow-1); }
.consumo-detalhe-head { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.consumo-detalhe-head h3 { margin: 0; font-size: 16px; }
.mes-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mes-tab { border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s; font-family: inherit; }
.mes-tab:hover { background: #f0f3f8; }
.mes-tab.active { background: var(--primary-light); color: var(--primary-dark); border-color: transparent; }

.day-bars-wrap { margin-bottom: 18px; }
.db-title { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #9aa5b1;
  font-weight: 700; margin-bottom: 8px; }
.day-bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.day-bars .db { flex: 1; min-width: 4px; background: var(--primary-light); border-radius: 3px 3px 0 0;
  position: relative; }
.day-bars .db.on { background: var(--primary); }
.day-bars .db:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%); background: #1f2933; color: #fff; font-size: 11px;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }

.tabela-wrap { overflow-x: auto; }
.tabela-consumo { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabela-consumo th { text-align: left; color: #9aa5b1; font-size: 11px; text-transform: uppercase;
  letter-spacing: .6px; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tabela-consumo td { padding: 9px 10px; border-bottom: 1px solid #f0f3f8; }
.tabela-consumo td.num, .tabela-consumo th.num { text-align: right; }
.tabela-consumo tr:last-child td { border-bottom: none; }
.tabela-consumo .vazio { text-align: center; color: var(--muted); padding: 22px; }

/* Historico de consultas (expansivel) */
.usage-tiles { grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); }
.historico-area { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.btn-historico { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--primary-dark); border-radius: 10px; padding: 9px 14px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-1);
  transition: background .15s; font-family: inherit; }
.btn-historico:hover { background: #f0f3f8; }
.btn-historico svg { width: 16px; height: 16px; }
.btn-historico.aberto { background: var(--primary-light); border-color: transparent; }
.btn-mais { margin-top: 12px; }
.historico-wrap { margin-top: 16px; }
.tabela-consumo td.nowrap { white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.tabela-consumo td.motivo { color: var(--muted); font-size: 12.5px; line-height: 1.4; }

/* Skeleton (shimmer) do card de cota: ativo ate a primeira carga de dados. */
.usage-card.skeleton .usage-sub, .usage-card.skeleton .usage-numbers,
.usage-card.skeleton .usage-meta span, .usage-card.skeleton .ut-value {
  background: linear-gradient(90deg,#eef1f6 25%,#e2e7ef 37%,#eef1f6 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
  color: transparent !important; border-radius: 8px;
}
.usage-card.skeleton .usage-numbers b { color: transparent; }
.usage-card.skeleton .usage-fill { background: transparent; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Icone (i) informativo nos cabecalhos: tooltip nativo via title. */
.info-i { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 5px;
  border-radius: 50%; background: #cfd8e3; color: #fff; font-size: 10px; font-weight: 800;
  font-style: normal; text-transform: lowercase; cursor: help; vertical-align: middle; }
.info-i:hover { background: var(--primary); }

/* Correcao: display do botao sobrepoe o [hidden] nativo; forca o sumico. */
.btn-historico[hidden] { display: none !important; }

/* Botao de acao do cabecalho (padrao .refresh do Fiscal Engine): icone + texto. */
.refresh { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--primary-dark); border-radius: 10px; padding: 9px 14px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-1);
  transition: background .15s; font-family: inherit; }
.refresh:hover { background: #f0f3f8; }
.refresh .rico, .refresh .bico { display: inline-grid; place-items: center; width: 16px;
  height: 16px; flex: none; font-size: 15px; line-height: 1; }
.refresh svg { width: 16px; height: 16px; display: block; }
.refresh.loading .rico { animation: spin 1s linear infinite; }
.refresh:disabled { cursor: default; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Linha de totais da tabela de ferramentas: MESMO formato do cabecalho da tabela
   (cinza, caixa alta, discreto), espelhando o th no rodape. */
.tabela-consumo tr.total td { border-top: 1px solid var(--border); border-bottom: none;
  background: transparent; color: #9aa5b1; font-size: 11px; text-transform: uppercase;
  letter-spacing: .6px; font-weight: 700; padding: 8px 10px; }

/* Empresas: badge de alerta (posto sem abastecer ha mais de 24h) e loading da celula. */
.badge-alerta { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
  background: #fdecea; color: var(--danger); border-radius: 999px; padding: 2px 8px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px; cursor: help; white-space: nowrap; }
.carregando-mini { color: #aeb6c2; font-size: 12px; font-style: italic; }

/* Empresas: campo de busca (filtro client-side sobre a lista carregada). */
.busca-empresas { position: relative; margin-bottom: 14px; max-width: 520px; }
.busca-empresas .busca-icone { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #9aa5b1; display: grid; place-items: center; pointer-events: none; }
.busca-empresas .busca-icone svg { width: 16px; height: 16px; }
.busca-empresas input { width: 100%; padding: 11px 14px 11px 38px; font-size: 14px;
  border: 1.5px solid #d5dbe2; border-radius: 10px; outline: none; background: var(--surface);
  transition: border-color .15s, box-shadow .15s; font-family: inherit; }
.busca-empresas input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,.15); }

/* ---------------- Secao Plano (cards de precos estilo Claude) ---------------- */
.planos-toggle { display: flex; gap: 6px; margin-bottom: 18px; }
.planos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  align-items: stretch; margin-bottom: 20px; }
@media (max-width: 980px) { .planos-grid { grid-template-columns: 1fr; } }

.plano-card { position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px 22px 22px; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.plano-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.plano-card.destaque { border: 2px solid var(--primary); box-shadow: var(--shadow-2); }
.plano-card.atual { background: #f8fbff; }

.plano-ribbon { position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; border-radius: 999px; padding: 3px 14px;
  font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  white-space: nowrap; }
.plano-ribbon.atual-ribbon { background: #2e7d32; top: auto; bottom: -11px; }

.plano-nome { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.plano-tagline { color: var(--muted); font-size: 12.5px; min-height: 34px; margin-bottom: 14px; }
.plano-preco .preco-valor { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.plano-preco .preco-periodo { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.plano-preco-sub { color: var(--muted); font-size: 12px; margin: 4px 0 16px; min-height: 15px; }

/* Toggle mensal/anual (anual e o padrao): mostra apenas o ciclo ativo (classe no .planos-grid). */
.planos-grid .ciclo-mensal, .planos-grid .ciclo-anual { display: none; }
.planos-grid[data-ciclo="mensal"] .ciclo-mensal { display: inline-block; }
.planos-grid[data-ciclo="anual"] .ciclo-anual { display: inline-block; }
.planos-grid[data-ciclo="mensal"] .plano-preco-sub.ciclo-mensal,
.planos-grid[data-ciclo="anual"] .plano-preco-sub.ciclo-anual { display: block; }

/* Bonus de migracao no card do plano superior (credito em tempo da contratacao vigente) */
.plano-bonus { background: #e8f5e9; color: var(--success); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; line-height: 1.45; margin: -6px 0 14px; }
.planos-grid[data-ciclo="mensal"] .plano-bonus.ciclo-mensal,
.planos-grid[data-ciclo="anual"] .plano-bonus.ciclo-anual { display: block; }

/* Regra do ciclo igual ou maior: p/ cliente anual, o CTA de migracao so existe no
   toggle Anual; no Mensal entra a nota explicativa no lugar do botao. */
.planos-grid[data-ciclo="anual"] .plano-cta.ciclo-anual { display: block; }
.planos-grid[data-ciclo="mensal"] .plano-nota-downgrade.ciclo-mensal { display: block; }

.plano-features { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }
.plano-features li { position: relative; padding: 6px 0 6px 26px; font-size: 13.5px;
  line-height: 1.4; border-bottom: 1px solid #f0f3f8; }
.plano-features li:last-child { border-bottom: none; }
.plano-features li::before { content: "✓"; position: absolute; left: 2px; top: 6px;
  color: var(--success); font-weight: 800; }

.plano-cta { width: 100%; border: none; cursor: pointer; border-radius: 10px;
  padding: 12px 16px; font-size: 14px; font-weight: 700; color: #fff;
  background: var(--primary); transition: background .15s; font-family: inherit; }
.plano-cta:hover { background: var(--primary-dark); }
.plano-cta.secundario { background: var(--surface); color: var(--primary-dark);
  border: 1.5px solid var(--primary); }
.plano-cta.secundario:hover { background: var(--primary-light); }
.plano-cta:disabled { background: #eef1f6; color: #9aa5b1; border: none; cursor: default; }

.plano-aviso-contratacao { background: #e8f0fe; color: #174ea6; border-radius: 12px;
  padding: 13px 16px; font-size: 13px; margin-bottom: 20px; }
.plano-aviso-contratacao[hidden] { display: none !important; }

.planos-limites h3, .planos-qa h3 { margin: 0 0 12px; font-size: 16px; }
.planos-limites { margin-bottom: 16px; }
.limites-lista { list-style: none; margin: 0; padding: 0; }
.limites-lista li { padding: 8px 0; font-size: 13.5px; line-height: 1.5; color: var(--text);
  border-bottom: 1px solid #f0f3f8; }
.limites-lista li:last-child { border-bottom: none; }

.planos-qa details { border-bottom: 1px solid #f0f3f8; }
.planos-qa details:last-child { border-bottom: none; }
.planos-qa summary { cursor: pointer; padding: 11px 4px; font-size: 14px; font-weight: 600;
  list-style: none; position: relative; padding-right: 26px; }
.planos-qa summary::-webkit-details-marker { display: none; }
.planos-qa summary::after { content: "+"; position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%); color: var(--primary); font-size: 18px; font-weight: 700; }
.planos-qa details[open] summary::after { content: "–"; }
.planos-qa details p { margin: 0 4px 14px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* ---------------- Secao Conecte sua AI ---------------- */
.conectar-endereco { margin-bottom: 16px; }
.conectar-texto { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 0 0 12px; }
.conectar-obs { margin: 14px 0 0; font-size: 12.5px; }
.copy-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f8fafd; border: 1.5px dashed #c3cfe0; border-radius: 12px; padding: 12px 14px; }
.copy-box code { font-family: "Consolas", "Courier New", monospace; font-size: 14.5px;
  font-weight: 700; color: var(--primary-dark); word-break: break-all; flex: 1; min-width: 220px; }
.copy-box .refresh.copiado { background: #e6f4ea; color: var(--success); border-color: #b7e0c0; }

.passos-lista { margin: 0; padding: 0 0 0 4px; list-style: none; counter-reset: passo; }
.passos-lista li { position: relative; padding: 10px 0 10px 42px; font-size: 13.5px;
  line-height: 1.55; border-bottom: 1px solid #f0f3f8; counter-increment: passo; }
.passos-lista li:last-child { border-bottom: none; }
.passos-lista li::before { content: counter(passo); position: absolute; left: 0; top: 10px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary-dark); font-weight: 800; font-size: 13px; display: grid; place-items: center; }

.conectar-privacidade { margin-top: 16px; border-left: 4px solid var(--primary); }
.conectar-privacidade h3 { display: flex; align-items: center; gap: 8px; }
.icone-privacidade { width: 18px; height: 18px; color: var(--primary); flex: none; }

/* Conecte sua AI: abas por plataforma e frase de validacao. */
.plat-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.plat-passos { display: none; }
.plat-passos.active { display: block; }
.frase-teste { background: #f8fafd; border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 10px 0 14px;
  font-size: 15px; font-weight: 700; color: var(--primary-dark); }
.conectar-qa { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 8px; }
.conectar-qa .frase-teste { font-size: 13.5px; margin: 8px 0; }

/* ---------------- Secao Dashboard (casa do servico) ---------------- */
.dash-bloco { margin-bottom: 16px; }
.dash-dados-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; }
.dash-dado { background: #f8fafd; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; transition: box-shadow .2s, transform .2s; }
.dash-dado:hover { box-shadow: var(--shadow-1); transform: translateY(-2px); }
.dd-bubble { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-light);
  display: grid; place-items: center; color: var(--primary); margin-bottom: 10px; }
.dd-bubble svg { width: 18px; height: 18px; }
.dd-titulo { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.dd-desc { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.dash-passos { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.dash-passo { flex: 1; min-width: 180px; background: #f8fafd; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 14px; text-align: center; }
.dp-num { width: 30px; height: 30px; border-radius: 50%; background: var(--primary);
  color: #fff; font-weight: 800; display: grid; place-items: center; margin: 0 auto 10px; }
.dp-titulo { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.dp-desc { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.dash-passo-seta { align-self: center; color: #c3cfe0; font-size: 22px; font-weight: 700; }
@media (max-width: 700px) { .dash-passo-seta { display: none; } }

.dash-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-ctas .plano-cta { width: auto; padding: 12px 26px; }

/* Observacao discreta dentro dos cards de dados do dashboard. */
.dd-obs { display: block; margin-top: 6px; font-size: 11px; color: #aeb6c2; font-style: italic; }

/* Videos de onboarding (Conecte sua AI): um por plataforma, carregados sob demanda. */
.video-onboarding { margin-bottom: 16px; }
.video-onboarding video { width: 100%; max-width: 720px; border-radius: 12px;
  border: 1px solid var(--border); box-shadow: var(--shadow-1); background: #000;
  display: block; }

/* Nota no card de plano inferior ao atual: downgrade e sempre automatico. */
.plano-nota-downgrade { text-align: center; color: #9aa5b1; font-size: 12px; line-height: 1.45;
  padding: 12px 8px; border: 1.5px dashed var(--border); border-radius: 10px; }

/* ---------------- Modal de pagamento PIX (sempre acima de tudo) ---------------- */
.pagamento-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(16,24,40,.55);
  display: grid; place-items: center; padding: 20px; }
.pagamento-overlay[hidden] { display: none !important; }
.pagamento-modal { position: relative; width: 100%; max-width: 440px; max-height: 92vh;
  overflow-y: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-2);
  padding: 24px 22px; }
.pagamento-modal h3 { margin: 0 0 4px; font-size: 17px; }
.pagamento-resumo { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.pagamento-fechar { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  border: none; background: transparent; color: #9aa5b1; font-size: 22px; cursor: pointer;
  border-radius: 8px; line-height: 1; }
.pagamento-fechar:hover { background: #f0f3f8; color: var(--text); }

.pagamento-etapa { text-align: center; }
.pagamento-etapa[hidden] { display: none !important; }
.pagamento-qr { width: 100%; max-width: 240px; border: 1px solid var(--border);
  border-radius: 12px; margin: 0 auto 12px; display: block; background: #fff; }
.pagamento-etapa .copy-box { text-align: left; }
.pagamento-status { display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-top: 14px; color: var(--muted); font-size: 12.5px; text-align: left; }

.pagamento-spinner { width: 34px; height: 34px; margin: 10px auto; border-radius: 50%;
  border: 3px solid #e2e7ef; border-top-color: var(--primary);
  animation: spin 0.9s linear infinite; }
.pagamento-spinner.mini { width: 16px; height: 16px; border-width: 2px; margin: 0; flex: none; }

.pagamento-final .pf-icone { width: 52px; height: 52px; border-radius: 50%; margin: 6px auto 10px;
  display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; }
.pagamento-final.ok .pf-icone { background: var(--success); }
.pagamento-final.erro .pf-icone { background: var(--danger); }
.pagamento-final h4 { margin: 0 0 6px; font-size: 16px; }
.pagamento-final p { color: var(--muted); font-size: 13.5px; margin: 0 0 6px; }

/* ---------------- Secao Pagamentos (historico do billing) ---------------- */
.pag-valor { color: var(--success); font-weight: 600; }
.pag-st-ok { color: var(--success); font-weight: 600; }
.pag-st-atencao { color: #b45309; font-weight: 600; }
.pag-st-neutro { color: var(--muted); }
.pag-st-falha { color: var(--danger); font-weight: 600; }
.pag-quando { color: var(--muted); font-weight: 400; font-size: 12px; }
.btn-retomar { white-space: nowrap; }

/* Sem escape lateral: clique no fundo nao fecha, apenas pulsa o modal (mcp_panel.js). */
.pagamento-modal.atencao { animation: pagamentoAtencao 0.35s ease; }
@keyframes pagamentoAtencao {
  0% { transform: scale(1); }
  40% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* Aviso do recebedor (WayPlus) no modal de pagamento: evita susto no app do banco. */
.pagamento-recebedor { display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: #e6f4ea; color: #1e5e2e; border-radius: 10px; padding: 11px 14px;
  font-size: 12.5px; line-height: 1.5; margin-top: 14px; }
.pagamento-recebedor svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
