:root {
  --bg: #0f1115;
  --bg-card: #171a21;
  --bg-card-hover: #1e222b;
  --border: #262b36;
  --text: #e6e8ec;
  --text-muted: #8b93a3;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.topbar nav { display: flex; gap: 4px; align-items: center; }
.topbar nav a {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}
.topbar nav a:hover, .topbar nav a.active { background: var(--bg-card-hover); color: var(--text); }

.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .num { font-size: 30px; font-weight: 700; }
.stat .label { color: var(--text-muted); font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--bg-card-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

input, select, textarea {
  width: 100%;
  background: #0c0e12;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: var(--bg-card-hover); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-pendente { background: rgba(234,179,8,.15); color: var(--yellow); }
.badge-andamento { background: rgba(59,130,246,.15); color: var(--blue); }
.badge-fechado { background: rgba(34,197,94,.15); color: var(--green); }
.badge-semsucesso { background: rgba(239,68,68,.15); color: var(--red); }

.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; }
.flash-ok { background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.flash-erro { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.3); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}

.member-row { display: flex; align-items: center; gap: 12px; }
.member-meta { display: flex; flex-direction: column; }
.member-meta .name { font-weight: 600; }
.member-meta .specialty { color: var(--text-muted); font-size: 13px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { text-align: center; font-size: 20px; margin-bottom: 24px; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

.rank-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rank-pos { font-weight: 700; color: var(--text-muted); width: 24px; }
.rank-score { margin-left: auto; font-weight: 700; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

.top-right { display: flex; align-items: center; gap: 12px; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px; }
  .topbar nav { order: 3; width: 100%; overflow-x: auto; }
  .topbar nav a { white-space: nowrap; }
  .card { overflow-x: auto; }
  table { min-width: 680px; }
}
