:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
  gap: 10px;
}
.brand { color: var(--text); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--text); }
.who { color: var(--text); font-weight: 600; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.95rem; padding: 0; }
.link-btn:hover { color: var(--red); }
.inline { display: inline; }

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

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
}
.card h3 { margin-top: 0; }

.period-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.period-card {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 12px;
  padding: 16px 10px;
  text-align: center;
}
.period-medal { font-size: 1.8rem; line-height: 1; }
.period-points { font-size: 1.3rem; font-weight: 700; margin-top: 4px; }
.period-label { font-size: 0.85rem; opacity: 0.9; margin-top: 2px; }
.period-rank { font-size: 0.78rem; margin-top: 4px; opacity: 0.85; }
@media (max-width: 480px) {
  .period-cards { grid-template-columns: 1fr; }
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.muted { color: var(--muted); }

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #0f172a;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
label { display: block; margin: 12px 0 6px; font-size: 0.9rem; color: var(--muted); }
.hint { font-size: 0.8rem; }

.btn-primary {
  margin-top: 16px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-hover); }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 32px; width: 100%; max-width: 380px; }
.auth-card h1 { margin: 0 0 4px; font-size: 1.3rem; }
.subtitle { color: var(--muted); margin: 0 0 10px; }
.alt-link { text-align: center; margin-top: 16px; color: var(--muted); }
.alt-link a { color: var(--primary); }
.error { color: var(--red); background: rgba(239,68,68,0.1); padding: 8px 12px; border-radius: 8px; }

.submission-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.submission { border: 1px solid var(--card-border); border-radius: 10px; padding: 12px 14px; }
.submission-client { font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.submission-desc { margin-bottom: 6px; }
.submission-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.date { color: var(--muted); }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-pendente { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-aprovado { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-rejeitado { background: rgba(239,68,68,0.15); color: var(--red); }
.review-note { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }

.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.review-actions form { display: flex; gap: 6px; align-items: center; }
.note-input { width: 160px; }
.btn-approve, .btn-reject {
  border: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; color: white;
}
.btn-approve { background: var(--green); }
.btn-reject { background: var(--red); }

.ranking-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ranking-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 14px;
}
.ranking-row.me { border-color: var(--primary); background: rgba(99,102,241,0.08); }
.pos { color: var(--muted); width: 32px; }
.rank-emoji { font-size: 1.3rem; }
.rank-name { flex: 1; font-weight: 600; }
.rank-points { font-weight: 700; }
