* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f6fb;
  color: #1f2937;
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 32px 24px;
  background: #111827;
  color: #fff;
}

.sidebar h1 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 28px;
}

.muted {
  color: #6b7280;
}

.sidebar .muted {
  color: #9ca3af;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.button.secondary,
.nav a {
  background: #1f2937;
}

.button.danger {
  background: #dc2626;
}

.main {
  padding: 32px;
}

.panel,
.auth-card,
.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  margin-bottom: 24px;
}

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

.stat-card {
  background: #eff6ff;
  border-radius: 14px;
  padding: 20px;
}

.stat-label {
  display: block;
  color: #475569;
  margin-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.inline-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

.checkbox-row {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}

.checkbox-row input {
  width: auto;
}

.question-picker {
  max-height: 420px;
  overflow: auto;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #f8fafc;
}

.question-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px !important;
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
}

.question-option:last-child {
  border-bottom: none;
}

.question-option input {
  width: auto;
  margin-top: 4px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 12px;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: min(560px, 100%);
}

.note {
  background: #f8fafc;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.code-block {
  padding: 14px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  word-break: break-all;
}

code {
  font-family: Consolas, monospace;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
