/* ─── APP SHELL ─── */
.app-body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--bg-elevated);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-link:hover, .nav-link.active {
  color: var(--fg);
}

.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: #7c6ef3; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-secondary:hover { border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-ghost:hover { color: var(--fg); }

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-icon:hover { background: rgba(255,255,255,0.08); }
.btn-icon.btn-danger:hover { background: rgba(255,107,107,0.15); }

/* ─── CARD ─── */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ─── INPUTS ─── */
.input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--fg);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

.input:focus { border-color: var(--accent); }
.textarea { resize: vertical; }
.select { cursor: pointer; appearance: none; }

/* ─── FORM FIELDS ─── */
.field-group {
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.required { color: var(--pushback); }
.muted { color: var(--fg-muted); font-weight: 400; }

.field-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--fg);
  white-space: nowrap;
}

/* ─── SECTION ─── */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ─── ALERT ─── */
.alert {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.alert-warn {
  background: rgba(255, 200, 0, 0.08);
  border: 1px solid rgba(255, 200, 0, 0.2);
  color: #ffd166;
}

.alert-warn strong { color: #ffd166; }

/* ─── FORMS GRID ─── */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s;
}

.form-card:hover { border-color: rgba(108,92,231,0.3); }

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

.form-card-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.form-card-status.active { background: rgba(0,210,160,0.15); color: var(--green); }
.form-card-status.inactive { background: rgba(255,255,255,0.06); color: var(--fg-muted); }

.form-card-actions { display: flex; gap: 0.25rem; }

.form-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.form-card-desc {
  font-size: 0.825rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.form-card-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.form-link {
  cursor: pointer;
  color: var(--telegram-blue);
}

.form-link:hover { text-decoration: underline; }

/* ─── QUESTION CARDS ─── */
.question-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.question-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.question-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--fg-muted);
  min-width: 24px;
}

.question-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.type-text { background: rgba(108,92,231,0.15); color: var(--accent); }
.type-number { background: rgba(0,210,160,0.12); color: var(--green); }
.type-email { background: rgba(42,171,238,0.12); color: var(--telegram-blue); }
.type-yesno { background: rgba(255,200,0,0.12); color: #ffd166; }
.type-choice { background: rgba(255,107,107,0.12); color: var(--pushback); }

.pushback-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255,107,107,0.1);
  color: var(--pushback);
}

.question-actions { margin-left: auto; display: flex; gap: 0.25rem; }

.question-text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.question-meta {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

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

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--fg-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--fg); margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 1.5rem; font-size: 0.875rem; }

/* ─── MODAL ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header h3 { font-size: 1rem; font-weight: 600; }

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.hidden { display: none !important; }

/* ─── STATS ROW ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

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

.score-high { color: var(--green); }
.score-mid { color: #ffd166; }
.score-low { color: var(--pushback); }

/* ─── RESPONSES LIST ─── */
.responses-list { display: flex; flex-direction: column; gap: 1rem; }

.response-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
}

.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
}

.response-meta { display: flex; align-items: center; gap: 1rem; }
.response-user { font-weight: 600; font-size: 0.875rem; color: var(--telegram-blue); }
.response-time { font-size: 0.775rem; color: var(--fg-muted); }

.response-score {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
}

.response-answers { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }

.answer-row {}

.answer-question {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.answer-value {
  font-size: 0.875rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pushback-indicator {
  font-size: 0.8rem;
  title: "AI pushed back";
}

.answer-score.score-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
}
