:root {
  --bg: #f3efe6;
  --ink: #1c2430;
  --muted: #5b6675;
  --line: #d5cfc3;
  --panel: #fffdf8;
  --accent: #0f6a5a;
  --accent-soft: #d8eee8;
  --danger: #8a2f2f;
  --shadow: 0 10px 30px rgba(28, 36, 48, 0.08);
  --radius: 14px;
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #fff8e8, transparent 40%),
    linear-gradient(180deg, #f7f3eb 0%, var(--bg) 100%);
  min-height: 100vh;
}

a {
  color: var(--accent);
}

.wrap {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

header.site h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

header.site p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 42rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.grid {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

button,
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary,
button[type="submit"] {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-danger {
  background: #f3dcdc;
  color: var(--danger);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  justify-content: space-between;
}

.toolbar .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 1;
}

.toolbar label {
  min-width: 12rem;
  flex: 1;
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1rem;
}

.flash.error {
  background: #f3dcdc;
  color: var(--danger);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.vote-box {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  min-width: 4.2rem;
}

.vote-box form {
  margin: 0;
}

.vote-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.vote-count {
  font-weight: 700;
  font-size: 1.1rem;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.45rem;
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card .details {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card .details span {
  display: block;
}

.empty {
  color: var(--muted);
  padding: 1rem 0.2rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #efe7d8;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.hidden {
  background: #f3dcdc;
  color: var(--danger);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .card {
    grid-template-columns: 1fr;
  }

  .vote-box {
    justify-items: start;
    grid-auto-flow: column;
    align-items: center;
  }
}
