*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f7f8fa;
  color: #1a1a2e;
  padding: 2rem;
}

/* ── Login ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.4rem; }
.login-card .subtitle { color: #666; font-size: 0.9rem; margin-bottom: 1.5rem; }

.login-card input[type="password"] {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}
.login-card input[type="password"]:focus { border-color: #4a6cf7; }

.login-card button {
  width: 100%;
  padding: 0.75rem;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.login-card button:hover { background: #2a2a4e; }

.error { color: #c0392b; font-size: 0.85rem; margin-bottom: 0.75rem; }

/* ── Header ── */
header { margin-bottom: 1.5rem; }

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

header h1 { font-size: 1.5rem; font-weight: 700; }
header p { color: #666; font-size: 0.9rem; margin-top: 0.3rem; }

.logout { font-size: 0.85rem; color: #4a6cf7; text-decoration: none; font-weight: 500; }
.logout:hover { text-decoration: underline; }

/* ── Search ── */
#search {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
#search:focus { border-color: #4a6cf7; }

/* ── Table ── */
table.main {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

table.main thead tr { background: #1a1a2e; color: #fff; text-align: left; }
table.main thead th {
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table.main tbody tr { border-bottom: 1px solid #ebebeb; transition: background 0.15s; }
table.main tbody tr:last-child { border-bottom: none; }
table.main tbody tr:hover { background: #f0f4ff; }
table.main td { padding: 0.85rem 1rem; vertical-align: top; font-size: 0.9rem; }

td.rank { font-weight: 700; color: #888; width: 3rem; text-align: center; }
td.title a { color: #1a1a2e; font-weight: 600; text-decoration: none; }
td.title a:hover { text-decoration: underline; color: #4a6cf7; }
td.votes { font-weight: 700; text-align: center; width: 5rem; color: #4a6cf7; }
td.voter-cell { min-width: 200px; }

/* ── Badges ── */
.badge { padding: 2px 10px; border-radius: 10px; font-size: 0.78em; font-weight: 600; white-space: nowrap; }
.badge-review { background: #fff8e1; color: #f57f17; }
.badge-open   { background: #e8f5e9; color: #2e7d32; }

/* ── Voter list ── */
details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a6cf7;
  user-select: none;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▶ "; font-size: 0.65em; vertical-align: middle; }
details[open] summary::before { content: "▼ "; }

.voter-list {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
  font-size: 0.8rem;
  color: #555;
  list-style: disc;
  columns: 2;
}

.none { color: #aaa; font-size: 0.9rem; margin-top: 1rem; }
