:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

h1 { font-size: 1.6rem; font-weight: 600; margin-bottom: 1rem; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

button:hover { background: var(--primary-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

button.secondary:hover { background: var(--bg); }

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

button.small { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

input, textarea, select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  color: var(--text);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.field { margin-bottom: 1rem; }

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

@media (max-width: 700px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
}

.stat {
  text-align: center;
  padding: 1.5rem 1rem;
}

.stat .number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td { border-bottom: none; }

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

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

.success {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  font-size: 0.85rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.success { background: var(--success); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.draft { background: #fef3c7; color: #92400e; }
.badge.published { background: #d1fae5; color: #065f46; }
.badge.inactive { background: #fee2e2; color: #991b1b; }

.question-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--surface);
}

.question-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.question-card .header h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.option-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.option-row input { margin: 0; }

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

.login-box {
  max-width: 400px;
  margin: 4rem auto;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-box .subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.progress {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.progress-step {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.progress-step.active { background: var(--primary); }

.progress-step.done { background: var(--success); }

.public-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.public-page .interview-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.public-page .interview-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.question-block {
  margin-bottom: 1.75rem;
}

.question-block .q-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

.question-block .q-instructions {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.required-star { color: var(--danger); margin-left: 2px; }

.option-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.option-label:hover { background: var(--bg); }

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.actions {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 2rem;
}

.hidden { display: none !important; }
