@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg-1: #0b162f;
  --bg-2: #0f172a;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #0ea5e9;
  --muted: #64748b;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  --radius: 16px;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.14), transparent 25%),
              radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.18), transparent 22%),
              linear-gradient(180deg, var(--bg-1), var(--bg-2));
  color: #0f172a;
}

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

a:hover {
  color: var(--primary-strong);
}

.shell {
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-body {
  padding: 32px 0 56px;
}

.topbar {
  background: linear-gradient(120deg, #0b2447, #0f3e6e 55%, #0ea5e9);
  color: #e2e8f0;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(150deg, #38bdf8, #2563eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  margin: 0;
  color: rgba(226, 232, 240, 0.9);
  font-size: 13px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-chip {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
}

h1, h2, h3, h4 {
  margin: 0 0 8px;
  color: #0f172a;
}

p {
  margin: 0 0 10px;
}

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

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin: 0 0 6px;
  font-weight: 700;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 90% 10%, rgba(14, 165, 233, 0.14), transparent 20%),
              radial-gradient(circle at 5% 15%, rgba(37, 99, 235, 0.12), transparent 22%);
  opacity: 0.8;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card.accent {
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(150deg, #e0f2fe, #ffffff 40%, #eff6ff);
}

.card-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.section-header .actions {
  display: flex;
  gap: 8px;
}

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

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
  transition: all 0.18s ease;
}

.btn:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  background: #0f172a;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.22);
}

.btn.ghost {
  background: transparent;
  color: #0f172a;
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.soft {
  background: #e0f2fe;
  color: #0f172a;
  border: 1px solid rgba(14, 165, 233, 0.25);
  box-shadow: none;
}

.btn.yes { background: var(--success); box-shadow: 0 10px 24px rgba(22, 163, 74, 0.2); }
.btn.no { background: var(--danger); box-shadow: 0 10px 24px rgba(220, 38, 38, 0.2); }
.btn.abstain { background: #475569; box-shadow: 0 10px 24px rgba(71, 85, 105, 0.2); }

.btn.small {
  padding: 8px 10px;
  font-size: 14px;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-muted);
  font: inherit;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  background: #fff;
}

textarea {
  resize: vertical;
}

.help-text {
  font-size: 13px;
  color: #475569;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a;
}

.badge-open { background: #ecfdf3; color: #166534; }
.badge-closed { background: #fef2f2; color: #b91c1c; }
.badge-draft { background: #fefce8; color: #b45309; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.space { height: 8px; }

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

ul.clean {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.callout {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.callout.info {
  border-color: rgba(37, 99, 235, 0.2);
  background: #e0f2fe;
  color: #0f172a;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.card-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.table th,
.table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.table th {
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #475569;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0f172a;
  font-weight: 600;
}

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

.subtle {
  color: #1e293b;
  font-size: 14px;
}

.vote-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #0f172a;
}

.vote-stats span {
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.notice {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.08);
  color: #0f172a;
  border: 1px solid rgba(14, 165, 233, 0.25);
  font-size: 13px;
}

.admin-menu .card-inner {
  gap: 12px;
}

.admin-menu .btn {
  width: 100%;
  justify-content: flex-start;
}

.admin-menu .btn + .btn {
  margin-top: 6px;
}

.collapsible {
  padding: 0;
}

.collapsible[open] > .collapsible-summary,
.collapsible > .collapsible-summary {
  padding: 20px 22px 14px;
}

.collapsible > .collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.collapsible > .collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible > .collapsible-summary::after {
  content: '▼';
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.collapsible[open] > .collapsible-summary::after {
  transform: rotate(180deg);
}

.collapsible .card-inner {
  padding: 0 22px 22px;
}

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

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card {
    padding: 16px;
  }

  .shell {
    padding: 0 14px;
  }

  .grid-auto {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .btn {
    width: 100%;
  }

  .row {
    gap: 8px;
  }

  .admin-menu .btn {
    width: 100%;
  }
}
