:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #141414;
  --border: #262626;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --accent: #ffffff;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 14px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", -apple-system, system-ui, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: 0.01em;
}

body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .85; }

h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; }

.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brandbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.25em;
}
.brandbar .brand img { width: 32px; height: 32px; }
.brandbar .link { color: var(--muted); }

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

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input, select, textarea, button {
  font: inherit;
  color: var(--text);
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
}
input::placeholder { color: #555; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.btn {
  background: transparent;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  transition: background .15s ease, border-color .15s ease;
  color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn.primary {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-color: var(--accent);
}
.btn.primary:hover { background: #e5e5e5; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.icon { padding: 8px 10px; }

.link {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
}
.link:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.hidden { display: none !important; }

.msg { min-height: 1.2em; margin: 8px 0 0; font-size: .9rem; }
.msg.error { color: var(--danger); }
.msg.success { color: var(--success); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .75rem; letter-spacing: .1em; }

.candidate {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.candidate header { display: flex; justify-content: space-between; align-items: center; }
.candidate .btn-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
}
.candidate .btn-remove:hover { color: var(--danger); }

.vote-option {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.vote-option:hover { border-color: var(--accent); }
.vote-option.selected { border-color: var(--accent); background: #1a1a1a; }
.vote-option strong { display: block; margin-bottom: 4px; }
.vote-option .reason { color: var(--muted); font-size: .9rem; }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--nav-h);
  background: #000;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 20;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.bottom-nav a .ico { font-size: 1.25rem; line-height: 1; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a:hover { color: var(--accent); text-decoration: none; }

.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: #000;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}
.auth-card .logo { width: 96px; height: 96px; margin: 0 auto 8px; }
.auth-card h1 { margin: 0; letter-spacing: .3em; font-size: 1.4rem; }
.auth-card form { text-align: left; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar .dow {
  text-align: center;
  color: var(--muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 6px 0;
}
.calendar .day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #000;
  cursor: pointer;
  color: var(--text);
  position: relative;
  font-size: .95rem;
}
.calendar .day.out { color: #333; background: transparent; cursor: default; border-color: transparent; }
.calendar .day.has-vote { background: var(--accent); color: #000; font-weight: 700; }
.calendar .day.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calendar-header h3 { margin: 0; text-transform: capitalize; }

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
}
.profile-hero .dorsal {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 800;
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.stat .num { display: block; font-size: 1.6rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
