:root {
  --bg: #f2f5f4;
  --panel: #ffffff;
  --text: #172321;
  --muted: #5b6d69;
  --line: #d5dfdc;
  --primary: #184a45;
  --primary-strong: #0e322f;
  --danger: #8a1d2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef4f2 0%, #f9fbfa 100%);
  color: var(--text);
  font: 16px/1.45 "Segoe UI", sans-serif;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 700;
  color: var(--primary-strong);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
}

.hero,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(24, 74, 69, 0.06);
}

.hero h1,
.card h1,
.card h2 {
  margin-top: 0;
}

.hero-actions,
.section-head,
.actions,
.rowline,
.topnav,
.inline-form,
.list-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stats,
.grid.two {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
}

.stat strong {
  display: block;
  font-size: 2rem;
  color: var(--primary-strong);
}

.button,
button {
  border: 0;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.button.primary,
button.primary,
button[type="submit"] {
  background: var(--primary);
  color: #fff;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.stack-form label > span {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  background: #fff;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox input {
  width: auto;
}

.narrow {
  max-width: 520px;
  margin: 0 auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.8rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  margin-bottom: 1rem;
}

.flash-success {
  background: #dff5e8;
  color: #115436;
}

.flash-error {
  background: #fbe1e5;
  color: var(--danger);
}

.vote-card {
  max-width: 700px;
  margin: 0 auto;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.score-row label {
  display: block;
}

.score-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.score-row span {
  display: block;
  text-align: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}

.score-row input:checked + span {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  display: inline-flex;
  align-items: center;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.chip input:checked + span {
  background: #dff5e8;
  border-color: #8bc5a4;
}

.rowline {
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.rowline:last-child {
  border-bottom: 0;
}

.list-links {
  flex-wrap: wrap;
}

.list-links a {
  display: inline-block;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.inline-form {
  display: inline-flex;
}

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

.qr-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.qr-card img {
  width: 92px;
  height: 92px;
  background: #fff;
  border-radius: 12px;
}

@media (max-width: 720px) {
  .topbar,
  .section-head,
  .actions {
    flex-wrap: wrap;
  }

  .table {
    font-size: 0.95rem;
  }

  .page {
    padding: 1rem;
  }
}
