:root {
  --bg: #0d0d0d;
  --bg-alt: #131313;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --red: #c8100c;
  --red-bright: #e51e25;
  --red-rgb: 200, 16, 12;
  --white: #f7f6f4;
  --ink-70: rgba(247, 246, 244, 0.72);
  --ink-50: rgba(247, 246, 244, 0.5);
  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
}
h1, h2, .btn-primary, .btn-outline, .topbar-brand span { font-family: var(--font-display); }
[hidden] { display: none !important; }

/* ---------- Login ---------- */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(var(--red-rgb), 0.22), transparent 60%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 34px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-logo { height: 28px; width: auto; margin-bottom: 22px; }
.login-card h1 { font-size: 1.5rem; margin: 0 0 4px; }
.login-card .subtitle { color: var(--ink-50); margin: 0 0 22px; font-size: 0.9rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 0.85rem; color: var(--ink-70); font-family: var(--font-display); font-weight: 500; }
.field input {
  background: var(--bg-alt); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 12px 14px; color: var(--white); font-size: 0.95rem;
}
.field input:focus { outline: none; border-color: var(--red-bright); }
.error-msg { color: var(--red-bright); font-size: 0.85rem; min-height: 1.2em; margin: 0 0 8px; }
.btn-primary, .btn-outline {
  border: none; border-radius: 999px; padding: 13px 22px; font-weight: 600; font-size: 0.92rem;
  cursor: pointer; transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-bright); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--white); }
.btn-outline:hover { border-color: var(--red-bright); }

/* ---------- Dashboard ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--bg-alt);
}
.topbar-brand { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.topbar-brand img { height: 22px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.current-user { color: var(--ink-50); font-size: 0.85rem; }

.dashboard { padding: 28px; max-width: 1200px; margin: 0 auto; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 24px; }
.stat-card { background: var(--surface); padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; }
.stat-label { color: var(--ink-50); font-size: 0.82rem; }
@media (max-width: 700px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stats-row-modalidade { grid-template-columns: repeat(2, 1fr); }
.stats-row-modalidade .stat-value { color: var(--red-bright); }

.toolbar { margin-bottom: 16px; }
.toolbar input {
  width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 11px 14px; color: var(--white); font-size: 0.92rem;
}
.toolbar input:focus { outline: none; border-color: var(--red-bright); }

.table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 820px; font-size: 0.88rem; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--red-bright); font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; background: var(--bg-alt); }
td { color: var(--ink-70); }
tr:last-child td { border-bottom: none; }
td.name-cell { color: var(--white); font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-pago { background: rgba(60, 180, 90, 0.15); color: #4ade80; }
.badge-pendente { background: rgba(var(--red-rgb), 0.15); color: var(--red-bright); }

.toggle-btn {
  border: 1px solid var(--line-strong); background: transparent; color: var(--white);
  border-radius: 999px; padding: 7px 14px; font-size: 0.8rem; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.toggle-btn:hover { border-color: var(--red-bright); background: rgba(var(--red-rgb), 0.1); }

.empty-msg { text-align: center; padding: 40px 20px; color: var(--ink-50); }
