/* Voxmed Admin — painel desktop (Cescorf) */
:root {
  --bg: #e9e7f8;
  --card: #ffffff;
  --accent: #6050f0;
  --accent-dark: #5040f0;
  --accent-soft: rgba(96, 80, 240, 0.12);
  --text: #1f1e33;
  --muted: #8a89a8;
  --borda: rgba(31, 30, 51, 0.08);
  --red: #ef4444;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--card); border-radius: 20px; padding: 34px 38px;
  box-shadow: 0 18px 50px rgba(60, 50, 140, 0.18);
  width: 100%; max-width: 380px; text-align: center;
}
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #8b7cff);
  color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(96, 80, 240, 0.35);
}
.login-card h1 { font-size: 22px; font-weight: 800; }
.login-card h1 span { color: var(--accent); }
.login-card .sub { font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.login-card label { display: block; text-align: left; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.login-card input {
  width: 100%; margin-top: 5px; background: #fff; border: 1px solid #e4e3f2;
  border-radius: 10px; padding: 11px 12px; font-size: 14px; color: var(--text); outline: none;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary {
  width: 100%; background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; border: none; border-radius: 12px; padding: 13px; font-size: 15px;
  font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(96, 80, 240, 0.3);
}
.btn-primary:active { transform: scale(0.98); }
.erro { color: var(--red); font-size: 13px; margin-top: 12px; }
.status { color: var(--accent); font-size: 13px; margin-top: 12px; font-weight: 600; }

/* Painel */
.adm-top {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--accent), #8b7cff);
  color: #fff; padding: 14px 28px;
  box-shadow: 0 6px 20px rgba(96, 80, 240, 0.3);
  position: sticky; top: 0; z-index: 10;
}
.adm-brand { font-size: 18px; font-weight: 800; }
.adm-brand span { opacity: 0.85; font-weight: 700; }
.adm-user { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.adm-user button {
  background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff; border-radius: 8px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.adm-user button:hover { background: rgba(255, 255, 255, 0.3); }

.adm-main { max-width: 1180px; margin: 0 auto; padding: 24px 28px 60px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.card-kpi {
  background: var(--card); border: 1px solid var(--borda); border-radius: 16px;
  padding: 18px 20px; box-shadow: 0 6px 18px rgba(60, 50, 140, 0.07);
}
.kpi-ico { font-size: 24px; }
.kpi-num { font-size: 32px; font-weight: 800; color: var(--accent); margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-lab { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-extra { font-size: 11px; color: var(--muted); margin-top: 6px; }

.grid-graf { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.graf-card {
  background: var(--card); border: 1px solid var(--borda); border-radius: 16px;
  padding: 16px 20px; box-shadow: 0 6px 18px rgba(60, 50, 140, 0.07);
}
.graf-card h3 { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.graf-card canvas { width: 100%; display: block; }

/* Card "Equações usadas" — lista com nome, fórmula, dobras e frequência */
.eq-list { display: flex; flex-direction: column; gap: 12px; }
.eq-item { padding: 10px 0; border-bottom: 1px solid var(--borda); }
.eq-item:last-child { border-bottom: none; padding-bottom: 0; }
.eq-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.eq-nome { font-weight: 700; font-size: 12.5px; color: var(--text); }
.eq-total { font-weight: 800; font-size: 12.5px; color: #6050f0; white-space: nowrap; }
.eq-bar { height: 6px; background: var(--borda); border-radius: 999px; margin: 6px 0; overflow: hidden; }
.eq-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6050f0, #8a7cf0); border-radius: 999px; }
.eq-formula { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px; line-height: 1.45; color: #4a4868; word-break: break-word; }
.eq-dobras { font-size: 10.5px; color: #8a89a8; margin-top: 3px; }
.eq-empty { font-size: 12px; color: #8a89a8; }

.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: var(--accent-soft); color: var(--accent-dark); text-align: left; padding: 10px 12px; font-weight: 700; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--borda); }
tr:hover td { background: #f8f7ff; }

.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.btn-peq {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; border: none; border-radius: 8px; padding: 7px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.btn-peq:hover { filter: brightness(1.08); }

/* Modal — display controlado via JS (style.display) para não conflitar com hidden */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(31, 30, 51, 0.45);
  display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 18px; padding: 26px 30px;
  width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(31, 30, 51, 0.3);
}
.modal-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.modal-card label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.modal-card input, .modal-card select {
  width: 100%; margin-top: 5px; background: #fff; border: 1px solid #e4e3f2;
  border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--text); outline: none;
}
.modal-card input:focus, .modal-card select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.modal-btns { display: flex; gap: 10px; margin-top: 6px; }
.modal-btns .btn-primary { flex: 1; }
.btn-ghost {
  background: transparent; border: 1px solid #e4e3f2; color: var(--muted);
  border-radius: 12px; padding: 13px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .grid-graf { grid-template-columns: 1fr; }
}

/* Card de uso de IA (tokens) */
.tokens-card { margin-top: 16px; }
.tokens-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px;
}
.tok-cell {
  background: #f7f5ff; border: 1px solid rgba(96,80,240,0.12);
  border-radius: 12px; padding: 12px 10px; text-align: center;
}
.tok-cell .kpi-num { font-size: 20px; color: #5040f0; }
.tok-cell .kpi-lab { font-size: 10.5px; margin-top: 2px; }
.tok-cell .kpi-extra { font-size: 11px; color: #16a34a; margin-top: 3px; }
.tok-nota { font-size: 11px; color: #8a89a8; margin-top: 10px; line-height: 1.5; }
@media (max-width: 720px) { .tokens-grid { grid-template-columns: repeat(2, 1fr); } }

/* Modal de detalhes do profissional */
.linha-prof:hover { background: #f4f2fe; }
.badge-plano { background: #e9e7f8; color: #5040f0; border-radius: 99px; padding: 2px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-status { border-radius: 99px; padding: 2px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-status.ativo { background: rgba(34,197,94,0.12); color: #15803d; }
.badge-status.bloqueado { background: rgba(239,68,68,0.12); color: #b91c1c; }
.modal-prof { max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; }
.mp-badge { display: inline-block; border-radius: 99px; padding: 4px 14px; font-size: 12px; font-weight: 700; margin: 8px 0 14px; }
.mp-badge.ativo { background: rgba(34,197,94,0.12); color: #15803d; }
.mp-badge.bloqueado { background: rgba(239,68,68,0.12); color: #b91c1c; }
.mp-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mp-item { background: #f7f5ff; border: 1px solid rgba(96,80,240,0.1); border-radius: 10px; padding: 10px 12px; }
.mp-item span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; color: #8a89a8; margin-bottom: 4px; }
.mp-item b { font-size: 14px; color: #1f1e33; }
.mp-acoes { border-top: 1px solid #eee; padding-top: 14px; margin-bottom: 14px; }
.mp-acoes label { display: block; font-size: 12px; font-weight: 700; color: #5040f0; margin-bottom: 8px; }
.mp-acoes input, .mp-acoes select { width: 100%; padding: 8px 10px; border: 1px solid #d5d3ec; border-radius: 8px; font-size: 13px; margin-top: 4px; margin-bottom: 10px; }
.mp-bloquear { width: 100%; background: rgba(239,68,68,0.1); color: #b91c1c; border: 1px solid rgba(239,68,68,0.3); }
.mp-bloquear:hover { background: rgba(239,68,68,0.18); }
.mp-desbloquear { background: rgba(34,197,94,0.1); color: #15803d; border-color: rgba(34,197,94,0.3); }

/* Perfil do Avaliado */
.perfil-head { margin: 6px 0 12px; }
.perfil-head h3 { font-size: 15px; font-weight: 800; }
.perfil-head .perfil-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-perfil { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.tabela-perfil th, .tabela-perfil td { text-align: right; }
.tabela-perfil th:first-child, .tabela-perfil td:first-child { text-align: left; }
@media (max-width: 900px) { .card-perfil { grid-template-columns: 1fr; } }
