/* Painel no visual escuro com menu lateral (design recebido pelo Eder em 15/11/2026).
   Carregado depois de painel.css: para voltar ao visual anterior, basta tirar este arquivo do painel.html. */

/* ---------- Cores-base ---------- */
body.painel.tema-escuro {
  --fundo: #0C0D11; --branco: #15171c; --linha: #262932; --tinta: #F5F5F5; --suave: #9aa0a8;
  --marca: #F5F5F5; --marca-escura: #c9ccd2; --marca-texto: #0C0D11;
  --aviso-tinta: #fcd34d; --reservado: #fbbf24; --vendido: #ff6b76;
  --sup: #15171c; --sup2: #1b1e25; --borda: #262932;
  background: #0C0D11; color: #F5F5F5;
}
body.tema-escuro h1, body.tema-escuro h2, body.tema-escuro h3, body.tema-escuro legend { color: #F5F5F5; }
body.tema-escuro a { color: inherit; }
body.tema-escuro .dica, body.tema-escuro .sub { color: #9aa0a8; }

/* ---------- Estrutura: menu lateral + área ---------- */
body.tema-escuro #app:not([hidden]) { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.painel-lateral { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #0e0f13; border-right: 1px solid #1d2027; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px; }
.painel-lateral .painel-marca { padding: 0 8px 6px; }
.menu-lateral { display: grid; gap: 4px; }
.menu-lateral button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; color: #b7bac1; font: 600 14.5px Inter, sans-serif; padding: 11px 12px; border-radius: 10px; cursor: pointer; text-align: left; position: relative; }
.menu-lateral button svg, .painel-inferior button svg, .folha-inferior button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.menu-lateral button:hover { background: #17191f; color: #fff; }
.menu-lateral button[aria-current="page"] { background: linear-gradient(90deg, #b3121f, #E11D2E); color: #fff; box-shadow: 0 6px 18px rgba(225, 29, 46, .25); }
.menu-lateral button[hidden], .painel-inferior button[hidden], .folha-inferior button[hidden] { display: none; }
.selo-aba { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #E11D2E; color: #fff; font: 700 11px Inter, sans-serif; font-style: normal; display: inline-grid; place-items: center; }
.menu-lateral button[aria-current="page"] .selo-aba { background: #fff; color: #E11D2E; }
.lateral-cartao { margin-top: auto; border-radius: 14px; padding: 16px; background: radial-gradient(120% 90% at 100% 0%, #2a1013 0%, #15171c 60%); border: 1px solid #23262e; display: grid; gap: 2px; }
.lateral-cartao b { font: 800 16px Montserrat, sans-serif; color: #fff; }
.lateral-cartao span { font: 700 14px Montserrat, sans-serif; color: #fff; }
.lateral-cartao small { color: #9aa0a8; font-size: 12px; margin-top: 6px; }
.lateral-cartao::after { content: ""; width: 34px; height: 3px; background: #E11D2E; margin-top: 10px; }
.painel-principal { min-width: 0; }
body.tema-escuro .painel-topo { position: sticky; top: 0; z-index: 8; background: rgba(12, 13, 17, .92); backdrop-filter: blur(8px); border-bottom: 1px solid #1d2027; }
body.tema-escuro .painel-linha { padding: 12px 24px; }
.topo-marca { display: none; }
body.tema-escuro .painel-area { padding: 22px 24px 48px; }
.painel-inferior, .folha-inferior { display: none; }
body.modo-entrada .painel-lateral, body.modo-entrada .painel-inferior { display: none !important; }
body.modo-entrada #app:not([hidden]) { display: block; }

/* ---------- Cartões, caixas e textos ---------- */
body.tema-escuro .caixa, body.tema-escuro .kpi, body.tema-escuro .linha-carro, body.tema-escuro .config-corpo,
body.tema-escuro .cartao-contato, body.tema-escuro .form-painel fieldset, body.tema-escuro .limite-plano, body.tema-escuro .token-capi,
body.tema-escuro .cartao-plano, body.tema-escuro .linha-admin, body.tema-escuro .adicionar-membro, body.tema-escuro .tema-opcao,
body.tema-escuro .evento-meta, body.tema-escuro .envio-meta, body.tema-escuro .editor-lateral, body.tema-escuro .editor-celular,
body.tema-escuro .vazio, body.tema-escuro .resultados-grade .caixa, body.tema-escuro .kpi-forte {
  background: linear-gradient(180deg, #17191f, #121419); border-color: #23262e; color: #F5F5F5; box-shadow: none;
}
body.tema-escuro .painel-area .caixa h2::before { background: #E11D2E; }
body.tema-escuro .evento-meta.servidor { background: #121419; }
body.tema-escuro .kpi-icone { background: #23262e; }
body.tema-escuro .kpi-corpo b, body.tema-escuro .kpi b { color: #fff; }
body.tema-escuro .contador { background: #23262e; color: #c9ccd2; }
body.tema-escuro .token-status code { background: #23262e; color: #F5F5F5; }
body.tema-escuro .token-status.ok { color: #4ade80; }
body.tema-escuro .linha-texto small, body.tema-escuro small { color: inherit; }
body.tema-escuro .linha-texto small, body.tema-escuro .cartao-lead small, body.tema-escuro .tarefa small { color: #9aa0a8; }

/* ---------- Campos, botões e links ---------- */
body.tema-escuro.painel select, body.tema-escuro.painel input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), body.tema-escuro.painel textarea {
  background: #0f1014; color: #F5F5F5; border-color: #2c2f37;
}
body.tema-escuro.painel input::placeholder, body.tema-escuro.painel textarea::placeholder { color: #6b7079; }
body.tema-escuro.painel select option { background: #15171c; color: #F5F5F5; }
body.tema-escuro.painel input:focus, body.tema-escuro.painel select:focus, body.tema-escuro.painel textarea:focus { outline: 2px solid #E11D2E; outline-offset: 1px; }
body.tema-escuro.painel input[disabled] { color: #9aa0a8; }
body.tema-escuro.painel .botao { background: #F5F5F5; color: #0C0D11; border-color: #F5F5F5; }
body.tema-escuro.painel .botao:hover { background: #fff; }
body.tema-escuro.painel .botao.perigo { background: #E11D2E; color: #fff; border-color: #E11D2E; }
body.tema-escuro.painel .botao-claro { background: transparent; color: #F5F5F5; border-color: #3a3e48; }
body.tema-escuro.painel .botao-claro:hover { border-color: #F5F5F5; }
body.tema-escuro .link-acao { color: #F5F5F5; }
body.tema-escuro .link-acao.perigo { color: #ff6b76; }
body.tema-escuro .campo-prefixo { background: #0f1014; border-color: #2c2f37; }
body.tema-escuro .campo-prefixo span { background: #1b1e25; color: #9aa0a8; }
body.tema-escuro .foto-botoes button { background: #1b1e25; color: #F5F5F5; border-color: #2c2f37; }
body.tema-escuro .interruptor span { background: #3a3e48; }
body.tema-escuro .rotulo-campo, body.tema-escuro .form-painel label { color: #c9ccd2; }

/* ---------- Avisos e etiquetas ---------- */
body.tema-escuro .alerta { background: rgba(245, 158, 11, .1); color: #fcd34d; border-left: 4px solid #f59e0b; }
body.tema-escuro .alerta .link-acao { color: #fff; }
body.tema-escuro .alerta-vez { background: rgba(225, 29, 46, .12); color: #ffb3b9; border-left-color: #E11D2E; }
body.tema-escuro .prazo.atrasada { background: rgba(225, 29, 46, .16); color: #ff8a94; }
body.tema-escuro .prazo.hoje { background: rgba(245, 158, 11, .16); color: #fbbf24; }
body.tema-escuro .prazo.futura { background: rgba(34, 197, 94, .14); color: #4ade80; }
body.tema-escuro .prazo.sem { background: #23262e; color: #9aa0a8; }
body.tema-escuro .etiqueta-reservado, body.tema-escuro .rk-nome small { background: rgba(245, 158, 11, .16); color: #fbbf24; }
body.tema-escuro .editor-estado.ok, body.tema-escuro .pedido-enviado { background: rgba(34, 197, 94, .12); color: #4ade80; }
body.tema-escuro .editor-estado.erro { background: rgba(225, 29, 46, .14); color: #ff8a94; }
body.tema-escuro .editor-estado.ligando, body.tema-escuro .previa-aviso { background: rgba(245, 158, 11, .12); color: #fcd34d; }
body.tema-escuro .plano-aviso { background: rgba(34, 197, 94, .12); color: #4ade80; }
body.tema-escuro .plano-aviso.atencao { background: rgba(245, 158, 11, .12); color: #fbbf24; }
body.tema-escuro .plano-aviso.urgente, body.tema-escuro .plano-aviso.vencido { background: rgba(225, 29, 46, .14); color: #ff8a94; }
body.tema-escuro .plano-aviso.sem { background: #1b1e25; color: #9aa0a8; }
body.tema-escuro .limite-barra, body.tema-escuro .rk-barra, body.tema-escuro .ativ-trilho, body.tema-escuro .etapa-trilho, body.tema-escuro .funil-trilho { background: #23262e; }
body.tema-escuro .limite-barra i, body.tema-escuro .rk-barra i { background: #F5F5F5; }
body.tema-escuro .ranking-carros li:first-child .rk-barra i, body.tema-escuro .etapa-barra { background: #E11D2E; }
body.tema-escuro .limite-plano.cheio { background: rgba(225, 29, 46, .1); border-color: #E11D2E; }
body.tema-escuro .confirmar-exclusao { background: rgba(225, 29, 46, .08); }

/* ---------- Hoje ---------- */
body.tema-escuro .tarefa { background: #15171c; border-color: #23262e; color: #F5F5F5; }
body.tema-escuro .tarefa:hover { background: #1b1e25; }
body.tema-escuro .tarefa-avatar { background: #F5F5F5; color: #0C0D11; }

/* ---------- Pipeline (CRM) ---------- */
body.tema-escuro .coluna { background: #111317; border: 1px solid #1d2027; }
body.tema-escuro .coluna.destino { background: #1b1e25; outline-color: #E11D2E; }
body.tema-escuro .cartao-lead { background: #17191f; border-color: #262932; color: #F5F5F5; }
body.tema-escuro .cartao-lead:hover { border-color: #3a3e48; }
body.tema-escuro .na-vez { background: #23262e; color: #c9ccd2; }
body.tema-escuro .na-vez b { color: #fff; }
body.tema-escuro .historico li { border-color: #23262e; }

/* ---------- Interesses e estoque ---------- */
body.tema-escuro .compativeis li { background: rgba(34, 197, 94, .07); border-color: rgba(34, 197, 94, .25); }
body.tema-escuro .ranking-carros li:nth-child(odd) { background: #17191f; }
body.tema-escuro .rk-pos { background: #23262e; color: #fff; }
body.tema-escuro .ativacao-forte li:not(.feito) { background: rgba(225, 29, 46, .08); }
body.tema-escuro .ativ-resolver { background: #F5F5F5; color: #0C0D11; }

/* ---------- Formulário (editor em mapa) ---------- */
body.tema-escuro .editor-rolagem { background-color: #0f1014; border-color: #23262e; background-image: radial-gradient(#23262e 1px, transparent 1px); }
body.tema-escuro .no { background: #17191f; border-color: #2c2f37; color: #F5F5F5; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
body.tema-escuro .no.selecionado { border-color: #E11D2E; }
body.tema-escuro .porta { background: #0f1014; border-color: #4a4f5a; color: #9aa0a8; }
body.tema-escuro .editor-linhas path, body.tema-escuro #ed-linhas path { stroke: #9aa0a8; }

/* ---------- Configurações ---------- */
body.tema-escuro .config-menu button { background: transparent; border-color: transparent; color: #F5F5F5; }
body.tema-escuro .config-menu button b { color: #F5F5F5; }
body.tema-escuro .config-menu button small { color: #9aa0a8; }
body.tema-escuro .config-menu button:hover, body.tema-escuro .config-menu button[aria-current="true"] { background: #17191f; border-color: #262932; }
body.tema-escuro .config-corpo, body.tema-escuro .config-corpo h2, body.tema-escuro .config-corpo label { color: #F5F5F5; }
body.tema-escuro .grupo-chips { background: #15171c; border-color: #262932; }
body.tema-escuro .chip-filtro { color: #c9ccd2; }
body.tema-escuro .chip-filtro:hover { background: #1b1e25; }
body.tema-escuro .chip-filtro.ativo { background: #F5F5F5; color: #0C0D11; }
body.tema-escuro .etapa-fonte { background: #23262e; color: #c9ccd2; }

/* ---------- Janelas ---------- */
body.tema-escuro .modal, body.tema-escuro .janela-etapa { background: #15171c; color: #F5F5F5; border: 1px solid #262932; }
body.tema-escuro .modal .fechar { color: #F5F5F5; }
body.tema-escuro #aviso-painel { background: #F5F5F5; color: #0C0D11; }

/* ---------- Celular: barra de baixo com o botão + ---------- */
@media (max-width: 900px) {
  body.tema-escuro #app:not([hidden]) { display: block; }
  .painel-lateral { display: none; }
  .topo-marca { display: inline-flex; }
  body.tema-escuro .painel-linha { padding: 10px 14px; gap: 8px; }
  body.tema-escuro .painel-linha .espaco { display: none; }
  body.tema-escuro .topo-marca { order: 0; margin-right: auto; }
  body.tema-escuro #minha-conta { order: 1; } body.tema-escuro #sair { order: 2; }
  body.tema-escuro .painel-linha .seletor-loja { order: 3; flex: 1 1 160px; } body.tema-escuro .painel-linha .seletor-loja select { flex: 1; min-width: 0; }
  body.tema-escuro #ver-site { order: 4; }
  body.tema-escuro .painel-area { padding: 16px 14px 96px; }
  .painel-inferior { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(14, 15, 19, .97); border-top: 1px solid #23262e; padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); }
  .painel-inferior > button { background: none; border: 0; color: #9aa0a8; display: grid; justify-items: center; gap: 3px; font: 600 11px Inter, sans-serif; padding: 6px 2px; position: relative; cursor: pointer; }
  .painel-inferior > button[aria-current="page"] { color: #E11D2E; }
  .painel-inferior .selo-aba { position: absolute; top: 0; right: calc(50% - 22px); margin: 0; height: 17px; min-width: 17px; font-size: 10px; }
  .painel-inferior .botao-rapido { justify-self: center; width: 54px; height: 54px; border-radius: 50%; background: #E11D2E; color: #fff; font: 400 30px/1 Inter, sans-serif;
    margin-top: -22px; box-shadow: 0 6px 20px rgba(225, 29, 46, .45); display: grid; place-items: center; padding: 0; }
  body.perfil-gerente .painel-inferior .so-vendedor, body.perfil-vendedor .painel-inferior .so-gerente,
  body.perfil-vendedor .folha-inferior .so-gerente { display: none; }
  .folha-inferior:not([hidden]) { display: grid; gap: 6px; position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 31;
    background: #15171c; border: 1px solid #2c2f37; border-radius: 16px; padding: 10px; box-shadow: 0 -10px 40px rgba(0, 0, 0, .6); }
  .folha-inferior button { display: flex; align-items: center; gap: 12px; background: #1b1e25; border: 0; border-radius: 12px; padding: 13px 14px; color: #F5F5F5; font: 600 15px Inter, sans-serif; text-align: left; cursor: pointer; }
  .folha-inferior button[data-rapido] { display: grid; gap: 2px; }
  .folha-inferior button small { color: #9aa0a8; font-size: 12px; font-weight: 400; }
  #aviso-painel { bottom: calc(90px + env(safe-area-inset-bottom)) !important; }
}

/* Regras antigas mais específicas (body.painel .painel-area .caixa) também ficam no escuro */
body.painel.tema-escuro .painel-area .caixa, body.painel.tema-escuro .painel-area .kpi, body.painel.tema-escuro .painel-area .linha-carro,
body.painel.tema-escuro .painel-area .config-corpo, body.painel.tema-escuro .interesse-card {
  background: linear-gradient(180deg, #17191f, #121419); border-color: #23262e; color: #F5F5F5;
}
body.painel.tema-escuro .compativeis li { background: rgba(34, 197, 94, .07); border-color: rgba(34, 197, 94, .25); color: #F5F5F5; }
body.painel.tema-escuro .config-menu button:hover, body.painel.tema-escuro .config-menu button[aria-current="true"] { background: #17191f; border-color: #262932; }
body.tema-escuro .interesse-card .sub, body.tema-escuro .interesse-card small { color: #9aa0a8; }
body.tema-escuro .etapa-barra { background: #e5e7eb; }
body.tema-escuro .fonte-lead .etapa-barra { background: #9aa0a8; }
body.tema-escuro .fonte-whatsapp .etapa-barra { background: #22c55e; }
body.tema-escuro .fonte-crm .etapa-barra { background: #E11D2E; }

/* Topo no celular: logo + Minha conta + Sair na 1ª linha; loja + Ver site na 2ª */
@media (max-width: 640px) {
  body.tema-escuro .painel-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: center; }
  body.tema-escuro .topo-marca { grid-column: 1; grid-row: 1; }
  body.tema-escuro #minha-conta { grid-column: 2; grid-row: 1; margin: 0; justify-self: end; }
  body.tema-escuro #sair { grid-column: 3; grid-row: 1; }
  body.tema-escuro .painel-linha .seletor-loja { grid-column: 1 / 3; grid-row: 2; display: block; }
  body.tema-escuro #ver-site { grid-column: 3; grid-row: 2; white-space: nowrap; }
}
