/* ============================================
   ENEM Lab — Design System
   ============================================ */

:root {
  /* Colors */
  --bg-base: #0a0b0f;
  --bg-surface: #111318;
  --bg-card: #16181f;
  --bg-card-hover: #1c1f28;
  --bg-elevated: #1e2130;

  --border: rgba(255,255,255,0.07);
  --border-active: rgba(129,140,248,0.5);

  --text-primary: #f1f2f6;
  --text-secondary: #a0a9c0;
  --text-muted: #5a6380;

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-glow: rgba(129,140,248,0.15);

  --green: #34d399;
  --orange: #fb923c;
  --pink: #f472b6;
  --purple: #c084fc;

  --disc-linguagens: #818cf8;
  --disc-humanas: #34d399;
  --disc-natureza: #fb923c;
  --disc-matematica: #f472b6;

  /* Spacing */
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Typography */
  --font: 'Inter', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,11,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: white;
  box-shadow: 0 0 20px rgba(129,140,248,0.4);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.logo-accent { color: var(--accent); }

.logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border);
}

.nav-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--border-active);
}

/* ---- MAIN ---- */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.section { display: none; }
.section.active { display: block; }

.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

/* ---- GRID ---- */
.generator-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.card-title svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---- FILTER GROUPS ---- */
.filter-group {
  margin-bottom: 1.25rem;
}

.filter-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

/* ---- TOGGLE GROUP ---- */
.toggle-group {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.toggle-btn {
  flex: 1;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  white-space: nowrap;
}

.toggle-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ---- YEAR CHIPS ---- */
.year-chips, .discipline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.chip:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.chip.active {
  background: var(--accent-glow);
  border-color: var(--border-active);
  color: var(--accent-hover);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- SLIDER ---- */
.slider-wrapper { padding: 0 4px; }

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-elevated);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(129,140,248,0.5);
  transition: box-shadow 0.2s;
}

input[type="range"]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 20px rgba(129,140,248,0.7);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.count-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 32px;
  text-align: center;
}

/* ---- TEXT INPUT ---- */
.text-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.87rem;
  font-family: var(--font);
  transition: border-color 0.2s;
  outline: none;
}

.text-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.text-input::placeholder { color: var(--text-muted); }

/* ---- BUTTONS ---- */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  box-shadow: 0 4px 16px rgba(129,140,248,0.3);
  margin-top: 1rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(129,140,248,0.45);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-secondary:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.btn-secondary svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- PREVIEW ---- */
.preview-card {
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

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

.preview-header .card-title { margin-bottom: 0; }

.preview-actions {
  display: flex;
  gap: 8px;
}

#preview-actions {
  display: flex;
  gap: 8px;
}

.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

.preview-empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.preview-empty p { max-width: 300px; line-height: 1.6; }

.preview-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
}

.preview-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.meta-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.meta-badge.total {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--border-active);
}

.meta-badge.disc {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ---- QUESTION ITEM ---- */
.question-item {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  background: var(--bg-surface);
  transition: border-color 0.2s;
  animation: fadeIn 0.3s ease;
}

.question-item:hover { border-color: var(--border-active); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}


.question-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.75rem;
}

.question-num {
  width: 28px;
  height: 28px;
  background: var(--accent-glow);
  border: 1px solid var(--border-active);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.question-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}

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

.disc-linguagens { background: rgba(129,140,248,0.15); color: #818cf8; }
.disc-ciencias-humanas { background: rgba(52,211,153,0.15); color: #34d399; }
.disc-ciencias-natureza { background: rgba(251,146,60,0.15); color: #fb923c; }
.disc-matematica { background: rgba(244,114,182,0.15); color: #f472b6; }

.question-context {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
  max-height: 120px;
  overflow: hidden;
  position: relative;
}

.question-context::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--bg-surface));
}

.question-intro {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.alternatives {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alternative {
  display: flex;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.alternative:hover { background: var(--bg-elevated); }

.alt-letter {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 16px;
}

.question-images {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.question-images img {
  max-width: 200px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg-elevated);
}

/* ---- SPINNER ---- */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---- STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.stat-year {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.stat-disciplines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-disc-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-disc-bar-bg {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.stat-disc-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.stat-disc-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-disc-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 24px;
  text-align: right;
}

/* ---- LISTS SECTION ---- */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.list-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.list-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.75rem;
}

.list-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.list-type-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.list-type-lista { background: var(--accent-glow); color: var(--accent); }
.list-type-simulado { background: rgba(196,132,252,0.15); color: var(--purple); }

.list-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.list-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 1rem;
}

.list-action-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.list-action-btn:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.list-action-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- MODAL ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 400px;
  max-width: 90vw;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
  padding: 4px;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 1.5rem;
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.25rem;
  font-size: 0.87rem;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 2000;
  animation: slideUp 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--accent); }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- EDITOR SECTION ---- */
.editor-filters {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
}

.editor-filters-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.editor-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.editor-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.editor-search {
  padding-left: 34px !important;
}

.editor-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---- EDITOR GRID ---- */
.editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.editor-q-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.editor-q-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}

.editor-q-card[data-disc="linguagens"]::before     { background: #818cf8; }
.editor-q-card[data-disc="ciencias-humanas"]::before { background: #34d399; }
.editor-q-card[data-disc="ciencias-natureza"]::before { background: #fb923c; }
.editor-q-card[data-disc="matematica"]::before     { background: #f472b6; }

.editor-q-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.editor-q-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.6rem;
}

.editor-q-index {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.editor-q-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-q-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.editor-q-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-images {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
}

.badge-no-images {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.editor-q-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.editor-q-thumb {
  margin-top: 0.6rem;
  display: flex;
  gap: 5px;
}

.editor-q-thumb img {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.editor-q-edit-btn {
  margin-top: 0.75rem;
  width: 100%;
  padding: 6px 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.editor-q-edit-btn:hover {
  background: var(--accent-glow);
  border-color: var(--border-active);
}

.editor-q-edit-btn svg {
  width: 13px; height: 13px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- PAGINATION ---- */
.editor-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 1rem 0 2rem;
}

.page-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.page-btn:hover { border-color: var(--border-active); color: var(--text-primary); }
.page-btn.active { background: var(--accent-glow); border-color: var(--border-active); color: var(--accent); }
.page-btn:disabled { opacity: 0.35; pointer-events: none; }

/* ---- EDIT DRAWER ---- */
.edit-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.edit-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.edit-drawer-panel {
  position: relative;
  z-index: 1;
  width: 680px;
  max-width: 95vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes drawerIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.edit-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.edit-drawer-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.edit-drawer-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.edit-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.edit-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-surface);
}

/* ---- EDIT FIELDS ---- */
.edit-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edit-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edit-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.edit-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-family: var(--font);
  line-height: 1.6;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color 0.2s;
}

.edit-textarea:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.edit-textarea::placeholder { color: var(--text-muted); }

/* ---- IMAGE EDITOR ---- */
.img-editor-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.img-editor-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.img-editor-preview {
  width: 100px;
  height: 75px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  object-fit: contain;
  display: block;
}

.img-editor-preview.broken {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.img-editor-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.img-editor-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.img-url-input-row {
  display: flex;
  gap: 6px;
}

.img-url-input-row .text-input {
  flex: 1;
  font-size: 0.78rem;
  padding: 7px 10px;
}

.img-preview-btn {
  padding: 7px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  white-space: nowrap;
}

.img-preview-btn:hover {
  border-color: var(--border-active);
  color: var(--accent);
}

.img-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.img-add-btn:hover {
  border-color: var(--border-active);
  color: var(--accent);
}

.img-remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.2s;
  align-self: flex-start;
}

.img-remove-btn:hover { background: rgba(239,68,68,0.1); }

/* ---- ALT EDITOR ---- */
.alt-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alt-editor-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.alt-editor-item:focus-within {
  border-color: var(--border-active);
}

.alt-editor-letter {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.alt-editor-letter.correct {
  background: rgba(52,211,153,0.2);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.4);
}

.alt-editor-letter.wrong {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.alt-editor-textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-family: var(--font);
  line-height: 1.5;
  resize: none;
  min-height: 40px;
}

.alt-img-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alt-img-url-input {
  font-size: 0.75rem;
  padding: 4px 8px;
  margin-top: 4px;
}

/* ---- SCALE SLIDER ---- */
.scale-slider {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  transition: opacity .2s;
}

.scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.scale-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .generator-grid {
    grid-template-columns: 1fr;
  }

  .filters-card {
    position: static;
  }

  .header-inner { padding: 0 1rem; }
  .main { padding: 1.5rem 1rem; }
  .edit-drawer-panel { width: 100vw; }
  .editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .nav-btn span { display: none; }
  .logo-text { display: none; }
}

/* ============================================
   EXERCÍCIOS ENEM — Styles
   ============================================ */

/* Filters bar */
.ex-filters-card {
  margin-bottom: 2rem;
}

.ex-filters-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.ex-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 180px;
}

.ex-filter-btn {
  flex: 0 0 auto;
  min-width: 120px;
}

/* Custom select */
.ex-select-wrap {
  position: relative;
}

.ex-select {
  width: 100%;
  padding: 9px 36px 9px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ex-select:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.ex-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ex-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.ex-select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Buscar button override */
.ex-buscar-btn {
  width: 100%;
  margin-top: 0;
  padding: 9px 20px;
  font-size: 0.875rem;
}

/* Count label */
.ex-count-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Question card */
.ex-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  animation: fadeIn 0.3s ease;
}

.ex-question-card:hover {
  border-color: rgba(129,140,248,0.3);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* Card header */
.ex-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 0.75rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.ex-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ex-exam-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ex-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ex-tag {
  display: inline-block;
  padding: 2px 9px;
  background: rgba(129,140,248,0.12);
  border: 1px solid rgba(129,140,248,0.25);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-hover);
  letter-spacing: 0.02em;
}

.ex-q-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Card body */
.ex-card-body {
  padding: 1.25rem;
}

.ex-context {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-surface);
  border-left: 3px solid var(--border-active);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.ex-intro {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.65;
  margin-bottom: 1.1rem;
}

/* Alternatives */
.ex-alts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ex-alt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
  background: var(--bg-surface);
}

.ex-alt:hover {
  border-color: rgba(129,140,248,0.4);
  background: var(--bg-elevated);
}

.ex-alt.selected {
  border-color: var(--border-active);
  background: var(--accent-glow);
}

.ex-alt.correct {
  border-color: #34d399 !important;
  background: rgba(52,211,153,0.1) !important;
}

.ex-alt.incorrect {
  border-color: #f87171 !important;
  background: rgba(248,113,113,0.1) !important;
}

.ex-alt-letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.18s;
}

.ex-alt.selected .ex-alt-letter {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.ex-alt.correct .ex-alt-letter {
  background: #34d399;
  border-color: #34d399;
  color: white;
}

.ex-alt.incorrect .ex-alt-letter {
  background: #f87171;
  border-color: #f87171;
  color: white;
}

.ex-alt-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  padding-top: 3px;
}

/* Card footer */
.ex-card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.ex-confirm-btn {
  width: auto;
  margin: 0;
  padding: 9px 24px;
  font-size: 0.875rem;
}

/* Result banner */
.ex-result-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  animation: fadeIn 0.25s ease;
}

.ex-result-banner.correct {
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.35);
  color: #34d399;
}

.ex-result-banner.incorrect {
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.35);
  color: #f87171;
}

/* Pagination */
.ex-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.ex-page-btn {
  padding: 6px 12px;
  min-width: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.18s;
}

.ex-page-btn:hover:not(:disabled) {
  border-color: var(--border-active);
  color: var(--accent);
}

.ex-page-btn.active {
  background: var(--accent-glow);
  border-color: var(--border-active);
  color: var(--accent);
  font-weight: 700;
}

.ex-page-btn.disabled,
.ex-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ex-page-ellipsis {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0 4px;
}

/* Shake animation for confirm without selection */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
}

/* Responsive */
@media (max-width: 768px) {
  .ex-filters-row {
    flex-direction: column;
  }
  .ex-filter-group {
    min-width: unset;
    width: 100%;
  }
}

/* Images inside question content */
.ex-img-wrap {
  margin: 0.75rem 0;
  text-align: center;
}

.ex-img {
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.ex-intro-cont {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---- Tree Picker ---- */
.ex-tree-wrap {
  position: relative;
}

.ex-tree-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px 9px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ex-tree-btn:hover:not(:disabled) {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.ex-tree-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ex-tree-btn #ex-tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-tree-panel {
  position: fixed;
  min-width: 280px;
  max-height: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ex-tree-search-wrap {
  padding: 10px 10px 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ex-tree-search {
  width: 100%;
  padding: 7px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.ex-tree-search:focus {
  border-color: var(--border-active);
}

.ex-tree-list {
  overflow-y: scroll;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding: 6px 0;
}

.ex-tree-list::-webkit-scrollbar { width: 4px; }
.ex-tree-list::-webkit-scrollbar-track { background: transparent; }
.ex-tree-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.ex-tree-node-wrap { display: block; }

.ex-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
  user-select: none;
  border-radius: 0;
}

.ex-tree-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.ex-tree-item.selected {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.ex-tree-all {
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  color: var(--text-muted);
}

.ex-tree-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
  transform: rotate(0deg);
  cursor: pointer;
  border-radius: 4px;
}

.ex-tree-arrow:hover {
  background: var(--bg-elevated);
  color: var(--accent);
}

.ex-tree-arrow.open {
  transform: rotate(90deg);
}

.ex-tree-arrow-spacer {
  display: inline-block;
  width: 18px;
  flex-shrink: 0;
}

.ex-tree-code {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: center;
}

.ex-tree-label-text {
  flex: 1;
  line-height: 1.3;
}

.ex-tree-children {
  border-left: 1px solid var(--border);
  margin-left: 20px;
}

/* ============================================
   GAB-BODY — Gabarito Comentado Formatting
   ============================================ */

.gab-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* Headings: numbered sections like ## 1. Calcule os volumes */
.gab-body h1,
.gab-body h2,
.gab-body h3 {
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}
.gab-body h1 { font-size: 1.1rem; }
.gab-body h2 { font-size: 1.05rem; }
.gab-body h3 { font-size: 0.98rem; }

/* Remove excess top margin on the very first heading */
.gab-body > h1:first-child,
.gab-body > h2:first-child,
.gab-body > h3:first-child {
  margin-top: 0.25em;
}

/* Paragraphs */
.gab-body p {
  margin-bottom: 0.75em;
}

/* Unordered lists — top level */
.gab-body ul {
  list-style-type: disc;
  margin: 0.4em 0 0.75em 1.4em;
  padding: 0;
}

/* Unordered lists — nested (sub-items) */
.gab-body ul ul {
  list-style-type: circle;
  margin: 0.25em 0 0.25em 1.6em;
}

/* Third level and beyond */
.gab-body ul ul ul {
  list-style-type: square;
  margin-left: 1.4em;
}

/* Ordered lists */
.gab-body ol {
  list-style-type: decimal;
  margin: 0.4em 0 0.75em 1.6em;
  padding: 0;
}

.gab-body ol ol {
  list-style-type: lower-alpha;
  margin-left: 1.4em;
}

/* List items spacing */
.gab-body li {
  margin-bottom: 0.3em;
  line-height: 1.65;
}

/* Bold inside lists (parent topic labels like **Cone Maior:**) */
.gab-body li > strong:first-child {
  color: var(--text-primary);
}

/* KaTeX display blocks — centered with breathing room */
.gab-body .katex-display {
  margin: 1em auto;
  overflow-x: auto;
}

/* Inline code fallback */
.gab-body code {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
  font-family: monospace;
  color: var(--accent-hover);
}

/* Italic (notes, footnotes) */
.gab-body em {
  color: var(--text-secondary);
  font-style: italic;
}

/* Horizontal rule */
.gab-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.2em 0;
}

/* ---- EX CARD (Questions) ---- */
.ex-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ex-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}

.ex-card-header {
  background: var(--bg-surface);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ex-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.ex-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ex-card-badge {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.ex-card-content {
  padding: 24px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.ex-card-content img {
  border-radius: 4px;
  border: 1px solid var(--border);
}

.ex-card-content .alternative {
  background: var(--bg-base);
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.ex-card-content .alternative:hover {
  background: var(--bg-surface);
}

/* ==================================================================
   Admin — sidebar agrupada (substitui o header/nav horizontal)
   ================================================================== */
.admin-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.admin-sidebar {
  width: 240px;
  flex: 0 0 240px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 0.75rem;
}
.admin-sidebar-logo { padding: 0 0.5rem 0.25rem; }
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}
.admin-nav-group { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.75rem 0.35rem;
}
.admin-sidebar .nav-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 8px 12px;
  border-radius: 10px;
}
.admin-sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 1rem 0.5rem 0.25rem;
  border-top: 1px solid var(--border);
}
.admin-sidebar-foot .btn-secondary { width: 100%; margin: 0; }
.admin-main-wrap { flex: 1; min-width: 0; }
.admin-menu-toggle { display: none; }

@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }
  .admin-sidebar.admin-sidebar--open { transform: translateX(0); }
  .admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 1rem;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
  }
  .main { padding: 1.25rem 1rem; }
}

/* Badge "modo teste" na tela de Integrações */
.config-testbadge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.15);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.vendas-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.vendas-row:last-child { border-bottom: none; }
.vendas-row .vr-main { flex: 1 1 240px; min-width: 0; }
.vendas-row .vr-email { font-weight: 600; color: var(--text-primary); }
.vendas-row .vr-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.vendas-row .vr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vendas-row .vr-actions .btn-secondary { width: auto; margin: 0; padding: 6px 12px; font-size: 0.78rem; }
