/* public/assets/admin.css — painel administrativo do Prospector.
   Standalone (não importa assets/app.css) — linguagem visual dark portada
   de C:\claude\prospector\gerar_painel.py (mesmas variáveis de cor, mesmos
   cards/chips/botões), adaptada pra telas e tabelas de admin. */

:root {
  --bg: #0b0d12;
  --panel: #13161e;
  --panel2: #1a1e29;
  --line: #252b3a;
  --tx: #e8eaf0;
  --tx2: #9aa3b8;
  --tx3: #6b7388;
  --azul: #5b8cff;
  --verde: #34d27b;
  --verm: #ff6b7d;
  --lar: #ffb84d;
  --roxo: #b78cff;
  --ama: #ffd479;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Vários blocos abaixo (.container, .modal-overlay, .paginacao) fixam
   "display: flex" incondicional na classe — sem isso, o atributo nativo
   "hidden" (que o JS liga/desliga) perderia pra essas regras de author no
   empate de especificidade e o elemento ficaria visível mesmo "escondido". */
[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--tx);
  font-size: 14px;
  line-height: 1.45;
}

::selection {
  background: #5b8cff55;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---- topbar ---- */

.topbar {
  background: linear-gradient(180deg, #141823, #10131b);
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
}

.topbar h1 {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar h1 .logo {
  background: linear-gradient(135deg, #5b8cff, #7aa5ff);
  color: #fff;
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: 0 2px 12px #5b8cff44;
  font-size: 13px;
}

.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--tx2);
}

.topbar-user strong {
  color: var(--tx);
}

/* ---- layout ---- */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 22px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-head h2 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-head .card-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---- botões ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--panel2);
  color: var(--tx);
  transition: filter .1s, border-color .1s;
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(1.12);
}

.btn:disabled {
  cursor: default;
  opacity: .5;
  filter: none;
}

.btn-primary {
  background: var(--azul);
  color: #fff;
}

.btn-success {
  background: var(--verde);
  color: #06351f;
}

.btn-danger {
  background: var(--verm);
  color: #3b0d13;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--tx2);
}

.btn-ghost:hover {
  color: var(--tx);
  border-color: #3a4358;
}

.btn-secondary {
  background: var(--panel2);
  border-color: var(--line);
  color: var(--tx);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 7px;
}

/* ---- badge ---- */

.badge {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--tx2);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.badge.on {
  background: var(--lar);
  color: #3a2200;
  border-color: var(--lar);
}

/* ---- pendências ---- */

.pend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pend-col h3 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx2);
  margin-bottom: 10px;
  font-weight: 700;
}

.pend-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pend-item {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pend-item .pend-lead {
  font-weight: 700;
  font-size: 13.5px;
}

.pend-item .pend-meta {
  font-size: 12px;
  color: var(--tx2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.pend-item .pend-meta b {
  color: #cdd3e0;
}

.pend-item .pend-valor {
  font-size: 13px;
  color: var(--ama);
  font-weight: 700;
}

.pend-item .pend-acoes {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.pend-item .pend-acoes .btn {
  flex: 1;
}

.vazio {
  color: var(--tx3);
  font-size: 12.5px;
  padding: 16px 4px;
  text-align: center;
}

/* ---- tabelas ---- */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  color: var(--tx3);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #171b26;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.acoes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.pill.ativo {
  background: #173326;
  color: #4be38c;
}

.pill.inativo {
  background: #3b1f24;
  color: #ff8b96;
}

.pill.admin {
  background: #2a2440;
  color: var(--roxo);
}

.tabela-vazia {
  color: var(--tx3);
  text-align: center;
  padding: 24px;
  font-size: 12.5px;
}

/* ---- funil ---- */

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

.funil-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.funil-card .n {
  font-size: 22px;
  font-weight: 800;
}

.funil-card .lbl {
  font-size: 11.5px;
  color: var(--tx2);
}

/* ---- atividade ---- */

.atividade-filtros {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

select {
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 8px;
  outline: none;
}

select:focus {
  border-color: var(--azul);
}

.paginacao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--tx2);
}

/* ---- 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: 18px;
}

.modal {
  background: var(--panel);
  border: 1px solid #3a4358;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  padding: 20px;
  max-height: 92vh;
  overflow: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--tx2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.modal-close:hover {
  color: var(--tx);
  background: var(--panel2);
}

.form-campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-campo label {
  font-size: 12.5px;
  color: var(--tx2);
  font-weight: 600;
}

.form-campo input[type=text],
.form-campo input[type=number],
.form-campo textarea {
  background: #10131b;
  border: 1px solid var(--line);
  color: var(--tx);
  padding: 10px 12px;
  border-radius: 9px;
  outline: none;
  width: 100%;
}

.form-campo input:focus,
.form-campo textarea:focus {
  border-color: var(--azul);
}

.form-campo textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.form-campo .dica {
  font-size: 11.5px;
  color: var(--tx3);
}

.form-erro {
  background: #241a1c;
  border: 1px solid #5e2a30;
  border-radius: 9px;
  color: #ff9d9d;
  font-size: 12.5px;
  padding: 9px 11px;
  margin-bottom: 12px;
}

.modal-acoes {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.senha-revelada {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.senha-revelada .senha-linha {
  display: flex;
  gap: 8px;
}

.senha-revelada input {
  flex: 1;
  background: #10131b;
  border: 1px solid var(--line);
  color: var(--ama);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  font-family: "SF Mono", Consolas, monospace;
}

.aviso-senha {
  font-size: 12.5px;
  color: var(--lar);
  font-weight: 600;
}

/* ---- toast ---- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1f2937;
  color: #fff;
  padding: 11px 22px;
  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;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.erro {
  border-color: #5e2a30;
  background: #2a1417;
  color: #ff9d9d;
}

/* ---- responsivo ---- */

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

  .topbar-inner {
    flex-wrap: wrap;
  }

  .card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-head .card-actions,
  .atividade-filtros {
    margin-left: 0;
    width: 100%;
  }
}
