:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: #111c2d;
  --panel-soft: #17243a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #2b3d57;
  --primary: #4c8f86;
  --primary-strong: #2563eb;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(76, 143, 134, 0.28), transparent 30rem),
    linear-gradient(135deg, #08111f, #0f172a 55%, #111827);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.center-card {
  width: min(720px, 100%);
  margin: 6vh auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(17, 28, 45, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.center-card h1,
.dashboard h1,
.dashboard h2,
.placeholder-panel h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.muted,
small {
  color: var(--muted);
  line-height: 1.5;
}

.stacked-form,
.form-panel {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

label {
  color: #dbeafe;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #41536d;
  border-radius: 10px;
  background: #0b1423;
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.primary-btn,
.secondary-btn {
  padding: 11px 16px;
  color: white;
  font-weight: 800;
}

.primary-btn {
  background: var(--primary-strong);
}

.secondary-btn {
  background: #334155;
}

.secondary-link {
  display: inline-flex;
  margin-top: 16px;
  color: #93c5fd;
  font-weight: 800;
  text-decoration: none;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: #fca5a5;
}

.spinner {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 4px solid rgba(255, 255, 255, 0.16);
  border-top-color: #6ee7b7;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 22px;
  min-height: calc(100vh - 48px);
}

.sidebar,
.dashboard-main,
.form-panel,
.table-wrap,
.placeholder-panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(17, 28, 45, 0.94);
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  display: flex;
  min-height: calc(100vh - 48px);
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 22px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-btn {
  padding: 11px 12px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  font-weight: 750;
}

.nav-btn.active,
.nav-btn:hover {
  background: #2563eb;
  color: white;
}

.dashboard-main {
  padding: 24px;
}

.module-panel {
  display: none;
}

.module-panel.active {
  display: block;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.stat-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-soft);
}

.stat-card span {
  display: block;
  color: #6ee7b7;
  font-size: 34px;
  font-weight: 900;
}

.stat-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.logo-panel {
  margin-top: 18px;
}

.logo-panel h3 {
  margin: 0;
}

.logo-preview {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #0b1423;
}

.question-cell {
  max-width: 320px;
}

.question-cell small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.mind-parent-row {
  cursor: pointer;
}

.mind-parent-row:hover {
  background: rgba(96, 165, 250, 0.08);
}

.mind-followup-row td {
  background: rgba(15, 23, 42, 0.62);
}

.mind-followup-row ol {
  margin: 10px 0 0;
  padding-left: 22px;
  color: #dbeafe;
}

.mind-followup-row li small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.form-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.table-actions {
  white-space: nowrap;
}

.table-action {
  margin: 2px;
  padding: 8px 10px;
  color: white;
  font-weight: 800;
}

.edit-action {
  background: var(--primary-strong);
}

.toggle-action {
  background: #64748b;
}

.delete-action {
  background: var(--danger);
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
}

.badge.off {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.placeholder-panel {
  padding: 28px;
}

@media (max-width: 860px) {
  .shell {
    padding: 14px;
  }

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

  .sidebar {
    position: static;
    min-height: auto;
  }

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

  .section-heading {
    flex-direction: column;
  }
}
