/* public/assets/app.css — design system do Prospector.
   Cores/cards/chips/tags portados de C:\claude\prospector\gerar_painel.py
   (linhas 84-200) e adaptados mobile-first: 1 coluna no celular, grid no
   desktop. Usado por login.html e index.html. NÃO usado por admin.html. */

:root {
  --bg: #0b0d12;
  --panel: #13161e;
  --panel2: #1a1e29;
  --panel3: #1f2432;
  --line: #252b3a;
  --line2: #2c3346;
  --tx: #e8eaf0;
  --tx2: #9aa3b8;
  --tx3: #6b7388;
  --azul: #5b8cff;
  --verde: #34d27b;
  --verm: #ff6b7d;
  --lar: #ffb84d;
  --roxo: #b78cff;
  --ama: #ffd479;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
}

/* o atributo hidden precisa vencer qualquer display:flex/grid que a gente
   declare mais embaixo pros mesmos elementos (modal, lightbox etc). */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--tx);
  font-size: 15.5px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: #5b8cff55; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--azul); }

/* ---------- header + abas ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #141823, #10131b);
  border-bottom: 1px solid var(--line);
}
.brand {
  background: linear-gradient(135deg, var(--azul), #7aa5ff);
  color: #fff; font-weight: 800; letter-spacing: .3px;
  padding: 5px 11px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 2px 12px #5b8cff44;
  white-space: nowrap;
}
.user-nome {
  margin-left: auto; color: var(--tx2); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw;
}

.tabs { display: flex; background: #0e1118; border-bottom: 1px solid var(--line); }
.tab-btn {
  flex: 1; background: none; border: none; border-bottom: 3px solid transparent;
  color: var(--tx2); padding: 12px 6px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; min-height: 46px;
}
.tab-btn.active { color: var(--tx); border-bottom-color: var(--azul); }
.tab-btn:hover { color: var(--tx); }

.content { padding: 14px 14px 40px; max-width: 980px; margin: 0 auto; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 14px; border-radius: var(--radius-sm);
  border: none; font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: #fff; transition: filter .1s, opacity .1s;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { cursor: default; opacity: .55; filter: none; }
.btn-block { width: 100%; }
.btn-primary { background: var(--azul); }
.btn-secondary { background: var(--panel2); color: var(--tx); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--tx2); border: 1px solid var(--line); }
.btn-danger-ghost { background: transparent; color: var(--verm); border: 1px solid #4a2530; }
.btn-copiar {
  background: var(--panel2); color: var(--tx2); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.btn-copiar:hover { color: var(--tx); }

/* ---------- filtros (aba Leads) ---------- */
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.filters input[type=text], .filters select {
  background: var(--panel2); border: 1px solid var(--line); color: var(--tx);
  padding: 11px 12px; border-radius: var(--radius-sm); outline: none; width: 100%;
}
.filters input:focus, .filters select:focus { border-color: var(--azul); }
.filters-row2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters-row2 select { flex: 1; min-width: 140px; width: auto; }

.chip {
  background: var(--panel2); border: 1px solid var(--line); color: var(--tx2);
  padding: 10px 14px; border-radius: 20px; cursor: pointer; font-size: 13px;
  user-select: none; font-weight: 600;
}
.chip.on { background: var(--azul); border-color: var(--azul); color: #fff; }

.list-meta { color: var(--tx3); font-size: 12.5px; margin-bottom: 10px; min-height: 15px; }

/* ---------- grid + card ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 680px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s;
}
.card:hover { border-color: var(--line2); }
.card.is-due { border-left: 3px solid var(--lar); }
.card.is-win { border-left: 3px solid var(--verde); }
.card.is-lost { opacity: .55; }
.grupo-titulo {
  grid-column: 1 / -1; color: var(--tx2); font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; margin: 6px 0 -2px;
}
.grupo-titulo:first-child { margin-top: 0; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-nome { font-weight: 700; font-size: 14.5px; line-height: 1.3; }

.pri { font-weight: 800; font-size: 11.5px; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.pri-hot { background: #3b1f24; color: #ff7b8a; }
.pri-warm { background: #3a3320; color: var(--ama); }
.pri-cold { background: #1f2a3b; color: #7bb0ff; }

/* linha única: cidade · nicho · ★ nota (avaliações) */
.meta { font-size: 12.5px; color: var(--tx2); display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.meta .mdot { color: var(--tx3); }
.meta .mstar { color: var(--tx2); }
.meta .mtx3 { color: var(--tx3); margin-left: 2px; }
.muted { color: var(--tx3); }

.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 10.5px; padding: 3px 9px; border-radius: 6px; background: var(--panel3); color: var(--tx2); font-weight: 600; }
.tag-nosite { background: #3b1f24; color: #ff7b8a; }
.tag-insta { background: #3a2740; color: #e08be0; }
.tag-fora { background: #4a1418; color: #ff8b96; border: 1px solid #6b2730; }
.tag-perfbad { background: #3b1f24; color: #ff9d6b; }
.tag-perfmid { background: #3a3320; color: var(--ama); }

/* motivo: linha sutil com um pontinho, sem caixa/fundo (mesma linguagem do painel local) */
.motivo { font-size: 12px; color: var(--tx3); line-height: 1.45; padding-left: 11px; position: relative; }
.motivo::before {
  content: ''; position: absolute; left: 0; top: .55em; width: 4px; height: 4px;
  border-radius: 50%; background: var(--azul);
}

.print {
  width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: zoom-in;
  max-height: 170px; object-fit: cover; object-position: top; display: block;
}

.fone {
  font-size: 13px; color: var(--tx2); display: flex; align-items: center; justify-content: space-between;
  gap: 8px; border-top: 1px solid var(--line); padding-top: 9px;
}
.fone-num { font-weight: 600; color: var(--tx); }

/* lead já pego por outra pessoa: rótulo leve, sem caixa pesada */
.dono { font-size: 12.5px; color: var(--tx2); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 9px 10px; text-align: center; }

/* ---------- Meus Leads: status/badges/ações ----------
   Bloco de CRM mais leve: sem fundo pesado, só uma linha divisória fina
   separando do resto do card (mesma direção do redesign do painel local). */
.crm-block {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--line); padding-top: 10px;
}
.badges-row { display: flex; flex-wrap: wrap; gap: 6px; }
.status-badge, .badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: var(--panel3); color: var(--tx2); }
.status-badge.status-novo { color: var(--tx2); }
.status-badge.status-contatado { color: var(--azul); background: #1c2740; }
.status-badge.status-aguardando { color: var(--lar); background: #3a3320; }
.status-badge.status-reuniao_marcada { color: var(--roxo); background: #2a2140; }
.status-badge.status-fechado { color: var(--verde); background: #163326; }
.status-badge.status-perdido { color: var(--verm); background: #3b1f24; }
.status-badge.status-optout { color: var(--verm); background: #3b1f24; }
.badge-hoje { background: #3a3320; color: var(--ama); }
.badge-atrasado { background: #3b1f24; color: #ff8b96; }
.badge-reuniao { background: #2a2140; color: var(--roxo); }

.crm-row { display: flex; align-items: center; gap: 8px; }
.toques-info { font-size: 11.5px; color: var(--tx3); white-space: nowrap; }

.sel-status {
  background: var(--panel2); border: 1px solid var(--line); color: var(--tx2);
  padding: 8px 10px; border-radius: var(--radius-xs); flex: 1; min-width: 0; font-size: 12.5px;
}
.sel-status:focus { border-color: var(--azul); color: var(--tx); }

/* ação principal (registrar toque) em destaque, secundárias menores e alinhadas */
.actions-primary { display: flex; }
.actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.actions-grid .btn {
  padding: 8px 4px; font-size: 11.5px; font-weight: 600; color: var(--tx2);
  background: var(--panel3); border: 1px solid var(--line);
}
.actions-grid .btn:hover { color: var(--tx); border-color: var(--line2); }
.actions-grid .btn.btn-accent-verde { color: var(--verde); border-color: #1f5c3a; }
.actions-grid .btn.btn-accent-verde:hover { color: var(--verde); border-color: var(--verde); }

.nota-box { display: flex; flex-direction: column; gap: 8px; }
.nota-box textarea {
  width: 100%; background: #10131b; border: 1px solid var(--line); color: var(--tx);
  border-radius: var(--radius-sm); padding: 10px; resize: vertical; min-height: 70px;
}
.nota-box textarea:focus { border-color: var(--azul); outline: none; }
.nota-actions { display: flex; gap: 8px; }
.nota-actions .btn { flex: 1; }

/* ---------- paginação / estados vazios ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.pag-info { color: var(--tx2); font-size: 12.5px; }
.loading, .empty {
  padding: 40px 12px; text-align: center; color: var(--tx2); font-size: 13.5px; grid-column: 1 / -1;
}

/* ---------- saldo ---------- */
.saldo-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 6px; }
@media (min-width: 680px) { .saldo-cards { grid-template-columns: repeat(3, 1fr); } }
.saldo-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.saldo-label { font-size: 12.5px; color: var(--tx2); margin-bottom: 6px; }
.saldo-valor { font-size: 26px; font-weight: 800; }
.saldo-pendente .saldo-valor { color: var(--lar); }
.saldo-receber .saldo-valor { color: var(--azul); }
.saldo-pago .saldo-valor { color: var(--verde); }
.saldo-explica { color: var(--tx3); font-size: 12.5px; margin: 12px 2px 18px; }

.extrato { display: flex; flex-direction: column; gap: 8px; }
.extrato-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.extrato-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.extrato-tipo { font-weight: 700; font-size: 13px; }
.extrato-lead, .extrato-obs { color: var(--tx2); font-size: 12.5px; margin-bottom: 6px; }
.extrato-base { display: flex; justify-content: space-between; align-items: baseline; }
.extrato-valor { font-weight: 700; font-size: 14.5px; }
.extrato-data { color: var(--tx3); font-size: 12px; }

.status-pill { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.status-pill.status-pendente { background: #3a3320; color: var(--ama); }
.status-pill.status-confirmada, .status-pill.status-confirmado { background: #163326; color: var(--verde); }
.status-pill.status-rejeitada, .status-pill.status-rejeitado { background: #3b1f24; color: var(--verm); }
.status-pill.status-pago { background: #1c2740; color: var(--azul); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(90px);
  background: #1f2937; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 13.5px; z-index: 300; transition: transform .25s; border: 1px solid #374151;
  box-shadow: 0 8px 30px #0009; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-error { border-color: #6b2730; }
.toast-success { border-color: #1f5c3a; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  background: var(--panel); border: 1px solid #3a4358; border-radius: 16px;
  max-width: 420px; width: 100%; padding: 20px; max-height: 90vh; overflow: auto;
}
.modal-box h3 { font-size: 16px; margin-bottom: 14px; }
.modal-box label { display: block; font-size: 12.5px; color: var(--tx2); margin: 10px 0 6px; }
.modal-box input, .modal-box textarea {
  width: 100%; background: #10131b; border: 1px solid var(--line); color: var(--tx);
  border-radius: var(--radius-sm); padding: 10px; outline: none;
}
.modal-box input:focus, .modal-box textarea:focus { border-color: var(--azul); }
.modal-error { color: var(--verm); font-size: 12.5px; margin-top: 10px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ---------- lightbox (print da auditoria em tela cheia) ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 18px; cursor: zoom-out;
}
.lightbox img { max-width: 95%; max-height: 95%; border-radius: 8px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 24px; box-shadow: 0 20px 60px -20px #000a;
}
.login-title { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 22px; }
.login-form { display: flex; flex-direction: column; }
.login-form label { font-size: 12.5px; color: var(--tx2); margin: 12px 0 6px; }
.login-form label:first-child { margin-top: 0; }
.login-form input {
  background: var(--panel2); border: 1px solid var(--line); color: var(--tx);
  padding: 12px; border-radius: var(--radius-sm); outline: none; width: 100%;
}
.login-form input:focus { border-color: var(--azul); }
.form-error { color: var(--verm); font-size: 12.5px; margin-top: 12px; }
.form-hint { color: var(--tx2); font-size: 12.5px; margin-bottom: 4px; }
.login-form .btn { margin-top: 18px; }

/* ---------- loading screen (checagem de sessão) ---------- */
#loading-screen { min-height: 100vh; display: grid; place-items: center; color: var(--tx2); font-size: 13.5px; }
