@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@300;500;700;800&family=Playfair+Display:wght@600&display=swap");

:root {
  color-scheme: light;
  --bg: #f3f0ea;
  --ink: #1c1c1c;
  --muted: #6b645c;
  --brand: #1f6f68;
  --accent: #e4702a;
  --card: #fffdf9;
  --line: #e5dfd6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at top, #fff7ea 0%, var(--bg) 45%, #efe8dd 100%);
  color: var(--ink);
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 24px;
  background: linear-gradient(120deg, #fff2df 0%, #f7f8f3 55%, #e8f3ef 100%);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(30, 25, 20, 0.08);
  position: relative;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.admin-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.hero.simple {
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #efe7dd;
}

.brand h1 {
  margin: 4px 0 0;
  font-family: "Playfair Display", serif;
  letter-spacing: 1px;
  font-size: 32px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.primary,
.secondary,
.ghost {
  border: none;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ghost.danger {
  border-color: #f0c6bf;
  color: #a43a32;
  background: #fceceb;
}

.primary[disabled],
.secondary[disabled],
.ghost[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 20px rgba(31, 111, 104, 0.2);
}

.secondary {
  background: transparent;
  border: 1px solid var(--brand);
  color: var(--brand);
}

.ghost {
  background: #f3efe8;
  color: var(--muted);
  border: 1px dashed var(--line);
}

.primary:hover,
.secondary:hover,
.ghost:hover {
  transform: translateY(-1px);
}

.content {
  margin-top: 26px;
  display: grid;
  gap: 18px;
}

.filters {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--muted);
  background: #f7f2eb;
  font-weight: 600;
}

.chip.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.card,
.form-card,
.empty {
  background: var(--card);
  border-radius: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(25, 20, 15, 0.08);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card h2 {
  margin: 6px 0 0;
  font-size: 22px;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f6d7c5;
  color: #7b3f1d;
  font-size: 12px;
  font-weight: 700;
}

.date {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.stats {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.stats strong {
  font-size: 18px;
  color: var(--ink);
}

.options {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f8f4ef;
  border: 1px solid #efe7dd;
  gap: 12px;
}

.option > div:first-child {
  flex: 1;
}

.bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e7dfd4;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.count {
  text-align: right;
  font-weight: 700;
  color: var(--accent);
  display: grid;
  gap: 2px;
}

.count small {
  font-size: 12px;
  color: var(--muted);
}

.actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 20, 16, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(18, 15, 10, 0.2);
  display: grid;
  gap: 14px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-card h2 {
  margin: 0;
  font-size: 20px;
}

.modal-card form {
  display: grid;
  gap: 12px;
}

.modal-card input[type="password"] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #ded7ce;
  font-size: 15px;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
}

.voters {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.voter-group h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.voter-group p {
  margin: 0;
  color: var(--muted);
}

.form-card label,
.choices {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.form-card input[type="text"],
.form-card input[type="date"] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #ded7ce;
  font-size: 15px;
}

.form-card {
  display: grid;
  gap: 18px;
}

.options-builder {
  display: grid;
  gap: 12px;
}

.options-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#options {
  display: grid;
  gap: 10px;
}

.choices {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.choice input {
  accent-color: var(--brand);
}

.flash {
  margin-top: 18px;
  padding: 12px 18px;
  background: #fff3e3;
  border-radius: 16px;
  border: 1px solid #f0d9b9;
}

.flash p {
  margin: 0;
  color: #8b4b1a;
}

.closed-note {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fce9e0;
  color: #8a3a1c;
  border: 1px solid #f2c8b5;
  font-weight: 600;
}

.empty {
  text-align: center;
}

.empty h2 {
  margin: 0 0 6px;
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero.simple {
    align-items: stretch;
    text-align: left;
  }

  .hero-actions {
    align-self: flex-end;
  }

  .admin-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .hero.simple h1 {
    font-size: 26px;
  }

  .hero.simple .secondary {
    align-self: flex-end;
    padding: 6px 10px;
    font-size: 12px;
  }

  .stats {
    text-align: left;
  }

  .card-head {
    flex-direction: column;
  }
}
