/**
 * MenteUp - Private App Environment & Dashboard Styles
 * Shell responsivo, Sidebar desktop, Navegação adaptada mobile, Dashboard e Telas de Estudo.
 */

/* ==========================================================================
   App Shell Layout
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-page);
}

/* ==========================================================================
   Desktop Sidebar
   ========================================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  transition: width var(--transition-normal);
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.15rem;
}

/* Seletor de Espaço Ativo */
.space-selector-wrapper {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.space-selector-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.space-selector-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-border);
  color: var(--primary-800);
}

.space-badge-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

/* Navegação Principal da Sidebar */
.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background-color: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active .nav-item-icon {
  opacity: 1;
  color: var(--primary);
}

.nav-item-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 600;
}

/* Rodapé da Sidebar (Usuário) */
.sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-decoration: none;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-plan-tag {
  font-size: 0.6875rem;
  color: var(--primary-700);
}

/* ==========================================================================
   App Main Area & Topbar
   ========================================================================== */
.app-main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.app-topbar {
  height: var(--topbar-height);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 80;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.topbar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-search-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px 12px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topbar-search-btn:hover {
  background-color: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.kbd-shortcut {
  font-size: 0.6875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  color: var(--text-subtle);
  font-family: var(--font-family-mono);
}

.app-content {
  flex: 1;
  padding: var(--space-8);
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Dashboard Components
   ========================================================================== */
.dashboard-hero {
  margin-bottom: var(--space-8);
}

.dashboard-greeting-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-1);
}

.dashboard-greeting-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

/* Onboarding Card (Primeiro Acesso) */
.onboarding-guide-card {
  background: linear-gradient(to right, #ffffff, var(--primary-50));
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-xs);
}

.onboarding-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.onboarding-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.onboarding-step-card:hover {
  border-color: var(--primary-400);
  box-shadow: var(--shadow-sm);
}

.step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Grid Principal do Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-8);
}

.dashboard-main-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.dashboard-side-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Cards de Matérias em Andamento */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.subject-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.subject-card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.subject-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.subject-color-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

.subject-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.subject-subtitle {
  font-size: 0.78125rem;
  color: var(--text-muted);
}

.subject-stats-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
}

/* Materiais Recentes */
.materials-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.material-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.material-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.material-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  overflow: hidden;
}

.material-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-50);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.material-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Próximas Revisões (Spaced Repetition) */
.reviews-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
}

.review-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.review-item-title {
  font-size: 0.84375rem;
  font-weight: 500;
  color: var(--text-main);
}

.review-item-due {
  font-size: 0.75rem;
  color: var(--primary-600);
  font-weight: 500;
}

/* Atividades Recentes (Timeline) */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  padding-left: var(--space-4);
}

.activity-timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 2px;
  background: var(--border-subtle);
}

.activity-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-dot {
  position: absolute;
  left: -14px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-surface);
}

.activity-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.activity-time {
  font-size: 0.6875rem;
  color: var(--text-subtle);
}

/* Metas de Estudo (Progresso) */
.study-goals-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.goal-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.goal-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.goal-target {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Navegação Mobile
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  padding: 0 var(--space-2);
  align-items: center;
  justify-content: space-around;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  text-decoration: none;
  flex: 1;
  padding: 6px 0;
  transition: color var(--transition-fast);
}

.mobile-nav-link.active {
  color: var(--primary-700);
  font-weight: 600;
}

.mobile-nav-link svg {
  width: 20px;
  height: 20px;
}

/* Drawer Mobile */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 150;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.mobile-drawer-overlay.open {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 280px;
  background: var(--bg-surface);
  z-index: 160;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-elevated);
}

.mobile-drawer.open {
  transform: translateX(0);
}

/* ==========================================================================
   Responsividade App
   ========================================================================== */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    display: none;
  }
  .app-main-wrapper {
    margin-left: 0;
    padding-bottom: 70px; /* Espaço para barra inferior */
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .app-topbar {
    padding: 0 var(--space-4);
  }
  .app-content {
    padding: var(--space-4);
  }
  .onboarding-steps-grid {
    grid-template-columns: 1fr;
  }
  .topbar-search-btn .kbd-shortcut {
    display: none;
  }
}

/* ==========================================================================
   Tela Sobre o seu Curso & Atividades Semanais da IA
   ========================================================================== */
.course-overview-hero {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--primary-50) 100%);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.course-overview-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-top: 8px;
  margin-bottom: 6px;
}

.course-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.course-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.ai-diagnosis-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.ai-diagnosis-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
  border-left-color: var(--primary);
}

.ai-diagnosis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-diagnosis-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 16px;
}

.ai-methodology-box {
  background: var(--primary-50);
  border: 1px dashed var(--primary-300);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.84375rem;
  color: var(--primary-900);
  font-weight: 500;
}

/* Grid de Resumo das Respostas do Formulário */
.form-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.form-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: all var(--transition-fast);
}

.form-summary-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xs);
}

.form-summary-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-summary-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.form-summary-sub {
  font-size: 0.78125rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

/* Container de 3 Atividades Semanais da IA */
.weekly-activities-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.weekly-activities-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.weekly-progress-bar-wrapper {
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  width: 100%;
}

.weekly-progress-bar-fill {
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.weekly-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  margin-bottom: 12px;
  transition: all var(--transition-fast);
}

.weekly-activity-item:last-child {
  margin-bottom: 0;
}

.weekly-activity-item:hover {
  border-color: var(--primary-300);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-xs);
}

.weekly-activity-item.completed {
  border-color: var(--success-300);
  background: #f0fdf4;
}

.weekly-activity-item.completed .activity-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.activity-num-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--primary-50);
  color: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.weekly-activity-item.completed .activity-num-badge {
  background: var(--success-100);
  color: var(--success-700);
}

.activity-body {
  flex: 1;
}

.activity-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.activity-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.activity-desc {
  font-size: 0.84375rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
}

.activity-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.activity-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.activity-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.activity-check-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  background: var(--bg-surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: transparent;
}

.activity-check-btn:hover {
  border-color: var(--primary);
  background: var(--primary-50);
}

.weekly-activity-item.completed .activity-check-btn {
  background: var(--success-600);
  border-color: var(--success-600);
  color: #fff;
}

/* Stepper do Diagnóstico */
.diagnostic-step-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.diagnostic-step-dot {
  flex: 1;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  transition: background 0.3s ease;
}

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

.diagnostic-step-dot.completed {
  background: var(--success-500);
}

.diag-cat-pill, .diag-level-pill, .diag-format-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.diag-cat-pill:hover, .diag-level-pill:hover, .diag-format-pill:hover {
  border-color: var(--primary-400);
  background: var(--primary-50);
  color: var(--primary-800);
}

.diag-cat-pill.selected, .diag-level-pill.selected, .diag-format-pill.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary-800);
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--primary);
}

/* ==========================================================================
   Pontuação Acadêmica & Badges
   ========================================================================== */
.academic-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.academic-score-card {
  background: linear-gradient(135deg, #ffffff, #faf5ff);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

/* ==========================================================================
   Card de Prova Semanal (Exame Oficial com Bloqueio/Desbloqueio)
   ========================================================================== */
.weekly-exam-card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.weekly-exam-card.locked {
  background: #fcfcfd;
  border-color: var(--border-light);
  border-style: dashed;
}

.weekly-exam-card.unlocked {
  background: linear-gradient(135deg, #ffffff, #f0fdf4);
  border-color: #22c55e;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.12);
}

.weekly-exam-card.completed {
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  border-color: #3b82f6;
}

.exam-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84375rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.exam-status-indicator.locked {
  color: var(--text-muted);
}

.exam-status-indicator.unlocked {
  color: #16a34a;
}

.exam-status-indicator.completed {
  color: #2563eb;
}

/* ==========================================================================
/* ==========================================================================
   Leitor Acadêmico de PDF Digital (100% Fundo Branco Editorial & Imersivo)
   ========================================================================== */
.academic-pdf-reader {
  background: #ffffff !important;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  height: 86vh;
  max-height: 880px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--border-light);
}

.pdf-toolbar {
  background: #ffffff;
  color: var(--text-main);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.pdf-toolbar-title {
  font-size: 0.9375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
}

.pdf-toolbar-title svg {
  color: #dc2626;
  flex-shrink: 0;
}

.pdf-pages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff !important;
  scroll-behavior: smooth;
}

.pdf-sheet {
  background: #ffffff !important;
  color: #1e293b;
  width: 100%;
  max-width: 820px;
  min-height: 100%;
  padding: 48px 56px 80px 56px;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
}

.pdf-sheet-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.pdf-univ-name {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #64748b;
}

.pdf-doc-title {
  font-family: var(--font-family-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 6px;
  line-height: 1.25;
}

.pdf-doc-meta {
  font-size: 0.75rem;
  color: #64748b;
  text-align: right;
  line-height: 1.5;
  font-family: var(--font-family-mono);
}

.pdf-chapter-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary-700);
  background: var(--primary-50);
  border: 1px solid var(--primary-border);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-family: var(--font-family-mono);
}

.pdf-chapter-h2 {
  font-family: var(--font-family-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 22px 0 12px 0;
  border-left: 3px solid var(--primary-700);
  padding-left: 14px;
  line-height: 1.35;
}

.pdf-p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #334155;
  margin-bottom: 16px;
  text-align: justify;
}

.pdf-box-doctrine {
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
  font-size: 0.875rem;
  color: #1e293b;
  line-height: 1.6;
}

.pdf-box-keytakeaway {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 22px 0;
  font-size: 0.875rem;
  color: #065f46;
  line-height: 1.6;
}

.pdf-sheet-footer {
  border-top: 1px solid #e2e8f0;
  margin-top: 48px;
  padding-top: 18px;
  padding-bottom: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.775rem;
  color: #94a3b8;
  background: #ffffff !important;
}

/* ==========================================================================
   Executor de Questões & Atividades
   ========================================================================== */
.quiz-option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
  margin-bottom: 10px;
}

.quiz-option-card:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-50);
}

.quiz-option-card.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 2px var(--primary);
}

.quiz-option-card.correct {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
  box-shadow: 0 0 0 2px #22c55e !important;
}

.quiz-option-card.wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 2px #ef4444 !important;
}

.quiz-option-letter {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.quiz-option-card.selected .quiz-option-letter {
  background: var(--primary);
  color: #fff;
}

.quiz-explanation-box {
  background: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-subtle);
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.55;
  animation: fadeIn 0.3s ease;
}

.quiz-explanation-box.correct {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.quiz-explanation-box.wrong {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ==========================================================================
   Modo de Impressão Direta da Apostila PDF
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  .printable-academic-doc, .printable-academic-doc * {
    visibility: visible;
  }
  .printable-academic-doc {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }
}

/* ==========================================================================
   Banners Acadêmicos com Fotografia & Embelezamento de Portal
   ========================================================================== */
.academic-portal-banner {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-6);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  background-color: var(--dark-surface);
  min-height: 180px;
  display: flex;
  align-items: center;
}

.academic-portal-banner .banner-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  filter: contrast(1.08) saturate(0.95);
  transition: transform 0.6s ease;
}

.academic-portal-banner:hover .banner-bg-img {
  transform: scale(1.02);
}

.academic-portal-banner .banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 23, 34, 0.94) 0%, rgba(20, 23, 34, 0.78) 55%, rgba(20, 23, 34, 0.88) 100%);
}

.academic-portal-banner .banner-inner {
  position: relative;
  z-index: 2;
  padding: var(--space-6) var(--space-8);
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.academic-portal-banner .banner-kicker {
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-500);
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.academic-portal-banner .banner-title {
  font-family: var(--font-family-display);
  font-size: 1.85rem;
  color: #ffffff;
  margin: 0 0 6px 0;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.academic-portal-banner .banner-title em {
  font-style: italic;
  color: var(--amber-200);
}

.academic-portal-banner .banner-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 580px;
  line-height: 1.5;
}

.goal-option-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.goal-option-card:hover {
  border-color: var(--primary-400);
  background: var(--bg-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.goal-option-card strong {
  font-family: var(--font-family-sans-heading);
}

/* ==========================================================================
   Botões de Pílula Rápida (Onboarding e Filtros)
   ========================================================================== */
.quick-course-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.badge-pill-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-800);
  transform: translateY(-1px);
}

/* ==========================================================================
   Roteiro Guiado da Semana (Trilha de 3 Passos Simples)
   ========================================================================== */
.weekly-roadmap-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.weekly-roadmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.roadmap-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roadmap-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.roadmap-step-card {
  background: var(--bg-page);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all var(--transition-fast);
}

.roadmap-step-card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-xs);
}

.roadmap-step-card.active-step {
  border-color: var(--primary-500);
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(93, 66, 195, 0.08);
}

.roadmap-step-card.completed-step {
  border-color: #86efac;
  background: #fcfdfc;
}

.roadmap-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.roadmap-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.8125rem;
  background: var(--primary-100);
  color: var(--primary-800);
}

.roadmap-step-card.completed-step .roadmap-step-badge {
  background: #dcfce7;
  color: #15803d;
}

.roadmap-step-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.35;
}

.roadmap-step-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 14px;
}

.roadmap-step-action {
  margin-top: auto;
}

/* ==========================================================================
   Helper Callout Card (Dúvida comum e aviso tranquilizador)
   ========================================================================== */
.helper-callout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--primary-50);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  gap: 14px;
  flex-wrap: wrap;
}

.helper-callout-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.helper-callout-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.helper-callout-text {
  font-size: 0.84375rem;
  color: var(--primary-900);
  line-height: 1.45;
}

/* ==========================================================================
   Central de Dúvidas & Ajuda (In-App FAQ)
   ========================================================================== */
.inapp-faq-container {
  max-width: 900px;
  margin: 0 auto;
}

.inapp-faq-header {
  margin-bottom: 24px;
}

.inapp-faq-search-box {
  position: relative;
  margin-bottom: 20px;
}

.inapp-faq-search-input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-medium);
  font-size: 0.95rem;
  background: var(--bg-surface);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.inapp-faq-search-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--shadow-glow-primary);
}

.inapp-faq-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.inapp-faq-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.faq-cat-pill {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.faq-cat-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.faq-cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.inapp-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.inapp-faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.inapp-faq-item:hover {
  border-color: var(--primary-300);
}

.inapp-faq-item.active {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-sm);
}

.inapp-faq-q-btn {
  width: 100%;
  padding: 18px 22px;
  text-align: left;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-family: var(--font-family-sans-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.inapp-faq-item.active .inapp-faq-q-btn {
  color: var(--primary-800);
}

.inapp-faq-icon {
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

.inapp-faq-item.active .inapp-faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.inapp-faq-ans {
  padding: 0 22px 20px 22px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: none;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

.inapp-faq-item.active .inapp-faq-ans {
  display: block;
}

.inapp-faq-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-muted);
  margin-right: 10px;
}

/* ==========================================================================
   ADAPTAÇÃO E INVERSÃO DE CORES PARA TEMAS ESCUROS (CINZA & PRETO)
   Garante contraste perfeito e legibilidade sem reflexos indesejados.
   ========================================================================== */
html[data-theme="gray"] .app-topbar,
html[data-theme="black"] .app-topbar {
  background-color: var(--topbar-bg);
  border-bottom-color: var(--border-subtle);
}

html[data-theme="gray"] .app-sidebar,
html[data-theme="black"] .app-sidebar {
  background-color: var(--bg-surface);
  border-right-color: var(--border-subtle);
}

html[data-theme="gray"] .sidebar-header,
html[data-theme="black"] .sidebar-header,
html[data-theme="gray"] .space-selector-wrapper,
html[data-theme="black"] .space-selector-wrapper,
html[data-theme="gray"] .sidebar-footer,
html[data-theme="black"] .sidebar-footer {
  border-bottom-color: var(--border-subtle);
}

html[data-theme="gray"] .surface-card,
html[data-theme="black"] .surface-card {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

html[data-theme="gray"] .space-selector-btn,
html[data-theme="black"] .space-selector-btn {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

html[data-theme="gray"] .space-selector-btn:hover,
html[data-theme="black"] .space-selector-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-border);
  color: var(--primary);
}

html[data-theme="gray"] .modal-container,
html[data-theme="black"] .modal-container {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
}

html[data-theme="gray"] .modal-footer,
html[data-theme="black"] .modal-footer {
  background-color: var(--bg-subtle);
  border-top-color: var(--border-subtle);
}

html[data-theme="gray"] .modal-header,
html[data-theme="black"] .modal-header {
  border-bottom-color: var(--border-subtle);
}

html[data-theme="gray"] .quiz-option-card,
html[data-theme="black"] .quiz-option-card {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

html[data-theme="gray"] .quiz-option-card:hover:not(:disabled),
html[data-theme="black"] .quiz-option-card:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-50);
}

html[data-theme="gray"] .quiz-option-card.selected,
html[data-theme="black"] .quiz-option-card.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 2px var(--primary);
}

html[data-theme="gray"] .quiz-option-card.correct,
html[data-theme="black"] .quiz-option-card.correct {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.18) !important;
  color: #86efac !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4) !important;
}

html[data-theme="gray"] .quiz-option-card.wrong,
html[data-theme="black"] .quiz-option-card.wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4) !important;
}

html[data-theme="gray"] .quiz-option-letter,
html[data-theme="black"] .quiz-option-letter {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

html[data-theme="gray"] .quiz-explanation-box,
html[data-theme="black"] .quiz-explanation-box {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

html[data-theme="gray"] .quiz-explanation-box.correct,
html[data-theme="black"] .quiz-explanation-box.correct {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #dcfce7;
}

html[data-theme="gray"] .quiz-explanation-box.wrong,
html[data-theme="black"] .quiz-explanation-box.wrong {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fee2e2;
}

html[data-theme="gray"] .academic-points-badge,
html[data-theme="black"] .academic-points-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

html[data-theme="gray"] .academic-score-card,
html[data-theme="black"] .academic-score-card {
  background: var(--card-gradient);
  border-color: var(--border-subtle);
}

html[data-theme="gray"] .btn-secondary,
html[data-theme="black"] .btn-secondary {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

html[data-theme="gray"] .btn-secondary:hover,
html[data-theme="black"] .btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

html[data-theme="gray"] input[type="text"],
html[data-theme="black"] input[type="text"],
html[data-theme="gray"] input[type="password"],
html[data-theme="black"] input[type="password"],
html[data-theme="gray"] input[type="email"],
html[data-theme="black"] input[type="email"],
html[data-theme="gray"] select,
html[data-theme="black"] select,
html[data-theme="gray"] textarea,
html[data-theme="black"] textarea {
  background-color: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

/* ==========================================================================
   MÓDULO: CONFIGURAÇÕES VISUAIS & PREFERÊNCIAS
   ========================================================================== */
.settings-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-section-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.45;
}

/* Seletor Visual dos 3 Temas Solicitados pelo Usuário */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .theme-picker-grid {
    grid-template-columns: 1fr;
  }
}

.theme-card-option {
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  background: var(--bg-subtle);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.theme-card-option:hover {
  border-color: var(--primary-300);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-card-option.active {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 2px var(--primary);
}

.theme-card-preview-bar {
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

/* Visual Mockup dos Temas nos Cards */
.theme-preview-light {
  background: #faf9f6;
}
.theme-preview-light .preview-sidebar {
  width: 25%;
  background: #ffffff;
  border-right: 1px solid #e6e2d6;
}
.theme-preview-light .preview-content {
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.theme-preview-light .preview-line {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
}

.theme-preview-gray {
  background: #171923;
}
.theme-preview-gray .preview-sidebar {
  width: 25%;
  background: #222634;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.theme-preview-gray .preview-content {
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.theme-preview-gray .preview-line {
  height: 6px;
  background: #2d3345;
  border-radius: 3px;
}

.theme-preview-black {
  background: #000000;
}
.theme-preview-black .preview-sidebar {
  width: 25%;
  background: #0e0f14;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.theme-preview-black .preview-content {
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.theme-preview-black .preview-line {
  height: 6px;
  background: #1e212d;
  border-radius: 3px;
}

.theme-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-card-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
}

.theme-card-tag {
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
}

.theme-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Opções de Configuração em Lista com Toggle e Select */
.setting-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}

.setting-row-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-row-info {
  flex: 1;
}

.setting-row-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.setting-row-description {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Switch Toggle UI */
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-medium);
  transition: var(--transition-fast);
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-fast);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch-control input:checked + .switch-slider {
  background-color: var(--primary);
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Botões Seletores de Densidade de Fonte */
.pill-btn-group {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.pill-group-btn {
  padding: 6px 14px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-group-btn:hover {
  color: var(--text-main);
}

.pill-group-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   MÓDULO: MEU DESEMPENHO & ANÁLISE GRÁFICA DE APRENDIZADO
   ========================================================================== */
.desempenho-container {
  max-width: 1080px;
  margin: 0 auto;
}

.desempenho-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.desempenho-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.desempenho-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.5;
}

/* Cards Principais de Desempenho (4 KPIs em Linha) */
.desempenho-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 1024px) {
  .desempenho-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .desempenho-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.desempenho-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.desempenho-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
}

.kpi-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.kpi-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.kpi-main-val {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.kpi-sub-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Grid de Gráficos (2 Colunas Principais) */
.charts-split-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

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

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.chart-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.chart-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Gráfico de Barras: Acertos vs Erros por Disciplina */
.subject-bar-row {
  margin-bottom: 16px;
}

.subject-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.8125rem;
}

.subject-bar-name {
  font-weight: 600;
  color: var(--text-main);
}

.subject-bar-stats {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.stacked-bar-track {
  height: 12px;
  background: var(--bg-subtle);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--border-light);
}

.stacked-bar-correct {
  background: #16a34a;
  height: 100%;
  transition: width 0.6s ease;
}

.stacked-bar-wrong {
  background: #ef4444;
  height: 100%;
  transition: width 0.6s ease;
}

/* Abas e Filtros de Questões Respondidas (Acertos vs Erros) */
.history-filter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.history-tabs-list {
  display: flex;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.history-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-tab-btn:hover {
  color: var(--text-main);
}

.history-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.history-tab-btn.active.tab-correct {
  color: #16a34a;
}

.history-tab-btn.active.tab-wrong {
  color: #dc2626;
}

/* Cartão Individual de Análise de Questão */
.question-history-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 14px;
  transition: all var(--transition-fast);
}

.question-history-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.question-history-card.is-correct {
  border-left: 4px solid #22c55e;
}

.question-history-card.is-wrong {
  border-left: 4px solid #ef4444;
}

.q-history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.8125rem;
}

.q-history-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 14px;
}

.q-history-answer-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.q-history-explanation {
  background: var(--bg-hover);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 10px 14px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Área Administrativa & Coordenação Acadêmica MenteUp
   ========================================================================== */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 8px 48px 8px;
}

.admin-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 26px 30px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.admin-header-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #7c3aed, #4f46e5);
}

.admin-badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

[data-theme="gray"] .admin-badge-gold,
[data-theme="black"] .admin-badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.admin-header-title {
  font-family: var(--font-family-serif-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 6px 0 4px 0;
  line-height: 1.25;
}

.admin-header-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.admin-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Grid de Indicadores / KPIs Administrativos */
.admin-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.admin-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.admin-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.admin-kpi-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-purple { background: #f3e8ff; color: #7c3aed; }
.kpi-green  { background: #dcfce7; color: #16a34a; }
.kpi-blue   { background: #e0f2fe; color: #0284c7; }
.kpi-amber  { background: #fef3c7; color: #d97706; }
.kpi-rose   { background: #ffe4e6; color: #e11d48; }

[data-theme="gray"] .kpi-purple, [data-theme="black"] .kpi-purple { background: rgba(124, 58, 237, 0.2); color: #c084fc; }
[data-theme="gray"] .kpi-green,  [data-theme="black"] .kpi-green  { background: rgba(34, 197, 94, 0.2);  color: #4ade80; }
[data-theme="gray"] .kpi-blue,   [data-theme="black"] .kpi-blue   { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
[data-theme="gray"] .kpi-amber,  [data-theme="black"] .kpi-amber  { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-theme="gray"] .kpi-rose,   [data-theme="black"] .kpi-rose   { background: rgba(225, 29, 72, 0.2);  color: #fb7185; }

.admin-kpi-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.admin-kpi-desc {
  font-size: 0.775rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Indicador de Status com Pulso */
.status-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: adminPulse 2s infinite;
  vertical-align: middle;
}

@keyframes adminPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.status-inactive {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Seções de Conteúdo e Gráficos do Painel */
.admin-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.admin-section-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Distribuição de Cursos / Disciplinas */
.admin-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.admin-course-row {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-course-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.admin-course-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.admin-course-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Tabela de Estudantes */
.admin-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.admin-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: var(--bg-hover);
}

.admin-student-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-student-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.admin-student-name {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

.admin-student-email {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Modal de Detalhes do Aluno */
.student-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.student-detail-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.student-detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.student-detail-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.student-logs-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-log-item {
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Botão de Área Administrativa no Rodapé */
.admin-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 0.84375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.admin-footer-btn:hover {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Customizações do Layout Exclusivo da Coordenação / Administrador */
.admin-sidebar {
  border-right-color: rgba(180, 83, 9, 0.18);
}

.admin-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-sidebar .nav-item.active {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

[data-theme="gray"] .admin-sidebar .nav-item.active,
[data-theme="black"] .admin-sidebar .nav-item.active {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.admin-topbar {
  border-bottom-color: rgba(180, 83, 9, 0.18);
}

.admin-layout-shell .app-content {
  background: var(--bg-body);
}



