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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--primary);
  color: white;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header h1 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(255, 255, 255, 0.35);
}

main {
  max-width: 800px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.card h2,
.card .card-label {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
}

label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

input,
textarea,
select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-top: 0.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}

button:hover {
  background: var(--primary-dark);
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #b91c1c;
}

.actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}

.error {
  color: var(--danger);
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

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

th,
td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.station-card {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--primary);
}

.station-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.station-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.station-card .points {
  color: var(--success);
  font-weight: 600;
}

.station-admin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.station-admin .btns {
  display: flex;
  gap: 0.5rem;
}

.station-admin button {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.stat-box {
  display: inline-block;
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 0.5rem 0.5rem 0.5rem 0;
  text-align: center;
}

.stat-box .num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-box .label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  z-index: 999;
  transition: opacity 0.3s;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 1.1rem;
  }

  main {
    padding: 0 0.5rem;
  }

  .card {
    padding: 1rem;
  }
}

/* Question type elements */
.mc-option {
  display: block;
  padding: 0.6rem 0.8rem;
  margin: 0.3rem 0;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.mc-option:hover {
  background: #dbeafe;
}

.mc-option input {
  margin-right: 0.5rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #dbeafe;
  color: var(--primary-dark);
  margin-left: 0.5rem;
}

.q-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.3rem;
}

.pending-item {
  border-left: 4px solid #f59e0b;
}

#q-fields label,
#mc-fields label {
  margin-top: 0.5rem;
}

#photo-preview img {
  border-radius: 8px;
  margin-top: 0.5rem;
}
