:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e3e6ea;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #16a34a;
  --warn: #b45309;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
button {
  background: var(--brand); color: #fff; border: 0; border-radius: 7px;
  padding: 8px 14px; font-size: 14px; cursor: pointer;
}
button:hover { background: var(--brand-dark); }
button:disabled { opacity: .55; cursor: default; }
input, select {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  font-size: 14px; background: #fff; color: var(--ink);
}
.muted { color: var(--muted); }
.oculto { display: none !important; }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); padding: 10px 18px; border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sair { color: var(--muted); text-decoration: none; font-size: 13px; }
.sair:hover { color: var(--brand); }

/* abas */
.abas { display: flex; gap: 6px; padding: 14px 18px 0; }
.aba {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  border-bottom: 0; border-radius: 8px 8px 0 0; padding: 9px 16px; font-weight: 600;
}
.aba:hover { background: #eaecef; color: var(--ink); }
.aba.ativa { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 -1px 0 var(--card); }

/* painéis */
.painel { background: var(--card); margin: 0 18px 18px; padding: 18px;
  border: 1px solid var(--line); border-radius: 0 10px 10px 10px; box-shadow: var(--shadow); }
.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 14px; }
.filtros label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filtros .chk { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }
.resumo { margin: 6px 0 12px; }

/* tabela */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 56px; }
tr:hover td { background: #f8fafc; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag-sim { background: #dcfce7; color: var(--ok); }
.tag-nao { background: #fef3c7; color: var(--warn); }
td.acoes { white-space: nowrap; }
.btn-mini { padding: 5px 10px; font-size: 12px; margin-right: 4px; }
.btn-mini.sec { background: #64748b; }
.btn-mini.sec:hover:not(:disabled) { background: #475569; }

/* galeria */
.galeria-overlay { position: fixed; inset: 0; background: rgba(15,20,30,.55);
  display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.galeria-box { background: var(--card); width: min(1000px, 96vw); max-height: 90vh;
  overflow: auto; border-radius: 12px; box-shadow: var(--shadow); padding: 18px; }
.galeria-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.galeria-head > div { font-weight: 700; }
.fechar { background: #eef0f3; color: var(--ink); padding: 4px 10px; }
.fechar:hover { background: #e0e3e8; }
.galeria-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 4px; }
.galeria-acoes .muted { font-size: 12px; }
.galeria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-top: 12px; }
.cand { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.cand img { width: 100%; height: 180px; object-fit: contain; background: #f1f3f5; }
.cand .meta { padding: 6px 8px; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand button { border-radius: 0; width: 100%; padding: 9px; font-size: 13px; }

/* spinner */
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid #c7d2fe;
  border-top-color: var(--brand); border-radius: 50%; animation: g 0.8s linear infinite;
  vertical-align: -3px; margin-right: 6px; }
@keyframes g { to { transform: rotate(360deg); } }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--card); padding: 32px; border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; width: 320px; }
.login-card h1 { margin: 0; font-size: 20px; }
.login-card input { padding: 10px; }
.login-erro { color: #dc2626; font-size: 13px; min-height: 16px; }
